Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

Commit

Permalink
Merge pull request #23 from novoda/22/use_arg_version
Browse files Browse the repository at this point in the history
22/Use version property if available
  • Loading branch information
blundell committed Mar 26, 2015
2 parents 608c57a + ae1eaf0 commit a69f98a
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.novoda:bintray-release:0.2.7'
classpath 'com.novoda:bintray-release:0.2.8'
}
}
```
Expand All @@ -36,11 +36,12 @@ publish {
userOrg = 'novoda'
groupId = 'com.novoda'
artifactId = 'bintray-release'
version = '0.2.7'
description = 'Oh hi, this is a nice description for a project right?'
version = '0.2.8'
description = 'Oh hi, this is a nice description for a project, right?'
website = 'https://github.com/novoda/bintray-release'
}
```
(note, since 0.2.8, publish.version can also be supplied on the command line. [See here](https://github.com/novoda/bintray-release/pull/23))

Finally, use the task `bintrayUpload` to publish (make sure you build the project first!):

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
allprojects {
version = "0.2.7"
version = "0.2.8"
}
2 changes: 1 addition & 1 deletion core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.novoda:bintray-release:0.2.6'
classpath 'com.novoda:bintray-release:0.2.7'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class BintrayConfiguration {

licenses = extension.licences
version {
name = extension.version
name = getString(project, 'version', extension.version)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ class ReleasePlugin implements Plugin<Project> {

void attachArtifacts(Project project) {
Artifacts artifacts = project.plugins.hasPlugin('com.android.library') ? new AndroidArtifacts() : new JavaArtifacts()
String projectVersion = getString(project, 'version', project.publish.version)
project.publishing {
publications {
maven(MavenPublication) {
groupId project.publish.groupId
artifactId project.publish.artifactId
version project.publish.version
version projectVersion

artifacts.all(project).each {
delegate.artifact it
Expand All @@ -42,4 +43,8 @@ class ReleasePlugin implements Plugin<Project> {
}
}

private String getString(Project project, String propertyName, String defaultValue) {
project.hasProperty(propertyName) ? project.getProperty(propertyName) : defaultValue
}

}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-2.0-all.zip
distributionUrl=http\://services.gradle.org/distributions/gradle-2.3-all.zip

0 comments on commit a69f98a

Please sign in to comment.