Skip to content

Commit

Permalink
Move process ProcessStarter to main source set
Browse files Browse the repository at this point in the history
  • Loading branch information
marcphilipp committed Nov 28, 2024
1 parent 2f73267 commit d94324e
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ plugins {
}

javaLibrary {
mainJavaVersion = JavaVersion.VERSION_11
mainJavaVersion = JavaVersion.VERSION_21
}

spotless {
Expand Down Expand Up @@ -50,16 +50,19 @@ dependencies {
implementation(libs.commons.io) {
because("moving/deleting directory trees")
}
implementation(libs.groovy4) {
because("it provides convenience methods to handle process output")
}
implementation(libs.opentest4j) {
because("it throws TestAbortedException to abort tests")
}

testImplementation(libs.archunit) {
because("checking the architecture of JUnit 5")
}
testImplementation(libs.apiguardian) {
because("we validate that public classes are annotated")
}
testImplementation(libs.groovy4) {
because("it provides convenience methods to handle process output")
}
testImplementation(libs.bndlib) {
because("parsing OSGi metadata")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import java.util.List;

public record ProcessResult(int exitCode, Duration duration, String stdOut, String stdErr) {

public List<String> stdOutLines() {
return stdOut.lines().toList();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ public static ProcessStarter gradlew() {

public static ProcessStarter maven() {
var starter = new ProcessStarter() //
.executable(Path.of(System.getProperty("mavenDistribution")).resolve("bin/mvn")) //
.putEnvironment("JAVA_HOME", getGradleJavaHome().orElseThrow(TestAbortedException::new));
.executable(Path.of(System.getProperty("mavenDistribution")).resolve("bin/mvn"));
return withCommonEnvironmentVariables(starter);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* Utilities for working with processes.
*
* @since 1.12
*/

package platform.tooling.support.process;

0 comments on commit d94324e

Please sign in to comment.