Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Architectury Loom 1.7 #220

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
24a3802
Bump version
modmuss50 Apr 10, 2024
befebfb
Merge remote-tracking branch 'origin/dev/1.6' into exp/1.7
modmuss50 Apr 15, 2024
b8da4e5
Update dependencies (#1089)
modmuss50 Apr 15, 2024
9a3b82c
Initial config caching work (#1053)
modmuss50 Apr 15, 2024
683a3ba
Merge remote-tracking branch 'origin/dev/1.6' into exp/1.7
modmuss50 Apr 25, 2024
1fac65c
Add test to prove closed zip filesystem issue (#1108)
modmuss50 Apr 26, 2024
2c3a0ad
Add manifest entry allowing deps to define known bsms (#1111)
modmuss50 Apr 26, 2024
2752dc3
Make Vineflower the default decompiler (#1110)
modmuss50 Apr 26, 2024
be1e207
Stop Gradle daemon after unrecoverable zip errors (#1113)
modmuss50 May 2, 2024
0b2d683
Improve error message when failing to parse fmj json.
modmuss50 May 4, 2024
cb2af08
Remove packages from log4j config
modmuss50 May 4, 2024
63ebc35
Improve how `include` configuration works (#1080)
lukebemish May 4, 2024
c5c52ab
Use different cache files for custom manifest and metadata jsons (#1077)
SpaceWalkerRS May 4, 2024
8ba38ef
Fix Mojang mappings with noIntermediateMappings (#1114)
modmuss50 May 5, 2024
5b7d598
More work towards config caching support (#1115)
modmuss50 May 5, 2024
e54d33a
Update tiny remapper
modmuss50 May 5, 2024
db65759
Experimental Sandbox support (#1107)
modmuss50 May 9, 2024
8110523
Add super classes to decompiler cache ClassEntry (#1118)
modmuss50 May 14, 2024
63214b4
Don't print warning about incorrect sources jar when there is no sour…
modmuss50 May 16, 2024
6c7ef44
Publish experimental versions to maven
modmuss50 May 17, 2024
e621e34
Don't publish snapshots for experimental versions
modmuss50 May 17, 2024
7c70a5f
Fix handling of classes with no package in CachedJarProcessor.
modmuss50 May 23, 2024
bee963b
Reset decompiler cache with refresh deps
modmuss50 May 23, 2024
ed8ca12
No longer trick gradle into thinking loom is signed. (#1123)
modmuss50 May 29, 2024
eacd6fb
Don't throw when loom was unable to stop the worker, as it may have a…
modmuss50 Jun 13, 2024
097fd98
Update to Gradle 8.8 (#1125)
modmuss50 Jun 14, 2024
2960fb7
Merge branch 'dev/1.7' into arch/1.7
Jab125 Jun 19, 2024
406bef8
some fixes
Jab125 Jun 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/publish-exp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish
on:
push:
branches:
- 'exp/**'

jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: setup jdk
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2

# Generate the build number based on tags to allow per branch build numbers, not something github provides by default.
- name: Generate build number
id: buildnumber
uses: onyxmueller/build-tag-number@v1
with:
token: ${{ secrets.github_token }}
prefix: "build/exp/${{ github.ref }}"

- run: ./gradlew build publish -x test --stacktrace
env:
MAVEN_URL: ${{ secrets.MAVEN_URL }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
EXPERIMENTAL: true
9 changes: 6 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ on:

jobs:
build:

runs-on: ubuntu-latest

runs-on: ubuntu-24.04
steps:
- name: setup jdk
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- name: Set up JDK 17
Expand Down
50 changes: 25 additions & 25 deletions .github/workflows/test-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@ concurrency:

jobs:
build:
strategy:
fail-fast: false
matrix:
version: [8.6.0-jdk17]
runs-on: ubuntu-22.04
container:
image: gradle:${{ matrix.version }}
options: --user root
runs-on: ubuntu-24.04
steps:
- name: setup jdk
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- run: gradle build check -x test --stacktrace --warning-mode fail
- run: ./gradlew build check -x test --stacktrace --warning-mode fail
- uses: Juuxel/publish-checkstyle-report@v1
if: ${{ failure() }}
with:
Expand All @@ -32,7 +30,7 @@ jobs:
- name: setup jdk
uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: 'temurin'
- uses: gradle/wrapper-validation-action@v2
- run: ./gradlew build check -x test --stacktrace --warning-mode fail
Expand All @@ -42,14 +40,16 @@ jobs:
# Lets wait to ensure it builds before going running tests
needs: build

runs-on: ubuntu-22.04
container:
image: gradle:8.6.0-jdk17
options: --user root
runs-on: ubuntu-24.04

steps:
- name: setup jdk
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
- uses: actions/checkout@v4
- run: gradle writeActionsTestMatrix --stacktrace --warning-mode fail
- run: ./gradlew writeActionsTestMatrix --stacktrace --warning-mode fail
-
id: set-matrix
run: echo "matrix=$(cat build/test_matrix.json)" >> $GITHUB_OUTPUT
Expand All @@ -63,17 +63,18 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [8.6.0-jdk17]
test: ${{ fromJson(needs.prepare_test_matrix.outputs.matrix) }}

runs-on: ubuntu-22.04
container:
image: gradle:${{ matrix.version }}
options: --user root
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4
- run: gradle printActionsTestName --name="${{ matrix.test }}" test --tests ${{ matrix.test }} --stacktrace --warning-mode fail
- name: setup jdk
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
- run: ./gradlew printActionsTestName --name="${{ matrix.test }}" test --tests ${{ matrix.test }} --stacktrace --warning-mode fail
env:
TEST_WARNING_MODE: fail
id: test
Expand All @@ -95,17 +96,16 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [17]
test: ${{ fromJson(needs.prepare_test_matrix.outputs.matrix) }}

runs-on: windows-2022

steps:
- uses: actions/checkout@v4
- name: setup jdk ${{ matrix.java }}
- name: setup jdk
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
java-version: 21
distribution: 'temurin'
- run: ./gradlew printActionsTestName --name="${{ matrix.test }}" test --tests ${{ matrix.test }} --stacktrace --warning-mode fail
env:
Expand All @@ -131,7 +131,7 @@ jobs:
fail-fast: false
matrix:
java: [ 17, 21 ]
os: [ windows-2022, ubuntu-22.04, macos-14 ]
os: [ windows-2022, ubuntu-24.04, macos-14 ]

runs-on: ${{ matrix.os }}
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
@SuppressWarnings("unused")
public class LoomGradlePluginBootstrap implements Plugin<PluginAware> {
private static final String MIN_SUPPORTED_GRADLE_VERSION = "8.6";
private static final String MIN_SUPPORTED_GRADLE_VERSION = "8.8";
private static final int MIN_SUPPORTED_MAJOR_JAVA_VERSION = 17;
private static final int MIN_SUPPORTED_MAJOR_IDEA_VERSION = 2021;

Expand Down

This file was deleted.

105 changes: 56 additions & 49 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ plugins {
id 'eclipse'
id 'groovy'
id 'checkstyle'
id 'jacoco'
id 'codenarc'
alias(libs.plugins.kotlin) apply false // Delay this so we can perform magic 🪄 first.
alias(libs.plugins.spotless)
Expand Down Expand Up @@ -50,15 +49,19 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
}

group = "dev.architectury"
def baseVersion = '1.6'
def baseVersion = '1.7'

def ENV = System.getenv()
def runNumber = ENV.GITHUB_RUN_NUMBER ?: "9999"

def isSnapshot = ENV.PR_NUM != null

if (!isSnapshot) {
version = baseVersion + "." + runNumber
if (ENV.EXPERIMENTAL) {
version = baseVersion + '.0-alpha.' + runNumber
} else {
version = baseVersion + '.' + runNumber
}
} else {
version = baseVersion + "-PR." + ENV.PR_NUM + "." + runNumber
}
Expand Down Expand Up @@ -92,11 +95,17 @@ configurations {
testRuntimeClasspath.extendsFrom bootstrap
}

configurations.all {
configurations.configureEach {
resolutionStrategy {
// I am sorry, for now
// failOnNonReproducibleResolution()
}

if (canBeConsumed) {
attributes {
attribute(GradlePluginApiVersion.GRADLE_PLUGIN_API_VERSION_ATTRIBUTE, objects.named(GradlePluginApiVersion, GradleVersion.current().getVersion()))
}
}
}

sourceSets {
Expand Down Expand Up @@ -299,20 +308,6 @@ gradlePlugin {
}
}

jacoco {
toolVersion = libs.versions.jacoco.get()
}

// Run to get test coverage.
jacocoTestReport {
dependsOn test
reports {
xml.required = false
csv.required = false
html.outputLocation = file("${layout.buildDirectory.get().asFile}/jacocoHtml")
}
}

test {
maxHeapSize = "2560m"
jvmArgs "-XX:+HeapDumpOnOutOfMemoryError"
Expand All @@ -331,6 +326,16 @@ test {
}
}

// Workaround https://github.com/gradle/gradle/issues/25898
tasks.withType(Test).configureEach {
jvmArgs = [
'--add-opens=java.base/java.lang=ALL-UNNAMED',
'--add-opens=java.base/java.util=ALL-UNNAMED',
'--add-opens=java.base/java.lang.invoke=ALL-UNNAMED',
'--add-opens=java.base/java.net=ALL-UNNAMED'
]
}


import org.gradle.api.internal.artifacts.configurations.ConfigurationRoles
import org.gradle.launcher.cli.KotlinDslVersion
Expand All @@ -342,36 +347,38 @@ import org.w3c.dom.Node
publishing {
publications {
if (isSnapshot) return
if (!ENV.EXPERIMENTAL) {

// Also publish a snapshot so people can use the latest version if they wish
snapshot(MavenPublication) { publication ->
groupId project.group
artifactId project.base.archivesName.get()
version baseVersion + '-SNAPSHOT'
// Also publish a snapshot so people can use the latest version if they wish
snapshot(MavenPublication) { publication ->
groupId project.group
artifactId project.base.archivesName.get()
version baseVersion + '-SNAPSHOT'

from components.java
}
from components.java
}

// Manually crate the plugin marker for snapshot versions
snapshotPlugin(MavenPublication) {
groupId 'dev.architectury.loom'
artifactId 'dev.architectury.loom.gradle.plugin'
version baseVersion + '-SNAPSHOT'

pom.withXml {
// Based off org.gradle.plugin.devel.plugins.MavenPluginPublishPlugin
Element root = asElement()
Document document = root.getOwnerDocument()
Node dependencies = root.appendChild(document.createElement('dependencies'))
Node dependency = dependencies.appendChild(document.createElement('dependency'))
Node groupId = dependency.appendChild(document.createElement('groupId'))
groupId.setTextContent(project.group)
Node artifactId = dependency.appendChild(document.createElement('artifactId'))
artifactId.setTextContent(project.archivesBaseName)
Node version = dependency.appendChild(document.createElement('version'))
version.setTextContent(baseVersion + '-SNAPSHOT')
// Manually crate the plugin marker for snapshot versions
snapshotPlugin(MavenPublication) {
groupId 'dev.architectury.loom'
artifactId 'dev.architectury.loom.gradle.plugin'
version baseVersion + '-SNAPSHOT'

pom.withXml {
// Based off org.gradle.plugin.devel.plugins.MavenPluginPublishPlugin
Element root = asElement()
Document document = root.getOwnerDocument()
Node dependencies = root.appendChild(document.createElement('dependencies'))
Node dependency = dependencies.appendChild(document.createElement('dependency'))
Node groupId = dependency.appendChild(document.createElement('groupId'))
groupId.setTextContent(project.group)
Node artifactId = dependency.appendChild(document.createElement('artifactId'))
artifactId.setTextContent(project.archivesBaseName)
Node version = dependency.appendChild(document.createElement('version'))
version.setTextContent(baseVersion + '-SNAPSHOT')
}
}
}
}
}

repositories {
Expand All @@ -388,7 +395,7 @@ publishing {
}

// Need to tweak this file to pretend we are compatible with j8 so the bootstrap will run.
tasks.withType(GenerateModuleMetadata) {
tasks.withType(GenerateModuleMetadata).configureEach {
doLast {
def file = outputFile.get().asFile

Expand All @@ -403,7 +410,7 @@ tasks.withType(GenerateModuleMetadata) {
}

// A task to output a json file with a list of all the test to run
task writeActionsTestMatrix() {
tasks.register('writeActionsTestMatrix') {
doLast {
def testMatrix = []
file('src/test/groovy/net/fabricmc/loom/test/integration').traverse {
Expand Down Expand Up @@ -450,7 +457,7 @@ tasks.named('wrapper') {
/**
* Run this task to download the gradle sources next to the api jar, you may need to manually attach the sources jar
*/
task downloadGradleSources() {
tasks.register('downloadGradleSources') {
doLast {
// Awful hack to find the gradle api location
def gradleApiFile = project.configurations.detachedConfiguration(dependencies.gradleApi()).files.stream()
Expand All @@ -472,13 +479,13 @@ tasks.withType(GenerateModuleMetadata) {
enabled = false
}

task printActionsTestName(type: PrintActionsTestName) {
tasks.register('printActionsTestName', PrintActionsTestName) {
}

/**
* Replaces invalid characters in test names for GitHub Actions artifacts.
*/
class PrintActionsTestName extends DefaultTask {
abstract class PrintActionsTestName extends DefaultTask {
@Input
@Option(option = "name", description = "The test name")
String testName
Expand Down
Loading
Loading