Skip to content

Commit

Permalink
Port to 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrbysco committed Oct 13, 2024
1 parent 063e239 commit dfae8ee
Show file tree
Hide file tree
Showing 27 changed files with 549 additions and 508 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Thumbs.db

## ForgeGradle
/run
/runs

## eclipse
/.settings
Expand Down
92 changes: 33 additions & 59 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,86 +1,65 @@
plugins {
id 'java-library'
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'pmd'
id 'com.diffplug.spotless' version '5.12.5'
id 'net.minecraftforge.gradle' version '5.1.+'
id 'org.parchmentmc.librarian.forgegradle' version '1.+'
id 'org.spongepowered.mixin' version '0.7.+'
id 'com.diffplug.spotless' version '6.25.0'
id 'net.neoforged.gradle.userdev' version '7.0.165'
}

ext.configFile = file('build.properties')
ext.config = parseConfig(configFile)

version = "${config.version}-${config.build_number}"
group = "vazkii.${config.mod_id}" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = config.mod_name
base {
archivesName = config.mod_name
}

java.toolchain.languageVersion = JavaLanguageVersion.of(17)
java.toolchain.languageVersion = JavaLanguageVersion.of(21)

compileJava.options.compilerArgs << "-Xlint:all,-classfile,-processing,-deprecation" << "-Werror"

if (System.getenv('BUILD_NUMBER') != null) {
version += "." + System.getenv('BUILD_NUMBER')
}

minecraft {
// The mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD Snapshot are built nightly.
// stable_# Stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace.

mappings channel: "${config.mapping_channel}", version: "${config.mapping_version}"
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.

// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
runs {
client {
workingDirectory project.file('run')

// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'

// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'

mods {
akashictome {
source sourceSets.main
}
}
}
runs {
// applies to all the run configs below
configureEach {
// Recommended logging data for a userdev environment
systemProperty 'forge.logging.markers', 'REGISTRIES'

server {
workingDirectory project.file('run')
// Recommended logging level for the console
systemProperty 'forge.logging.console.level', 'debug'

// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
modSource project.sourceSets.main
}

// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
client {
}

mods {
akashictome {
source sourceSets.main
}
}
}
server {
programArgument '--nogui'
}
}

repositories {
maven {
url "https://cursemaven.com"
content {
includeGroup "curse.maven"
}
}
}

dependencies {
minecraft "net.minecraftforge:forge:${config.mc_version}-${config.forge_version}"
implementation fg.deobf("curse.maven:curios-309927:5367944")
implementation fg.deobf("curse.maven:patchouli-306770:4966125")
implementation fg.deobf("curse.maven:botania-225643:5594997")
implementation "net.neoforged:neoforge:${config.neo_version}"

implementation "curse.maven:curios-1037991:5765721"
implementation "curse.maven:patchouli-306770:5683901"
// implementation "curse.maven:botania-225643:5594997"
}

spotless {
Expand All @@ -96,11 +75,9 @@ spotless {
}

pmd {
toolVersion '6.22.0'
// no way around this warning unless we upgrade Gradle, apparently
//incrementalAnalysis.set(true)
ruleSets.clear()
ruleSetFiles = files("spotless/pmd-ruleset.xml")
toolVersion '6.35.0'
incrementalAnalysis.set(true)
ruleSetFiles = rootProject.files("spotless/pmd-ruleset.xml")
}

task checkSyntax (group: "verification") {
Expand All @@ -118,7 +95,7 @@ task incrementBuildNumber {

import java.util.regex.Pattern
task sortArtifacts(type: Copy) {
from jar.destinationDir
from jar.destinationDirectory
into config.dir_output
//Put each jar with a classifier in a subfolder with the classifier as its name
eachFile {
Expand All @@ -144,9 +121,6 @@ def parseConfig(File config) {
}

jar {
//rename the default output, for some better... sanity with scipts
archiveName = "${baseName}-${version}.${extension}"

manifest {
attributes([
"Specification-Title": "${config.mod_id}",
Expand Down
4 changes: 2 additions & 2 deletions build.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#Wed Aug 07 18:14:17 UTC 2024
mapping_channel=parchment
forge_version=47.2.0
neo_version=21.1.68
mod_id=akashictome
dir_repo=./
build_number=28
dir_output=../Build Output/AkashicTome/
mapping_version=2023.09.03-1.20.1
version=1.7
mod_name=AkashicTome
mc_version=1.20.1
mc_version=1.21.1
4 changes: 4 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 \
--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED

neogradle.subsystems.parchment.minecraftVersion=1.21
neogradle.subsystems.parchment.mappingsVersion=2024.07.28
neogradle.subsystems.conventions.runs.create-default-run-per-type=false
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
Loading

0 comments on commit dfae8ee

Please sign in to comment.