Cleaned some stuff on the gradle

This commit is contained in:
coolGi
2023-02-27 22:32:47 +10:30
parent 3c111cd8d6
commit e9eeba944a
4 changed files with 11 additions and 39 deletions
+6 -35
View File
@@ -88,23 +88,6 @@ forgix {
removeDuplicate "com.seibel.lod.core" removeDuplicate "com.seibel.lod.core"
} }
def useManifold(p) {
// def enableManifold = true
// // Only add manifold to forge when this is disabled
// // if manifold is enabled when forge is running runtimeClasspathCopy
// println gradle.taskGraph.allTasks
// gradle.taskGraph.whenReady { taskGraph ->
// println taskGraph.allTasks
// taskGraph.allTasks.each { task ->
// println task.path
// if (task.path.contains("Srg") || task.path.contains("runtimeClasspathCopy") || task.path.contains(":forge"))
// enableManifold = false
// }
// }
// return enableManifold
return p != project(":forge")
}
subprojects { p -> subprojects { p ->
// Does the same as "p == project(":common") || p == project(":fabric") || p == project(":quilt") || p == project(":forge")" // Does the same as "p == project(":common") || p == project(":fabric") || p == project(":quilt") || p == project(":forge")"
// Useful later on so we dont have duplicated code // Useful later on so we dont have duplicated code
@@ -113,7 +96,7 @@ subprojects { p ->
// Apply plugins // Apply plugins
apply plugin: "java" apply plugin: "java"
if (isMinecraftSubProject && useManifold(p)) if (isMinecraftSubProject)
apply plugin: "systems.manifold.manifold-gradle-plugin" apply plugin: "systems.manifold.manifold-gradle-plugin"
apply plugin: "com.github.johnrengelman.shadow" apply plugin: "com.github.johnrengelman.shadow"
// apply plugin: "org.spongepowered.gradle.vanilla" // Provides minecraft libraries // apply plugin: "org.spongepowered.gradle.vanilla" // Provides minecraft libraries
@@ -123,10 +106,9 @@ subprojects { p ->
// Set the manifold version (may not be required tough) // Set the manifold version (may not be required tough)
if (useManifold(p)) manifold {
manifold { manifoldVersion = rootProject.manifold_version
manifoldVersion = rootProject.manifold_version }
}
// set up custom configurations (configurations are a way to handle dependencies) // set up custom configurations (configurations are a way to handle dependencies)
@@ -165,7 +147,7 @@ subprojects { p ->
// Manifold // Manifold
if (isMinecraftSubProject && useManifold(p)) if (isMinecraftSubProject)
annotationProcessor("systems.manifold:manifold-preprocessor:${rootProject.manifold_version}") annotationProcessor("systems.manifold:manifold-preprocessor:${rootProject.manifold_version}")
// Log4j // Log4j
@@ -427,18 +409,7 @@ allprojects { p ->
tasks.withType(JavaCompile) { tasks.withType(JavaCompile) {
if (isMinecraftSubProject) { if (isMinecraftSubProject) {
options.release = rootProject.java_version as Integer options.release = rootProject.java_version as Integer
options.compilerArgs += ['-Xplugin:Manifold']
// def enableManifold = false
// // Only add manifold to forge when this is disabled
// // if manifold is enabled when forge is running runtimeClasspathCopy
// gradle.taskGraph.whenReady { taskGraph ->
// taskGraph.allTasks.each { task ->
// if (task.path.contains("compileJava"))
// enableManifold = true
// }
// }
if (useManifold(p))
options.compilerArgs += ['-Xplugin:Manifold']
} else { } else {
options.release = 8; // Core & Api should use Java 8 no matter what options.release = 8; // Core & Api should use Java 8 no matter what
//options.release = rootProject.java_version as Integer // But if minecraft //options.release = rootProject.java_version as Integer // But if minecraft
+1
View File
@@ -115,6 +115,7 @@ dependencies {
common(project(path: ":common")) { transitive false } common(project(path: ":common")) { transitive false }
shadowCommon(project(path: ":common")) { transitive false } shadowCommon(project(path: ":common")) { transitive false }
// shadowCommon(project(path: ":common"), configuration: "transformProductionFabric") { transitive false } // FIXME // shadowCommon(project(path: ":common"), configuration: "transformProductionFabric") { transitive false } // FIXME
// TODO: These exist in the main build.gradle so fix shadow there
shadowMe(project(path: ":core")) { transitive false } shadowMe(project(path: ":core")) { transitive false }
shadowMe(project(path: ":api")) { transitive false } shadowMe(project(path: ":api")) { transitive false }
} }
+3 -3
View File
@@ -30,7 +30,7 @@ def loadProperties() {
def mcVersion = "" def mcVersion = ""
def mcVers = fileTree("versionProperties").files.name // Get all the files in "versionProperties" def mcVers = fileTree("versionProperties").files.name // Get all the files in "versionProperties"
for (int i = 0; i < mcVers.size(); i++) { for (int i = 0; i < mcVers.size(); i++) {
mcVers[i] = mcVers[i].replaceAll(".properties", "") // As we are getting the file names, we should remove the ".properties" at the end to get the versions mcVers[i] = mcVers[i].replaceAll("\\.properties", "") // As we are getting the file names, we should remove the ".properties" at the end to get the versions
} }
mcVers.sort() // Sort so it always goes from oldest to newest mcVers.sort() // Sort so it always goes from oldest to newest
@@ -79,8 +79,8 @@ if (gradle.builds_for.contains("fabric"))
include("fabric") include("fabric")
if (gradle.builds_for.contains("quilt")) if (gradle.builds_for.contains("quilt"))
include("quilt") // Just put this here for once we need it ;) include("quilt") // Just put this here for once we need it ;)
if (gradle.builds_for.contains("forge")) //if (gradle.builds_for.contains("forge"))
include("forge") // include("forge")
rootProject.name = "DistantHorizons" rootProject.name = "DistantHorizons"