Skip to content

Commit

Permalink
Update Gradle (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
modmuss50 authored Jun 19, 2024
1 parent a8254c7 commit d0a6ebd
Show file tree
Hide file tree
Showing 7 changed files with 293 additions and 225 deletions.
12 changes: 6 additions & 6 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]
runs-on: ubuntu-20.04
java: [17-jdk, 21-jdk]
runs-on: ubuntu-24.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-24.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
177 changes: 88 additions & 89 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 "me.modmuss50.remotesign" version "0.4.0"
id "io.github.goooler.shadow" version "8.1.7"
}

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 @@ -248,7 +250,6 @@ javadoc {
options {
docTitle 'Welcome to the Mixin Javadoc'
overview 'docs/javadoc/overview.html'
stylesheetFile file('docs/javadoc/mixin.css')
addBooleanOption '-allow-script-in-comments', true
}
doLast {
Expand Down Expand Up @@ -334,10 +335,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 @@ -440,7 +439,7 @@ task sourceJar(type: Jar) {
}

task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
from javadoc.destinationDir
archiveClassifier = "javadoc"
}

Expand All @@ -465,7 +464,7 @@ publishing {
publications {
developer(MavenPublication) { publication ->
groupId project.group
artifactId project.archivesBaseName
artifactId project.base.archivesName.get()
version project.version

artifact sourceJar
Expand Down Expand Up @@ -498,45 +497,45 @@ publishing {
}
}

pom {
name = "Fabric Mixin"
description = 'Fabric Mixin is a trait/mixin and bytecode weaving framework for Java using ASM.'
url = 'https://github.com/FabricMC/Mixin'

scm {
connection = "scm:git:https://github.com/FabricMC/Mixin.git"
developerConnection = "scm:git:git@github.com:FabricMC/Mixin.git"
url = "https://github.com/FabricMC/Mixin"
}

issueManagement {
system = "GitHub"
url = "https://github.com/FabricMC/Mixin/issues"
}

licenses {
license {
name = 'The MIT License'
url = 'https://raw.githubusercontent.com/FabricMC/Mixin/main/LICENSE.txt'
}
}

developers {
// Et. al. that arent in the fabric org on maven central

developer {
id = "modmuss50"
name = "modmuss50"
email = "modmuss50@fabricmc.net"
}

developer {
id = "sfPlayer"
name = "Player"
email = "player@fabricmc.net"
}
}
}
pom {
name = "Fabric Mixin"
description = 'Fabric Mixin is a trait/mixin and bytecode weaving framework for Java using ASM.'
url = 'https://github.com/FabricMC/Mixin'

scm {
connection = "scm:git:https://github.com/FabricMC/Mixin.git"
developerConnection = "scm:git:git@github.com:FabricMC/Mixin.git"
url = "https://github.com/FabricMC/Mixin"
}

issueManagement {
system = "GitHub"
url = "https://github.com/FabricMC/Mixin/issues"
}

licenses {
license {
name = 'The MIT License'
url = 'https://raw.githubusercontent.com/FabricMC/Mixin/main/LICENSE.txt'
}
}

developers {
// Et. al. that arent in the fabric org on maven central

developer {
id = "modmuss50"
name = "modmuss50"
email = "modmuss50@fabricmc.net"
}

developer {
id = "sfPlayer"
name = "Player"
email = "player@fabricmc.net"
}
}
}
}
}

Expand All @@ -551,24 +550,24 @@ publishing {
}
}

if (ENV.MAVEN_CENTRAL_URL) {
repositories.maven {
name "central"
url ENV.MAVEN_CENTRAL_URL
credentials {
username ENV.MAVEN_CENTRAL_USERNAME
password ENV.MAVEN_CENTRAL_PASSWORD
}
}
}
if (ENV.MAVEN_CENTRAL_URL) {
repositories.maven {
name "central"
url ENV.MAVEN_CENTRAL_URL
credentials {
username ENV.MAVEN_CENTRAL_USERNAME
password ENV.MAVEN_CENTRAL_PASSWORD
}
}
}
}
}

remoteSign {
requestUrl = ENV.SIGNING_SERVER
pgpAuthKey = ENV.SIGNING_PGP_KEY
useDummyForTesting = ENV.SIGNING_SERVER == null
sign publishing.publications.developer
requestUrl = ENV.SIGNING_SERVER
pgpAuthKey = ENV.SIGNING_PGP_KEY
useDummyForTesting = ENV.SIGNING_SERVER == null
sign publishing.publications.developer
}

// A task to ensure that the version being released has not already been released.
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 d0a6ebd

Please sign in to comment.