-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.copy
162 lines (139 loc) · 3.85 KB
/
build.gradle.copy
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.netflix.nebula:gradle-contacts-plugin:3.+'
classpath 'com.netflix.nebula:gradle-info-plugin:3.+'
}
}
apply plugin: 'nebula.info'
apply plugin: 'nebula.info-owners'
apply plugin: 'nebula.contacts'
def isCiBuild
def isReleaseBuild
def isDevBuild
if (hasProperty('dev')) {
isDevBuild = true
} else if (hasProperty('ci')) {
isCiBuild = true
} else if (hasProperty('release')) {
isReleaseBuild = true
} else {
isDevBuild = true
}
def requiresSigning = isReleaseBuild && gradle.taskGraph.hasTask("uploadArchives")
version '0.0.1'
if (isCiBuild) {
version += '-SNAPSHOT'
}
def projectName = 'Mnemonic Encoding'
def projectUrl = 'https://github.com/devinrsmith/mnemonic-encoding'
description 'Human readable encoding for small amounts of data'
contacts {
moniker 'Devin Smith'
github 'devinrsmith'
role 'owner'
}
}
allprojects {
repositories {
jcenter()
}
}
subprojects {
apply plugin: 'java-library'
apply plugin: 'maven'
apply plugin: 'signing'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.2'
}
}
version parent.version
group 'com.devinrsmith.mnemonic'
sourceCompatibility = 1.8
dependencies {
// fixes warning... todo, remove?
testCompileOnly 'org.apiguardian:apiguardian-api:1.0.0'
testCompile 'org.junit.jupiter:junit-jupiter-api:5.0.2'
testCompile 'org.junit.jupiter:junit-jupiter-params:5.0.2'
testRuntime 'org.junit.jupiter:junit-jupiter-engine:5.0.2'
testCompile 'org.assertj:assertj-core:3.8.0'
testCompile 'com.google.guava:guava:23.6-jre'
}
task javadocJar(type: Jar) {
classifier 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier 'sources'
from sourceSets.main.allSource
}
artifacts {
archives jar
archives javadocJar
archives sourcesJar
}
// see inner comments on why we aren't doing this w/ "required"
if (requiresSigning) {
signing {
// Bad documentation: https://docs.gradle.org/current/userguide/signing_plugin.html
// https://discuss.gradle.org/t/signing-required-doesnt-work/17924/6
// The following doesn't work when signing properties are set
//required { requiresSigning }
sign configurations.archives
}
} else {
task signArchives {
// empty
}
}
uploadArchives {
repositories {
if (isDevBuild) {
mavenLocal()
} else {
mavenDeployer {
if (requiresSigning) {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
}
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name projectName
description rootProject.description
url projectUrl
packaging 'jar'
scm {
url 'scm:[email protected]:devinrsmith/mnemonic-encoding.git'
connection '[email protected]:devinrsmith/mnemonic-encoding.git'
developerConnection '[email protected]:devinrsmith/mnemonic-encoding.git'
}
licenses {
license {
name 'todo'
url 'http://todo.com/todo.txt'
}
}
developers {
developer {
id 'devinrsmith'
name 'Devin Smith'
email '[email protected]'
}
}
}
}
}
}
}
}