Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/exp/1.5' into include-bom
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/java/net/fabricmc/loom/configuration/CompileConfiguration.java
  • Loading branch information
modmuss50 committed Dec 15, 2023
2 parents df7e027 + f2e8ff2 commit d3131fb
Show file tree
Hide file tree
Showing 280 changed files with 11,725 additions and 4,645 deletions.
40 changes: 2 additions & 38 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,38 +1,2 @@
# Handle line endings automatically for files detected as text
# and leave all files detected as binary untouched.
* text=auto

*.patch text eol=lf

#
# The above will handle all files NOT found below
#
# These files are text and should be normalized (Convert crlf => lf)
*.css text
*.df text
*.htm text
*.html text
*.java text
*.js text
*.json text
*.jsp text
*.jspf text
*.properties text
*.sh text
*.tld text
*.txt text
*.xml text

# These files are binary and should be left untouched
# (binary is a macro for -text -diff)
*.class binary
*.dll binary
*.ear binary
*.gif binary
*.ico binary
*.jar binary
*.jpg binary
*.jpeg binary
*.png binary
*.so binary
*.war binary
* text=auto eol=lf
*.bat text eol=crlf
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ jobs:
image: eclipse-temurin:17-jdk
options: --user root
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v1

# 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: einaregilsson/build-number@v3
uses: onyxmueller/build-tag-number@v1
with:
token: ${{ secrets.github_token }}
prefix: ${{ github.ref }}
prefix: "build/${{ github.ref }}"

- run: ./gradlew build publish -x test --stacktrace
env:
Expand Down
44 changes: 33 additions & 11 deletions .github/workflows/test-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,40 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [7.5.1-jdk17]
version: [8.3.0-jdk17]
runs-on: ubuntu-22.04
container:
image: gradle:${{ matrix.version }}
options: --user root
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v1
- run: gradle build check -x test --stacktrace --warning-mode fail

build_windows:
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- name: setup jdk
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
- uses: gradle/wrapper-validation-action@v1
- run: ./gradlew build check -x test --stacktrace --warning-mode fail

# This job is used to feed the test matrix of next job to allow the tests to run in parallel
prepare_test_matrix:
# Lets wait to ensure it builds before going running tests
needs: build

runs-on: ubuntu-22.04
container:
image: gradle:7.5.1-jdk17
image: gradle:8.3.0-jdk17
options: --user root

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: gradle writeActionsTestMatrix --stacktrace --warning-mode fail
-
id: set-matrix
Expand All @@ -46,7 +58,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [7.5.1-jdk17]
version: [8.3.0-jdk17]
test: ${{ fromJson(needs.prepare_test_matrix.outputs.matrix) }}

runs-on: ubuntu-22.04
Expand All @@ -55,7 +67,7 @@ jobs:
options: --user root

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: gradle printActionsTestName --name="${{ matrix.test }}" test --tests ${{ matrix.test }} --stacktrace --warning-mode fail
env:
TEST_WARNING_MODE: fail
Expand All @@ -66,6 +78,11 @@ jobs:
with:
name: ${{ steps.test.outputs.test }} Results
path: build/reports/
- uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: ${{ steps.test.outputs.test }} Heap Dump
path: "*.hprof"

run_tests_windows:
needs: prepare_test_matrix
Expand All @@ -79,9 +96,9 @@ jobs:
runs-on: windows-2022

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
Expand All @@ -95,6 +112,11 @@ jobs:
with:
name: ${{ steps.test.outputs.test }} (${{ matrix.java }}) Results (Windows)
path: build/reports/
- uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: ${{ steps.test.outputs.test }} Heap Dump (Windows)
path: "*.hprof"

# Special case this test to run across all os's
reproducible_build_test:
Expand All @@ -103,13 +125,13 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [ 17, 18 ]
java: [ 17, 20 ]
os: [ windows-2022, ubuntu-22.04, macos-12 ]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@
!/Jenkinsfile
!/checkstyle.xml
!/codenarc.groovy
!/bootstrap
!/bootstrap

/src/**/generated
6 changes: 4 additions & 2 deletions bootstrap/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ plugins {
id 'groovy'
}

sourceCompatibility = 8
targetCompatibility = 8
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
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 int MIN_SUPPORTED_MAJOR_GRADLE_VERSION = 7;
private static final String MIN_SUPPORTED_GRADLE_VERSION = "8.3";
private static final int MIN_SUPPORTED_MAJOR_JAVA_VERSION = 17;
private static final int MIN_SUPPORTED_MAJOR_IDEA_VERSION = 2021;

Expand All @@ -40,7 +40,7 @@ private void validateEnvironment() {
List<String> errors = new ArrayList<>();

if (!isValidGradleRuntime()) {
errors.add(String.format("You are using an outdated version of Gradle (%s). Gradle %d or higher is required.", GradleVersion.current().getVersion(), MIN_SUPPORTED_MAJOR_GRADLE_VERSION));
errors.add(String.format("You are using an outdated version of Gradle (%s). Gradle %s or higher is required.", GradleVersion.current().getVersion(), MIN_SUPPORTED_GRADLE_VERSION));
}

if (!isValidJavaRuntime()) {
Expand Down Expand Up @@ -73,7 +73,7 @@ private static boolean isValidJavaRuntime() {
}

private static boolean isValidGradleRuntime() {
return getMajorGradleVersion() >= MIN_SUPPORTED_MAJOR_GRADLE_VERSION;
return GradleVersion.current().compareTo(GradleVersion.version(MIN_SUPPORTED_GRADLE_VERSION)) >= 0;
}

private static boolean isValidIdeaRuntime() {
Expand All @@ -87,11 +87,6 @@ private static boolean isValidIdeaRuntime() {
return ideaYear >= MIN_SUPPORTED_MAJOR_IDEA_VERSION;
}

private static int getMajorGradleVersion() {
String version = GradleVersion.current().getVersion();
return Integer.parseInt(version.substring(0, version.indexOf(".")));
}

BootstrappedPlugin getActivePlugin() {
try {
return (BootstrappedPlugin) Class.forName(PLUGIN_CLASS_NAME).getConstructor().newInstance();
Expand Down
Loading

0 comments on commit d3131fb

Please sign in to comment.