Skip to content

Commit

Permalink
Remove inner class in mixin (#7)
Browse files Browse the repository at this point in the history
* Update BS

* Disable ktfmt since it doesn't support JVM 8

* Apply spotless

* Remove inner class in TableBlockMixin

Fixes crash with various coremods.

* Port old buildscript's Kotlin patches to addon & dependencies.gradle

* Fix refmap not getting added to jar
  • Loading branch information
makamys authored Dec 14, 2022
1 parent 5739206 commit 9da80d8
Show file tree
Hide file tree
Showing 52 changed files with 1,085 additions and 210 deletions.
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@ trim_trailing_whitespace = true
[*.{bat,ini}]
end_of_line = crlf

[*.{dtd,json,mcmeta,md,sh,svg,xml,xsd,xsl,yaml,yml}]
[*.{dtd,json,info,mcmeta,md,sh,svg,xml,xsd,xsl,yaml,yml}]
indent_size = 2

[*.lang]
trim_trailing_whitespace = false
44 changes: 44 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
* text eol=lf

*.[jJ][aA][rR] binary

*.[pP][nN][gG] binary
*.[jJ][pP][gG] binary
*.[jJ][pP][eE][gG] binary
*.[gG][iI][fF] binary
*.[tT][iI][fF] binary
*.[tT][iI][fF][fF] binary
*.[iI][cC][oO] binary
*.[sS][vV][gG] text
*.[eE][pP][sS] binary
*.[xX][cC][fF] binary

*.[kK][aA][rR] binary
*.[mM]4[aA] binary
*.[mM][iI][dD] binary
*.[mM][iI][dD][iI] binary
*.[mM][pP]3 binary
*.[oO][gG][gG] binary
*.[rR][aA] binary

*.7[zZ] binary
*.[gG][zZ] binary
*.[tT][aA][rR] binary
*.[tT][gG][zZ] binary
*.[zZ][iI][pP] binary

*.[tT][cC][nN] binary
*.[sS][oO] binary
*.[dD][lL][lL] binary
*.[dD][yY][lL][iI][bB] binary
*.[pP][sS][dD] binary
*.[tT][tT][fF] binary
*.[oO][tT][fF] binary

*.[pP][aA][tT][cC][hH] -text

*.[bB][aA][tT] text eol=crlf
*.[cC][mM][dD] text eol=crlf
*.[pP][sS]1 text eol=crlf

*[aA][uU][tT][oO][gG][eE][nN][eE][rR][aA][tT][eE][dD]* binary
12 changes: 12 additions & 0 deletions .github/scripts/update_version
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

if ! git diff --name-only HEAD HEAD~1 | grep -qF 'build.gradle'; then
new_version="$(date +%s)"
sed --in-place "s!^//version:.*!//version: $new_version!g" build.gradle
git add build.gradle
git commit -m "[ci skip] update build script version to $new_version"
git push
printf 'Updated buildscript version to %s\n' "$new_version"
else
printf 'Ignored buildscript version update: no changes detected\n'
fi
19 changes: 19 additions & 0 deletions addon.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'com.github.gmazzo.buildconfig'
apply plugin: 'org.jetbrains.kotlin.kapt'

compileKotlin {
kotlinOptions {
Expand All @@ -12,3 +13,21 @@ buildConfig {
buildConfigField('String', 'MODVER', "\"${project.modVersion}\"")
useKotlinOutput { topLevelConstants = true }
}

if (usesMixins.toBoolean()) {
def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json'
def refMap = "${tasks.compileJava.temporaryDir}" + File.separator + mixingConfigRefMap
def mixinSrg = "${tasks.reobf.temporaryDir}" + File.separator + "mixins.srg"

kapt {
correctErrorTypes = true
javacOptions {
option("-AreobfSrgFile=${tasks.reobf.srg}")
option("-AoutSrgFile=$mixinSrg")
option("-AoutRefMapFile=$refMap")
}
}
jar {
from refMap
}
}
Loading

0 comments on commit 9da80d8

Please sign in to comment.