Skip to content

Commit

Permalink
The separation
Browse files Browse the repository at this point in the history
  • Loading branch information
Desoroxxx committed Oct 6, 2023
1 parent 90d6738 commit c45a53a
Show file tree
Hide file tree
Showing 27 changed files with 757 additions and 743 deletions.
21 changes: 17 additions & 4 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,36 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

### Highlight

Welcome to Red Core 0.5 a breaking release.
Welcome to Red Core 0.5 an originally breaking release, but now it has a compatibility layer, all mods using it should update before 0.8 when the compatibility layer will be removed.

### Changed

- Red Core is now split into two, `Red Core` and `Red Core MC` the later being the MC specific part of Red Core, this finally allows it to be used everywhere
- `MathUtil` is now under `utils.math`
- Separated `MathUtil` clamping methods into their own class `ClampUtil`
- Changed GroupId from `io.redstudioragnarok` to `dev.redstudio`
- Moved `startClientTicker` from `RedCore` to `RedClientTicker
- Moved `forceOptiFineFastRenderOff` from `RedCore` to `OptiNotFine`

### Removed

- Removed `pack.mcmeta`
- Removed `Stopwatch` :sob: it wasn't that good or useful but was fun to make

### Internal

- Switched to [gradle-buildconfig-plugin](https://github.com/gmazzo/gradle-buildconfig-plugin) entirely for project constants
- Switched to Gradle Kotlin DSL
- General cleanup

### Red Core MC

#### Changed

- Moved `startClientTicker` from `RedCore` to `RedClientTicker
- Moved `forceOptiFineFastRenderOff` from `RedCore` to `OptiNotFine`

#### Removed

- Removed `pack.mcmeta`

---

## Red Core Version 0.4 Changelog - 2023-09-07
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ Join us in enhancing Red-Core! We believe in constant evolution and the power of

Integrating Red-Core into your project is a straightforward process that involves tweaking your Gradle build script. Follow the steps below:

*Not up to date with 0.5 dev builds, README will be updated once 0.5 is released*

1. **Add a New Configuration:** Start by adding a new configuration to your Gradle build script, which will be used to download and attach sources.

```groovy
Expand Down
120 changes: 0 additions & 120 deletions build.gradle

This file was deleted.

81 changes: 81 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import org.jetbrains.gradle.ext.settings
import org.gradle.plugins.ide.idea.model.IdeaLanguageLevel
import org.jetbrains.gradle.ext.Gradle
import org.jetbrains.gradle.ext.runConfigurations

plugins {
id("org.jetbrains.kotlin.jvm") version embeddedKotlinVersion
id("org.jetbrains.gradle.plugin.idea-ext") version "1.1.7"
id("dev.redstudio.gradleembeder") version "1.0"
id("io.freefair.lombok") version "8.3"
id("maven-publish")
id("java-library")
}

allprojects {
apply(plugin = "org.jetbrains.gradle.plugin.idea-ext")
apply(plugin = "io.freefair.lombok")
apply(plugin = "java-library")
apply(plugin = "dev.redstudio.gradleembeder")
apply(plugin = "maven-publish")

group = "dev.redstudio"
version = "0.5-Dev-2" // Versioning must follow Ragnarök versioning convention: https://shor.cz/ragnarok_versioning_convention

repositories {
gradlePluginPortal()
}

idea {
module {
excludeDirs = setOf(
file(".github"), file(".gradle"), file(".idea"), file("build"), file("gradle"), file("run")
)
}
}

// Set the toolchain version to decouple the Java we run Gradle with from the Java used to compile and run the mod
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
// Azul covers the most platforms for Java 8 toolchains, crucially including macOS arm64
vendor.set(JvmVendorSpec.AZUL)
}
withJavadocJar()
}

tasks.withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
options.isFork = true
}
}

idea {
project {
settings {
jdkName = "1.8"
languageLevel = IdeaLanguageLevel("JDK_1_8")

runConfigurations {
create("MC Client", Gradle::class.java) {
taskNames = setOf("runClient")
}
create("MC Server", Gradle::class.java) {
taskNames = setOf("runServer")
}
create("MC Obfuscated Client", Gradle::class.java) {
taskNames = setOf("runObfClient")
}
create("MC Obfuscated Server", Gradle::class.java) {
taskNames = setOf("runObfServer")
}
create("MC Vanilla Client", Gradle::class.java) {
taskNames = setOf("runVanillaClient")
}
create("MC Vanilla Server", Gradle::class.java) {
taskNames = setOf("runVanillaServer")
}
}
}
}
}
31 changes: 31 additions & 0 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
plugins {
id("com.github.gmazzo.buildconfig") version "4.1.2"
}

val log4jVersion = "2.17.1"

dependencies {
embed("net.jafama", "jafama", "2.3.2")

compileOnly("org.apache.logging.log4j", "log4j-api", log4jVersion)
compileOnly("org.apache.logging.log4j", "log4j-core", log4jVersion)
}

buildConfig {
packageName(project.group.toString() + ".redcore")
className("ProjectConstants")

useJavaOutput()
buildConfigField("String", "NAME", provider { "\"Red Core\"" })
buildConfigField("String", "VERSION", provider { "\"${project.version}\"" })
buildConfigField("org.apache.logging.log4j.Logger", "LOGGER", "org.apache.logging.log4j.LogManager.getLogger(NAME)")
buildConfigField("dev.redstudio.redcore.logging.RedLogger", "RED_LOGGER", "new RedLogger(NAME, \"https://linkify.cz/RedCoreBugReport\", LOGGER)")
}

publishing.publications.register("redCore", MavenPublication::class) {
from(components["java"])

groupId = project.group.toString()
artifactId = "red-core"
version = project.version.toString()
}
Loading

0 comments on commit c45a53a

Please sign in to comment.