本文共 3521 字,大约阅读时间需要 11 分钟。
1 2 3 4 5 6 7 8 9 | .PHONY: clean all: hello hello: hello.c gcc -o hello hello.c clean: rm hello |
1 2 3 4 5 6 7 8 | // 普通的Java项目 apply plugin: 'java' //Android Application apply plugin: 'com.android.application' //Android Library apply plugin: 'com.android.library' |
1 2 3 4 5 6 7 8 9 10 11 | :compileJava :processResources :classes :jar :assemble :compileTestJava :processTestResources :testClasses : test :check :build |
1 2 3 4 5 6 7 8 9 10 11 12 13 | android { compileSdkVersion 21 buildToolsVersion "21.1.1" defaultConfig { applicationId "com.jhuster.test" minSdkVersion 15 targetSdkVersion 21 versionCode 1 versionName "1.0.0" } } |
1 2 | $ make all $ make clean |
1 2 3 4 | $gradle build // 构建和打包整个项目 $gradle clean // 清除之前的构建 $gradle test // 执行测试 $gradle compileJava // 编译java |
1 2 | hello: hello.c gcc -o hello hello.c -L /libs/foo .a |
1 2 3 4 | dependencies { compile files( 'libs/foo.jar' ) // 以jar的方式引用 compile project( ':foo' ) // 以library工程源码的方式引用 } |
1 2 3 4 5 6 7 8 9 | allprojects { repositories { jcenter() } } dependencies { compile 'com.squareup.okhttp:okhttp:2.4.0' } |
转载地址:http://monub.baihongyu.com/