-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
101 lines (87 loc) · 2.7 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
apply plugin: 'groovy'
sourceCompatibility = '1.7'
targetCompatibility = '1.7'
repositories {
mavenCentral()
}
dependencies {
compile gradleApi()
compile localGroovy()
}
task wrapper(type: Wrapper) {
gradleVersion = '1.6'
}
/******** Maven publication *********/
apply plugin: 'signing'
apply plugin: 'maven'
ext.isSnapshot = version.endsWith("-SNAPSHOT")
task sourceJar(type: Jar) {
description = 'An archive of the source code for Maven Central'
classifier = 'sources'
from sourceSets.main.groovy
}
task groovydocJar(type: Jar) {
description = 'An archive of the GroovyDocs for Maven Central'
classifier = 'javadoc'
from groovydoc
}
artifacts {
archives groovydocJar, sourceJar
}
signing {
sign configurations.archives
}
// Only *require* signing if we are uploading a non snapshot version
gradle.taskGraph.whenReady { taskGraph ->
tasks.withType(org.gradle.plugins.signing.Sign).all {
required = taskGraph.hasTask(":uploadArchives") && !isSnapshot
}
}
install.repositories.mavenInstaller {
pom.project(pomConfiguration)
if (signing.signatory) {
beforeDeployment { signing.signPom(it) }
}
}
uploadArchives {
repositories {
mavenDeployer {
if (signing.signatory) {
beforeDeployment { signing.signPom(it) }
}
repository(url: (isSnapshot ? 'https://oss.sonatype.org/content/repositories/snapshots/' : 'https://oss.sonatype.org/service/local/staging/deploy/maven2/')) {
authentication(userName: System.properties['mavenCentralUsername'], password: System.properties['mavenCentralPassword'])
releases(updatePolicy: 'always')
snapshots(updatePolicy: 'always')
}
pom.project(pomConfiguration)
}
}
}
def getPomConfiguration() {
return {
name 'Gradle Jasquire Plugin'
packaging 'jar'
description project.description
url 'https://github.com/abirmingham/gradle-jasquire-plugin'
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
developers {
developer {
id 'abirmingham'
name 'Alex Birmingham'
email '[email protected]'
}
}
scm {
connection 'scm:https://[email protected]/abirmingham/gradle-jasquire-plugin'
developerConnection 'scm:[email protected]:abirmingham/gradle-jasquire-plugin.git'
url 'https://github.com/abirmingham/gradle-jasquire-plugin'
}
}
}