发表2 分钟读完 (大约348个字)
Gradle常用命令
Gradle 常用命令
0x01 快速构建命令
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| ./gradlew -v
./gradlew clean
./gradlew build
./gradlew installDebug
./gradlew build --info
./gradlew build --profile
./gradlew build --info --debug --stacktrace
./gradlew aDR --offline
./gradlew build --daemon
./gradlew build --parallel --parallel-threads=N
|
0x02 构建并安装命令
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| ./gradlew assembleDebug
./gradlew aD
./gradlew assembleRelease
./gradlew aR
./gradlew install app:assembleDebug
./gradlew installRelease
./gradlew uninstallRelease
./gradlew install app:assemble<Flavor>Debug
|
0x03 查看包依赖
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| ./gradlew dependencies
./gradlew app:dependencies
./gradlew app:dependencies | grep CompileClasspath
./gradlew app:dependencies | findstr "CompileClasspath"
./gradlew app:dependencies --configuration <flavor>DebugCompileClasspath
./gradlew app:dependencies --configuration <flavor>DebugCompileClasspath >1.log
|
0x04 依赖包更新
1 2 3 4 5
| ./gradlew build --refresh-dependencies
./gradlew clean build --refresh-dependencies
|