Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change log level for missing user properties #212

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ gradle-bintray-plugin.iml
gradle-bintray-plugin.ipr
gradle-bintray-plugin.iws
gradle.properties
.idea/
.gradle/
.DS_STORE
build/
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class BintrayPlugin implements Plugin<Project> {
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)
Expand Down
20 changes: 10 additions & 10 deletions src/main/groovy/com/jfrog/bintray/gradle/BintrayUploadTask.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -565,9 +565,9 @@ class BintrayUploadTask extends DefaultTask {
*/
int getCurrentTaskIndex() {
List<BintrayUploadTask> 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
}
Expand All @@ -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)
}
}
}
Expand All @@ -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) {
Expand Down
10 changes: 5 additions & 5 deletions src/main/groovy/com/jfrog/bintray/gradle/Utils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down