diff --git a/src/main/java/com/massivedisaster/bintraydeployautomator/BintrayDeployAutomator.java b/src/main/java/com/massivedisaster/bintraydeployautomator/BintrayDeployAutomator.java index a5980b5..aadb4db 100644 --- a/src/main/java/com/massivedisaster/bintraydeployautomator/BintrayDeployAutomator.java +++ b/src/main/java/com/massivedisaster/bintraydeployautomator/BintrayDeployAutomator.java @@ -23,10 +23,7 @@ public static void main(String args[]) { .connect(); // Clean and build all projects. - rebuild(gradleConnection, configuration); - - // Bintrayupload. - bintrayUpload(gradleConnection, configuration); + rebuildAndBintrayDeploy(gradleConnection, configuration); // Replace version if needed. if (configuration.UpdateReadmeVersion()) { @@ -42,13 +39,7 @@ public static void main(String args[]) { } } - private static void rebuild(ProjectConnection gradleConnection, Configuration configuration) { - GradleUtils.runGradle(gradleConnection, configuration.getRebuildTasks(), configuration.getRebuildArguments()); - } - - private static void bintrayUpload(ProjectConnection gradleConnection, Configuration configuration) { - for (String task: configuration.getBintrayTasks()) { - GradleUtils.runGradle(gradleConnection, new String[] {task}, configuration.getBintrayArguments()); - } + private static void rebuildAndBintrayDeploy(ProjectConnection gradleConnection, Configuration configuration) { + GradleUtils.runGradle(gradleConnection, configuration.getRebuildAndBintrayDeployTasks(), configuration.getRebuildAndBintrayDeployArguments()); } } diff --git a/src/main/java/com/massivedisaster/bintraydeployautomator/model/Configuration.java b/src/main/java/com/massivedisaster/bintraydeployautomator/model/Configuration.java index 4b5f67f..ab8f935 100644 --- a/src/main/java/com/massivedisaster/bintraydeployautomator/model/Configuration.java +++ b/src/main/java/com/massivedisaster/bintraydeployautomator/model/Configuration.java @@ -1,7 +1,6 @@ package com.massivedisaster.bintraydeployautomator.model; import com.google.gson.Gson; -import org.gradle.internal.impldep.org.apache.commons.lang.NullArgumentException; import org.gradle.internal.impldep.org.apache.commons.lang.StringUtils; import java.io.IOException; @@ -46,22 +45,7 @@ public String getBintrayKey() { return bintrayKey; } - public String[] getBintrayTasks() { - if(modules == null){ - throw new NullArgumentException("modules can't be null"); - } - - if(bintrayTasks == null){ - int size = modules.size(); - bintrayTasks = new String[size]; - for (int i = 0; i