This repository has been archived by the owner on Feb 10, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.upload
119 lines (104 loc) · 3.2 KB
/
build.upload
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
116
117
118
119
apply from: 'build.shared'
apply plugin: 'maven-publish'
apply plugin: 'signing'
sourceCompatibility = 1.11
targetCompatibility = 1.11
test {
maxParallelForks = Math.max(1, (int)(Runtime.getRuntime().availableProcessors() / 2))
}
def findJVM() {
String[] java11Paths = new String[4]
java11Paths[0] = "/usr/lib/jvm/java-11-openjdk-amd64/lib/"
java11Paths[1] = "/usr/lib/jvm/java-11-openjdk/lib/"
java11Paths[2] = "/usr/lib/jvm/openjdk-11/lib/"
java11Paths[3] = "/usr/lib/jvm/java-11-sun/lib/"
for (String path : java11Paths) {
if (new java.io.File(path).exists()) {
return path
}
}
return null
}
compileJava {
def jvmPath = findJVM()
if (jvmPath == null) {
println 'Unable to find java 11 install, will cause failure so exiting now'
println ''
System.exit(1)
}
println 'Using java 11: ' + jvmPath
options.bootstrapClasspath = fileTree(include: ['*.jar'], dir: jvmPath)
}
compileTestJava {
options.compilerArgs << "-Xlint:all" << "-Xlint:-deprecation" << "-Werror"
options.bootstrapClasspath = fileTree(include: ['*.jar'], dir: findJVM())
}
signing {
sign configurations.archives
if (! version.contains('SNAPSHOT')) {
sign publishing.publications
}
}
publishing {
publications {
mavenJava(MavenPublication) {
pom {
name = 'Ambush'
description = 'A unique java library for structuring and driving performance load tests. What makes this so unique is the belief that what is describing how test code runs, should be the same language/closely connected with the tool which helps structure those actions and executes those actions.'
url = 'http://threadly.org/'
scm {
url = 'scm:[email protected]:threadly/ambush.git'
connection = 'scm:[email protected]:threadly/ambush.git'
developerConnection = 'scm:[email protected]:threadly/ambush.git'
}
issueManagement {
system = 'GitHub'
url = 'https://github.com/threadly/ambush/issues'
}
licenses {
license {
name = 'Mozilla Public License Version 2.0'
url = 'https://www.mozilla.org/MPL/2.0/'
distribution = 'repo'
}
}
developers {
developer {
id = 'jent'
name = 'Mike Jensen'
email = '[email protected]'
}
}
}
from components.java
artifact(sourcesJar) {
classifier = 'sources'
}
artifact(javadocJar) {
classifier = 'javadoc'
}
}
}
repositories {
maven {
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username sonatypeUsername
password sonatypePassword
}
}
}
}
model {
tasks.generatePomFileForMavenJavaPublication {
destination = file("$buildDir/generated-pom.xml")
}
tasks.publishMavenJavaPublicationToMavenLocal {
dependsOn project.tasks.signArchives
}
tasks.publishMavenJavaPublicationToMavenRepository {
dependsOn project.tasks.signArchives
}
}