diff --git a/Jenkinsfile b/Jenkinsfile index da207ac..509817f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -72,6 +72,7 @@ set -e def props = readProperties(file: 'build/version.properties') version = props.VERSION_DISPLAY gitCommit = props.VERSION_COMMIT + currentBuild.description = "Version $version" } echo "Version = ${version}" } @@ -111,7 +112,7 @@ curl -X POST "https://api.github.com/repos/nemerosa/versioning/releases" \\ branch 'release/*' } environment { - BINTRAY = credentials('BINTRAY') + GRADLE_PLUGINS = credentials('GRADLE_PLUGINS') } steps { sh '''\ @@ -119,22 +120,15 @@ curl -X POST "https://api.github.com/repos/nemerosa/versioning/releases" \\ set -e ./gradlew \\ - publishPluginToBintray \\ - -x test \\ + + publishPlugins \\ --stacktrace \\ --profile \\ --console plain \\ - -PbintrayUser=${BINTRAY_USR} \\ - -PbintrayApiKey=${BINTRAY_PSW} + -Pgradle.publish.key=${GRADLE_PLUGINS_USR} \\ + -Pgradle.publish.secret=${GRADLE_PLUGINS_PSW} ''' - script { - // Reads version information - def props = readProperties(file: 'build/version.properties') - version = props.VERSION_DISPLAY - gitCommit = props.VERSION_COMMIT - } - echo "Version = ${version}" } } } -} \ No newline at end of file +} diff --git a/build.gradle b/build.gradle index d4b3bcf..1a7d29e 100644 --- a/build.gradle +++ b/build.gradle @@ -3,16 +3,21 @@ */ plugins { - id 'nu.studer.plugindev' version '1.0.3' - id 'com.jfrog.bintray' version '1.8.4' + /** + * Plugin + */ + id 'java-gradle-plugin' + id 'com.gradle.plugin-publish' version '0.10.0' /** * Versioning applied to itself */ id 'net.nemerosa.versioning' version '2.7.1' + /** + * Written in Groovy + */ + id 'groovy' } -apply plugin: 'groovy' - /** * Meta information */ @@ -28,8 +33,13 @@ ext { jgitVersion = '5.1.1.201809181055-r' } +repositories { + jcenter() +} + dependencies { - localGroovy() + compile gradleApi() + compile localGroovy() compile 'org.ajoberstar.grgit:grgit-core:3.0.0-rc.2' compile "org.eclipse.jgit:org.eclipse.jgit.ui:${jgitVersion}" compile "org.eclipse.jgit:org.eclipse.jgit:${jgitVersion}" @@ -37,53 +47,29 @@ dependencies { testCompile "junit:junit:4.12" testCompile "commons-lang:commons-lang:2.6" testCompile "commons-io:commons-io:2.5" - - - } /** * Plug-in definition */ -plugindev { - pluginImplementationClass 'net.nemerosa.versioning.VersioningPlugin' - pluginDescription 'Gradle plug-in that computes version information from the SCM' - pluginLicenses 'MIT' - pluginTags 'gradle', 'plugin', 'scm', 'git', 'svn', 'version' - authorId 'dcoraboeuf' - authorName 'Damien Coraboeuf' - authorEmail 'damien.coraboeuf@gmail.com' - projectUrl 'https://github.com/nemerosa/versioning' - projectInceptionYear '2015' - done() +pluginBundle { + website = 'https://github.com/nemerosa/versioning/' + vcsUrl = 'https://github.com/nemerosa/versioning/' + tags = ['gradle', 'plugin', 'scm', 'git', 'svn', 'version'] } -/** - * Plug-in publication - */ - -bintray { - user = bintrayUser - key = bintrayApiKey - pkg { - repo = 'nemerosa' - version { - attributes = [ - 'gradle-plugin': 'net.nemerosa.versioning:net.nemerosa:versioning' - ] +gradlePlugin { + plugins { + versioningPlugin { + id = 'net.nemerosa.versioning' + displayName = 'Versioning plugin for Gradle' + description = 'Gradle plug-in that computes version information from the SCM' + implementationClass = 'net.nemerosa.versioning.VersioningPlugin' } } } -/** - * Wrapper definition - */ - -task wrapper(type: Wrapper) { - gradleVersion = '2.13' -} - test { environment "GIT_TEST_BRANCH", "feature/456-cute" environment "SVN_TEST_BRANCH", "feature-456-cute"