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

feat: Update Java version to 17 #13352

Merged
merged 6 commits into from
Feb 6, 2024
Merged
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
6 changes: 3 additions & 3 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: ['11', '14']
java: ['17']
env:
WORKSPACE: ${{ github.workspace }}
steps:
Expand Down Expand Up @@ -47,11 +47,11 @@ jobs:
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4
with:
distribution: 'adopt'
java-version: 11
java-version: 17
- name: Publish Artifacts (repo.grails.org)
id: publish
uses: gradle/gradle-build-action@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/groovy-joint-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
~/.m2/repository
key: cache-local-groovy-maven-${{ github.sha }}
- name: Checkout Groovy 3_0_X (Grails 5 and later)
if: startsWith(github.ref, 'refs/heads/6.') || startsWith(github.base_ref, '6.') || startsWith(github.ref, 'refs/heads/5.') || startsWith(github.base_ref, '5.')
if: startsWith(github.ref, 'refs/heads/7.') || startsWith(github.base_ref, '7.') || startsWith(github.ref, 'refs/heads/6.') || startsWith(github.base_ref, '6.') || startsWith(github.ref, 'refs/heads/5.') || startsWith(github.base_ref, '5.')
run: cd .. && git clone --depth 1 https://github.com/apache/groovy.git -b GROOVY_3_0_X --single-branch
- name: Set CI_GROOVY_VERSION for Grails
id: groovy-version
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '11'
java-version: '17'
- name: Cache local Maven repository & Groovy
uses: actions/cache@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '11'
java-version: '17'
- name: Extract Target Branch
id: extract_branch
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/retry-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4
with:
distribution: 'adopt'
java-version: 11
java-version: 17
- name: Extract Target Branch
id: extract_branch
run: |
Expand Down
22 changes: 14 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,8 @@ subprojects { project ->
if(project.name == 'grails-dependencies') return
if(project.name == 'grails-bom') return

sourceCompatibility = "1.11"
targetCompatibility = "1.11"
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

if(project.name =~ /^(grails-web|grails-plugin-|grails-test-suite|grails-test)/) {
dependencies {
Expand Down Expand Up @@ -533,11 +533,17 @@ subprojects { project ->
}
}

def debugArguments = ['-Xmx2g', '-Xdebug', '-Xnoagent', '-Djava.compiler=NONE',
'-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005']

tasks.withType(Test) {
def debugArguments = [
'-Xmx2g', '-Xdebug', '-Xnoagent', '-Djava.compiler=NONE',
'-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005'
]
def java17moduleReflectionCompatibilityArguments = [
'--add-opens=java.base/java.lang=ALL-UNNAMED',
'--add-opens=java.base/java.util=ALL-UNNAMED'
]
tasks.withType(Test).configureEach {
useJUnitPlatform()
jvmArgs += java17moduleReflectionCompatibilityArguments
}

test {
Expand Down Expand Up @@ -566,14 +572,14 @@ subprojects { project ->
maxHeapSize = '1024m'
}
if(System.getProperty("debug.tests")) {
jvmArgs debugArguments
jvmArgs += debugArguments
}
}

task singleTest(type: Test) {
// task for running a single test with -DsingleTest.single=TestName singleTest
if(System.getProperty("debug.tests")) {
jvmArgs debugArguments
jvmArgs += debugArguments
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class GrailsUtilTests {

@Test
public void testGrailsVersion() {
assertEquals("6.2.0-SNAPSHOT", GrailsUtil.getGrailsVersion());
assertEquals("7.0.0-SNAPSHOT", GrailsUtil.getGrailsVersion());
}

@AfterEach
Expand Down
Loading