Closed keta1 closed 1 year ago
A bit surprised. Just checked again to make sure, and it does interrupt on error. Can you post the script you use and the output from gradle build task?
Demo project: DexKit, Intentionally modify :dexkit
module source code to make it non-compilable, use gradle :main:run
get output:
Okay, seems that this behavior is caused by running the task via Android Studio.
Add the following lines to dexkit/build.gradle
:
tasks.clean.dependsOn tasks.cmakeClean
tasks.jar.dependsOn tasks.cmakeBuild
This seemed to solve the problem.
Basically, because of the dependency association on dexkit
by main
, there exists a dependency on :dexkit:jar
. So this would add :dexkit:cmakeBuild
to the dependency tree.
Okay, seems that this behavior is caused by running the task via Android Studio. Add the following lines to
dexkit/build.gradle
:tasks.clean.dependsOn tasks.cmakeClean tasks.jar.dependsOn tasks.cmakeBuild
This seemed to solve the problem.
Basically, because of the dependency association on
dexkit
bymain
, there exists a dependency on:dexkit:jar
. So this would add:dexkit:cmakeBuild
to the dependency tree.
Very well. Instead add
tasks.run.dependsOn(tasks.cmakeBuild)
Below that line
Thank you, it did work as expected after this improvement. Although I still don't understand how it works, I'll check the gradle documentation to find out why
Although I still don't understand how it works, I'll check the gradle documentation to find out why
Well, if you run the task :main:run
from the terminal, you'll see that it does terminate early. The behavior you saw seems to be only when running from Android Studio Configuration. At least as far as I saw.
If that is indeed the case, it is likely that it's related to how Android Studio executes the tasks.
Although I still don't understand how it works, I'll check the gradle documentation to find out why
Well, if you run the task
:main:run
from the terminal, you'll see that it does terminate early. The behavior you saw seems to be only when running from Android Studio Configuration. At least as far as I saw. If that is indeed the case, it is likely that it's related to how Android Studio executes the tasks.
Indeed, it seems to be a problem with the gradle that comes with AS. Thank you for your reply.
https://github.com/tomtzook/gradle-cmake/blob/ad215d2b6b77c6fc94ca450cece720743e5b6157/plugin/src/main/java/com/github/tomtzook/gcmake/tasks/CmakeBuildTask.java#L76
maybe u shoule invkoe isIgnoreExitValue?
https://github.com/gradle/gradle/blob/master/subprojects/process-services/src/main/java/org/gradle/process/BaseExecSpec.java#L39