Skip to content

Commit

Permalink
#53 Upgrade Gradle publication
Browse files Browse the repository at this point in the history
  • Loading branch information
dcoraboeuf committed Oct 14, 2018
1 parent 28b1cdb commit 95ddfea
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 53 deletions.
20 changes: 7 additions & 13 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}
Expand Down Expand Up @@ -111,30 +112,23 @@ curl -X POST "https://api.github.com/repos/nemerosa/versioning/releases" \\
branch 'release/*'
}
environment {
BINTRAY = credentials('BINTRAY')
GRADLE_PLUGINS = credentials('GRADLE_PLUGINS')
}
steps {
sh '''\
#!/bin/bash
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}"
}
}
}
}
}
66 changes: 26 additions & 40 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -28,62 +33,43 @@ 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}"
compile 'org.tmatesoft.svnkit:svnkit:1.8.12'
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 '[email protected]'
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"
Expand Down

0 comments on commit 95ddfea

Please sign in to comment.