-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
147 additions
and
148 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 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 |
---|---|---|
@@ -0,0 +1,128 @@ | ||
plugins { | ||
id("net.minecraftforge.gradle") version "[6.0,6.2)" | ||
id("idea") | ||
id("eclipse") | ||
} | ||
|
||
fun getGitRef(): String { | ||
return providers.exec { | ||
commandLine("git", "rev-parse", "--short", "HEAD") | ||
isIgnoreExitValue = true | ||
}.standardOutput.asText.get().trim() | ||
} | ||
|
||
val modId: String by extra | ||
val minecraftVersion: String by extra | ||
val forgeVersion: String by extra | ||
val modVersion: String by extra | ||
val mavenGroup: String by extra | ||
|
||
version = "${modVersion}+${getGitRef()}" | ||
group = mavenGroup | ||
base { | ||
archivesName.set("${modId}-MC${minecraftVersion}") | ||
} | ||
|
||
java.toolchain.languageVersion.set(JavaLanguageVersion.of(17)) | ||
|
||
tasks.withType<JavaCompile>().configureEach { | ||
options.encoding = "utf-8" | ||
} | ||
|
||
repositories { | ||
maven { | ||
url = uri("https://cursemaven.com") | ||
content { includeGroup("curse.maven") } | ||
} | ||
} | ||
|
||
dependencies { | ||
minecraft("net.minecraftforge:forge:${minecraftVersion}-${forgeVersion}") | ||
|
||
// Just for in-dev convenience. Mod doesn't use any JEI APIs. | ||
runtimeOnly(fg.deobf("curse.maven:jei-238222:4690097")) | ||
} | ||
|
||
minecraft { | ||
mappings("official", minecraftVersion) | ||
|
||
runs { | ||
create("client") { | ||
workingDirectory(file("run")) | ||
|
||
property("forge.logging.markers", "REGISTRIES") | ||
property("forge.logging.console.level", "info") | ||
|
||
mods { | ||
create(modId) { | ||
source(sourceSets.main.get()) | ||
} | ||
} | ||
} | ||
|
||
create("server") { | ||
workingDirectory(file("run")) | ||
|
||
property("forge.logging.markers", "REGISTRIES") | ||
property("forge.logging.console.level", "info") | ||
|
||
mods { | ||
create(modId) { | ||
source(sourceSets.main.get()) | ||
} | ||
} | ||
} | ||
|
||
create("data") { | ||
workingDirectory(file("run")) | ||
|
||
property("forge.logging.markers", "REGISTRIES") | ||
property("forge.logging.console.level", "info") | ||
|
||
args("--mod", "bedrockores", "--all", "--output", file("src/generated/resources/"), "--existing", file("src/main/resources")) | ||
|
||
mods { | ||
create(modId) { | ||
source(sourceSets.main.get()) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
tasks.register<Copy>("copyGeneratedResources") { | ||
from("src/generated") | ||
into("src/main") | ||
exclude("resources/.cache") | ||
} | ||
|
||
tasks.withType<ProcessResources> { | ||
inputs.property("version", modVersion) | ||
|
||
filesMatching("META-INF/mods.toml") { | ||
expand(mapOf("version" to modVersion)) | ||
} | ||
} | ||
|
||
tasks.withType<Jar> { | ||
finalizedBy("reobfJar") | ||
|
||
manifest { | ||
attributes(mapOf( | ||
"Specification-Title" to "bedrockores", | ||
"Specification-Vendor" to "Sangar", | ||
"Specification-Version" to "1", | ||
"Implementation-Title" to project.name, | ||
"Implementation-Version" to version, | ||
"Implementation-Vendor" to "Sangar", | ||
)) | ||
} | ||
} | ||
|
||
idea { | ||
module { | ||
for (exclude in arrayOf("out", "logs")) { | ||
excludeDirs.add(file(exclude)) | ||
} | ||
} | ||
} |
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,12 +1,10 @@ | ||
org.gradle.jvmargs=-Xmx3G | ||
org.gradle.daemon=false | ||
|
||
minecraft_version=1.20.1 | ||
minecraftVersion=1.20.1 | ||
forgeVersion=47.1.0 | ||
|
||
archives_base_name=bedrockores | ||
maven_group=li.cil.bedrockores | ||
|
||
forge_version=47.1.0 | ||
modId=bedrockores | ||
mavenGroup=li.cil.bedrockores | ||
|
||
# Set by build pipeline. | ||
semver=0.0.0 | ||
modVersion=0.0.0 |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
pluginManagement { | ||
repositories { | ||
gradlePluginPortal() | ||
maven { url = uri("https://maven.minecraftforge.net/") } | ||
} | ||
} | ||
|
||
plugins { | ||
id("org.gradle.toolchains.foojay-resolver-convention") version "0.5.0" | ||
} | ||
|
||
val modId: String by settings | ||
rootProject.name = modId |