Skip to content

Commit

Permalink
Update Gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
modmuss50 committed Jun 19, 2024
1 parent a8254c7 commit 1399410
Show file tree
Hide file tree
Showing 7 changed files with 237 additions and 168 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [8-jdk, 11-jdk, 16-jdk, 17-jdk]
java: [8-jdk, 11-jdk, 16-jdk, 17-jdk, 21-jdk]
runs-on: ubuntu-20.04
container:
image: openjdk:${{ matrix.java }}
image: eclipse-temurin:${{ matrix.java }}
options: --user root
steps:
- uses: actions/checkout@v1
- uses: gradle/wrapper-validation-action@v1
- run: ./gradlew build publishToMavenLocal --stacktrace
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- run: ./gradlew build publishToMavenLocal --stacktrace --warning-mode fail
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: Release
on: [workflow_dispatch] # Manual trigger
jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
container:
image: openjdk:17-jdk
image: eclipse-temurin:21-jdk
options: --user root
steps:
- uses: actions/checkout@v1
- uses: gradle/wrapper-validation-action@v1
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- run: ./gradlew checkVersion build publish --stacktrace
env:
MAVEN_URL: ${{ secrets.MAVEN_URL }}
Expand Down
66 changes: 33 additions & 33 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ buildscript {
}
dependencies {
classpath 'gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:0.16.1'
classpath 'gradle.plugin.com.github.jengelman.gradle.plugins:shadow:7.0.0'
classpath 'com.guardsquare:proguard-gradle:' + (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_11) ? '7.2.0' : '7.1.0')
classpath 'com.guardsquare:proguard-gradle:' + (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_11) ? '7.5.0' : '7.1.0')
}
}

plugins {
id "me.modmuss50.remotesign" version "0.4.0"
id "com.github.johnrengelman.shadow" version "8.1.1"
}

import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
Expand All @@ -24,17 +24,18 @@ apply plugin: 'checkstyle'
apply plugin: 'maven-publish'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'potemkin-modules'

// Default tasks
defaultTasks 'licenseFormat', 'check', 'build'

// Basic project information
group = 'net.fabricmc'
archivesBaseName = 'sponge-mixin'
version = buildVersion + "+mixin." + upstreamMixinVersion

base {
archivesName = 'sponge-mixin'
}

def ENV = System.getenv()
if (!ENV.CI) {
Expand All @@ -50,12 +51,13 @@ ext.packaging = 'jar'
ext.asmVersion = project.hasProperty("asmVersion") ? asmVersion : '9.0'
ext.legacyForgeAsmVersion = project.hasProperty("legacyForgeAsmVersion") ? asmVersion : '5.0.3'

// Minimum version of Java required
sourceCompatibility = '1.8'
targetCompatibility = '1.8'

java {
modularity.inferModulePath = false
disableAutoTargetJvm()

// Minimum version of Java required
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}

// Project repositories
Expand All @@ -76,26 +78,6 @@ repositories {
}
}

configurations {
stagingJar

exampleImplementation .extendsFrom implementation
fernflowerImplementation .extendsFrom implementation
launchwrapperImplementation .extendsFrom implementation
agentImplementation .extendsFrom implementation
modlauncherImplementation .extendsFrom implementation
modlauncher9Implementation .extendsFrom modlauncherImplementation
modularityImplementation .extendsFrom modlauncher9Implementation
modularityCompileOnly .extendsFrom compileOnly

proguard {
extendsFrom fernflowerImplementation
extendsFrom launchwrapperImplementation
extendsFrom modlauncherImplementation
extendsFrom compileClasspath
}
}

sourceSets {
legacy {
ext.languageVersion = 8
Expand Down Expand Up @@ -164,6 +146,26 @@ sourceSets {
modularityDummy {}
}

configurations {
stagingJar

exampleImplementation .extendsFrom implementation
fernflowerImplementation .extendsFrom implementation
launchwrapperImplementation .extendsFrom implementation
agentImplementation .extendsFrom implementation
modlauncherImplementation .extendsFrom implementation
modlauncher9Implementation .extendsFrom modlauncherImplementation
modularityImplementation .extendsFrom modlauncher9Implementation
modularityCompileOnly .extendsFrom compileOnly

proguard {
extendsFrom fernflowerImplementation
extendsFrom launchwrapperImplementation
extendsFrom modlauncherImplementation
extendsFrom compileClasspath
}
}

// Because Mixin aims to support a variety of environments, we have to be able to run with older versions of GSON and Guava that lack official module
// names. This means the same library may appear with multiple module names. We want to be able to link our module with either of these two at
// runtime, without having to have two versions of the library on our compile-time module path. To do this, we generate empty "potemkin" jars with
Expand Down Expand Up @@ -334,10 +336,8 @@ tasks.withType(JavaCompile) {
def modularityInputs = objects.fileCollection()

project.sourceSets.each { set -> {
if (set.ext.has("languageVersion")) {
project.tasks[set.compileJavaTaskName].javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(set.ext.languageVersion)
}
if (set.ext.has("languageVersion") && JavaVersion.current().isJava9Compatible()) {
project.tasks[set.compileJavaTaskName].options.release = set.ext.languageVersion
}
if (set.ext.has("compatibility")) {
project.tasks[set.compileJavaTaskName].sourceCompatibility = set.ext.compatibility
Expand Down Expand Up @@ -465,7 +465,7 @@ publishing {
publications {
developer(MavenPublication) { publication ->
groupId project.group
artifactId project.archivesBaseName
artifactId project.base.archivesName.get()
version project.version

artifact sourceJar
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.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 1399410

Please sign in to comment.