Skip to content

Commit

Permalink
Added capability of automatically updating the released version numbe…
Browse files Browse the repository at this point in the history
…r within the README
  • Loading branch information
ysb33r committed Jul 14, 2016
1 parent ee80047 commit 09fb405
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
= GNU Make Gradle Plugin
:revnumber: 1.1.1

Provides a wrapper for calling GNU Make from Gradle. This is especially useful
for projects migrating to Gradle or when constructing complex build systems of which
Expand Down Expand Up @@ -40,7 +41,7 @@ buildscript {
}
}
dependencies {
classpath 'org.ysb33r.gradle:gnumake:1.1'
classpath 'org.ysb33r.gradle:gnumake:{revnumber}'
}
}
Expand All @@ -52,7 +53,7 @@ or if you use Gradle 2.1+
[source,groovy]
----
plugins {
id 'org.ysb33r.gnumake' version '1.0'
id 'org.ysb33r.gnumake' version '{revnumber}'
}
----

Expand Down
12 changes: 11 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,20 @@ license {
exclude '**/*CompatibilitySpec.groovy'
}

task updateReadmeWithReleaseNumber {
group 'Publication'
description 'Updates the README with the release version number'
onlyIf { !version.endsWith("SNAPSHOT") }

doLast {
File readme = file("${projectDir}/README.adoc")
readme.text = readme.text.replaceFirst(/:revnumber:\s?[\d.]+/,":revnumber: ${version}")
}
}

task release {
group 'Publication'
description 'Build, test & push publications'
onlyIf { !version.endsWith("SNAPSHOT") }
dependsOn build, publishPlugins, uploadArchives
dependsOn updateReadmeWithReleaseNumber, build, publishPlugins, uploadArchives
}

0 comments on commit 09fb405

Please sign in to comment.