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

Upgrade build system to support a minimum of Java 11 only #1344

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 2 additions & 6 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
# Some tests require more CPU, and all can use multiple CPUs
max-parallel: 1
matrix:
java: [ '8', '11', '17' ]
java: [ '11', '17' ]
name: Rhino Java ${{ matrix.java }}
steps:
- name: Checkout
Expand All @@ -31,11 +31,7 @@ jobs:
with:
java-version: ${{ matrix.java }}
distribution: 'adopt'
- if: matrix.java == '8'
name: Check everything with Gradle on Java 8
run: ./gradlew check jacocoTestReport
- if: matrix.java != '8'
name: Check everything with Gradle, modular Java
- name: Check everything with Gradle
run: >-
./gradlew check jacocoTestReport
-Dorg.gradle.jvmargs="--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
Expand Down
22 changes: 15 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ plugins {
id 'jacoco'
id 'distribution'
id 'checkstyle'
id 'com.diffplug.spotless' version "5.12.1"
id 'com.diffplug.spotless' version "5.13.0"
id 'com.github.spotbugs' version "4.7.1"
}

tasks.withType(JavaCompile) {
sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = 11
targetCompatibility = 11
options.encoding = "UTF-8"
options.compilerArgs = [ "-Xlint:deprecation,unchecked" ]
}
Expand Down Expand Up @@ -71,10 +71,8 @@ test {
exclude "**/benchmarks/**"

jvmArgs += '-Xss1280k'

if (JavaVersion.current() > JavaVersion.VERSION_1_8) {
jvmArgs += ['--add-opens', 'java.desktop/javax.swing.table=ALL-UNNAMED']
}
jvmArgs += ['--add-opens', 'java.base/java.util=ALL-UNNAMED']
jvmArgs += ['--add-opens', 'java.desktop/javax.swing.table=ALL-UNNAMED']

jacoco.excludes = ['**/testsrc_tests_ecma_3_RegExp_perlstress*']

Expand Down Expand Up @@ -441,6 +439,16 @@ spotbugs {
excludeFilter = file("./spotbugs-exclude.xml")
}

spotbugsMain {
reports {
html {
required = true
outputLocation = file("$buildDir/reports/spotbugs/main/spotbugs.html")
stylesheet = 'fancy-hist.xsl'
}
}
}

spotless {
java {
googleJavaFormat().aosp()
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
5 changes: 5 additions & 0 deletions spotbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@
<Class name="org.mozilla.javascript.optimizer.OptRuntime$GeneratorState"/>
<Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD"/>
</Match>
<Match>
<!-- Really old legacy stuff -->
<Class name="org.mozilla.javascript.ContextFactory$1GlobalSetterImpl"/>
<Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD"/>
</Match>
<!-- Complex legacy stuff -->
<!--<Match>
<Class name="org.mozilla.javascript.regexp.RegExpImpl"/>
Expand Down
Loading