Skip to content

Commit

Permalink
Update Gradle (#117)
Browse files Browse the repository at this point in the history
* Update Gradle

* Update docker image

* Remove Java 8, spotless doesnt support it.

* Include history

* Maybe fix?

* remove ratchetFrom

* Spotlesss apply
  • Loading branch information
modmuss50 authored Nov 26, 2023
1 parent 160a64b commit e8c6caf
Show file tree
Hide file tree
Showing 11 changed files with 230 additions and 133 deletions.
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
tab_width = 4

[*.gradle]
indent_style = tab

[*.java]
indent_style = tab
ij_continuation_indent_size = 8
ij_java_imports_layout = $*,|,java.**,|,javax.**,|,*,|,net.minecraft.**,|,net.fabricmc.**
ij_java_class_count_to_use_import_on_demand = 999

[.editorconfig]
indent_style = space
indent_size = 4
10 changes: 6 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ jobs:
build:
strategy:
matrix:
java: [8-jdk, 11-jdk, 16-jdk]
runs-on: ubuntu-20.04
java: [11-jdk, 17-jdk, 21-jdk]
runs-on: ubuntu-22.04
container:
image: openjdk:${{ matrix.java }}
image: eclipse-temurin:${{ matrix.java }}
options: --user root
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: gradle/wrapper-validation-action@v1
- run: chmod +x ./gradlew
- run: ./gradlew build test --stacktrace
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ name: Release
on: [workflow_dispatch] # Manual trigger
jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
container:
image: openjdk:16-jdk
image: eclipse-temurin:21-jdk
options: --user root
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: gradle/wrapper-validation-action@v1
- run: chmod +x ./gradlew
- run: ./gradlew checkVersion build publish --stacktrace
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
.idea/
!src/test/resources/**
/tiny-remapper/
/out/
20 changes: 12 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ plugins {
id 'java-library'
id 'maven-publish'
id 'checkstyle'
id 'com.diffplug.spotless' version '5.14.2'
id 'com.github.johnrengelman.shadow' version '6.1.0'
id 'com.diffplug.spotless' version '6.22.0'
id 'com.github.johnrengelman.shadow' version '8.1.1'
}

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

version = '0.8.11'

def ENV = System.getenv()
version = version + (ENV.GITHUB_ACTIONS ? "" : "+local")

group = 'net.fabricmc'
archivesBaseName = 'tiny-remapper'

base {
archivesName = 'tiny-remapper'
}

repositories {
mavenCentral()
Expand All @@ -33,6 +33,8 @@ dependencies {

java {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

tasks.withType(JavaCompile).configureEach {
Expand Down Expand Up @@ -70,10 +72,12 @@ checkstyle {
}

spotless {
ratchetFrom 'origin/master'

java {
licenseHeaderFile(rootProject.file('HEADER')).yearSeparator(', ')
removeUnusedImports()
importOrder('java', 'javax', '', 'net.minecraft', 'net.fabricmc')
indentWithTabs()
trimTrailingWhitespace()
}
}

Expand Down
2 changes: 1 addition & 1 deletion checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

<module name="ImportOrder">
<property name="groups" value="java,javax,*,net.minecraft,net.fabricmc"/>
<property name="ordered" value="false"/><!-- the plugin orders alphabetically without considering separators.. -->
<property name="ordered" value="true"/>
<property name="separated" value="true"/>
<property name="option" value="top"/>
<property name="sortStaticImportsAlphabetically" value="true"/>
Expand Down
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-7.3.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit e8c6caf

Please sign in to comment.