Grails Clover Plugin Developer Guide
Preconditions
- Install Grails 2.0.4 and set $GRAILS_HOME
- the minimum Grails version required to run the plugin is 2.0.0 (see CloverGrailsPlugin.groovy)
- the compilation and deployment of the plugin is done using 2.0.4 (see application.properties)
- Set JAVA_HOME to JDK 1.6+ (otherwise you'll end up with java.lang.NoClassDefFoundError: org.codehaus.gant.GantBuilder error)
- Clone the repository from Bitbucket:
hg clone ssh://hg@bitbucket.org/atlassian/grails-clover-plugin
This is Mercurial repository, not Git.
Build and test
To build the plugin and to run unit tests type:
grails package-plugin
grails test-app
To run integration tests:
Install the artefact
grails test maven-install # it puts zip into local Maven cache ~/.m2
By default maven-install and publish-plugin targets are switching environment context to "production" and our CloverGrailsPlugin.groovy has def environment = ["test"] declared. Therefore you have to force switch of environment context by "grails test ...", otherwise a build fails.
- Test it against the enclosed Grails test applications located in /testcases directory.
Update Clover plugin number in <grails>/testcases/<project>/grails-app/conf/BuildConfig.groovy, e.g.:
plugins { build ":clover:4.1.2" }
Switch to proper Grails version - set GRAILS_HOME and PATH variables according to test project's settings.
Change directory to <grails>/testcases/<project_name> and run
grails test-app -clover.on
Creating a pull request
In case you'd like to have your changes included in the official release:
- Fork atlassian/grails-clover-plugin repository and clone the fork into your workstation.
- Implement the change (also write unit or integration tests). Commit changes.
- Create a pull request for atlassian/grails-clover-plugin project
- Ensure any new features / configuration options are documented in the pull request description.
Release and publish
In case you'd like to build a new release on your own:
Preconditions
You must be a member of the Grails Plug-in Development team:
- register at http://grails.org/register
- get permission to write to the Grails Central release repository; see http://grails.org/Creating+Plugins
- get write permissions in https://bitbucket.org/atlassian/grails-clover-plugin Git repository
- create an account on Grails Wiki in order to edit the http://grails.org/plugins/clover page
add the following in ~/.grails/settings.groovy:
grails.project.repos.grailsCentral.username = "YOUR_GRAILS_ORG_LOGIN" grails.project.repos.grailsCentral.password = "YOUR_GRAILS_ORG_PASSWORD"
Steps
- Increment the version number in <grails>/CloverGrailsPlugin.groovy and commit this, e.g.
def version = "4.1.2" - Update <grails>/grails-app/conf/BuildConfig.groovy and change the version of Clover Core required (if necessary), e.g.
core.version = 'com.atlassian.clover:clover:4.1.2' - Build the plugin via:
grails package-plugin
grails test maven-install - Test it against the enclosed Grails test applications located in /testcases directory
- Create a tag for new version, e.g:
hg tag grails-clover-plugin-4.1.2
and push code changes into Bitbucket:
hg push - Push the plugin to Grails Central via:
grails test publish-plugin --plain-output --verbose - Test that the zip has been pushed to the Grails Central and exists at: http://grails.org/plugin/clover and is being listed via:
grails list-plugins
You may have to wait few minutes before it becomes visible; if not - contact dev@grails.codehaus.org - Test that plugin can be installed, e.g.:
grails install-plugin clover 4.1.2
Make sure that clover-X.Y.Z.zip is not available locally in ~/.m2, ~/.ivy2, ~/.grails/X.Y.Z/*, ~/.grails/ivy_cache to check that it indeed downloads from Grails Central and not your cache. - Update plugin's documentation on http://grails.org/plugin/clover.
Binaries
Stable releases can be downloaded from Grails Plugins site.