-
Notifications
You must be signed in to change notification settings - Fork 28
Release v0.3.1 #22
Release v0.3.1 #22
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,6 @@ local.properties | |
|
||
# Generated files | ||
gen/ | ||
|
||
# Properties files | ||
secrets.properties | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
Change Log | ||
========== | ||
|
||
Version 0.3.1 *(08/02/2017)* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will merging this trigger a build and release? If not, the release should go before updating this imo There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no automatic trigger at the moment, but ideally it would yes. Once this gets merged the task on the CI will execute There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To be honest we could remove the date completely and add links to the GH release instead. What you think @ataulm? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah cool There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I think safer since the date could be incorrect (if no one merges this til tomorrow, then the release doesn't actually happen til the day after). With the link to releases, the link will be broken, but when the release is made, it will work (or link to releases page) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes plus one for link to release instead of date |
||
-------------------------- | ||
|
||
- Honour exclude filters in Findbugs tasks ([PR#20](https://github.com/novoda/gradle-static-analysis-plugin/pull/20)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Honor for us english There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you can just type There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @takecare I wasn't sure it would work in this file too, I'll try There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah i think you're right, it won't work! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I checked, it doesn't work indeed (I might even had done the same check before 😅 ) |
||
|
||
Version 0.3 *(27/01/2017)* | ||
-------------------------- | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,102 @@ | ||
version = '0.3.1' | ||
String tag = "v$project.version" | ||
groovydoc.docTitle = 'Static Analysis Plugin' | ||
|
||
apply plugin: 'com.novoda.bintray-release' | ||
publish { | ||
userOrg = 'novoda' | ||
groupId = 'com.novoda' | ||
artifactId = 'gradle-static-analysis-plugin' | ||
publishVersion = '0.3' | ||
publishVersion = project.version | ||
website = 'https://github.com/novoda/gradle-static-analysis-plugin' | ||
} | ||
|
||
apply plugin: 'com.novoda.build-properties' | ||
buildProperties { | ||
secrets { | ||
file(rootProject.file('secrets.properties'), ''' | ||
This file should contain: | ||
- git.username: the username used to push to the repo | ||
- git.password: the password used to push to the repo | ||
''') | ||
} | ||
} | ||
|
||
apply plugin: 'org.ajoberstar.grgit' | ||
apply plugin: 'org.ajoberstar.github-pages' | ||
|
||
githubPages { | ||
commitMessage = "Deploy groovydoc for release $tag" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
pages { | ||
from groovydoc.destinationDir | ||
into "docs/${project.version}" | ||
} | ||
} | ||
|
||
task prepareGhCredentials { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i'd stick to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it was to align with the naming used by one of the gradle plugin we are using to use the git/github API There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 just mentioned it 'cause there's a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, that extension (and the incosistent naming) is coming from the aforementioned plugin 👼 |
||
description = 'Prepare GitHub credentials' | ||
group = 'release' | ||
doLast { | ||
System.properties['org.ajoberstar.grgit.auth.username'] = buildProperties.secrets['git.username'].string | ||
System.properties['org.ajoberstar.grgit.auth.password'] = buildProperties.secrets['git.password'].string | ||
} | ||
} | ||
|
||
prepareGhPages.dependsOn groovydoc | ||
publishGhPages.dependsOn prepareGhCredentials | ||
|
||
task prepareRelease { | ||
description = 'Prepare changelog and tag for release' | ||
group = 'release' | ||
dependsOn prepareGhPages, prepareGhCredentials | ||
doLast { | ||
String changelog = extractChangelog() | ||
grgit.tag.add { | ||
name = tag | ||
message = "Release $tag\n\n$changelog" | ||
} | ||
} | ||
} | ||
|
||
String extractChangelog() { | ||
String fullChangelog = rootProject.file('CHANGELOG.md').text | ||
def latestChangelog = (fullChangelog =~ /Version ${project.version}.*\n-*([\s\S]*?)Version.*\n-*/) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gotta thanks the god of regex 😄 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there a format to follow? As in, a guide on how to adhere to the required format There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @florianmski The struggle was real! But you probably remember ;) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ataulm yes, this is assuming the changelog is written always following a specific structure. The script here is a first draft, something I hacked together a while ago that I feel should not be just a stashed snippet. Soon a follow-up PR will enhance this script adding the missing piece of functionality (the creation of a release entry in GitHub) and the documentation on how to release (including the format of the changelog). |
||
if (latestChangelog.size() > 0) { | ||
return latestChangelog[0][1].trim() | ||
} | ||
|
||
def firstChangelog = (fullChangelog =~ /Version ${project.version}.*\n-*([\s\S]*)/) | ||
if (firstChangelog.size() > 0) { | ||
return firstChangelog[0][1].trim() | ||
} | ||
throw new GradleException("No changelog found for version $project.version") | ||
} | ||
|
||
task publishArtifact { | ||
description = "Publish artifact for plugin version: $tag" | ||
group = 'release' | ||
project.afterEvaluate { dependsOn bintrayUpload } | ||
mustRunAfter prepareRelease | ||
} | ||
|
||
task publishGroovydoc { | ||
description = "Deploy groovydoc for plugin version: $tag" | ||
group = 'release' | ||
dependsOn publishGhPages | ||
mustRunAfter publishArtifact | ||
} | ||
|
||
task publishRelease { | ||
description = "Publish release for plugin version: $tag" | ||
group = 'release' | ||
if (project.hasProperty('dryRun') && project['dryRun'] == 'false') { | ||
dependsOn prepareRelease, publishArtifact, publishGroovydoc | ||
doLast { | ||
grgit.push { | ||
tags = true | ||
} | ||
} | ||
} else { | ||
dependsOn publishArtifact | ||
} | ||
} |
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.
👀