forked from CaffeineMC/sodium
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into combine-draw-commands
- Loading branch information
Showing
114 changed files
with
3,287 additions
and
648 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 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 |
---|---|---|
|
@@ -28,6 +28,5 @@ jobs: | |
- name: Upload assets to GitHub | ||
uses: AButler/[email protected] | ||
with: | ||
# Filter built files to disregard -sources and -dev, and leave only the minecraft-compatible jars. | ||
files: 'build/libs/*[0-9].jar;LICENSE' | ||
files: 'build/mods/*.jar' | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} |
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,80 +0,0 @@ | ||
plugins { | ||
id("java") | ||
id("fabric-loom") version ("1.7.3") apply (false) | ||
} | ||
|
||
val MINECRAFT_VERSION by extra { "1.21.1" } | ||
val NEOFORGE_VERSION by extra { "21.1.46" } | ||
val FABRIC_LOADER_VERSION by extra { "0.16.4" } | ||
val FABRIC_API_VERSION by extra { "0.103.0+1.21.1" } | ||
|
||
// This value can be set to null to disable Parchment. | ||
// TODO: Re-add Parchment | ||
val PARCHMENT_VERSION by extra { null } | ||
|
||
// https://semver.org/ | ||
val MOD_VERSION by extra { "0.6.0-beta.2" } | ||
|
||
allprojects { | ||
apply(plugin = "java") | ||
apply(plugin = "maven-publish") | ||
} | ||
|
||
tasks.withType<JavaCompile> { | ||
options.encoding = "UTF-8" | ||
} | ||
|
||
tasks.jar { | ||
enabled = false | ||
} | ||
|
||
subprojects { | ||
apply(plugin = "maven-publish") | ||
|
||
java.toolchain.languageVersion = JavaLanguageVersion.of(21) | ||
|
||
|
||
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.substringBefore('-')) | ||
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() | ||
} | ||
|
||
tasks.processResources { | ||
filesMatching("META-INF/neoforge.mods.toml") { | ||
expand(mapOf("version" to createVersionString())) | ||
} | ||
} | ||
|
||
version = createVersionString() | ||
group = "net.caffeinemc.mods" | ||
|
||
tasks.withType<JavaCompile> { | ||
options.encoding = "UTF-8" | ||
options.release.set(21) | ||
} | ||
|
||
tasks.withType<GenerateModuleMetadata>().configureEach { | ||
enabled = false | ||
} | ||
} | ||
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,8 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
gradlePluginPortal() | ||
} |
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,41 @@ | ||
import org.gradle.api.Project | ||
|
||
object BuildConfig { | ||
val MINECRAFT_VERSION: String = "1.21.1" | ||
val NEOFORGE_VERSION: String = "21.1.46" | ||
val FABRIC_LOADER_VERSION: String = "0.16.4" | ||
val FABRIC_API_VERSION: String = "0.103.0+1.21.1" | ||
|
||
// This value can be set to null to disable Parchment. | ||
// TODO: Re-add Parchment | ||
val PARCHMENT_VERSION: String? = null | ||
|
||
// https://semver.org/ | ||
var MOD_VERSION: String = "0.6.0-beta.2" | ||
|
||
fun createVersionString(project: Project): 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.substringBefore('-')) | ||
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() | ||
} | ||
} |
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,44 @@ | ||
plugins { | ||
id("java-library") | ||
id("idea") | ||
} | ||
|
||
group = "net.caffeinemc" | ||
version = BuildConfig.createVersionString(project) | ||
|
||
java.toolchain.languageVersion = JavaLanguageVersion.of(21) | ||
|
||
tasks.withType<JavaCompile> { | ||
options.encoding = "UTF-8" | ||
options.release.set(21) | ||
} | ||
|
||
tasks.withType<GenerateModuleMetadata>().configureEach { | ||
enabled = false | ||
} | ||
|
||
repositories { | ||
exclusiveContent { | ||
forRepository { | ||
maven { | ||
name = "Modrinth" | ||
url = uri("https://api.modrinth.com/maven") | ||
} | ||
} | ||
filter { | ||
includeGroup("maven.modrinth") | ||
} | ||
} | ||
|
||
exclusiveContent { | ||
forRepository { | ||
maven { | ||
name = "Parchment" | ||
url = uri("https://maven.parchmentmc.org") | ||
} | ||
} | ||
filter { | ||
includeGroup("org.parchmentmc.data") | ||
} | ||
} | ||
} |
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,43 @@ | ||
plugins { | ||
id("multiloader-base") | ||
id("maven-publish") | ||
} | ||
|
||
val configurationDesktopIntegrationJava: Configuration = configurations.create("commonDesktopIntegration") { | ||
isCanBeResolved = true | ||
} | ||
|
||
dependencies { | ||
configurationDesktopIntegrationJava(project(path = ":common", configuration = "commonDesktopJava")) | ||
} | ||
|
||
tasks { | ||
processResources { | ||
inputs.property("version", version) | ||
|
||
filesMatching(listOf("fabric.mod.json", "META-INF/neoforge.mods.toml")) { | ||
expand(mapOf("version" to version)) | ||
} | ||
} | ||
|
||
jar { | ||
duplicatesStrategy = DuplicatesStrategy.FAIL | ||
from(rootDir.resolve("LICENSE.md")) | ||
|
||
// Entry-point for desktop integration when the file is executed directly | ||
from(configurationDesktopIntegrationJava) | ||
manifest.attributes["Main-Class"] = "net.caffeinemc.mods.sodium.desktop.LaunchWarn" | ||
} | ||
} | ||
|
||
publishing { | ||
publications { | ||
create<MavenPublication>("maven") { | ||
groupId = project.group as String | ||
artifactId = project.name as String | ||
version = version | ||
|
||
from(components["java"]) | ||
} | ||
} | ||
} |
Oops, something went wrong.