Skip to content

Commit

Permalink
Test with Java 21
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbsox committed Oct 19, 2023
1 parent 4f6f9c1 commit 0183411
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 19 deletions.
28 changes: 13 additions & 15 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ jobs:
matrix:
# test against latest update of each major Java version, as well as specific updates of LTS versions:
RUNTIME: [ol, wlp]
RUNTIME_VERSION: [23.0.0.6, 23.0.0.9]
java: [17, 11, 8]
RUNTIME_VERSION: [23.0.0.10]
java: [21, 17, 11, 8]
exclude:
- java: 8
RUNTIME_VERSION: 23.0.0.6
- java: 17
RUNTIME_VERSION: 23.0.0.6
RUNTIME: wlp
- java: 11
RUNTIME: ol
name: ${{ matrix.RUNTIME }} ${{ matrix.RUNTIME_VERSION }}, Java ${{ matrix.java }}, Linux
steps:
# Checkout repos
Expand Down Expand Up @@ -65,8 +65,8 @@ jobs:
# Install dependencies
- name: Install ci.ant and ci.common
run: |
mvn -V clean install -f ci.ant --batch-mode --no-transfer-progress --errors -DtrimStackTrace=false
mvn -V clean install -f ci.common --batch-mode --no-transfer-progress --errors -DtrimStackTrace=false
mvn -V clean install -f ci.ant --batch-mode --no-transfer-progress --errors -DtrimStackTrace=false -DskipTests
mvn -V clean install -f ci.common --batch-mode --no-transfer-progress --errors -DtrimStackTrace=false -DskipTests
# Run tests
- name: Run tests with Gradle on Ubuntu
run:
Expand Down Expand Up @@ -95,15 +95,13 @@ jobs:
matrix:
# test against latest update of each major Java version, as well as specific updates of LTS versions:
RUNTIME: [ol, wlp]
RUNTIME_VERSION: [23.0.0.6, 23.0.0.9]
java: [17, 11, 8]
RUNTIME_VERSION: [23.0.0.10]
java: [21, 17, 11, 8]
exclude:
- java: 8
RUNTIME_VERSION: 23.0.0.6
- java: 8
RUNTIME: ol
- java: 11
RUNTIME: wlp
- java: 17
RUNTIME_VERSION: 23.0.0.6
name: ${{ matrix.RUNTIME }} ${{ matrix.RUNTIME_VERSION }}, Java ${{ matrix.java }}, Windows
steps:
# Checkout repos
Expand Down Expand Up @@ -140,11 +138,11 @@ jobs:
# Install ci.ant
- name: Install ci.ant
working-directory: C:/ci.ant
run: mvn -V clean install --batch-mode --no-transfer-progress --errors -DtrimStackTrace=false
run: mvn -V clean install --batch-mode --no-transfer-progress --errors -DtrimStackTrace=false -DskipTests
# Install ci.common
- name: Install ci.common
working-directory: C:/ci.common
run: mvn -V clean install --batch-mode --no-transfer-progress --errors -DtrimStackTrace=false
run: mvn -V clean install --batch-mode --no-transfer-progress --errors -DtrimStackTrace=false -DskipTests
# Run tests
- name: Run tests with Gradle on Windows
working-directory: C:/ci.gradle
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ compileTestGroovy {
}

def libertyAntVersion = "1.9.13"
def libertyCommonVersion = "1.8.29-SNAPSHOT"
def libertyCommonVersion = "1.8.30-SNAPSHOT"

dependencies {
implementation gradleApi()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package io.openliberty.tools.gradle.tasks


import io.openliberty.tools.common.plugins.util.AbstractContainerSupportUtil
import io.openliberty.tools.common.plugins.util.InstallFeatureUtil
import io.openliberty.tools.common.plugins.util.InstallFeatureUtil.ProductProperties
import io.openliberty.tools.common.plugins.util.PluginExecutionException
Expand Down Expand Up @@ -109,6 +110,7 @@ public class AbstractFeatureTask extends AbstractServerTask {
private class InstallFeatureTaskUtil extends InstallFeatureUtil {
public InstallFeatureTaskUtil(File installDir, File buildDir, String from, String to, Set<String> pluginListedEsas, List<ProductProperties> propertiesList, String openLibertyVerion, String containerName, List<String> additionalJsons) throws PluginScenarioException, PluginExecutionException {
super(installDir, buildDir, from, to, pluginListedEsas, propertiesList, openLibertyVerion, containerName, additionalJsons)
setContainerEngine(this);
}

@Override
Expand Down Expand Up @@ -291,5 +293,17 @@ public class AbstractFeatureTask extends AbstractServerTask {
return util
}

protected void setContainerEngine(AbstractContainerSupportUtil util) throws PluginExecutionException {
String LIBERTY_DEV_PODMAN = "liberty.dev.podman";
Map<String, Object> projectProperties = project.getProperties();
if (!projectProperties.isEmpty()) {
Object isPodman = projectProperties.get(LIBERTY_DEV_PODMAN);
isPodman = projectProperties.get(LIBERTY_DEV_PODMAN);
if (isPodman != null) {
util.setIsDocker(!(Boolean.parseBoolean(isPodman.toString())));
logger.debug("liberty.dev.podman was set to: " + (Boolean.parseBoolean(isPodman.toString())));
}
}
}

}
14 changes: 11 additions & 3 deletions src/main/groovy/io/openliberty/tools/gradle/tasks/DevTask.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package io.openliberty.tools.gradle.tasks

import org.gradle.api.GradleException
import org.gradle.api.Project
import org.gradle.api.artifacts.Configuration
import org.gradle.api.internal.file.DefaultFilePropertyFactory
Expand Down Expand Up @@ -51,6 +52,7 @@ import java.nio.file.Path;

class DevTask extends AbstractFeatureTask {

private static final String LIBERTY_DEV_PODMAN = "liberty.dev.podman";
private static final String LIBERTY_HOSTNAME = "liberty.hostname";
private static final String LIBERTY_HTTP_PORT = "liberty.http.port";
private static final String LIBERTY_HTTPS_PORT = "liberty.https.port";
Expand Down Expand Up @@ -360,7 +362,7 @@ class DevTask extends AbstractFeatureTask {
boolean libertyDebug, boolean pollingTest, boolean container, File containerfile, File containerBuildContext,
String containerRunOpts, int containerBuildTimeout, boolean skipDefaultPorts, boolean keepTempContainerfile,
String mavenCacheLocation, String packagingType, File buildFile, boolean generateFeatures
) throws IOException {
) throws IOException, PluginExecutionException {
super(buildDir, serverDirectory, sourceDirectory, testSourceDirectory, configDirectory, projectDirectory, /* multi module project directory */ projectDirectory,
resourceDirs, hotTests, skipTests, false /* skipUTs */, false /* skipITs */, skipInstallFeature, artifactId, serverStartTimeout,
verifyAppStartTimeout, appUpdateTimeout, ((long) (compileWait * 1000L)), libertyDebug,
Expand All @@ -378,6 +380,8 @@ class DevTask extends AbstractFeatureTask {
project.configurations.getByName('libertyFeature').dependencies.each {
dep -> this.existingLibertyFeatureDependencies.add(dep.name)
}

setContainerEngine(this)
}

@Override
Expand Down Expand Up @@ -1171,14 +1175,18 @@ class DevTask extends AbstractFeatureTask {
File buildFile = project.getBuildFile();

// Instantiate util before any child gradle tasks launched so it can help find available port if needed
this.util = new DevTaskUtil(project.buildDir, serverInstallDir, getUserDir(project, serverInstallDir),
try {
this.util = new DevTaskUtil(project.buildDir, serverInstallDir, getUserDir(project, serverInstallDir),
serverDirectory, sourceDirectory, testSourceDirectory, configDirectory, project.getRootDir(),
resourceDirs, hotTests.booleanValue(), skipTests.booleanValue(), skipInstallFeature.booleanValue(), artifactId, serverStartTimeout.intValue(),
verifyAppStartTimeout.intValue(), verifyAppStartTimeout.intValue(), compileWait.doubleValue(),
libertyDebug.booleanValue(), pollingTest.booleanValue(), container.booleanValue(), containerfile, containerBuildContext, containerRunOpts,
containerBuildTimeout, skipDefaultPorts.booleanValue(), keepTempContainerfile.booleanValue(), localMavenRepoForFeatureUtility,
getPackagingType(), buildFile, generateFeatures.booleanValue()
);
);
} catch (IOException | PluginExecutionException e) {
throw new GradleException("Error initializing dev mode.", e)
}

ProjectConnection gradleConnection = initGradleProjectConnection();
BuildLauncher gradleBuildLauncher = gradleConnection.newBuild();
Expand Down

0 comments on commit 0183411

Please sign in to comment.