Compare commits

..

No commits in common. "74a180e6fd949f3a495d2cc8fbc2af39d2d5f9c0" and "5d78963f1dfbc9e547e5f90ff9e1327ca823317f" have entirely different histories.

4 changed files with 39 additions and 44 deletions

View file

@ -1,13 +1,43 @@
name: bld-ci name: bld-ci
on: [ push, pull_request, workflow_dispatch ] on: [push, pull_request, workflow_dispatch]
jobs: jobs:
build-bld-project: build-bld-project:
strategy: strategy:
matrix: matrix:
java-version: [ 17, 21, 24 ] java-version: [17, 21, 24]
kotlin-version: [ 1.9.25, 2.0.21, 2.1.20 ] kotlin-version: [1.9.25, 2.0.21, 2.1.20]
runs-on: ubuntu-latest
steps:
- name: Checkout source repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: ${{ matrix.java-version }}
- name: Download dependencies [examples]
working-directory: examples
run: ./bld download
- name: Download dependencies
run: ./bld download
- name: Run tests
run: ./bld compile test
build-bld-examples:
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 ] os: [ ubuntu-latest, windows-latest, macos-latest ]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@ -30,10 +60,4 @@ jobs:
- name: Run tests [examples] - name: Run tests [examples]
working-directory: examples working-directory: examples
run: ./bld compile test
- name: Download dependencies
run: ./bld download
- name: Run tests
run: ./bld compile test run: ./bld compile test

View file

@ -23,7 +23,6 @@ import rife.bld.publish.PublishLicense;
import rife.bld.publish.PublishScm; import rife.bld.publish.PublishScm;
import java.util.List; import java.util.List;
import java.util.Locale;
import static rife.bld.dependencies.Repository.*; import static rife.bld.dependencies.Repository.*;
import static rife.bld.dependencies.Scope.compile; import static rife.bld.dependencies.Scope.compile;
@ -98,13 +97,10 @@ public class CompileKotlinOperationBuild extends Project {
@Override @Override
public void test() throws Exception { public void test() throws Exception {
var os = System.getProperty("os.name"); new ExecOperation()
if (os != null && os.toLowerCase(Locale.US).contains("linux")) { .fromProject(this)
new ExecOperation() .command("scripts/cliargs.sh")
.fromProject(this) .execute();
.command("scripts/cliargs.sh")
.execute();
}
super.test(); super.test();
} }
} }

View file

@ -42,7 +42,7 @@ public class CompileKotlinOperation extends AbstractOperation<CompileKotlinOpera
private static final Logger LOGGER = Logger.getLogger(CompileKotlinOperation.class.getName()); private static final Logger LOGGER = Logger.getLogger(CompileKotlinOperation.class.getName());
private static final String OS_NAME = private static final String OS_NAME =
System.getProperty("os.name") != null ? System.getProperty("os.name").toLowerCase(Locale.US) : null; System.getProperty("os.name") != null ? System.getProperty("os.name").toLowerCase(Locale.US) : null;
private static final String KOTLINC_EXECUTABLE = "kotlinc" + (isWindows() && !isCygwin() && !isMinGW() ? ".bat" : ""); private static final String KOTLINC_EXECUTABLE = "kotlinc" + (isWindows() ? ".bat" : "");
private final Collection<String> compileMainClasspath_ = new ArrayList<>(); private final Collection<String> compileMainClasspath_ = new ArrayList<>();
private final Collection<String> compileTestClasspath_ = new ArrayList<>(); private final Collection<String> compileTestClasspath_ = new ArrayList<>();
private final JvmOptions jvmOptions_ = new JvmOptions(); private final JvmOptions jvmOptions_ = new JvmOptions();
@ -191,17 +191,6 @@ public class CompileKotlinOperation extends AbstractOperation<CompileKotlinOpera
return KOTLINC_EXECUTABLE; return KOTLINC_EXECUTABLE;
} }
/**
* Determines if the current runtime environment is Cygwin.
*
* @return {@code true} if the current runtime environment is Cygwin, {@code false} otherwise.
* @since 1.1.0
*/
public static boolean isCygwin() {
var path = System.getenv("ORIGINAL_PATH");
return path != null && path.contains("/cygdrive/");
}
private static boolean isExecutable(File file) { private static boolean isExecutable(File file) {
return file != null && file.exists() && file.isFile() && file.canExecute(); return file != null && file.exists() && file.isFile() && file.canExecute();
} }
@ -223,18 +212,7 @@ public class CompileKotlinOperation extends AbstractOperation<CompileKotlinOpera
* @since 1.1.0 * @since 1.1.0
*/ */
public static boolean isMacOS() { public static boolean isMacOS() {
return OS_NAME != null && (OS_NAME.contains("mac") || OS_NAME.contains("darwin") || OS_NAME.contains("osx")); return OS_NAME != null && (OS_NAME.contains("mac") || OS_NAME.contains("darwin"));
}
/**
* Determines if the current runtime environment is MinGW.
*
* @return {@code true} if the current runtime environment is MinGW, {@code false} otherwise.
* @since 1.1.0
*/
public static boolean isMinGW() {
var msys = System.getenv("MSYSTEM");
return msys != null && (msys.startsWith("MINGW") || msys.startsWith("MSYS"));
} }
/** /**

View file

@ -18,8 +18,6 @@ package rife.bld.extension.kotlin;
import org.assertj.core.api.AutoCloseableSoftAssertions; import org.assertj.core.api.AutoCloseableSoftAssertions;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledOnOs;
import org.junit.jupiter.api.condition.OS;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
@ -201,7 +199,6 @@ class CompileOptionsTest {
} }
@Test @Test
@EnabledOnOs(OS.LINUX)
void testCheckAllParams() throws IOException { void testCheckAllParams() throws IOException {
var args = Files.readAllLines(Paths.get("src", "test", "resources", "kotlinc-args.txt")); var args = Files.readAllLines(Paths.get("src", "test", "resources", "kotlinc-args.txt"));