Skip to content

Commit 95ddfea

Browse files
committed
#53 Upgrade Gradle publication
1 parent 28b1cdb commit 95ddfea

File tree

2 files changed

+33
-53
lines changed

2 files changed

+33
-53
lines changed

Jenkinsfile

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ set -e
7272
def props = readProperties(file: 'build/version.properties')
7373
version = props.VERSION_DISPLAY
7474
gitCommit = props.VERSION_COMMIT
75+
currentBuild.description = "Version $version"
7576
}
7677
echo "Version = ${version}"
7778
}
@@ -111,30 +112,23 @@ curl -X POST "https://api.github.com/repos/nemerosa/versioning/releases" \\
111112
branch 'release/*'
112113
}
113114
environment {
114-
BINTRAY = credentials('BINTRAY')
115+
GRADLE_PLUGINS = credentials('GRADLE_PLUGINS')
115116
}
116117
steps {
117118
sh '''\
118119
#!/bin/bash
119120
set -e
120121
121122
./gradlew \\
122-
publishPluginToBintray \\
123-
-x test \\
123+
124+
publishPlugins \\
124125
--stacktrace \\
125126
--profile \\
126127
--console plain \\
127-
-PbintrayUser=${BINTRAY_USR} \\
128-
-PbintrayApiKey=${BINTRAY_PSW}
128+
-Pgradle.publish.key=${GRADLE_PLUGINS_USR} \\
129+
-Pgradle.publish.secret=${GRADLE_PLUGINS_PSW}
129130
'''
130-
script {
131-
// Reads version information
132-
def props = readProperties(file: 'build/version.properties')
133-
version = props.VERSION_DISPLAY
134-
gitCommit = props.VERSION_COMMIT
135-
}
136-
echo "Version = ${version}"
137131
}
138132
}
139133
}
140-
}
134+
}

build.gradle

Lines changed: 26 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,21 @@
33
*/
44

55
plugins {
6-
id 'nu.studer.plugindev' version '1.0.3'
7-
id 'com.jfrog.bintray' version '1.8.4'
6+
/**
7+
* Plugin
8+
*/
9+
id 'java-gradle-plugin'
10+
id 'com.gradle.plugin-publish' version '0.10.0'
811
/**
912
* Versioning applied to itself
1013
*/
1114
id 'net.nemerosa.versioning' version '2.7.1'
15+
/**
16+
* Written in Groovy
17+
*/
18+
id 'groovy'
1219
}
1320

14-
apply plugin: 'groovy'
15-
1621
/**
1722
* Meta information
1823
*/
@@ -28,62 +33,43 @@ ext {
2833
jgitVersion = '5.1.1.201809181055-r'
2934
}
3035

36+
repositories {
37+
jcenter()
38+
}
39+
3140
dependencies {
32-
localGroovy()
41+
compile gradleApi()
42+
compile localGroovy()
3343
compile 'org.ajoberstar.grgit:grgit-core:3.0.0-rc.2'
3444
compile "org.eclipse.jgit:org.eclipse.jgit.ui:${jgitVersion}"
3545
compile "org.eclipse.jgit:org.eclipse.jgit:${jgitVersion}"
3646
compile 'org.tmatesoft.svnkit:svnkit:1.8.12'
3747
testCompile "junit:junit:4.12"
3848
testCompile "commons-lang:commons-lang:2.6"
3949
testCompile "commons-io:commons-io:2.5"
40-
41-
42-
4350
}
4451

4552
/**
4653
* Plug-in definition
4754
*/
4855

49-
plugindev {
50-
pluginImplementationClass 'net.nemerosa.versioning.VersioningPlugin'
51-
pluginDescription 'Gradle plug-in that computes version information from the SCM'
52-
pluginLicenses 'MIT'
53-
pluginTags 'gradle', 'plugin', 'scm', 'git', 'svn', 'version'
54-
authorId 'dcoraboeuf'
55-
authorName 'Damien Coraboeuf'
56-
authorEmail 'damien.coraboeuf@gmail.com'
57-
projectUrl 'https://github.com/nemerosa/versioning'
58-
projectInceptionYear '2015'
59-
done()
56+
pluginBundle {
57+
website = 'https://github.com/nemerosa/versioning/'
58+
vcsUrl = 'https://github.com/nemerosa/versioning/'
59+
tags = ['gradle', 'plugin', 'scm', 'git', 'svn', 'version']
6060
}
6161

62-
/**
63-
* Plug-in publication
64-
*/
65-
66-
bintray {
67-
user = bintrayUser
68-
key = bintrayApiKey
69-
pkg {
70-
repo = 'nemerosa'
71-
version {
72-
attributes = [
73-
'gradle-plugin': 'net.nemerosa.versioning:net.nemerosa:versioning'
74-
]
62+
gradlePlugin {
63+
plugins {
64+
versioningPlugin {
65+
id = 'net.nemerosa.versioning'
66+
displayName = 'Versioning plugin for Gradle'
67+
description = 'Gradle plug-in that computes version information from the SCM'
68+
implementationClass = 'net.nemerosa.versioning.VersioningPlugin'
7569
}
7670
}
7771
}
7872

79-
/**
80-
* Wrapper definition
81-
*/
82-
83-
task wrapper(type: Wrapper) {
84-
gradleVersion = '2.13'
85-
}
86-
8773
test {
8874
environment "GIT_TEST_BRANCH", "feature/456-cute"
8975
environment "SVN_TEST_BRANCH", "feature-456-cute"

0 commit comments

Comments
 (0)