中文 | English
Find build.gradle in root project,add info like below code:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.baoleiwei:levi-debug:0.0.1'
}
}
Find build.gradle in what module that you want to test,add info like below code:
apply plugin: 'com.baoleiwei.levi'
Find build.gradle in what module that you want to test,and add greeting closure like below:
greeting{
message '一个测试信息来自app'
}
android{
}
dependencies{
}
Open Terminal.
In windows , input gradle -q hello, then run
In mac, input ./gradle -q hello , then run
-qrepresent quite,remove som other unnecessary info.
Then you can find the info in your command line
Note : This method requires you to configure the gradle environment variable, otherwise the command line will prompt not find the command
like below:
Find Gradle in Android Studio,Find the module you test in the last few steps (I used the app module above).
Find the hello task in other , or input hello to find.
Then double click to run
Then find like below:
Find Gradle Console in Android Studio.
Finally you will find the message you test.
Through this project, I learned how to write a simple gradle plugin and upload binaries to jcenter quickly via bintray-release. how to upload binaries you can Google.