This repository was archived by the owner on Feb 18, 2021. It is now read-only.
forked from McModLauncher/modlauncher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
196 lines (173 loc) · 6.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
190
191
192
193
194
195
196
import java.text.SimpleDateFormat
plugins {
id 'org.ajoberstar.grgit' version '4.0.2'
id 'com.github.ben-manes.versions' version '0.27.0'
id 'me.champeau.gradle.jmh' version '0.5.0'
}
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'eclipse'
apply plugin: 'jacoco'
repositories {
mavenCentral()
maven {
name = 'forge'
url = 'https://files.minecraftforge.net/maven/'
}
}
sourceSets {
api
testJars
}
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return !stableKeyword && !(version ==~ regex)
}
dependencyUpdates {
rejectVersionIf {
isNonStable(it.candidate.version)
}
}
test {
useJUnitPlatform()
}
jacoco {
toolVersion = '0.8.2'
}
group = 'cpw.mods'
sourceCompatibility = 1.8
targetCompatibility = 1.8
ext.asmVersion = 7.2
version = grgit.describe(longDescr: true).split('-').with { "${it[0]}.${it[1]}" }
dependencies {
implementation('com.google.code.findbugs:jsr305:3.0.2')
implementation('net.sf.jopt-simple:jopt-simple:5.0.4')
api("org.ow2.asm:asm:${asmVersion}")
api("org.ow2.asm:asm-tree:${asmVersion}")
api("org.ow2.asm:asm-commons:${asmVersion}")
apiImplementation("org.ow2.asm:asm:${asmVersion}")
apiImplementation("org.ow2.asm:asm-tree:${asmVersion}")
apiImplementation("org.ow2.asm:asm-commons:${asmVersion}")
implementation('org.apache.logging.log4j:log4j-api:2.11.2')
implementation('org.apache.logging.log4j:log4j-core:2.11.2')
implementation('cpw.mods:grossjava9hacks:1.3.+')
implementation(sourceSets.api.output)
testImplementation('org.junit.jupiter:junit-jupiter-api:5.6.+')
testImplementation('org.powermock:powermock-core:2.0.+')
testImplementation('org.junit.jupiter:junit-jupiter-engine:5.6.+')
testImplementation(sourceSets.testJars.runtimeClasspath)
jmhImplementation('org.powermock:powermock-core:2.0.+')
jmhImplementation("org.ow2.asm:asm:${asmVersion}")
jmhImplementation("org.ow2.asm:asm-tree:${asmVersion}")
jmhImplementation("org.ow2.asm:asm-commons:${asmVersion}")
jmh("org.ow2.asm:asm:${asmVersion}")
}
task apiJar(type: Jar) {
archiveClassifier = 'api'
from sourceSets.api.output
}
task apiSourcesJar(type: Jar) {
archiveClassifier = 'apisource'
from sourceSets.api.allSource
}
task testsJar(type: Jar) {
archiveClassifier = 'testsjar'
from sourceSets.testJars.output
}
task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
from sourceSets.api.allSource
}
jmh {
include = [ 'cpw.mods.modlauncher.benchmarks.TransformBenchmark' ]
benchmarkMode = ['avgt' ]
profilers = [ 'stack' ]
timeOnIteration = '5s'
warmup = '5s'
warmupIterations = 3
iterations = 3
fork = 3
timeUnit = 'us'
}
tasks['jmh'].dependsOn(clean)
ext.sharedManifest = manifest {
attributes(['Specification-Title': 'modlauncher',
'Specification-Vendor': 'forge',
'Specification-Version': '4.0', // We are version 4 of the modlauncher specification
'Implementation-Title': project.name,
'Implementation-Version': "${project.version}+${System.getenv('BUILD_NUMBER')?:0}+${grgit.branch.current().getName()}.${grgit.head().abbreviatedId}",
'Implementation-Vendor' :'forge',
'Implementation-Timestamp': java.time.Instant.now().toString(),
'Git-Commit': grgit.head().abbreviatedId,
'Git-Branch': grgit.branch.current().getName(),
'Build-Number': "${System.getenv('BUILD_NUMBER')?:0}" ],
'cpw/mods/modlauncher/api/')
attributes(['Specification-Title': 'modlauncherserviceapi',
'Specification-Vendor': 'forge',
'Specification-Version': '4.0', // We are version 4 of the modlauncher serviceapi specification
"Implementation-Title": project.name,
'Implementation-Version': "${project.version}+${System.getenv('BUILD_NUMBER')?:0}+${grgit.branch.current().getName()}.${grgit.head().abbreviatedId}",
'Implementation-Vendor' :'forge',
'Implementation-Timestamp': java.time.Instant.now().toString(),
'Git-Commit': grgit.head().abbreviatedId,
'Git-Branch': grgit.branch.current().getName(),
'Build-Number': "${System.getenv('BUILD_NUMBER')?:0}"],
'cpw/mods/modlauncher/serviceapi/')
}
jar {
from sourceSets.api.output
manifest = project.manifest {
from sharedManifest
}
}
tasks.withType(JavaCompile) {
options.compilerArgs << '-Xlint:unchecked'
}
artifacts {
archives apiJar
archives apiSourcesJar
archives testsJar
archives jar
archives sourcesJar
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact apiJar
artifact apiSourcesJar
artifact sourcesJar
pom {
name = 'Mod Launcher'
description = 'Common ModLauncher framework'
url = 'https://github.com/cpw/modlauncher'
scm {
url = 'https://github.com/cpw/modlauncher'
connection = 'scm:git:git://github.com/cpw/modlauncher.git'
developerConnection = 'scm:git:git@github.com:cpw/modlauncher.git'
}
issueManagement {
system = 'github'
url = 'https://github.com/cpw/modlauncher/issues'
}
developers {
developer {
id = 'cpw'
name = 'cpw'
}
}
}
}
}
repositories {
maven {
credentials {
username project.properties['wutee.repository.deploy.username'] ?: 'fake'
password project.properties['wutee.repository.deploy.password'] ?: 'news'
}
url 'https://repo.wut.ee/repository/mikroskeem-repo'
}
}
}