-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
109 lines (96 loc) · 2.67 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
plugins {
id 'java'
id 'maven-publish'
id 'dev.lukebemish.managedversioning' version '1.2.21'
}
group = 'dev.lukebemish'
managedVersioning {
versionFile.set project.file('version.properties')
gitHubActions {
release {
prettyName.set 'Release'
workflowDispatch.set(true)
gradleJob {
buildCache()
name.set 'build'
javaVersion.set '21'
step {
setupGitUser()
}
readOnly.set false
gradlew 'Tag Release', 'tagRelease'
gradlew 'Build', 'build'
step {
run.set 'git push && git push --tags'
}
recordVersion 'Record Version', 'version'
}
gradleJob {
buildCache()
name.set 'publish'
javaVersion.set '21'
needs.add('build')
tag.set('${{needs.build.outputs.version}}')
gradlew 'Publish', 'publish'
mavenRelease('github')
}
}
}
apply()
}
sourceSets {
testmod {}
}
java {
toolchain.languageVersion = JavaLanguageVersion.of(17)
registerFeature('testmod') {
usingSourceSet(sourceSets.testmod)
disablePublication()
}
}
repositories {
mavenCentral()
maven {
url = 'https://maven.fabricmc.net/'
}
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
filter {
includeGroup "maven.modrinth"
}
}
}
dependencies {
compileOnly 'net.fabricmc:sponge-mixin:0.14.0+mixin.0.8.6'
compileOnly 'org.apache.logging.log4j:log4j-api:2.22.1'
testmodCompileOnly 'net.fabricmc:sponge-mixin:0.14.0+mixin.0.8.6'
testmodCompileOnly 'org.apache.logging.log4j:log4j-api:2.22.1'
testmodCompileOnly 'maven.modrinth:embeddium:B3uyzMOQ'
}
tasks.named('compileTestmodJava', JavaCompile) {
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(21)
}
}
['processResources', 'processTestmodResources'].each { tasks.named(it, ProcessResources) {
var replaceProperties = [
version: project.version as String
]
inputs.properties replaceProperties
filesMatching(['META-INF/neoforge.mods.toml', 'fabric.mod.json']) {
expand replaceProperties
}
}}
publishing {
managedVersioning.publishing.mavenRelease(it)
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}