Conversation
@@ -1,6 +1,6 @@ | |||
class GradlePlugins { | |||
final bintrayRelease = 'com.novoda:bintray-release:0.4.0' | |||
final buildProperties = 'com.novoda:gradle-build-properties-plugin:0.2' | |||
final buildProperties = 'com.novoda:gradle-build-properties-plugin:0.4.1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our build properties was not working so we have updated to the latest version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple minor things but a-ok otherwise
gradle/publish.gradle
Outdated
|
||
apply plugin: 'com.gradle.plugin-publish' | ||
apply plugin: 'com.novoda.bintray-release' | ||
publish { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: empty line before publish
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gradle/publish.gradle
Outdated
grgit.push { | ||
tags = true | ||
boolean isDryRun = buildProperties.cli['dryRun'].or(true).boolean | ||
if (!isDryRun) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we invert? if (isDryRun) { ... } else { ... }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not so familiar with Jenkins setups so if somebody could take a look over this that would be cool |
@tomsammons what about Jenkins? this PR doesn't seem to do anything Jenkins directly |
@rock3r Yep sorry, nothing about Jenkins |
gradle/publish.gradle
Outdated
apply plugin: 'com.novoda.build-properties' | ||
buildProperties { | ||
|
||
secrets { | ||
file(rootProject.file('secrets.properties'), ''' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you please change this too now that you're at it?
using rootProject.file('secrets.properties')
description = ''' ... '''
gradle/publish.gradle
Outdated
boolean isDryRun = cli['dryRun'].or(true).boolean | ||
return isDryRun ? | ||
['bintrayRepo': 'n/a', 'bintrayUser': 'n/a', 'bintrayKey': 'n/a'] : | ||
new File("${System.getenv('BINTRAY_PROPERTIES')}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you defined the CI job to set this var up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, this is configured:
https://ci.novoda.com/job/gradle-static-analysis-plugin-snapshot/configure
gradle/publish.gradle
Outdated
tags = true | ||
} | ||
} | ||
boolean isDryRun = buildProperties.cli['dryRun'].or(true).boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is used in 2 places already. could you extract as var in the outmost scope?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What exactly do you have in mind?
We consume this value the first time within the configuration of the buildProperties
extension itself.
We could define it within the ext
block with a default value and override it it within the buildPropeties.bintray
configuration. But this way we would need to rely on the order when reading the value a second time.
As alternative we could extract a method isDryRun()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extracting a method in this gradle file sounds good too (no need to expose it outside using any ext
)
gradle/publish.gradle
Outdated
} else { | ||
dependsOn publishArtifact | ||
boolean isSnapshot = buildProperties.cli['bintraySnapshot'].or(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
…alysis-plugin into gradle/snapshots # Conflicts: # gradle/publish.gradle
gradle/publish.gradle
Outdated
} | ||
|
||
boolean isSnapshot() { | ||
buildProperties.cli['bintraySnapshot'].or(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're missing .boolean
at the end of this like (see isDryRun()
)
This PR adds support for snapshots builds
These will be built off the development branch
We updated the
gradle-build-properties-plugin
to the latest versionHere is the link to the Jenkins job: https://ci.novoda.com/job/gradle-static-analysis-plugin-snapshot/
Paired with @tobiasheine