-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle
108 lines (88 loc) · 2.16 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
102
103
104
105
106
107
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "io.github.gradle-nexus:publish-plugin:1.0.0"
}
}
plugins {
id 'java'
id 'groovy'
id 'java-library'
id 'signing'
id 'idea'
id 'maven-publish'
}
ext {
isBuildSnapshot = version.endsWith('-SNAPSHOT')
isReleaseVersion = !isBuildSnapshot
}
group = 'com.bertramlabs.plugins'
if (isReleaseVersion) {
apply plugin: "io.github.gradle-nexus.publish-plugin"
nexusPublishing {
repositories {
sonatype {
if(project.hasProperty('mavenUser')) {
username = mavenUser
password = mavenPassword
}
}
}
}
} else {
publishing {
repositories {
maven {
url = "http://nexus.bertramlabs.com/content/repositories/snapshots"
if(project.hasProperty('labsNexusUser')) {
credentials {
username = labsNexusUser
password = labsNexusPassword
}
}
}
}
}
}
subprojects { project ->
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'signing'
afterEvaluate {
signing {
required { isReleaseVersion && gradle.taskGraph.hasTask("publish") }
sign publishing.publications.maven
}
}
tasks.withType(Sign) {
onlyIf { isReleaseVersion }
}
//do not generate extra load on Nexus with new staging repository if signing fails
tasks.withType(io.github.gradlenexus.publishplugin.InitializeNexusStagingRepository).configureEach {
shouldRunAfter(tasks.withType(Sign))
}
}
repositories {
mavenLocal()
jcenter()
mavenCentral()
}
dependencies {
}
test {
testLogging {
exceptionFormat = 'full'
showStandardStreams = true
}
}
tasks.withType(JavaExec) {
// Assign all Java system properties from
// the command line to the JavaExec task.
systemProperties System.properties
}