Skip to content

Commit

Permalink
Ported to 1.20.5... probably
Browse files Browse the repository at this point in the history
  • Loading branch information
LatvianModder committed Apr 28, 2024
1 parent 27d6d29 commit 667dd74
Show file tree
Hide file tree
Showing 389 changed files with 397 additions and 2,203 deletions.
492 changes: 191 additions & 301 deletions .editorconfig

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: Java CI
on:
push:
branches:
- "1.20.4/dev"
- "1.20.4/main"
- "main"
workflow_dispatch:
inputs:
norelease:
Expand All @@ -20,12 +19,12 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 30 # Gets the last 30 commits so the changelog might work
- name: Set up JDK 17
fetch-depth: 1
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
java-version: '21'
cache: gradle
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
Expand Down
12 changes: 4 additions & 8 deletions .kubejs/meta.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"minecraft": 2004,
"type": "architectury",
"minecraft": 2005,
"type": "neoforge",
"version": {
"file": "gradle.properties",
"pattern": "^mod_version=([\\w.]+)$",
Expand All @@ -9,12 +9,8 @@
},
"downloads": [
{
"name": "NeoForge",
"url": "https://maven.saps.dev/releases/dev/latvian/mods/rhino-neoforge/{version}/rhino-neoforge-{version}.jar"
},
{
"name": "Fabric",
"url": "https://maven.saps.dev/releases/dev/latvian/mods/rhino-fabric/{version}/rhino-fabric-{version}.jar"
"name": "Download",
"url": "https://maven.latvian.dev/releases/dev/latvian/mods/rhino/{version}/rhino-{version}.jar"
}
]
}
236 changes: 148 additions & 88 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,132 +2,192 @@ import java.time.Instant

plugins {
id 'base'
id 'architectury-plugin' version '3.4-SNAPSHOT'
id "dev.architectury.loom" version "1.4-SNAPSHOT" apply false
id "com.github.johnrengelman.shadow" version "7.0.0" apply false
id "me.shedaniel.unified-publishing" version "0.1.+" apply false
id 'java'
id 'maven-publish'
id "dev.architectury.loom" version "1.6-SNAPSHOT"
id "me.shedaniel.unified-publishing" version "0.1.+"
}

architectury {
minecraft = project.minecraft_version
injectInjectables = false
}
ext.ENV = System.getenv()

allprojects {
ext.ENV = System.getenv()
repositories {
mavenCentral()

repositories {
maven {
url "https://maven.architectury.dev/"
}
maven {
url "https://maven.architectury.dev/"
}

mavenLocal()
maven {
url "https://maven.latvian.dev/releases"
content {
includeGroup "dev.latvian.mods"
}
}

mavenLocal()
}

version = "${mod_version}-${ENV.GITHUB_RUN_NUMBER ? 'build.' + ENV.GITHUB_RUN_NUMBER : 'local.' + Instant.now().epochSecond}"
def isLocal = !ENV.containsKey("GITHUB_RUN_NUMBER")

version = "${mod_version}-${isLocal ? "local.${Instant.now().epochSecond}" : "build.${ENV.GITHUB_RUN_NUMBER}"}"
group = project.maven_group
base.archivesBaseName = project.archives_base_name

subprojects {
apply plugin: "java"
apply plugin: "dev.architectury.loom"
apply plugin: 'architectury-plugin'
apply plugin: "maven-publish"
apply from: "https://files.latmod.com/public/markdown-git-changelog.gradle"

version = rootProject.version
group = rootProject.group
base.archivesBaseName = rootProject.base.archivesBaseName
loom {
silentMojangMappingsLicense()

loom {
silentMojangMappingsLicense()
accessWidenerPath = file("src/main/resources/rhino.accesswidener")
interfaceInjection {
interfaceInjectionSourceSets.add sourceSets.main
}

compileJava {
options.encoding = "UTF-8"
options.release.set(17)
runs {
client {
if (ENV.MC_CLIENT_ARGS) {
programArgs ENV.MC_CLIENT_ARGS.split(' ')
}

vmArgs("-XX:+IgnoreUnrecognizedVMOptions", "-XX:+AllowEnhancedClassRedefinition")
runDir = 'run'
}

server {
runDir = 'run_server'
}
}
}

compileJava {
options.encoding = "UTF-8"
options.release.set(21)
}

java {
sourceCompatibility = targetCompatibility = '21'
withSourcesJar()
}

java {
sourceCompatibility = targetCompatibility = '17'
withSourcesJar()
repositories {
mavenLocal()
mavenCentral()

maven {
url "https://maven.architectury.dev/"
}

dependencies {
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
mappings loom.layered() {
officialMojangMappings()
// parchment("org.parchmentmc.data:parchment-1.17.1:2021.10.10")
maven {
url "https://maven.latvian.dev/releases"
content {
includeGroup "dev.latvian.mods"
}

// Unit Testing
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
}

test {
useJUnitPlatform()
maven {
url "https://maven.neoforged.net/releases"
}
}

subprojects {
if (project.path != ':common') {
apply plugin: "com.github.johnrengelman.shadow"
dependencies {
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
mappings loom.officialMojangMappings()

/*loom {
runConfigs.configureEach { ideConfigGenerated = true }
mods {
main { // to match the default mod generated for Forge
sourceSet project.sourceSets.main
sourceSet project(':common').sourceSets.main
}
}
}*/
neoForge("net.neoforged:neoforge:${rootProject.neoforge_version}")

configurations {
bundle {
canBeResolved(true)
canBeConsumed(false)
}
// Unit Testing
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
}

common
compileClasspath.extendsFrom common
runtimeClasspath.extendsFrom common
}
test {
useJUnitPlatform()
}

jar {
archiveClassifier.set "dev"
tasks {
processResources {
def toReplace = [
"version": project.version
]

println("[Process Resources] Replacing properties in resources: " + toReplace)

inputs.properties toReplace
filesMatching("META-INF/neoforge.mods.toml") {
expand toReplace
}
}
}

jar {
manifest {
attributes([
"Specification-Title" : project.mod_id,
"Specification-Vendor" : project.mod_author,
"Specification-Version" : "1",
"Implementation-Title" : project.name,
"Implementation-Version" : version,
"Implementation-Vendor" : project.mod_author,
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}

remapJar {
atAccessWideners.add "rhino.accesswidener"
}

shadowJar {
archiveClassifier.set "dev-shadow"
configurations = [
project.configurations.bundle
]
unifiedPublishing {
project {
releaseType = rootProject.artifact_type
gameVersions = Arrays.asList(rootProject.supported_versions.split(','))
gameLoaders = ["neoforge"]
displayName = "$mod_name NeoForge $project.version"
changelog = 'Changelog not available'
mainPublication remapJar

if (ENV.CURSEFORGE_KEY) {
curseforge {
token = ENV.CURSEFORGE_KEY
id = project.curseforge_id
}
}

remapJar {
dependsOn shadowJar
inputFile.set shadowJar.archiveFile
archiveBaseName.set "${rootProject.archives_base_name}-${project.name}"
archiveClassifier.set null
if (ENV.MODRINTH_TOKEN) {
modrinth {
token = ENV.MODRINTH_TOKEN
id = project.modrinth_id
version = "$project.version+$project.name"
}
}
}
}

task collectJars(type: Copy) {
subprojects {
if (project.path != ":common") {
def remapJar = project.tasks.named('remapJar')
dependsOn remapJar
from remapJar
publishing {
publications {
mavenNeoForge(MavenPublication) {
artifactId = "${rootProject.archives_base_name}-neoforge"
from components.java
}
}

into(buildDir.toPath().resolve("libs"))
}
repositories {
if (ENV.MAVEN_TOKEN) {
maven {
url "https://maven.latvian.dev/releases"
credentials {
username = "lat"
password = "${ENV.MAVEN_TOKEN}"
}
}
}

assemble {
dependsOn(collectJars)
if (ENV.SAPS_TOKEN) {
maven {
url "https://maven.saps.dev/releases"
credentials {
username = "latvian"
password = "${ENV.SAPS_TOKEN}"
}
}
}
}
}
42 changes: 0 additions & 42 deletions common/build.gradle

This file was deleted.

Loading

0 comments on commit 667dd74

Please sign in to comment.