-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
146 lines (129 loc) · 4.49 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
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
apply plugin: 'java'
def versionPropsFile = file('version.properties')
def versionBuild
/*Setting default value for versionBuild which is the last incremented value stored in the file */
if (versionPropsFile.canRead()) {
def Properties versionProps = new Properties()
def strm = new FileInputStream(versionPropsFile)
versionProps.load(strm)
strm.close()
versionBuild = versionProps['VERSION_BUILD']
} else {
versionBuild = "HOMEBAKED"
}
group = "com.thiakil"
version = "1.0.${versionBuild}"
// In this section you declare where to find the dependencies of your project
repositories {
mavenCentral()
jcenter()
}
// In this section you declare the dependencies for your production and test code
dependencies {
//compile "com.sangupta:murmur:1.0.0"
compile 'com.google.code.gson:gson:2.8.2'
compile 'org.apache.httpcomponents:httpclient:4.5.4 '
compile 'com.github.scribejava:scribejava-core:5.2.0-java7again'//for oauth
compile 'com.github.scribejava:scribejava-httpclient-apache:5.2.0-java7again'
compile 'org.apache.httpcomponents:httpclient-cache:4.5.4'
compile "org.apache.commons:commons-compress:1.16.1"
compile 'it.unimi.dsi:fastutil:8.1.1'
compileOnly "com.google.code.findbugs:jsr305:3.0.2"
}
configurations{
all*.exclude group: "commons-httpclient", module:"commons-httpclient"
}
sourceSets {
main {
java {
srcDirs 'src/main/java'
}
resources {
srcDirs 'src/main/resources'
}
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
archives jar
}
apply plugin: 'maven'
apply plugin: 'maven-publish'
uploadArchives {
if(project.hasProperty('mavenDestination')) {
repositories {
mavenDeployer {
/*if (System.getenv("SIGN_KEYSTORE") != null){
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
}*/
repository(url: project.mavenDestination)
pom {
groupId = project.group
version = project.version
if (System.getenv("MAVEN_ARTIFACT") != null) {
artifactId = System.getenv("MAVEN_ARTIFACT")
} else {
artifactId = project.archivesBaseName
}
project {
name rootProject.name
packaging 'jar'
description 'Curse Soap API & Project Feed implementation'
url 'https://github.com/thiakil/CurseApi'
scm {
url 'https://github.com/thiakil/CurseApi.git'
}
issueManagement {
system 'github'
url 'https://github.com/thiakil/CurseApi/issues'
}
licenses {
license {
name 'GPLv3'
url 'https://github.com/thiakil/CurseApi/blob/master/LICENSE'
distribution 'repo'
}
}
}
}
}
}
}
}
jar.doLast {
if (project.hasProperty('signKeystore')){
def keyStore=project.signKeystore
def alias="signFiles"
def storePass=project.signStorePass
def keyPass=project.signKeyPass
println("Signing jar")
jar.outputs.files.each {
ant.signjar(
'alias': alias,
'jar': it,
keystore: keyStore,
storepass: storePass,
keypass: keyPass
)
}
}
}
task incrementBuildNumber(group: "Build") {
doLast {
if (!versionPropsFile.canRead()) {
throw new FileNotFoundException("Could not read version.properties!")
}
def Properties versionProps = new Properties()
versionProps.load(new FileInputStream(versionPropsFile))
versionBuild = versionProps['VERSION_BUILD'].toInteger() + 1
versionProps['VERSION_BUILD'] = versionBuild.toString()
def writer = versionPropsFile.newWriter()
versionProps.store(writer, null)
writer.close()
project.version = "1.0.${versionBuild}"
}
}