-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
189 lines (163 loc) · 5.13 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
import org.w3c.dom.Element
import org.w3c.dom.Node
import org.w3c.dom.NodeList
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:latest.release"
}
}
repositories {
jcenter()
mavenCentral()
}
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'maven-publish'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'maven'
apply plugin: 'com.jfrog.artifactory'
sourceSets {
main {
java {
srcDir 'src/main/java'
}
compileClasspath += sourceSets.main.compileClasspath
}
}
dependencies {
compile('com.google.code.gson:gson:2.8.0')
compileOnly "com.intellij:annotations:+@jar"
compile 'com.intellij:annotations:+@jar'
}
processResources {
from(sourceSets.main.resources.srcDirs) {
include 'META-INF/mods.toml'
expand 'version': project.version
}
from(sourceSets.main.resources.srcDirs) {
exclude 'META-INF/mods.toml'
}
}
version = System.getenv().containsKey("Version") ? System.getenv("Version") : "borked-" + System.currentTimeMillis()
group = 'com.ldtteam'
archivesBaseName = 'datagenerators'
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
javadoc {
source += sourceSets.main.allJava
}
idea {
module {
inheritOutputDirs = true
}
}
jar {
from sourceSets.main.output
manifest {
attributes([
'Maven-Artifact' : "${project.group}:${project.archivesBaseName}:${project.version}",
"Specification-Title" : "datagenerators",
"Specification-Vendor" : "ldtteam",
"Specification-Version" : "1", // We are version 1 of ourselves
"Implementation-Title" : project.name,
"Implementation-Version" : "${version}",
"Implementation-Vendor" : "ldtteam",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
//Create a sources jar.
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
//Create a javadoc jar.
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
//Define what to publish and how.
publishing {
publications {
maven(MavenPublication) {
groupId = project.group
artifactId "datagenerators"
artifact javadocJar
artifact sourcesJar
from components.java
pom {
url = 'https://github.com/ldtteam/DataGenerators'
licenses {
license {
name = 'GNU GENERAL PUBLIC LICENSE Version 3'
url = 'https://www.gnu.org/licenses/gpl-3.0.en.html'
}
}
developers {
developer {
id = 'AshersLab'
name = 'Asher'
email = '[email protected]'
}
}
contributors {
contributor {
id = 'ldtteam'
name = 'Let\'s Develop Together - Team'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:git://github.com/ldtteam/datagenerators.git'
developerConnection = 'scm:git:ssh://github.com/ldtteam/datagenerators.git'
url = 'https://github.com/ldtteam/DataGenerators'
}
}
//Replace all deobf dependencies with normal jar references.
pom.withXml { xmlProvider ->
final Element document = xmlProvider.asElement()
final NodeList groupIdNodes = document.getElementsByTagName("groupId")
groupIdNodes.each { groupIdNodeObject ->
final Node groupIdNode = (Node) groupIdNodeObject
final String groupId = groupIdNode.getFirstChild().getTextContent().trim()
groupIdNode.setTextContent(groupId.replace("deobf.", ""))
}
}
}
}
}
//Notify artifactory of what to publish.
artifactory {
publish {
defaults {
publications('maven')
publishBuildInfo = true //Publish build-info to Artifactory (true by default)
publishArtifacts = true //Publish artifacts to Artifactory (true by default)
publishPom = true //Publish generated POM files to Artifactory (true by default).
}
}
}
task setupDecompWorkspace {
afterEvaluate {
println "Setup"
}
}
task setupCIWorkspace {
afterEvaluate {
println "Setup"
}
}
task curseforge {
afterEvaluate {
println "No uploading to curseforge required for this project."
}
}
task createChangelog {
afterEvaluate {
println "No changelog creation needed. since we are not uploading to curseforge."
}
}