-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathbuild.gradle
More file actions
191 lines (167 loc) · 5.53 KB
/
build.gradle
File metadata and controls
191 lines (167 loc) · 5.53 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
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
plugins {
id 'net.neoforged.moddev' version '2.0.107' apply false
id 'fabric-loom' version '1.9-SNAPSHOT' apply false
id "me.modmuss50.mod-publish-plugin" version "0.8.0" apply false
id 'org.moddedmc.wiki.toolkit' version '0.4.1'
}
// all projects including the root project
allprojects {
apply plugin: 'java'
apply plugin: 'me.modmuss50.mod-publish-plugin'
base {
archivesName = "$mod_id-${project.name}-$minecraft_version"
}
java {
withSourcesJar()
toolchain.languageVersion = JavaLanguageVersion.of(21)
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
}
// all projects but the root project
subprojects {
apply plugin: 'maven-publish'
sourceSets {
main {
resources {
srcDir(file("src/main/generated"))
exclude("**/.cache")
}
}
}
repositories {
mavenCentral()
// ModMaven
// mirrors a lot of commonly used Mavens
maven { url = "https://modmaven.dev" }
// CurseMaven
// Jade, Oracle Index
maven { url = "https://beta.cursemaven.com" }
// Architectury API, REI
maven { url = "https://maven.architectury.dev/" }
// Athena (CTM)
maven { url = "https://maven.teamresourceful.com/repository/maven-public/" }
// EMI
maven { url = 'https://maven.terraformersmc.com/' }
// Forgified Fabric API
maven { url = "https://maven.su5ed.dev/releases" }
// FTB Chunks
maven { url = "https://maven.ftb.dev/releases" }
// GeckoLib
maven { url = 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/' }
// owo-lib
maven { url = 'https://maven.wispforest.io/releases/' }
// Forge Config API Port
maven { url = 'https://raw.githubusercontent.com/Fuzss/modresources/main/maven/' }
}
dependencies {
// Auto Services
compileOnly "com.google.auto.service:auto-service:$autoServiceVersion"
annotationProcessor "com.google.auto.service:auto-service:$autoServiceVersion"
}
['apiElements', 'runtimeElements', 'sourcesElements'].each { variant ->
configurations."$variant".outgoing {
capability("$group:${base.archivesName.get()}:$version")
capability("$group:$mod_id-${project.name}-${minecraft_version}:$version")
capability("$group:$mod_id:$version")
}
publishing.publications.configureEach {
suppressPomMetadataWarningsFor(variant)
}
}
tasks.withType(AbstractCopyTask).configureEach {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
// configure Maven publishing
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = base.archivesName.get()
from components.java
}
}
repositories {
maven {
url System.getenv('local_maven_url')
}
}
}
}
// only loader projects
subprojects {
if (project.path == ":common") {
return
}
configurations {
commonJava {
canBeResolved = true
}
commonResources {
canBeResolved = true
}
}
dependencies {
compileOnly(project(':common')) {
capabilities {
requireCapability "$group:$mod_id"
}
transitive = false
}
commonJava project(path: ':common', configuration: 'commonJava')
commonResources project(path: ':common', configuration: 'commonResources')
}
sourceSets {
create("data") {
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
compileClasspath += sourceSets.main.compileClasspath
runtimeClasspath += sourceSets.main.runtimeClasspath
}
}
tasks {
processResources {
dependsOn(configurations.commonResources)
from(configurations.commonResources)
// copy wiki folder to assets
from("$rootDir/docs") {
into "assets/oracle_index/books/oritech"
exclude '.assets/item/**' // items are rendered in-game as actual item components, no need to include them here
}
inputs.property 'version', project.version
filesMatching(['META-INF/neoforge.mods.toml', "fabric.mod.json"]) {
expand version: version
}
}
named('compileJava', JavaCompile) {
dependsOn(configurations.commonJava)
source(configurations.commonJava)
}
named('sourcesJar', Jar) {
dependsOn(configurations.commonJava)
from(configurations.commonJava)
dependsOn(configurations.commonResources)
from(configurations.commonResources)
}
}
}
// sinytra wiki
wiki {
docs {
oritech {
// path to the folder containing metadata file (sinytra-wiki.json)
root = file('docs')
}
}
}
publishMods {
github {
accessToken = providers.environmentVariable("GITHUB_TOKEN")
repository = "Rearth/Oritech"
commitish = "1.21"
changelog = file("./CHANGELOG.MD").getText()
type = STABLE
tagName = "v${project.version}"
// Allow the release to be initially created without any files.
allowEmptyFiles = true
}
}