diff --git a/.github/workflows/bld.yml b/.github/workflows/bld.yml
index d55711f..138f5e5 100644
--- a/.github/workflows/bld.yml
+++ b/.github/workflows/bld.yml
@@ -1,16 +1,14 @@
name: bld-ci
-on: [ push, pull_request, workflow_dispatch ]
+on: [push, pull_request, workflow_dispatch]
jobs:
build-bld-project:
+ runs-on: ubuntu-latest
+
strategy:
matrix:
- java-version: [ 17, 21, 24 ]
- kotlin-version: [ 1.9.25, 2.0.21, 2.1.20 ]
- os: [ ubuntu-latest, windows-latest, macos-latest ]
-
- runs-on: ${{ matrix.os }}
+ java-version: [17, 21, 24]
steps:
- name: Checkout source repository
@@ -24,16 +22,8 @@ jobs:
distribution: "zulu"
java-version: ${{ matrix.java-version }}
- - name: Download dependencies [examples]
- working-directory: examples
- run: ./bld download
-
- - name: Run tests with JaCoCo [examples]
- working-directory: examples
- run: ./bld compile jacoco
-
- name: Download dependencies
run: ./bld download
- name: Run tests
- run: ./bld compile test
\ No newline at end of file
+ run: ./bld compile test
diff --git a/examples/.idea/bld.xml b/examples/.idea/bld.xml
deleted file mode 100644
index 6600cee..0000000
--- a/examples/.idea/bld.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
{@code * ./bld compile test * ./bld compile jacoco diff --git a/src/bld/java/rife/bld/extension/TestNgOperationBuild.java b/src/bld/java/rife/bld/extension/TestNgOperationBuild.java index 88f713c..521fc88 100644 --- a/src/bld/java/rife/bld/extension/TestNgOperationBuild.java +++ b/src/bld/java/rife/bld/extension/TestNgOperationBuild.java @@ -33,7 +33,7 @@ public class TestNgOperationBuild extends Project { public TestNgOperationBuild() { pkg = "rife.bld.extension"; name = "bld-testng"; - version = version(1, 0, 3, "SNAPSHOT"); + version = version(1, 0, 2); javaRelease = 17; @@ -100,13 +100,10 @@ public class TestNgOperationBuild extends Project { @Override public void test() throws Exception { - var os = System.getProperty("os.name"); - if (os != null && os.toLowerCase().contains("linux")) { - new ExecOperation() - .fromProject(this) - .command("scripts/cliargs.sh") - .execute(); - } + new ExecOperation() + .fromProject(this) + .command("scripts/cliargs.sh") + .execute(); super.test(); } } diff --git a/src/main/java/rife/bld/extension/TestNgOperation.java b/src/main/java/rife/bld/extension/TestNgOperation.java index 298857f..0617152 100644 --- a/src/main/java/rife/bld/extension/TestNgOperation.java +++ b/src/main/java/rife/bld/extension/TestNgOperation.java @@ -75,19 +75,6 @@ public class TestNgOperation extends TestOperationreturn this; } - private String buildClassPath(String... path) { - var classpath = new StringBuilder(); - for (var p : path) { - if (!p.isBlank()) { - if (!classpath.isEmpty()) { - classpath.append(File.pathSeparator); - } - classpath.append(p); - } - } - return classpath.toString(); - } - /** * This sets the default maximum number of threads to use for data providers when running tests in parallel. * It will only take effect if the parallel mode has been selected (for example,with the @@ -215,13 +202,11 @@ public class TestNgOperation extends TestOperation args.add("-cp"); if (testClasspath_.isEmpty()) { - args.add(buildClassPath(joinClasspathJar(project_.testClasspathJars()), - joinClasspathJar(project_.compileClasspathJars()), - joinClasspathJar(project_.providedClasspathJars()), - project_.buildMainDirectory().getAbsolutePath(), - project_.buildTestDirectory().getAbsolutePath())); + args.add(String.format("%s:%s:%s:%s", new File(project_.libTestDirectory(), "*"), + new File(project_.libCompileDirectory(), "*"), project_.buildMainDirectory(), + project_.buildTestDirectory())); } else { - args.add(String.join(File.pathSeparator, testClasspath_)); + args.add(String.join(":", testClasspath_)); } args.add("org.testng.TestNG"); @@ -239,7 +224,7 @@ public class TestNgOperation extends TestOperation } catch (IOException ioe) { if (LOGGER.isLoggable(Level.SEVERE) && !silent()) { LOGGER.severe("An IO error occurred while accessing the default testng.xml file: " - + ioe.getMessage()); + + ioe.getMessage()); } throw new RuntimeException(ioe); } @@ -387,14 +372,6 @@ public class TestNgOperation extends TestOperation return this; } - private String joinClasspathJar(List jars) { - if (!jars.isEmpty()) { - return String.join(File.pathSeparator, jars.stream().map(File::getAbsolutePath).toList()); - } else { - return ""; - } - } - /** * The list of {@code .class} files or list of class names implementing {@code ITestListener} or * {@code ISuiteListener} @@ -1079,10 +1056,10 @@ public class TestNgOperation extends TestOperation var temp = tempFile(); try (var bufWriter = Files.newBufferedWriter(Paths.get(temp.getPath()))) { bufWriter.write("" + - "" + - " " + - " " + - " "); + "" + + " " + + " " + + " "); for (var p : packages_) { bufWriter.write(String.format(" ", p)); } diff --git a/src/test/java/rife/bld/extension/TestNgOperationTest.java b/src/test/java/rife/bld/extension/TestNgOperationTest.java index d4f3193..3a9f795 100644 --- a/src/test/java/rife/bld/extension/TestNgOperationTest.java +++ b/src/test/java/rife/bld/extension/TestNgOperationTest.java @@ -18,8 +18,6 @@ package rife.bld.extension; import org.assertj.core.api.AutoCloseableSoftAssertions; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.EnabledOnOs; -import org.junit.jupiter.api.condition.OS; import rife.bld.Project; import rife.bld.blueprints.BaseProjectBlueprint; import rife.bld.operations.exceptions.ExitStatusException; @@ -53,7 +51,6 @@ class TestNgOperationTest { } @Test - @EnabledOnOs(OS.LINUX) void testCheckAllParameters() throws IOException { var args = Files.readAllLines(Paths.get("src", "test", "resources", "testng-args.txt"));