-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '1.21/dev' into 1.21/stable
- Loading branch information
Showing
56 changed files
with
722 additions
and
406 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
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,89 @@ | ||
plugins { | ||
id("java") | ||
id("fabric-loom") version ("1.7.2") apply (false) | ||
} | ||
|
||
val MINECRAFT_VERSION by extra { "1.21.1" } | ||
val NEOFORGE_VERSION by extra { "21.1.23" } | ||
val FABRIC_LOADER_VERSION by extra { "0.16.2" } | ||
val FABRIC_API_VERSION by extra { "0.102.1+1.21.1" } | ||
|
||
// This value can be set to null to disable Parchment. | ||
val PARCHMENT_VERSION by extra { null } | ||
|
||
// https://semver.org/ | ||
val MOD_VERSION by extra { "1.8.0-beta.1" } | ||
|
||
// | ||
val maven_group: String by project | ||
val archives_name: String by project | ||
|
||
allprojects { | ||
apply(plugin = "java") | ||
apply(plugin = "maven-publish") | ||
group = maven_group | ||
version = createVersionString() | ||
} | ||
|
||
tasks.withType<JavaCompile> { | ||
options.encoding = "UTF-8" | ||
} | ||
|
||
subprojects { | ||
apply(plugin = "maven-publish") | ||
|
||
repositories { | ||
maven("https://maven.parchmentmc.org/") | ||
maven("https://api.modrinth.com/maven") | ||
} | ||
|
||
base { | ||
archivesName = "$archives_name-${project.name}" | ||
} | ||
|
||
java.toolchain.languageVersion = JavaLanguageVersion.of(21) | ||
|
||
tasks.processResources { | ||
filesMatching("META-INF/neoforge.mods.toml") { | ||
expand(mapOf("version" to createVersionString())) | ||
} | ||
} | ||
|
||
version = createVersionString() | ||
group = "me.flashyreese.mods" | ||
|
||
tasks.withType<JavaCompile> { | ||
options.encoding = "UTF-8" | ||
options.release.set(21) | ||
} | ||
|
||
tasks.withType<GenerateModuleMetadata>().configureEach { | ||
enabled = false | ||
} | ||
} | ||
|
||
fun createVersionString(): String { | ||
val builder = StringBuilder() | ||
|
||
val isReleaseBuild = project.hasProperty("build.release") | ||
val buildId = System.getenv("GITHUB_RUN_NUMBER") | ||
|
||
if (isReleaseBuild) { | ||
builder.append(MOD_VERSION) | ||
} else { | ||
builder.append(MOD_VERSION.split('-')[0]) | ||
builder.append("-snapshot") | ||
} | ||
|
||
builder.append("+mc").append(MINECRAFT_VERSION) | ||
|
||
if (!isReleaseBuild) { | ||
if (buildId != null) { | ||
builder.append("-build.$buildId") | ||
} else { | ||
builder.append("-local") | ||
} | ||
} | ||
|
||
return builder.toString() | ||
} |
Oops, something went wrong.