Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
83 lines (74 loc) · 2.63 KB
/
Copy pathbuild.gradle
File metadata and controls
83 lines (74 loc) · 2.63 KB
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
plugins {
id 'multiloader-common'
id 'net.neoforged.moddev'
}
neoForge {
neoFormVersion = neo_form_version
// Automatically enable AccessTransformers if the file exists
def at = rootProject.file('src/accesstransformer.cfg')
if (at.exists()) {
accessTransformers.from(at.absolutePath)
}
}
repositories {
mavenCentral()
}
dependencies {
// Fabric and NeoForge both bundle Fabric Mixin, so it is safe to use it in common
// If you need to update, check what version they are using to see what is compatible
// https://github.com/neoforged/NeoForge/blob/26.3.x/gradle.properties#L37
// https://github.com/FabricMC/fabric-loader/blob/master/gradle.properties#L12
compileOnly('net.fabricmc:sponge-mixin:0.17.3+mixin.0.8.7')
compileOnly('org.jspecify:jspecify:1.0.0')
// Fabric and NeoForge both bundle MixinExtras, so it is safe to use it in common
compileOnly(annotationProcessor('io.github.llamalad7:mixinextras-common:0.5.3'))
testImplementation 'org.junit.jupiter:junit-jupiter:5.12.2'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testRuntimeOnly 'com.google.code.gson:gson:2.14.0'
testRuntimeOnly 'org.slf4j:slf4j-nop:2.0.17'
}
tasks.named('test', Test) {
useJUnitPlatform()
}
// Geometry tests exercise the real PoseStack and arm transforms without launching a client.
sourceSets.test {
compileClasspath += sourceSets.main.compileClasspath
runtimeClasspath += sourceSets.main.compileClasspath
}
configurations {
commonJava {
canBeResolved = false
canBeConsumed = true
}
commonResources {
canBeResolved = false
canBeConsumed = true
}
}
artifacts {
// Stonecutter generates the sources this version compiles, and the loaders compile those same files.
sourceSets.main.java.srcDirs.each { dir ->
add('commonJava', dir) { builtBy 'stonecutterGenerate' }
}
sourceSets.main.resources.srcDirs.each { dir ->
add('commonResources', dir) { builtBy 'stonecutterGenerate' }
}
}
// Implement mcgradleconventions loader attribute
def loaderAttribute = Attribute.of('io.github.mcgradleconventions.loader', String)
['apiElements', 'runtimeElements', 'sourcesElements', 'javadocElements'].each { variant ->
configurations.named(variant) {
attributes {
attribute(loaderAttribute, 'common')
}
}
}
sourceSets.configureEach {
[it.compileClasspathConfigurationName, it.runtimeClasspathConfigurationName].each { variant->
configurations.named(variant) {
attributes {
attribute(loaderAttribute, 'common')
}
}
}
}