diff --git a/.gitignore b/.gitignore index 7eee3a0..8204eda 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,7 @@ gradle-bintray-plugin.iml gradle-bintray-plugin.ipr gradle-bintray-plugin.iws gradle.properties +.idea/ +.gradle/ +.DS_STORE +build/ \ No newline at end of file diff --git a/build.gradle b/build.gradle index ea63302..3658f43 100644 --- a/build.gradle +++ b/build.gradle @@ -112,7 +112,7 @@ publishing { task createReleasePropertiesFile(type:Exec) { String fileName = 'bintray.plugin.release.properties' - println 'Creating $fileName' + println "Creating $fileName" String fileContent = "version=$currentVersion" (new File("$rootDir/src/main/resources/$fileName")).write(fileContent) } diff --git a/src/main/groovy/com/jfrog/bintray/gradle/BintrayHttpClientFactory.groovy b/src/main/groovy/com/jfrog/bintray/gradle/BintrayHttpClientFactory.groovy index 301b56e..c541a51 100644 --- a/src/main/groovy/com/jfrog/bintray/gradle/BintrayHttpClientFactory.groovy +++ b/src/main/groovy/com/jfrog/bintray/gradle/BintrayHttpClientFactory.groovy @@ -25,7 +25,7 @@ class BintrayHttpClientFactory { static HTTPBuilder create(apiUrl, user, apiKey) { def assertNotEmpty = { String name, String val -> if (val?.isEmpty()) { - throw new IllegalArgumentException("Bintray $name cannot be empty!"); + throw new IllegalArgumentException("Bintray $name cannot be empty!") } } assertNotEmpty('apiUrl', apiUrl) @@ -80,7 +80,7 @@ class BintrayHttpClientFactory { if (System.getProperty('http.proxyHost')) { String proxyHost = System.getProperty('http.proxyHost') - Integer proxyPort = Integer.parseInt(System.getProperty('http.proxyPort', '80')); + Integer proxyPort = Integer.parseInt(System.getProperty('http.proxyPort', '80')) String proxyUser = System.getProperty('http.proxyUser') String proxyPassword = System.getProperty('http.proxyPassword', '') logger.info "Using proxy ${proxyUser}:${proxyPassword}@${proxyHost}:${proxyPort}" diff --git a/src/main/groovy/com/jfrog/bintray/gradle/BintrayPlugin.groovy b/src/main/groovy/com/jfrog/bintray/gradle/BintrayPlugin.groovy index 8ae774f..5ab1768 100644 --- a/src/main/groovy/com/jfrog/bintray/gradle/BintrayPlugin.groovy +++ b/src/main/groovy/com/jfrog/bintray/gradle/BintrayPlugin.groovy @@ -11,7 +11,7 @@ class BintrayPlugin implements Plugin { private Project project public void apply(Project project) { - this.project = project; + this.project = project //Create and configure the task BintrayUploadTask bintrayUpload = project.task(type: BintrayUploadTask, BintrayUploadTask.NAME) diff --git a/src/main/groovy/com/jfrog/bintray/gradle/BintrayUploadTask.groovy b/src/main/groovy/com/jfrog/bintray/gradle/BintrayUploadTask.groovy index f8b462a..556868a 100644 --- a/src/main/groovy/com/jfrog/bintray/gradle/BintrayUploadTask.groovy +++ b/src/main/groovy/com/jfrog/bintray/gradle/BintrayUploadTask.groovy @@ -182,9 +182,9 @@ class BintrayUploadTask extends DefaultTask { @TaskAction void bintrayUpload() { - logger.info("Gradle Bintray Plugin version: ${new Utils().pluginVersion}"); + logger.info("Gradle Bintray Plugin version: ${new Utils().pluginVersion}") if (shouldSkip()) { - logger.info("Skipping task '{}:bintrayUpload' because user or apiKey is null.", this.project.name); + logger.error("Skipping task '{}:bintrayUpload' because user or apiKey is null.", this.project.name) return } validateDebianDefinition() @@ -212,7 +212,7 @@ class BintrayUploadTask extends DefaultTask { if (publication != null) { return collectArtifacts(publication) } else { - logger.error("{}: Could not find publication: {}.", path, it); + logger.error("{}: Could not find publication: {}.", path, it) } } else if (conf instanceof MavenPublication) { return collectArtifacts((Configuration) it) @@ -254,7 +254,7 @@ class BintrayUploadTask extends DefaultTask { // Check if the package has already been created by another BintrayUploadTask. Package pkg = checkPackageAlreadyCreated() if (pkg && pkg.isCreated()) { - return; + return } def create http.request(HEAD) { @@ -304,7 +304,7 @@ class BintrayUploadTask extends DefaultTask { // Check if the version has already been created by another BintrayUploadTask. Version version = checkVersionAlreadyCreated() if (version && version.isCreated()) { - return; + return } def create http.request(HEAD) { @@ -565,9 +565,9 @@ class BintrayUploadTask extends DefaultTask { */ int getCurrentTaskIndex() { List tasks = allBintrayUploadTasks - int currentTaskIndex = tasks.indexOf(this); + int currentTaskIndex = tasks.indexOf(this) if (currentTaskIndex == -1) { - throw new Exception("Could not find the current task {} in the task graph", getPath()); + throw new Exception("Could not find the current task {} in the task graph", getPath()) } currentTaskIndex } @@ -578,7 +578,7 @@ class BintrayUploadTask extends DefaultTask { for (Task task : getProject().getGradle().getTaskGraph().getAllTasks()) { if (task instanceof BintrayUploadTask) { if (!task.shouldSkip()) { - tasks.add(task); + tasks.add(task) } } } @@ -605,10 +605,10 @@ class BintrayUploadTask extends DefaultTask { name: it.name, groupId: project.group, version: project.version, extension: it.extension, type: it.type, classifier: it.classifier, file: it.file, signedExtension: signedExtension ) - }.unique(); + }.unique() // Add pom file per config - Upload installTask = project.tasks.withType(Upload).findByName('install'); + Upload installTask = project.tasks.withType(Upload).findByName('install') if (!installTask) { logger.info "maven plugin was not applied, no pom will be uploaded." } else if (!pomArtifact) { diff --git a/src/main/groovy/com/jfrog/bintray/gradle/Utils.groovy b/src/main/groovy/com/jfrog/bintray/gradle/Utils.groovy index 29b6c7b..5d5af5d 100644 --- a/src/main/groovy/com/jfrog/bintray/gradle/Utils.groovy +++ b/src/main/groovy/com/jfrog/bintray/gradle/Utils.groovy @@ -40,10 +40,10 @@ class Utils { } public static String readArtifactIdFromPom(File pom) { - FileReader reader = new FileReader(pom); - MavenXpp3Reader mavenreader = new MavenXpp3Reader(); - Model model = mavenreader.read(reader); - MavenProject project = new MavenProject(model); - return project.getArtifactId(); + FileReader reader = new FileReader(pom) + MavenXpp3Reader mavenreader = new MavenXpp3Reader() + Model model = mavenreader.read(reader) + MavenProject project = new MavenProject(model) + return project.getArtifactId() } } \ No newline at end of file diff --git a/src/test/groovy/com/jfrog/bintray/gradle/GradleLauncher.groovy b/src/test/groovy/com/jfrog/bintray/gradle/GradleLauncher.groovy index 75eccfe..0c34014 100644 --- a/src/test/groovy/com/jfrog/bintray/gradle/GradleLauncher.groovy +++ b/src/test/groovy/com/jfrog/bintray/gradle/GradleLauncher.groovy @@ -40,7 +40,7 @@ class GradleLauncher { private def tasksToString() { StringBuilder sb = new StringBuilder() - int c = 0; + int c = 0 for(task in tasks) { sb.append(task) if (c++ < tasks.size()-1) { @@ -52,7 +52,7 @@ class GradleLauncher { private def switchesToString() { StringBuilder sb = new StringBuilder() - int c = 0; + int c = 0 for(gradleSwitch in switches) { gradleSwitch = gradleSwitch.startsWith("--") ? gradleSwitch : "--${gradleSwitch}" sb.append(gradleSwitch) @@ -65,7 +65,7 @@ class GradleLauncher { private def envVarsToString() { StringBuilder sb = new StringBuilder() - int c = 0; + int c = 0 for(var in envVars) { def key = var.key.startsWith("-P") ? var.key : "-P${var.key}" sb.append(key).append("=").append(var.value) @@ -78,7 +78,7 @@ class GradleLauncher { private def systemPropsToString() { StringBuilder sb = new StringBuilder() - int c = 0; + int c = 0 for(var in systemProps) { def key = var.key.startsWith("-D") ? var.key : "-D${var.key}" sb.append(key).append("=").append(var.value)