-
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.
Complete conversion to Gradle Kotlin DSL
- Loading branch information
Showing
11 changed files
with
135 additions
and
132 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
plugins { | ||
id("java") | ||
id("java-library") | ||
} | ||
|
||
group = "com.noxcrew.noxesium" | ||
version = "1.0.0" | ||
|
||
repositories { | ||
mavenCentral() | ||
} |
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,15 @@ | ||
import java.io.ByteArrayOutputStream | ||
|
||
fun getGitCommit(): String { | ||
val stdout = ByteArrayOutputStream() | ||
exec { | ||
commandLine("git", "rev-parse", "--short", "HEAD") | ||
standardOutput = stdout | ||
} | ||
return stdout.toString().trim() | ||
} | ||
|
||
allprojects { | ||
group = "com.noxcrew.noxesium" | ||
version = "${property("mod_version")}+${getGitCommit()}" | ||
} |
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,74 @@ | ||
plugins { | ||
id("fabric-loom") version "1.3-SNAPSHOT" | ||
} | ||
|
||
repositories { | ||
// Add repositories to retrieve artifacts from in here. | ||
// You should only use this when depending on other mods because | ||
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically. | ||
// See https://docs.gradle.org/current/userguide/declaring_repositories.html | ||
// for more information about repositories. | ||
maven { url = uri("https://maven.terraformersmc.com/releases/") } | ||
maven { | ||
setUrl("https://api.modrinth.com/maven") | ||
content { | ||
includeGroup("maven.modrinth") | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
// To change the versions see the gradle.properties file | ||
minecraft("com.mojang:minecraft:${property("minecraft_version")}") | ||
mappings(loom.officialMojangMappings()) | ||
modImplementation("net.fabricmc:fabric-loader:${property("loader_version")}") | ||
|
||
// Fabric API. This is technically optional, but you probably want it anyway. | ||
modImplementation("net.fabricmc.fabric-api:fabric-api:${property("fabric_version")}") | ||
|
||
// Compatibility with other mods | ||
api(project(":api")) | ||
modImplementation("maven.modrinth:sodium:${property("sodium")}") | ||
modImplementation("maven.modrinth:iris:${property("iris")}") { | ||
isTransitive = false | ||
} | ||
|
||
modCompileOnly("com.terraformersmc:modmenu:${property("modmenu")}") | ||
modLocalRuntime("com.terraformersmc:modmenu:${property("modmenu")}") | ||
} | ||
|
||
java { | ||
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task | ||
// if it is present. | ||
// If you remove this line, sources will not be generated. | ||
withSourcesJar() | ||
toolchain.languageVersion.set(JavaLanguageVersion.of(17)) | ||
} | ||
|
||
loom { | ||
accessWidenerPath.set(file("src/main/resources/noxesium.accesswidener")) | ||
} | ||
|
||
tasks { | ||
processResources { | ||
inputs.property("version", project.version) | ||
filesMatching("fabric.mod.json") { | ||
expand("version" to project.version) | ||
} | ||
} | ||
|
||
withType<JavaCompile> { | ||
options.encoding = Charsets.UTF_8.name() | ||
options.release.set(17) | ||
} | ||
|
||
withType<AbstractArchiveTask> { | ||
archiveBaseName.set("noxesium") | ||
} | ||
|
||
jar { | ||
from("LICENSE") { | ||
rename { return@rename "${it}_${rootProject.name}" } | ||
} | ||
} | ||
} |
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
Binary file not shown.
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,5 +1,7 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
rootProject.name = "noxesium" | ||
|
||
pluginManagement { | ||
repositories { | ||
maven("https://maven.fabricmc.net/") | ||
gradlePluginPortal() | ||
} | ||
} | ||
|
||
include("api") | ||
include("fabric") |