forked from DenWav/primeiron
-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle
154 lines (135 loc) · 4.32 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
import net.neoforged.gradleutils.PomUtilsExtension.License
plugins {
alias(libs.plugins.gradleutils)
}
allprojects { project ->
apply plugin: 'java-library'
apply plugin: 'maven-publish'
group 'net.neoforged.accesstransformers'
version = gradleutils.version
gradleutils.setupSigning(project)
repositories {
mavenLocal()
mavenCentral()
maven {
name = 'neoforged'
url = 'https://maven.neoforged.net/releases/'
}
}
java {
modularity.inferModulePath = true
withSourcesJar()
toolchain.languageVersion = JavaLanguageVersion.of(21)
}
}
subprojects { proj ->
publishing {
publications {
mavenJava(MavenPublication) {
gradleutils.sign(it)
from components.java
artifactId = "at-${proj.name}"
pom {
name = "Access Transformers $proj"
description = 'Transforms class member access based on specification files'
pomUtils.githubRepo(it, 'AccessTransformers')
pomUtils.license(it, License.MIT)
pomUtils.neoForgedDeveloper(it)
}
}
}
repositories {
maven gradleutils.publishingMaven
}
}
}
group 'net.neoforged'
println('Version: ' + version)
sourceSets {
testJars
}
jar.manifest = manifest {
attributes([
'Specification-Title': 'accesstransformers',
'Specification-Vendor': 'neoforged',
'Specification-Version': '1', // Currently version 1 of the accesstransformer specification
'Implementation-Title': project.name,
'Implementation-Version': "${project.version}+${gradleutils.gitInfo.abbreviatedId}",
'Implementation-Vendor': 'neoforged',
'Git-Commit': gradleutils.gitInfo.abbreviatedId
])
}
tasks.register('testsJar', Jar) {
archiveClassifier = 'testsjar'
from sourceSets.testJars.output
}
changelog {
from '10.0'
}
build.dependsOn testsJar
dependencies {
testImplementation(libs.junit.api)
testImplementation(libs.powermock)
testImplementation(libs.assert4j)
testImplementation(libs.bsl)
testImplementation(libs.sjh)
testImplementation(libs.gson)
testImplementation(project(':modlauncher'))
testImplementation(libs.jopt5)
testImplementation(libs.bundles.log4j)
testRuntimeOnly(libs.junit.engine)
api(libs.slf4j)
api(libs.bundles.asm)
api(project(':parser'))
}
// Build the module path manually because Gradle won't do it for non-modular projects.
// Feel free to replace by a better way, I just wanted the tests to run.
import java.util.stream.Collectors
def buildModulePath() {
project.configurations.testRuntimeClasspath.resolve()*.toString().stream().filter {
it.contains('asm') || it.contains('modlauncher') || it.contains('bootstraplauncher') || it.contains('securejarhandler')
}.collect(Collectors.joining(File.pathSeparator))
}
test {
useJUnitPlatform()
forkEvery 1
jvmArgs(
'--add-opens', 'java.base/java.lang.invoke=cpw.mods.securejarhandler',
'-p', buildModulePath()
)
}
test.dependsOn(testJarsClasses)
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifactId = "accesstransformers"
gradleutils.sign(it)
pom {
name = 'Access Transformers'
description = 'Transforms class member access based on specification files'
pomUtils.githubRepo(it, 'AccessTransformers')
pomUtils.license(it, License.MIT)
developers {
developer {
id = 'cpw'
name = 'cpw'
}
developer {
id = 'DemonWav'
name = 'DemonWav'
}
developer {
id = 'neoforged'
name = 'NeoForged'
email = 'contact@neoforged.net'
url = 'https://github.com/NeoForged/'
}
}
}
}
}
repositories {
maven gradleutils.publishingMaven
}
}