forked from excelsior-oss/excelsior-jet-gradle-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaven.gradle
115 lines (100 loc) · 3.88 KB
/
maven.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/**
* Configuration required to publish artifacts into maven local and maven central
*/
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'io.codearte.nexus-staging'
apply plugin: 'net.researchgate.release'
ext.githubRepoOwner = "excelsior-oss"
ext.githubRepo = "excelsior-jet-gradle-plugin"
task javadocJar(type: Jar, dependsOn: [javadoc, groovydoc]) {
classifier = 'javadoc'
from tasks.javadoc.destinationDir
from tasks.groovydoc.destinationDir
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
artifacts {
archives jar
archives javadocJar
archives sourcesJar
}
signing {
sign configurations.archives
}
// To run functional tests we need to install plugin to maven local, so it became available for test build script.
// When signing plugin is applied it requires sonatype authentication data even for install into maven local.
// So to run tests locally developer have to set sonatype authentication data, which is not always acceptable.
// To work around this issue, we execute 'signArchives' task, only when 'uploadArchives' task is presented in task graph
gradle.taskGraph.whenReady {
signArchives.onlyIf { gradle.taskGraph.hasTask(":uploadArchives") }
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
if (!this.hasProperty("sonatypeUsername")) {
logger.warn("[WARN] sonatypeUsername is not set!")
ext.sonatypeUsername = ""
}
if (!this.hasProperty("sonatypePassword")) {
logger.warn("[WARN] sonatypePassword is not set!")
ext.sonatypePassword = ""
}
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
pom.project {
name 'Excelsior Jet Gradle Plugin'
packaging 'jar'
description '''
|Excelsior JET Gradle Plugin provides Gradle users with an easy way to compile their applications
|down to optimized native Windows, OS X, or Linux executables with Excelsior JET.'''.stripMargin('|')
url "https://github.com/${githubRepoOwner}/${githubRepo}"
scm {
url 'https://github.com/${githubRepoOwner}/${githubRepo}'
connection 'scm:git:https://github.com/${githubRepoOwner}/${githubRepo}.git'
developerConnection 'scm:git:https://github.com/${githubRepoOwner}/${githubRepo}.git'
tag 'HEAD'
}
licenses {
license {
name 'GNU General Public License</name'
url 'http://www.gnu.org/licenses/gpl.txt'
distribution 'repo'
}
}
developers {
developer {
id 'pjBooms'
name 'Nikita Lipsky'
}
developer {
id 'aleksey-zhidkov'
name 'Aleksey Zhidkov'
}
developer {
id 'dleskov'
name 'Dmitry Leskov'
}
}
}
}
}
}
// Gradle release plugin configuration
release {
failOnUpdateNeeded = false
failOnUnversionedFiles = false
}
afterReleaseBuild.dependsOn uploadArchives
gradle.taskGraph.whenReady {
if (gradle.taskGraph.hasTask(":closeAndPromoteRepository")) {
nexusStaging {
username = sonatypeUsername
password = sonatypePassword
}
}
}