-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Use ModDevGradle and fabric-loom instead of archloom and Vanil…
…laGradle (#341) * build: Use ModDevGradle and fabric-loom instead of archloom and VanillaGradle * remove redundant configuration this is done by indra * Cache build/moddev * Don't cache VanillaGradle * cache fabric loom cache
- Loading branch information
Showing
19 changed files
with
127 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,9 @@ | ||
import org.gradle.api.file.RegularFileProperty | ||
import org.gradle.api.model.ObjectFactory | ||
import org.gradle.api.provider.Property | ||
import org.gradle.kotlin.dsl.newInstance | ||
import javax.inject.Inject | ||
|
||
abstract class SquaremapPlatformExtension @Inject constructor(objects: ObjectFactory) { | ||
abstract class SquaremapPlatformExtension @Inject constructor() { | ||
abstract val productionJar: RegularFileProperty | ||
val loom: Loom = objects.newInstance(Loom::class) | ||
|
||
abstract class Loom { | ||
abstract val modInfoFilePath: Property<String> | ||
} | ||
abstract val modInfoFilePath: Property<String> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 2 additions & 33 deletions
35
build-logic/src/main/kotlin/squaremap.platform.loom.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,7 @@ | ||
plugins { | ||
id("squaremap.platform") | ||
id("xyz.jpenilla.quiet-architectury-loom") | ||
id("squaremap.platform.mod") | ||
id("quiet-fabric-loom") | ||
} | ||
|
||
val platformExt = extensions.getByType<SquaremapPlatformExtension>() | ||
platformExt.productionJar = tasks.remapJar.flatMap { it.archiveFile } | ||
|
||
val shade: Configuration by configurations.creating | ||
configurations.implementation { | ||
extendsFrom(shade) | ||
} | ||
val shadeFiltered: Configuration by configurations.creating { | ||
extendsFrom(shade) | ||
|
||
exclude("org.checkerframework") | ||
} | ||
|
||
tasks { | ||
shadowJar { | ||
configurations = listOf(shadeFiltered) | ||
listOf( | ||
"jakarta.inject", | ||
"com.google.inject", | ||
"org.aopalliance", | ||
).forEach(::reloc) | ||
} | ||
} | ||
|
||
afterEvaluate { | ||
tasks.processResources { | ||
expandIn(platformExt.loom.modInfoFilePath.get(), mapOf( | ||
"version" to project.version, | ||
"github_url" to rootProject.providers.gradleProperty("githubUrl").get(), | ||
"description" to project.description, | ||
)) | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
build-logic/src/main/kotlin/squaremap.platform.mdg.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
plugins { | ||
id("squaremap.platform.mod") | ||
id("net.neoforged.moddev") | ||
} | ||
|
||
val prod = tasks.register<Zip>("productionJar") { | ||
destinationDirectory = layout.buildDirectory.dir("libs") | ||
from(zipTree(tasks.shadowJar.flatMap { it.archiveFile })) | ||
// for some reason the inner jars were getting unpacked when from'ing directly to shadowJar...? | ||
from(tasks.jarJar) | ||
} | ||
|
||
val platformExt = extensions.getByType<SquaremapPlatformExtension>() | ||
platformExt.productionJar = prod.flatMap { it.archiveFile } |
24 changes: 24 additions & 0 deletions
24
build-logic/src/main/kotlin/squaremap.platform.mod.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
plugins { | ||
id("squaremap.platform") | ||
} | ||
|
||
val shade: Configuration by configurations.creating | ||
configurations.implementation { | ||
extendsFrom(shade) | ||
} | ||
val shadeFiltered: Configuration by configurations.creating { | ||
extendsFrom(shade) | ||
|
||
exclude("org.checkerframework") | ||
} | ||
|
||
tasks { | ||
shadowJar { | ||
configurations = listOf(shadeFiltered) | ||
listOf( | ||
"jakarta.inject", | ||
"com.google.inject", | ||
"org.aopalliance", | ||
).forEach(::reloc) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Any ATs declared here must be applied on all platforms (in one way or another) | ||
|
||
public net.minecraft.world.level.chunk.PalettedContainer get(I)Ljava/lang/Object; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
accessWidener v1 named | ||
|
||
# below are manually copied from squaremap-common.accesswidener, be sure to keep up to date with changes | ||
# below are manually copied from squaremap-common-at.cfg, be sure to keep up to date with changes | ||
accessible method net/minecraft/world/level/chunk/PalettedContainer get (I)Ljava/lang/Object; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# below are manually copied from squaremap-common.accesswidener, be sure to keep up to date with changes | ||
# below are manually copied from squaremap-common-at.cfg, be sure to keep up to date with changes | ||
public net.minecraft.world.level.chunk.PalettedContainer get(I)Ljava/lang/Object; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.