Skip to content

Commit 8b0b075

Browse files
committed
Merge remote-tracking branch 'origin/1.19.2' into 1.19.4
2 parents 5f45f61 + 375c978 commit 8b0b075

File tree

11 files changed

+221
-225
lines changed

11 files changed

+221
-225
lines changed

build.gradle

Lines changed: 3 additions & 212 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
plugins {
22
id "architectury-plugin" version "3.4-SNAPSHOT"
3-
id "dev.architectury.loom" version "1.2-SNAPSHOT" apply false
3+
id "dev.architectury.loom" version "1.3-SNAPSHOT" apply false
44
id "maven-publish"
55
id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
66
id 'com.palantir.git-version' version '1.0.0'
77
id 'org.ajoberstar.grgit' version '5.2.0'
88
id 'se.bjurr.gitchangelog.git-changelog-gradle-plugin' version '1.79.0'
99
id "com.modrinth.minotaur" version "2.+" apply false
1010
id("com.diffplug.spotless") version "6.18.0" apply false
11+
id 'modernfix.common-conventions' apply false
1112
}
1213

1314
architectury {
@@ -16,147 +17,7 @@ architectury {
1617

1718
ext.archives_base_name = 'modernfix'
1819

19-
allprojects {
20-
apply plugin: "java"
21-
apply plugin: "architectury-plugin"
22-
apply plugin: "maven-publish"
23-
apply plugin: "com.diffplug.spotless"
24-
25-
spotless {
26-
java {
27-
removeUnusedImports()
28-
}
29-
}
30-
31-
architectury {
32-
compileOnly()
33-
}
34-
35-
group = 'org.embeddedt'
36-
// extract base version from tag, generate other metadata ourselves
37-
def details = versionDetails()
38-
def plusIndex = details.lastTag.indexOf("+")
39-
if(plusIndex == -1) {
40-
plusIndex = details.lastTag.length()
41-
}
42-
def baseVersion = details.lastTag.substring(0, plusIndex)
43-
def dirtyMarker = grgit.status().clean ? "" : ".dirty"
44-
def commitHashMarker = details.commitDistance > 0 ? ("." + details.gitHash.substring(0, Math.min(4, details.gitHash.length()))) : ""
45-
def preMarker = (details.commitDistance > 0 || !details.isCleanTag) ? ("-beta." + details.commitDistance) : ""
46-
if(preMarker.length() > 0) {
47-
// bump to next patch release
48-
def versionParts = baseVersion.tokenize(".")
49-
baseVersion = "${versionParts[0]}.${versionParts[1]}.${versionParts[2].toInteger() + 1}"
50-
}
51-
def versionString = "${baseVersion}${preMarker}+mc${minecraft_version}${commitHashMarker}${dirtyMarker}"
52-
version = versionString
53-
archivesBaseName = rootProject.archives_base_name + '-' + project.name
54-
55-
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
56-
57-
repositories {
58-
maven { url 'https://modmaven.dev/' }
59-
maven {
60-
url "https://cursemaven.com"
61-
content {
62-
includeGroup "curse.maven"
63-
}
64-
}
65-
exclusiveContent {
66-
forRepository {
67-
maven {
68-
name = "Modrinth"
69-
url = "https://api.modrinth.com/maven"
70-
}
71-
}
72-
filter {
73-
includeGroup "maven.modrinth"
74-
}
75-
}
76-
maven {
77-
name = 'ParchmentMC'
78-
url = 'https://maven.parchmentmc.org'
79-
}
80-
maven {
81-
// Shedaniel's maven (Architectury API)
82-
url = "https://maven.architectury.dev"
83-
content {
84-
includeGroup "me.shedaniel"
85-
}
86-
}
87-
88-
maven {
89-
// saps.dev Maven (KubeJS and Rhino)
90-
url = "https://maven.saps.dev/minecraft"
91-
content {
92-
includeGroup "dev.latvian.mods"
93-
}
94-
}
95-
maven { // CTM
96-
url "https://maven.tterrag.com/"
97-
}
98-
maven { url 'https://maven.blamejared.com' }
99-
repositories {
100-
maven {
101-
name = "Fuzs Mod Resources"
102-
url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/"
103-
}
104-
}
105-
maven {
106-
url 'https://maven.terraformersmc.com/releases'
107-
}
108-
maven { url = "https://jitpack.io" }
109-
}
110-
}
111-
112-
configure(subprojects.findAll {it.name == "common" || it.name == "forge" || it.name == "fabric"}) {
113-
apply plugin: "dev.architectury.loom"
114-
115-
loom {
116-
silentMojangMappingsLicense()
117-
}
118-
119-
dependencies {
120-
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
121-
mappings loom.layered() {
122-
officialMojangMappings()
123-
if(rootProject.hasProperty("parchment_version")) {
124-
parchment("org.parchmentmc.data:parchment-${minecraft_version}:${parchment_version}@zip")
125-
}
126-
}
127-
}
128-
129-
processResources {
130-
def mixinFileList = []
131-
def mixinDirectory = file("src/main/java/org/embeddedt/modernfix/" + project.name + "/mixin")
132-
fileTree(mixinDirectory).visit { FileVisitDetails details ->
133-
if(details.file.isFile()) {
134-
def fileName = mixinDirectory.relativePath(details.file).toString().replaceFirst(/\.java$/, "").replace('/', '.')
135-
mixinFileList << fileName
136-
}
137-
}
138-
139-
def mixinClassesStringB = new StringBuilder()
140-
for(int i = 0; i < mixinFileList.size(); i++) {
141-
mixinClassesStringB.append(" \"")
142-
mixinClassesStringB.append(mixinFileList.get(i))
143-
mixinClassesStringB.append('"')
144-
if(i < (mixinFileList.size() - 1))
145-
mixinClassesStringB.append(',')
146-
mixinClassesStringB.append('\n')
147-
}
148-
149-
def replacements = [
150-
mixin_classes: mixinClassesStringB.toString()
151-
]
152-
153-
inputs.properties replacements
154-
def filePattern = "modernfix-" + project.name + ".mixins.json"
155-
filesMatching(filePattern) {
156-
expand replacements
157-
}
158-
}
159-
}
20+
apply plugin: 'modernfix.common-conventions'
16021

16122
tasks.withType(JavaCompile).configureEach {
16223
// ensure that the encoding is set to UTF-8, no matter what the system default is
@@ -203,74 +64,4 @@ tasks.register('checkCleanTag') {
20364
}
20465
}
20566

206-
configure(subprojects.findAll {it.name == "forge" || it.name == "fabric"}) {
207-
apply plugin: 'com.matthewprenger.cursegradle'
208-
apply plugin: 'com.modrinth.minotaur'
209-
210-
loom {
211-
mods {
212-
main { // to match the default mod generated for Forge
213-
sourceSet project.sourceSets.main
214-
sourceSet project(':common').sourceSets.main
215-
}
216-
}
217-
runs {
218-
client {
219-
vmArgs "-Xmx1G"
220-
vmArgs "-Xms1G"
221-
property("mixin.debug.export", "true")
222-
}
223-
}
224-
}
225-
226-
def copyJarNameConsistent = tasks.register('copyJarNameConsistent', Copy) {
227-
from remapJar // shortcut for createJar.outputs.files
228-
into project.file("build/libs")
229-
rename { name -> "modernfix-" + project.name + "-latest.jar" }
230-
}
231-
232-
def copyJarToBin = tasks.register('copyJarToBin', Copy) {
233-
from remapJar // shortcut for createJar.outputs.files
234-
into rootProject.file("bin")
235-
mustRunAfter "copyJarNameConsistent"
236-
}
237-
238-
tasks.build.dependsOn(copyJarToBin, copyJarNameConsistent)
239-
240-
def isBeta = project.version.toString().contains("beta")
241-
242-
curseforge {
243-
if (System.getenv("CURSEFORGE_TOKEN") != null) {
244-
apiKey = System.getenv("CURSEFORGE_TOKEN")
245-
project {
246-
id = "790626"
247-
changelog = file('../CHANGELOG.md')
248-
changelogType = "markdown"
249-
releaseType = isBeta ? "beta" : "release"
250-
addGameVersion project.name.capitalize()
251-
gameVersionStrings.addAll(supported_minecraft_versions.tokenize(","))
252-
mainArtifact remapJar
253-
}
254-
}
255-
}
256-
257-
modrinth {
258-
token = System.getenv("MODRINTH_TOKEN")
259-
projectId = "modernfix" // This can be the project ID or the slug. Either will work!
260-
versionType = isBeta ? "beta" : "release" // This is the default -- can also be `beta` or `alpha`
261-
uploadFile = remapJar
262-
gameVersions = supported_minecraft_versions.tokenize(",")
263-
loaders = [project.name]
264-
changelog.set(provider { file("CHANGELOG.md").getText('UTF-8') })
265-
}
266-
267-
tasks.curseforge.dependsOn(rootProject.generateChangelog)
268-
tasks.modrinth.dependsOn(rootProject.generateChangelog)
269-
270-
tasks.register('publishToModSites') {
271-
publishToModSites.dependsOn(tasks.modrinth)
272-
publishToModSites.dependsOn(tasks.curseforge)
273-
}
274-
}
275-
27667
println "ModernFix: " + version

buildSrc/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
plugins {
2+
id 'groovy-gradle-plugin'
3+
}

buildSrc/settings.gradle

Whitespace-only changes.
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
plugins {
2+
id 'java'
3+
id 'architectury-plugin'
4+
id 'maven-publish'
5+
id 'com.diffplug.spotless'
6+
}
7+
8+
spotless {
9+
java {
10+
removeUnusedImports()
11+
}
12+
}
13+
14+
architectury {
15+
compileOnly()
16+
}
17+
18+
group = 'org.embeddedt'
19+
// extract base version from tag, generate other metadata ourselves
20+
def details = versionDetails()
21+
def plusIndex = details.lastTag.indexOf("+")
22+
if(plusIndex == -1) {
23+
plusIndex = details.lastTag.length()
24+
}
25+
def baseVersion = details.lastTag.substring(0, plusIndex)
26+
def dirtyMarker = grgit.status().clean ? "" : ".dirty"
27+
def commitHashMarker = details.commitDistance > 0 ? ("." + details.gitHash.substring(0, Math.min(4, details.gitHash.length()))) : ""
28+
def preMarker = (details.commitDistance > 0 || !details.isCleanTag) ? ("-beta." + details.commitDistance) : ""
29+
if(preMarker.length() > 0) {
30+
// bump to next patch release
31+
def versionParts = baseVersion.tokenize(".")
32+
baseVersion = "${versionParts[0]}.${versionParts[1]}.${versionParts[2].toInteger() + 1}"
33+
}
34+
def versionString = "${baseVersion}${preMarker}+mc${minecraft_version}${commitHashMarker}${dirtyMarker}"
35+
version = versionString
36+
archivesBaseName = rootProject.archives_base_name + '-' + project.name
37+
38+
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
39+
40+
repositories {
41+
maven { url 'https://modmaven.dev/' }
42+
maven {
43+
url "https://cursemaven.com"
44+
content {
45+
includeGroup "curse.maven"
46+
}
47+
}
48+
maven {
49+
name = 'ParchmentMC'
50+
url = 'https://maven.parchmentmc.org'
51+
}
52+
maven {
53+
// Shedaniel's maven (Architectury API)
54+
url = "https://maven.architectury.dev"
55+
content {
56+
includeGroup "me.shedaniel"
57+
}
58+
}
59+
60+
maven {
61+
// saps.dev Maven (KubeJS and Rhino)
62+
url = "https://maven.saps.dev/minecraft"
63+
content {
64+
includeGroup "dev.latvian.mods"
65+
}
66+
}
67+
maven { // CTM
68+
url "https://maven.tterrag.com/"
69+
}
70+
maven { url 'https://maven.blamejared.com' }
71+
repositories {
72+
maven {
73+
name = "Fuzs Mod Resources"
74+
url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/"
75+
}
76+
}
77+
maven {
78+
url 'https://maven.terraformersmc.com/releases'
79+
}
80+
maven { url = "https://jitpack.io" }
81+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
plugins {
2+
id 'modernfix.common-conventions'
3+
id 'dev.architectury.loom'
4+
}
5+
6+
loom {
7+
silentMojangMappingsLicense()
8+
accessWidenerPath = file("${rootDir}/common/src/main/resources/modernfix.accesswidener")
9+
}
10+
11+
dependencies {
12+
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
13+
mappings loom.layered() {
14+
officialMojangMappings()
15+
if(rootProject.hasProperty("parchment_version")) {
16+
parchment("org.parchmentmc.data:parchment-${minecraft_version}:${parchment_version}@zip")
17+
}
18+
}
19+
}
20+
21+
tasks {
22+
processResources {
23+
def mixinFileList = []
24+
def mixinDirectory = file("src/main/java/org/embeddedt/modernfix/" + project.name + "/mixin")
25+
fileTree(mixinDirectory).visit { FileVisitDetails details ->
26+
if(details.file.isFile()) {
27+
def fileName = mixinDirectory.relativePath(details.file).toString().replaceFirst(/\.java$/, "").replace('/', '.')
28+
mixinFileList << fileName
29+
}
30+
}
31+
32+
def mixinClassesStringB = new StringBuilder()
33+
for(int i = 0; i < mixinFileList.size(); i++) {
34+
mixinClassesStringB.append(" \"")
35+
mixinClassesStringB.append(mixinFileList.get(i))
36+
mixinClassesStringB.append('"')
37+
if(i < (mixinFileList.size() - 1))
38+
mixinClassesStringB.append(',')
39+
mixinClassesStringB.append('\n')
40+
}
41+
42+
def replacements = [
43+
mixin_classes: mixinClassesStringB.toString()
44+
]
45+
46+
inputs.properties replacements
47+
def filePattern = "modernfix-" + project.name + ".mixins.json"
48+
filesMatching(filePattern) {
49+
expand replacements
50+
}
51+
}
52+
}

0 commit comments

Comments
 (0)