-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
General refactoring + fixes + update to 1.20.2
- Loading branch information
Showing
8 changed files
with
110 additions
and
68 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,97 @@ | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
plugins { | ||
val kotlinVersion: String by System.getProperties() | ||
kotlin("jvm").version(kotlinVersion) | ||
application | ||
id("fabric-loom") | ||
id("com.modrinth.minotaur") version "2.+" | ||
} | ||
|
||
val archives_base_name: String by project | ||
base { | ||
val archivesBaseName: String by project | ||
archivesName.set(archivesBaseName) | ||
archivesName.set(archives_base_name) | ||
} | ||
|
||
val modVersion: String by project | ||
version = modVersion | ||
val mavenGroup: String by project | ||
group = mavenGroup | ||
val mod_version: String by project | ||
version = mod_version | ||
val maven_group: String by project | ||
group = maven_group | ||
|
||
val minecraft_version: String by project | ||
val loader_version: String by project | ||
val fabric_kotlin_version: String by project | ||
|
||
repositories { | ||
mavenCentral() | ||
maven(url = "https://maven.shedaniel.me") | ||
maven(url = "https://maven.terraformersmc.com/releases/") | ||
} | ||
|
||
dependencies { | ||
val minecraftVersion: String by project | ||
minecraft("com.mojang:minecraft:$minecraftVersion") | ||
val yarnMappings: String by project | ||
mappings("net.fabricmc:yarn:$yarnMappings:v2") | ||
val loaderVersion: String by project | ||
modImplementation("net.fabricmc:fabric-loader:$loaderVersion") | ||
val fabricVersion: String by project | ||
modImplementation("net.fabricmc.fabric-api:fabric-api:$fabricVersion") | ||
val fabricKotlinVersion: String by project | ||
modImplementation("net.fabricmc:fabric-language-kotlin:$fabricKotlinVersion") | ||
val clothConfigVersion: String by project | ||
modApi("me.shedaniel.cloth:cloth-config-fabric:$clothConfigVersion") | ||
val modMenuVersion: String by project | ||
modApi("com.terraformersmc:modmenu:$modMenuVersion") | ||
minecraft("com.mojang:minecraft:$minecraft_version") | ||
|
||
val yarn_mappings: String by project | ||
mappings("net.fabricmc:yarn:$yarn_mappings:v2") | ||
|
||
val fabric_version: String by project | ||
modImplementation("net.fabricmc:fabric-loader:$loader_version") | ||
modImplementation("net.fabricmc.fabric-api:fabric-api:$fabric_version") | ||
modImplementation("net.fabricmc:fabric-language-kotlin:$fabric_kotlin_version") | ||
|
||
val cloth_config_version: String by project | ||
modApi("me.shedaniel.cloth:cloth-config-fabric:$cloth_config_version") | ||
|
||
val mod_menu_version: String by project | ||
modApi("com.terraformersmc:modmenu:$mod_menu_version") | ||
} | ||
|
||
tasks { | ||
val javaVersion = JavaVersion.VERSION_17 | ||
withType<JavaCompile> { | ||
options.encoding = "UTF-8" | ||
sourceCompatibility = javaVersion.toString() | ||
targetCompatibility = javaVersion.toString() | ||
options.release.set(javaVersion.toString().toInt()) | ||
} | ||
withType<KotlinCompile> { | ||
kotlinOptions { jvmTarget = javaVersion.toString() } | ||
sourceCompatibility = javaVersion.toString() | ||
targetCompatibility = javaVersion.toString() | ||
jar { | ||
from("LICENSE") { | ||
rename { "${it}_${base.archivesName}" | ||
} | ||
} | ||
} | ||
jar { from("LICENSE") { rename { "${it}_${base.archivesName}" } } } | ||
|
||
processResources { | ||
inputs.property("version", project.version) | ||
filesMatching("fabric.mod.json") { expand(mutableMapOf("version" to project.version)) } | ||
filesMatching("fabric.mod.json") { | ||
expand( | ||
mapOf( | ||
"mod_version" to mod_version, | ||
"minecraft_version" to minecraft_version, | ||
"loader_version" to loader_version, | ||
"fabric_kotlin_version" to fabric_kotlin_version, | ||
) | ||
) | ||
} | ||
} | ||
java { | ||
toolchain { languageVersion.set(JavaLanguageVersion.of(javaVersion.toString())) } | ||
sourceCompatibility = javaVersion | ||
targetCompatibility = javaVersion | ||
withSourcesJar() | ||
|
||
register<Exec>("createGitHubRelease") { | ||
dependsOn(remapJar) | ||
|
||
commandLine("git", "tag", "-a", "v${mod_version}", "-m", "Release v${mod_version}") | ||
commandLine("git", "push", "--tags") | ||
|
||
commandLine("gh", "release", "create", "v${mod_version}", "-F", "changelog.md", "-t", "v${mod_version}") | ||
} | ||
|
||
register("createReleases") { | ||
dependsOn("createGitHubRelease") | ||
dependsOn(modrinth) | ||
dependsOn(modrinthSyncBody) | ||
} | ||
} | ||
|
||
modrinth { | ||
val version = mod_version | ||
|
||
token.set(System.getenv("MODRINTH_TOKEN")) | ||
projectId.set("timedisplay") | ||
versionNumber.set(version) | ||
versionType.set("release") | ||
versionName.set("Time Display $mod_version") | ||
uploadFile.set(tasks.remapJar as Any) | ||
gameVersions.add(minecraft_version) | ||
loaders.addAll("fabric", "quilt") | ||
changelog.set(rootProject.file("changelog.md").readText()) | ||
syncBodyFrom.set(rootProject.file("README.md").readText()) | ||
} |
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,20 +1,24 @@ | ||
kotlin.code.style=official | ||
org.gradle.jvmargs = -Xmx1G | ||
org.gradle.warning.mode = all | ||
|
||
# Check these on https://fabricmc.net/develop/ | ||
minecraftVersion=1.20 | ||
yarnMappings=1.20+build.1 | ||
loaderVersion=0.14.21 | ||
minecraft_version=1.20.2 | ||
yarn_mappings=1.20.2+build.4 | ||
loader_version=0.14.22 | ||
|
||
#Fabric api | ||
fabricVersion=0.83.0+1.20 | ||
loomVersion = 1.0-SNAPSHOT | ||
fabric_version=0.89.3+1.20.2 | ||
loom_version = 1.4-SNAPSHOT | ||
|
||
# Mod Properties | ||
modVersion = 1.3.0 | ||
mavenGroup = me.iru | ||
archivesBaseName = timedisplay | ||
mod_version = 1.4.0 | ||
maven_group = me.iru | ||
archives_base_name = timedisplay | ||
|
||
# Kotlin | ||
systemProp.kotlinVersion = 1.6.10 | ||
fabricKotlinVersion = 1.8.7+kotlin.1.7.22 | ||
systemProp.kotlinVersion = 1.9.10 | ||
fabric_kotlin_version = 1.10.10+kotlin.1.9.10 | ||
|
||
clothConfigVersion = 11.0.99 | ||
modMenuVersion = 7.0.1 | ||
cloth_config_version = 12.0.109 | ||
mod_menu_version = 8.0.0 |
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,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip | ||
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 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