1
- def isDirty = { ->
2
- def stdout = new ByteArrayOutputStream ()
3
- exec {
4
- commandLine ' git' , ' status' , ' --porcelain'
5
- standardOutput = stdout
1
+ // First, apply the publishing plugin
2
+ buildscript {
3
+ repositories {
4
+ maven {
5
+ url " https://plugins.gradle.org/m2/"
6
+ }
7
+ }
8
+ dependencies {
9
+ classpath " com.gradle.publish:plugin-publish-plugin:0.9.2"
6
10
}
7
- return stdout. toString(). trim()
8
11
}
9
- def getVersionName = { ->
10
- def stdout = new ByteArrayOutputStream ()
11
- exec {
12
- commandLine ' git' , ' describe' , ' --tags'
13
- standardOutput = stdout
12
+
13
+ apply plugin : " com.gradle.plugin-publish"
14
+ description = ' gradle-scoverage is a Gradle plugin for calculating code coverage using Scoverage'
15
+ version = {
16
+ if (project. hasProperty(' version' )) {
17
+ return project. getProperty(' version' )
18
+ } else {
19
+ return ' 2.0.0-SNAPSHOT'
14
20
}
15
- def gitVersionName = stdout. toString(). trim()
16
- return isDirty() ? gitVersionName + ' -SNAPSHOT' : gitVersionName
17
21
}
18
- version = getVersionName()
19
22
20
23
repositories {
21
24
mavenCentral()
22
25
}
23
26
24
27
ext {
28
+ website = ' http://scoverage.org'
29
+ vcsUrl = ' https://github.com/scoverage/gradle-scoverage.git'
30
+ scmUrl = " scm:git:$vcsUrl "
25
31
sonatypeUser = System . env. SONATYPE_USER
26
32
sonatypePass = System . env. SONATYPE_PASS
27
33
}
@@ -73,6 +79,20 @@ if (project.properties.containsKey('signing.keyId')) {
73
79
}
74
80
}
75
81
82
+ pluginBundle {
83
+ website = project. website
84
+ vcsUrl = project. vcsUrl
85
+ description = project. description
86
+ tags = [' coverage' , ' scala' , ' scoverage' ]
87
+
88
+ plugins {
89
+ scoveragePlugin {
90
+ id = ' org.scoverage'
91
+ displayName = ' Gradle Scoverage plugin'
92
+ }
93
+ }
94
+ }
95
+
76
96
uploadArchives {
77
97
repositories {
78
98
mavenDeployer {
@@ -90,12 +110,12 @@ uploadArchives {
90
110
91
111
pom. project {
92
112
name ' GradleScoverage'
93
- description ' gradle-scoverage is a Gradle plugin for calculating code coverage using Scoverage '
94
- url ' http://scoverage.org '
113
+ description project . description
114
+ url project . website
95
115
96
116
scm {
97
- url ' scm:git:https://github.com/scoverage/gradle-scoverage.git '
98
- developerConnection ' scm:git:https://github.com/scoverage/gradle-scoverage.git '
117
+ url scmUrl
118
+ developerConnection scmUrl
99
119
}
100
120
101
121
licenses {
0 commit comments