Multi task execution failure


(Riznyk Yurii) #1

I have configuration where artifacts uploading to artifactory, with pre checking if artifact already uploaded , build script example below:

task ArtifactValidate{
dependsOn build
doLast {
if (!isSnapshot) {
if (new File(project.buildDir, “libs”).exists()) {

// checkin with custom class if artifact exists and disable artifactoryPublish per project
if (new ArtifactValidator(artifactor_url, “${artifactory_user}”, “${artifactory_password}”).ValidateURL()) {
logger.warn("${artifactFileName} with version ${artifactVersion} already uploded")
logger.warn(“Task artifactoryPublish wil be disabled for ${project}”)
project.tasks.findByName(“artifactoryPublish”).enabled = false

artifactoryPublish { task ->
    dependsOn ArtifactValidate

command :
./gradlew clean -s :module1:artifactoryPublish :module2:artifactoryPublish :module1:artifactoryPublish

I have changed version only in one module , so other two have to be skipped , but skipped all 3 , any of them won’t be executed

Question - Is it possible while executing multiple task to disable per project not