Here is what I do in general build.gradle without gradlew.
task play(type: Exec) {
commandLine 'sh', './test_work.sh'
}
build.dependsOn play
This is the first task gets executed when I run gradle build.
I want to do the same thing when I run gradle assembleDebug. Here is what I am doing right now:
android {
compileSdkVersion A
buildToolsVersion "X.Y.Z"
defaultConfig {
applicationId "helloWorld"
minSdkVersion X
targetSdkVersion Y
}
buildTypes {
applicationVariants.all { variant ->
variant.outputs.each { output ->
output.outputFile = file("$project.buildDir/outputs/helloWorld.apk")
}
}
debug {
minifyEnabled false
}
release {
minifyEnabled true
}
}
task test(type: Exec) << {
println "Hi"
commandLine 'sh', './new_test.sh'
}
}
repositories {
....
}
dependencies {
....
}
}
assemble.dependsOn deployGitHooks
Somehow the task test is not getting executed.
Can anybody please help.
Thanks...