forked from MinecraftForge/EventBus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.old
204 lines (182 loc) · 6.82 KB
/
build.gradle.old
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
197
198
199
200
201
202
203
204
plugins {
id 'net.minecraftforge.gradleutils' version '2.+'
id 'com.github.ben-manes.versions' version '0.42.0'
id 'de.jjohannes.extra-java-module-info' version '0.11'
}
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'eclipse'
group 'net.minecraftforge'
java.toolchain.languageVersion = JavaLanguageVersion.of(16)
changelog {
fromTag "1.0.0"
}
version = gradleutils.getTagOffsetVersion()
logger.lifecycle('Version: ' + version)
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()
forkEvery 1
}
sourceSets {
testJars
jmh
}
ext.sharedManifest = manifest {
attributes(['Specification-Title': 'eventbus',
'Specification-Vendor': 'Forge',
'Specification-Version': '1', // Currently version 1 of the eventbus specification
'Implementation-Title': project.name,
'Implementation-Version': "${project.version}+${System.getenv("BUILD_NUMBER")?:0}+${gradleutils.gitInfo.branch}.${gradleutils.gitInfo.abbreviatedId}",
'Implementation-Vendor' :'forge',
'Implementation-Timestamp': java.time.Instant.now().toString(),
'Git-Commit': gradleutils.gitInfo.abbreviatedId,
'Git-Branch': gradleutils.gitInfo.branch,
'Build-Number': "${System.getenv('BUILD_NUMBER')?:0}" ],
'net/minecraftforge/eventbus/service/')
}
extraJavaModuleInfo {
failOnMissingModuleInfo = false
automaticModule('jmh-core-1.35.jar', 'jmh.core')
automaticModule('jopt-simple-5.0.4.jar', 'jopt.simple')
automaticModule('typetools-0.8.3.jar', 'typetools')
}
jar {
manifest = project.manifest {
from sharedManifest
}
}
task testsJar(type: Jar) {
archiveClassifier = 'testsjar'
from sourceSets.testJars.output
}
task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
configurations {
jmhOnly
}
repositories {
mavenLocal()
maven {
name = 'forge'
url = 'https://maven.minecraftforge.net/'
}
}
dependencies {
testImplementation('org.junit.jupiter:junit-jupiter-api:5.8.+')
testImplementation('cpw.mods:modlauncher:10.0.+')
testImplementation('cpw.mods:securejarhandler:1.0.+')
testImplementation('org.junit.jupiter:junit-jupiter-engine:5.8.+')
testImplementation('org.apache.logging.log4j:log4j-core:2.17.1')
testImplementation('com.lmax:disruptor:3.4.2')
testImplementation('net.sf.jopt-simple:jopt-simple:5.0.4')
testImplementation('cpw.mods:bootstraplauncher:1.1.0')
testCompileOnly('org.jetbrains:annotations:23.0.0')
testImplementation(sourceSets.testJars.runtimeClasspath)
testJarsImplementation(sourceSets.main.output)
implementation('org.ow2.asm:asm:9.2')
implementation('org.ow2.asm:asm-commons:9.2')
implementation('org.ow2.asm:asm-tree:9.2')
implementation('org.apache.logging.log4j:log4j-api:2.17.1')
implementation('cpw.mods:modlauncher:10.0.+')
compileOnly('org.jetbrains:annotations:23.0.0')
api('net.jodah:typetools:0.8.+')
jmhImplementation(sourceSets.main.output)
jmhImplementation(sourceSets.testJars.output)
jmhImplementation('cpw.mods:modlauncher:10.0.+')
jmhImplementation('cpw.mods:securejarhandler:1.0.+')
jmhImplementation('org.junit.jupiter:junit-jupiter-engine:5.8.+')
jmhImplementation('org.apache.logging.log4j:log4j-core:2.17.1')
jmhImplementation('org.apache.logging.log4j:log4j-api:2.17.1')
jmhImplementation('org.ow2.asm:asm:9.2')
jmhImplementation('org.ow2.asm:asm-tree:9.2')
jmhImplementation('org.ow2.asm:asm-commons:9.2')
jmhImplementation('org.openjdk.jmh:jmh-core:1.35')
jmhImplementation('cpw.mods:bootstraplauncher:1.1.0')
jmhOnly('org.openjdk.jmh:jmh-core:1.35')
jmhOnly('org.openjdk.jmh:jmh-generator-annprocess:1.35')
jmhOnly('cpw.mods:bootstraplauncher:1.1.0')
jmhOnly('cpw.mods:securejarhandler:1.0.+')
jmhOnly(sourceSets.jmh.output)
jmhCompileOnly('org.jetbrains:annotations:23.0.0')
jmhAnnotationProcessor('org.openjdk.jmh:jmh-generator-annprocess:1.35')
}
configurations.jmhImplementation.extendsFrom(configurations.implementation)
task jmh(type: JavaExec, dependsOn: sourceSets.jmh.output) {
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(17)
}
jvmArgs= [
'-p', sourceSets.jmh.runtimeClasspath.asPath,
'--add-modules', 'ALL-MODULE-PATH',
'--add-exports', 'net.minecraftforge.eventbus.jmh/net.minecraftforge.eventbus.benchmarks.jmh_generated=jmh.core'
]
classpath = files(configurations.jmhOnly.asPath)
mainClass = 'org.openjdk.jmh.Main'
args '-bm', 'avgt' // benchmark mode
args '-r', '5s' // iteration time
args '-w', '5s' // warmup time
args '-wi', '3' // warmup iterations
args '-prof', 'stack' // profilers
args '-tu', 'ns' // time unit
args '-f', '3' // forks
args '-rff', project.file("${project.buildDir}/results/jmh/results.txt") // results file
args 'net.minecraftforge.eventbus.benchmarks.EventBusBenchmark'
}
artifacts {
archives jar
archives sourcesJar
archives testsJar
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
pom {
name = 'Event Bus'
description = 'High performance Event Bus library'
url = 'https://github.com/MinecraftForge/eventbus'
scm {
url = 'https://github.com/MinecraftForge/eventbus'
connection = 'scm:git:git://github.com/MinecraftForge/eventbus.git'
developerConnection = 'scm:git:[email protected]:MinecraftForge/eventbus.git'
}
issueManagement {
system = 'github'
url = 'https://github.com/MinecraftForge/eventbus/issues'
}
licenses {
license {
name = 'LGPLv2.1'
url = 'https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt'
}
}
developers {
developer {
id = 'cpw'
name = 'cpw'
}
developer {
id = 'LexManos'
name = 'LexManos'
}
}
}
}
}
repositories {
maven gradleutils.getPublishingForgeMaven()
}
}