简体   繁体   中英

What is the difference between gradlew assemble and gradlew compile

I noticed that

./gradlew tasks

for my android project gives me assemble* and compile* tasks.

What is the difference?

I also noticed that the command lists the tasks compileDemoDebugSources as well as compileDemoReleaseSources (where demo is a flavor and release is a build type) but only assembleDemo (instead of assembleDemoDebug and assembleDemoRelease ) -- however the latter two work just as fine. Why is that?

From official manual:

|---------------------|-----------------------------|
|          Task       |    Description   -----------|
|---------------------|-----------------------------|
|      compileJava    |  Compiles production Java   |
|                     |  source files using javac   |
|---------------------|-----------------------------|
|        assemble     |  Assembles all the archives |
|                     |      in the project         |
|---------------------|-----------------------------|

To investigate further, read Gradle 4.0 documentation:

PS drkstr1 has already mentioned main differences in the comment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM