forked from bladecoder/bladecoder-adventure-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
79 lines (62 loc) · 2.02 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
allprojects {
apply plugin: "eclipse"
apply plugin: "idea"
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
}
}
tasks.eclipse.doLast {
delete ".project"
}
// DISABLES JAVADOC ULTRACHECKS IN JDK8
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
// UPLOADARCHIVES properties management
def ask(title){
def console = System.console()
def string
if (console) {
string = console.readLine(title)
} else {
logger.error "Cannot get console."
}
return new String(string)
}
def askPasswd(title){
def console = System.console()
def string
if (console) {
string = console.readPassword(title)
} else {
logger.error "Cannot get console."
}
return new String(string)
}
// Set build variables based on build type (release, continuous integration, development)
if(hasProperty("release")) {
ext.sonatypeRepositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
if(!hasProperty("sonatypeUsername"))
ext.sonatypeUsername = ask('\nSonatype Username: ')
if(!hasProperty("sonatypePassword"))
ext.sonatypePassword = askPasswd('\nSonatype Password: ')
if(!hasProperty("signing.keyId"))
ext."signing.keyId" = ask('\nKey Id: ')
if(!hasProperty("signing.secretKeyRingFile"))
ext."signing.secretKeyRingFile" = ask('\nSecret Keyring file: ')
if(!hasProperty("signing.password"))
ext."signing.password" = askPasswd('\nKey Password: ')
} else if (hasProperty("ci")) {
if(!version.endsWith("-SNAPSHOT"))
version += "-SNAPSHOT"
ext.sonatypeRepositoryUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
if(!hasProperty("sonatypeUsername"))
ext.sonatypeUsername = ask('\nSonatype Username: ')
if(!hasProperty("sonatypePassword"))
ext.sonatypePassword = askPasswd('\nSonatype Password: ')
}