From 1be69e5326c0434df08f37903bda3d782fa6bbca Mon Sep 17 00:00:00 2001 From: "Daniel Doubrovkine (dB.)" Date: Wed, 9 Mar 2022 14:32:56 -0500 Subject: [PATCH] Remove JDK8 support and fix JDK17 build. (#129) --- .github/workflows/ci-17.yml | 40 ------------------------------------- .github/workflows/ci.yml | 2 +- build.gradle | 19 +++++++++--------- 3 files changed, 11 insertions(+), 50 deletions(-) delete mode 100644 .github/workflows/ci-17.yml diff --git a/.github/workflows/ci-17.yml b/.github/workflows/ci-17.yml deleted file mode 100644 index a6a8a1e2..00000000 --- a/.github/workflows/ci-17.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Build and Test -on: - push: - branches: - - "*" - pull_request: - branches: - - "*" - -jobs: - build: - - name: Build and Test (17) - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup Java 11 - uses: actions/setup-java@v2 - with: - distribution: 'temurin' - java-version: 11 - - - name: Build - run: | - ./gradlew build --build-cache - - - name: Setup Java 17 - uses: actions/setup-java@v2 - with: - distribution: 'temurin' - java-version: 17 - - - name: Test - run: | - ./gradlew test --build-cache - - diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e3e495c4..69e7573d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,9 +12,9 @@ jobs: strategy: matrix: java: - - 8 - 11 - 14 + - 17 name: Build and Test runs-on: ubuntu-latest diff --git a/build.gradle b/build.gradle index d92e0acf..5ab47cb4 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { ext { opensearch_group = "org.opensearch" opensearch_version = System.getProperty("opensearch.version", "2.0.0-SNAPSHOT") - kotlin_version = System.getProperty("kotlin.version", "1.4.32") + kotlin_version = System.getProperty("kotlin.version", "1.6.10") } repositories { @@ -21,7 +21,7 @@ buildscript { classpath "${opensearch_group}.gradle:build-tools:${opensearch_version}" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}" classpath "org.jetbrains.kotlin:kotlin-allopen:${kotlin_version}" - classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.17.1" + classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.20.0-RC1" } } @@ -50,7 +50,8 @@ allprojects { } } -sourceCompatibility = 1.8 +targetCompatibility = JavaVersion.VERSION_11 +sourceCompatibility = JavaVersion.VERSION_11 apply plugin: 'java' apply plugin: 'jacoco' @@ -70,15 +71,15 @@ dependencies { compileOnly "org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}" compileOnly "org.jetbrains.kotlin:kotlin-stdlib-common:${kotlin_version}" compileOnly "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3" // ${kotlin_version} does not work for coroutines - testCompile "org.opensearch.test:framework:${opensearch_version}" - testCompile "org.jetbrains.kotlin:kotlin-test:${kotlin_version}" - testCompile "org.mockito:mockito-core:3.10.0" + testImplementation "org.opensearch.test:framework:${opensearch_version}" + testImplementation "org.jetbrains.kotlin:kotlin-test:${kotlin_version}" + testImplementation "org.mockito:mockito-core:3.10.0" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.2' testImplementation 'org.mockito:mockito-junit-jupiter:3.10.0' testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0" testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.2' - ktlint "com.pinterest:ktlint:0.41.0" + ktlint "com.pinterest:ktlint:0.44.0" } test { @@ -126,13 +127,13 @@ task ktlintFormat(type: JavaExec, group: "formatting") { compileKotlin { kotlinOptions { freeCompilerArgs = ['-Xjsr305=strict'] - jvmTarget = "1.8" + jvmTarget = "11" } } compileTestKotlin { kotlinOptions { - jvmTarget = "1.8" + jvmTarget = "11" } }