diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 259db167..a8cd0049 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -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 @@ -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: @@ -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 @@ -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 diff --git a/build.gradle b/build.gradle index f8f84893..d98e023f 100644 --- a/build.gradle +++ b/build.gradle @@ -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() diff --git a/src/main/groovy/io/openliberty/tools/gradle/tasks/AbstractFeatureTask.groovy b/src/main/groovy/io/openliberty/tools/gradle/tasks/AbstractFeatureTask.groovy index 237419b0..7f5e7d71 100644 --- a/src/main/groovy/io/openliberty/tools/gradle/tasks/AbstractFeatureTask.groovy +++ b/src/main/groovy/io/openliberty/tools/gradle/tasks/AbstractFeatureTask.groovy @@ -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 @@ -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 pluginListedEsas, List propertiesList, String openLibertyVerion, String containerName, List additionalJsons) throws PluginScenarioException, PluginExecutionException { super(installDir, buildDir, from, to, pluginListedEsas, propertiesList, openLibertyVerion, containerName, additionalJsons) + setContainerEngine(this); } @Override @@ -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 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()))); + } + } + } } \ No newline at end of file diff --git a/src/main/groovy/io/openliberty/tools/gradle/tasks/DevTask.groovy b/src/main/groovy/io/openliberty/tools/gradle/tasks/DevTask.groovy index 263bb3c9..15d3f495 100644 --- a/src/main/groovy/io/openliberty/tools/gradle/tasks/DevTask.groovy +++ b/src/main/groovy/io/openliberty/tools/gradle/tasks/DevTask.groovy @@ -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 @@ -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"; @@ -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, @@ -378,6 +380,8 @@ class DevTask extends AbstractFeatureTask { project.configurations.getByName('libertyFeature').dependencies.each { dep -> this.existingLibertyFeatureDependencies.add(dep.name) } + + setContainerEngine(this) } @Override @@ -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();