Skip to content

Commit

Permalink
Merge pull request #328 from JordonPhillips/jdk-17
Browse files Browse the repository at this point in the history
Use JDK 17
  • Loading branch information
skmcgrail committed Sep 16, 2021
2 parents 565695c + 8fdd103 commit a6145d1
Show file tree
Hide file tree
Showing 13 changed files with 208 additions and 172 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/codegen.yml
Expand Up @@ -13,17 +13,24 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
java-version: ['11', '8']
go-version: [1.17]
env:
JAVA_TOOL_OPTIONS: "-Xmx2g"
steps:
- uses: actions/checkout@v2

- uses: actions/setup-java@v2
- name: Download Coretto 17 JDK
run: |
download_url="https://corretto.aws/downloads/latest/amazon-corretto-17-x64-linux-jdk.tar.gz"
wget -O $RUNNER_TEMP/java_package.tar.gz $download_url
- name: Set up Coretto 17 JDK
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: ${{ matrix.java-version }}
distribution: 'jdkfile'
jdkFile: ${{ runner.temp }}/java_package.tar.gz
java-version: 17
architecture: x64

- uses: actions/setup-go@v2
with:
Expand Down
31 changes: 15 additions & 16 deletions codegen/build.gradle.kts
Expand Up @@ -19,8 +19,8 @@ plugins {
signing
checkstyle
jacoco
id("com.github.spotbugs") version "1.6.10"
id("io.codearte.nexus-staging") version "0.21.0"
id("com.github.spotbugs") version "4.7.4"
id("io.codearte.nexus-staging") version "0.30.0"
}

allprojects {
Expand Down Expand Up @@ -72,8 +72,9 @@ subprojects {
apply(plugin = "java-library")

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}

tasks.withType<JavaCompile> {
Expand All @@ -87,10 +88,10 @@ subprojects {

// Apply junit 5 and hamcrest test dependencies to all java projects.
dependencies {
testCompile("org.junit.jupiter:junit-jupiter-api:5.4.0")
testRuntime("org.junit.jupiter:junit-jupiter-engine:5.4.0")
testCompile("org.junit.jupiter:junit-jupiter-params:5.4.0")
testCompile("org.hamcrest:hamcrest:2.1")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.4.0")
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.4.0")
testCompileOnly("org.junit.jupiter:junit-jupiter-params:5.4.0")
testImplementation("org.hamcrest:hamcrest:2.1")
}

// Reusable license copySpec
Expand Down Expand Up @@ -139,7 +140,7 @@ subprojects {
publishing {
repositories {
mavenCentral {
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
url = uri("https://aws.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = sonatypeUser
password = sonatypePassword
Expand Down Expand Up @@ -245,13 +246,11 @@ subprojects {
tasks["spotbugsTest"].enabled = false

// Configure the bug filter for spotbugs.
tasks.withType<com.github.spotbugs.SpotBugsTask> {
effort = "max"
excludeFilterConfig = project.resources.text.fromFile("${project.rootDir}/config/spotbugs/filter.xml")
reports {
xml.setEnabled(false)
html.setEnabled(true)
}
tasks.withType<com.github.spotbugs.snom.SpotBugsTask>().configureEach {
effort.set(com.github.spotbugs.snom.Effort.MAX)
excludeFilter.set(file("${project.rootDir}/config/spotbugs/filter.xml"))
reports.maybeCreate("xml").isEnabled = false
reports.maybeCreate("html").isEnabled = true
}
}
}
36 changes: 17 additions & 19 deletions codegen/config/checkstyle/checkstyle.xml
Expand Up @@ -15,11 +15,11 @@
-->

<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">

<module name="Checker">
<module name="SuppressWarningsFilter" />
<module name="SuppressWarningsFilter"/>

<module name="SuppressionFilter">
<property name="file" value="${config_loc}/suppressions.xml"/>
Expand All @@ -32,11 +32,19 @@
<!-- Files must contain a copyright header. -->
<module name="RegexpHeader">
<property name="header"
value="/*\n * Copyright \d\d\d\d Amazon.com, Inc. or its affiliates. All Rights Reserved.\n"/>
value="/\*\n \* Copyright 202\d Amazon\.com, Inc\. or its affiliates\. All Rights Reserved\.\n"/>
<property name="fileExtensions" value="java"/>
</module>

<module name="NewlineAtEndOfFile"/>
<module name="NewlineAtEndOfFile">
<property name="lineSeparator" value="lf_cr_crlf"/>
</module>

<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="LineLength">
<property name="max" value="${checkstyle.linelength}" default="120"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
</module>

<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
Expand All @@ -51,13 +59,6 @@
<module name="SuppressWarningsHolder"/>
<module name="SuppressionCommentFilter"/>

<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="LineLength">
<property name="max" value="${checkstyle.linelength}" default="120"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
</module>

<!-- Checks for imports -->
<!-- See http://checkstyle.sf.net/config_import.html -->
<module name="NoLineWrap"/>
Expand All @@ -79,12 +80,8 @@
<module name="JavadocMethod">
<property name="scope" value="public"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingThrowsTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="minLineCount" value="2"/>
<property name="allowedAnnotations" value="Override, Test"/>
<property name="allowThrowsTagsForSubclasses" value="true"/>
<property name="allowMissingJavadoc" value="true"/>
</module>
<module name="JavadocStyle"/>
<module name="NonEmptyAtclauseDescription"/>
Expand Down Expand Up @@ -155,7 +152,9 @@
<property name="tokens" value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
</module>
<module name="LeftCurly"/>
<module name="NeedBraces"/>
<module name="NeedBraces">
<property name="allowEmptyLoopBody" value="true"/>
</module>
<module name="RightCurly">
<property name="id" value="RightCurlySame"/>
<property name="tokens"
Expand All @@ -165,12 +164,11 @@
<property name="id" value="RightCurlyAlone"/>
<property name="option" value="alone"/>
<property name="tokens"
value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT, INSTANCE_INIT"/>
value="CLASS_DEF, METHOD_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT, INSTANCE_INIT"/>
</module>

<!-- Checks for common coding problems -->
<!-- See http://checkstyle.sf.net/config_coding.html -->
<module name="EmptyStatement"/>
<module name="EqualsHashCode"/>
<module name="IllegalInstantiation"/>
<module name="InnerAssignment"/>
Expand Down
4 changes: 2 additions & 2 deletions codegen/config/checkstyle/suppressions.xml
Expand Up @@ -15,7 +15,7 @@
-->

<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
<suppressions>
</suppressions>
2 changes: 1 addition & 1 deletion codegen/config/spotbugs/filter.xml
Expand Up @@ -22,6 +22,6 @@

<!-- Exceptions aren't going to be serialized. -->
<Match>
<Bug pattern="SE_NO_SERIALVERSIONID,SE_BAD_FIELD"/>
<Bug pattern="SE_NO_SERIALVERSIONID,SE_BAD_FIELD,EI_EXPOSE_REP,EI_EXPOSE_REP2"/>
</Match>
</FindBugsFilter>
Binary file modified codegen/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion codegen/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit a6145d1

Please sign in to comment.