-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port to DGT + add more versions + add OmniCore + cleanup
- Loading branch information
Showing
137 changed files
with
377 additions
and
418 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,21 +1,15 @@ | ||
group=org.polyfrost | ||
name=OneConfig | ||
mod_id=oneconfig | ||
version_major=1 | ||
version_minor=0 | ||
version_patch=0-alpha.65 | ||
|
||
polyfrost.defaults.loom=3 | ||
# Gradle Configuration -- DO NOT TOUCH THESE VALUES. | ||
org.gradle.daemon=true | ||
org.gradle.parallel=true | ||
org.gradle.configureoncommand=true | ||
org.gradle.parallel.threads=4 | ||
org.gradle.jvmargs=-Xmx2G | ||
|
||
kotlin.code.style=official | ||
|
||
org.gradle.parallel=true | ||
org.gradle.caching=true | ||
#org.gradle.configuration-cache=true | ||
org.gradle.configureondemand=true | ||
org.gradle.parallel.threads=4 | ||
org.gradle.dependency.verification=strict | ||
org.gradle.kotlin.dsl.allWarningsAsErrors=true | ||
org.gradle.kotlin.dsl.precompiled.accessors.strict=true | ||
org.gradle.workers.max=4 | ||
org.gradle.jvmargs=-Xmx4G -Dfile.encoding=UTF-8 | ||
dgt.java.version=8 | ||
|
||
# Project Configuration | ||
project.group=org.polyfrost | ||
project.name=OneConfig | ||
project.version=1.0.0-alpha.66 |
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
File renamed without changes.
File renamed without changes.
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,161 @@ | ||
@file:Suppress("UnstableApiUsage") | ||
// Shared build logic for all versions of OneConfig. | ||
|
||
import dev.deftu.gradle.utils.GameSide | ||
import dev.deftu.gradle.utils.MinecraftVersion | ||
import dev.deftu.gradle.utils.includeOrShade | ||
import org.polyfrost.gradle.provideIncludedDependencies | ||
import java.text.SimpleDateFormat | ||
|
||
plugins { | ||
java | ||
alias(libs.plugins.kotlin) | ||
id(libs.plugins.dgt.multiversion.platform.get().pluginId) | ||
id(libs.plugins.dgt.base.get().pluginId) | ||
id(libs.plugins.dgt.resources.get().pluginId) | ||
id(libs.plugins.dgt.loom.get().pluginId) | ||
id(libs.plugins.dgt.shadow.get().pluginId) | ||
} | ||
|
||
toolkitLoomHelper { | ||
disableRunConfigs(GameSide.SERVER) | ||
|
||
useProperty("mixin.debug.export", "true", GameSide.CLIENT) | ||
useProperty("debugBytecode", "true", GameSide.CLIENT) | ||
useProperty("forge.logging.console.level", "debug", GameSide.CLIENT) | ||
if (org.gradle.internal.os.OperatingSystem.current().isMacOsX) { | ||
useProperty("fml.earlyprogresswindow", "false", GameSide.CLIENT) | ||
} | ||
|
||
if (mcData.isForge) { | ||
useForgeMixin(modData.id) | ||
} | ||
|
||
if (mcData.isLegacyForge) { | ||
useTweaker("org.polyfrost.oneconfig.internal.legacy.OneConfigTweaker") | ||
} | ||
} | ||
|
||
if (mcData.isForge) { | ||
loom.forge.mixinConfig("mixins.${modData.id}.init.json") | ||
} | ||
|
||
repositories { | ||
maven("https://repo.polyfrost.org/releases") | ||
maven("https://repo.polyfrost.org/snapshots") | ||
maven("https://repo.hypixel.net/repository/Hypixel/") | ||
maven("https://maven.deftu.dev/releases") | ||
} | ||
|
||
val shadow by configurations.creating | ||
|
||
if (mcData.isLegacyForge) { // Quick substitution for relaunch in dev env, so that mixinextras works properly (yay!) | ||
configurations.all { | ||
resolutionStrategy { | ||
dependencySubstitution { | ||
all { | ||
if (requested is ModuleComponentSelector) { | ||
val module = (requested as ModuleComponentSelector) | ||
if (module.group == "org.ow2.asm" && module.version == "5.0.3") { | ||
logger.warn("Substituting ${module.group}:${module.module}:${module.version} with ${libs.asm.get()}") | ||
useTarget(module.group + ":" + module.module + ":" + libs.asm.get().version) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
compileOnly("gg.essential:vigilance-1.8.9-forge:295") { | ||
isTransitive = false | ||
} | ||
|
||
provideIncludedDependencies(Triple(mcData.version.major, mcData.version.minor, mcData.version.patch), mcData.loader.friendlyString).forEach { | ||
if (it.dep is String) { | ||
shade(it.dep as String, it.mod) | ||
} else { | ||
shade(it.dep as ExternalModuleDependency, it.mod) | ||
} | ||
} | ||
|
||
annotationProcessor(libs.mixin.extras) | ||
|
||
for (dep in listOf("-nanovg").run { if (mcData.version < MinecraftVersion.VERSION_1_13) this else this + listOf("-tinyfd", "-stb", "") }) { | ||
val lwjglDep = "org.lwjgl:lwjgl$dep:${libs.versions.lwjgl.get()}" | ||
compileOnlyApi(lwjglDep) { | ||
isTransitive = false | ||
} | ||
} | ||
|
||
implementation(project(":modules:dependencies:bundled")) | ||
implementation(project(":modules:internal")) { | ||
isTransitive = false | ||
} | ||
|
||
if (mcData.isLegacyForge) { | ||
compileOnly("cc.polyfrost:oneconfig-$mcData:0.2.2-alpha216") { | ||
isTransitive = false | ||
} | ||
} | ||
} | ||
|
||
fun DependencyHandlerScope.shade(dependency: String, isMod: Boolean = false) { | ||
val dep = project.dependencies.create(dependency) as ExternalModuleDependency | ||
shade(dep, isMod) | ||
} | ||
|
||
fun DependencyHandlerScope.shade(dependency: Provider<MinimalExternalModuleDependency>, isMod: Boolean = false) { | ||
shade(dependency.get(), isMod) | ||
} | ||
|
||
fun DependencyHandlerScope.shade(dependency: ExternalModuleDependency, isMod: Boolean = false) { | ||
val dep = "${dependency.group}:${dependency.name}:${dependency.version}" | ||
val configuration = if (isMod) modApi(dep) { | ||
isTransitive = false | ||
} else api(dep) { | ||
isTransitive = false | ||
} | ||
|
||
includeOrShade(configuration) | ||
} | ||
|
||
tasks { | ||
remapJar { | ||
manifest { | ||
val attributesMap = buildMap<String, Any> { | ||
putAll( | ||
mapOf( | ||
"Specification-Title" to modData.id, | ||
"Specification-Vendor" to "Polyfrost", | ||
"Specification-Version" to "1", // We are version 1 of ourselves, whatever the hell that means | ||
"Implementation-Title" to rootProject.name, | ||
"Implementation-Version" to project.version, | ||
"Implementation-Vendor" to "Polyfrost", | ||
"Implementation-Timestamp" to SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").format(`java.util`.Date()), | ||
"OneConfig-Main-Class" to "org.polyfrost.oneconfig.internal.bootstrap.Bootstrap" | ||
) | ||
) | ||
} | ||
|
||
attributes(attributesMap) | ||
} | ||
} | ||
} | ||
|
||
publishing { | ||
publications { | ||
register<MavenPublication>("java") { | ||
from(components["java"]) | ||
|
||
groupId = group.toString() | ||
artifactId = base.archivesName.get() | ||
|
||
signing { | ||
isRequired = project.properties["signing.keyId"] != null | ||
sign(this@register) | ||
} | ||
} | ||
} | ||
} |
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,4 @@ | ||
dgt.loom.mappings.flavor=parchment | ||
|
||
mod.name=OneConfig | ||
mod.id=oneconfig |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.