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

Extend JDK versions matrix #83

Merged
merged 1 commit into from
May 9, 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
26 changes: 18 additions & 8 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,28 @@ jobs:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
java:
- 14
- 17
- 21
name: Build and Test Plugin Template
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: temurin

- name: Build and Run Tests
run: |
- name: Build and Run Tests
run: |
./gradlew build
# Generated by 'opensearch.pluginzip' custom gradle plugin
./gradlew publishPluginZipPublicationToZipStagingRepository
- name: Update version to the next development iteration
if: matrix.os != 'windows-latest'
run: |
# Task to auto update version to the next development iteration
./gradlew updateVersion -DnewVersion=2.1.0-SNAPSHOT
65 changes: 44 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import org.opensearch.gradle.test.RestIntegTestTask

apply plugin: "java"
apply plugin: "idea"
apply plugin: "opensearch.opensearchplugin"
apply plugin: "opensearch.yaml-rest-test"
apply plugin: "opensearch.pluginzip"
apply plugin: "checkstyle"
apply plugin: "com.diffplug.spotless"

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

checkstyle {
toolVersion "10.3.3"
configDirectory.set(rootProject.file("checkstyle/"))
}
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'opensearch.opensearchplugin'
apply plugin: 'opensearch.yaml-rest-test'
apply plugin: 'opensearch.pluginzip'
apply plugin: com.diffplug.gradle.spotless.SpotlessPlugin

def pluginName = 'rename'
def pluginDescription = 'Custom plugin'
def projectPath = 'org.opensearch'
def pathToPlugin = 'path.to.plugin'
def pluginClassName = 'RenamePlugin'
group = "RenameGroup"

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

spotless {
java {
Expand All @@ -32,6 +33,29 @@ tasks.register("preparePluginPathDirs") {
}
}

publishing {
publications {
pluginZip(MavenPublication) { publication ->
pom {
name = pluginName
description = pluginDescription
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
name = "OpenSearch"
url = "https://github.com/opensearch-project/opensearch-plugin-template-java"
}
}
}
}
}
}

opensearchplugin {
name "encrypted-repository"
description "Provides client-side encryption for snapshotting repositories"
Expand Down Expand Up @@ -61,7 +85,7 @@ buildscript {

dependencies {
classpath "org.opensearch.gradle:build-tools:${opensearch_version}"
classpath "com.diffplug.spotless:spotless-plugin-gradle:6.21.0"
classpath "com.diffplug.spotless:spotless-plugin-gradle:6.25.0"
}
}

Expand Down Expand Up @@ -103,13 +127,12 @@ integTest {

// The --debug-jvm command-line option makes the cluster debuggable; this makes the tests debuggable
if (System.getProperty("test.debug") != null) {
jvmArgs "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005"
jvmArgs += ["-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005"]
}
jvmArgs += ["-Djava.security.manager=allow"]
}

testClusters.integTest {
testDistribution = "INTEG_TEST"

// This installs our plugin into the testClusters
plugin(project.tasks.bundlePlugin.archiveFile)
}
Expand All @@ -126,4 +149,4 @@ task updateVersion {
// String tokenization to support -SNAPSHOT
ant.replaceregexp(file:'build.gradle', match: '"opensearch.version", "\\d.*"', replace: '"opensearch.version", "' + newVersion.tokenize('-')[0] + '-SNAPSHOT"', flags:'g', byline:true)
}
}
}
Loading