Skip to content

Commit

Permalink
Merge branch 'dev' into combine-draw-commands
Browse files Browse the repository at this point in the history
  • Loading branch information
douira committed Oct 26, 2024
2 parents 9b24127 + 24f77ee commit e962b37
Show file tree
Hide file tree
Showing 114 changed files with 3,287 additions and 648 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ body:
- **Have you ensured that all of your mods (including Sodium) are up-to-date?** The latest version of Sodium
can always be found [on Modrinth](https://modrinth.com/mod/sodium).
- **Have you read the [list of known driver incompatibilities](https://github.com/CaffeineMC/sodium-fabric/wiki/Driver-Compatibility)?** Most problems
- **Have you read the [list of known driver incompatibilities](https://github.com/CaffeineMC/sodium/wiki/Driver-Compatibility)?** Most problems
(including "poor performance") are caused by out-of-date or incompatible graphics drivers.
- **Have you used the [search tool](https://github.com/CaffeineMC/sodium-fabric/issues) to check whether your issue
- **Have you used the [search tool](https://github.com/CaffeineMC/sodium/issues) to check whether your issue
has already been reported?** If it has been, then consider adding more information to the existing issue instead.
- **Have you determined the minimum set of instructions to reproduce the issue?** If your problem only occurs
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ contact_links:
- name: For help with other issues, join our Discord community
url: https://caffeinemc.net/discord
about: This is the best option for getting help with mod installation, performance issues, and any other support inquiries
# Copied from https://github.com/CaffeineMC/sodium-fabric#community
# Copied from https://github.com/CaffeineMC/sodium#community
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ body:
- type: markdown
attributes:
value: >-
Make sure you have used the [search tool](https://github.com/CaffeineMC/sodium-fabric/issues) to see if a similar
Make sure you have used the [search tool](https://github.com/CaffeineMC/sodium/issues) to see if a similar
request already exists. If we have previously closed a feature request, then please do not create another request.
- type: textarea
id: description
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: sodium-artifacts-${{ steps.ref.outputs.branch }}
path: build/libs/*.jar
path: build/mods/*.jar
2 changes: 1 addition & 1 deletion .github/workflows/build-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: sodium-artifacts-${{ steps.ref.outputs.branch }}
path: build/libs/*.jar
path: build/mods/*.jar
3 changes: 1 addition & 2 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
2 changes: 1 addition & 1 deletion .github/workflows/build-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: sodium-artifacts-${{ steps.ref.outputs.branch }}
path: build/libs/*.jar
path: build/mods/*.jar
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ The latest version of Sodium can be downloaded from our official [Modrinth](http
Since the release of Sodium 0.6.0, both the _Fabric_ and _NeoForge_ mod loaders are supported. We generally recommend
that new users prefer to use the _Fabric_ mod loader, since it is more lightweight and stable (for the time being.)

For more information about downloading and installing the mod, please refer to our [Installation Guide](https://github.com/CaffeineMC/sodium-fabric/wiki/Installation).
For more information about downloading and installing the mod, please refer to our [Installation Guide](https://github.com/CaffeineMC/sodium/wiki/Installation).

### 🐛 Reporting Issues

You can report bugs and crashes by opening an issue on our [issue tracker](https://github.com/CaffeineMC/sodium-fabric/issues).
You can report bugs and crashes by opening an issue on our [issue tracker](https://github.com/CaffeineMC/sodium/issues).
Before opening a new issue, use the search tool to make sure that your issue has not already been reported and ensure
that you have completely filled out the issue template. Issues that are duplicates or do not contain the necessary
information to triage and debug may be closed.
Expand Down
80 changes: 0 additions & 80 deletions build.gradle.kts
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
}
}
8 changes: 8 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
plugins {
`kotlin-dsl`
}

repositories {
mavenCentral()
gradlePluginPortal()
}
41 changes: 41 additions & 0 deletions buildSrc/src/main/kotlin/BuildConfig.kt
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()
}
}
44 changes: 44 additions & 0 deletions buildSrc/src/main/kotlin/multiloader-base.gradle.kts
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")
}
}
}
43 changes: 43 additions & 0 deletions buildSrc/src/main/kotlin/multiloader-platform.gradle.kts
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"])
}
}
}
Loading

0 comments on commit e962b37

Please sign in to comment.