Compare commits

..

No commits in common. "8f4bb51dd2efebb309ba35880459f90434819493" and "051f74483137a702f58ca637169a33eb3b9d6d73" have entirely different histories.

7 changed files with 47 additions and 56 deletions

View file

@ -22,9 +22,11 @@ jobs:
distribution: "zulu"
java-version: ${{ matrix.java-version }}
- name: Download dependencies
- name: Grant execute permission for bld
run: chmod +x bld
- name: Download the dependencies
run: ./bld download
- name: Run tests
- name: Run tests with bld
run: ./bld compile test

View file

@ -2,12 +2,12 @@
<library name="bld">
<CLASSES>
<root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.0.0-SNAPSHOT.jar!/" />
<root url="jar://$USER_HOME$/.bld/dist/bld-1.9.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.0.0-SNAPSHOT-sources.jar!/" />
<root url="jar://$USER_HOME$/.bld/dist/bld-1.9.1-sources.jar!/" />
</SOURCES>
<excluded>
<root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" />

View file

@ -9,7 +9,7 @@
],
"java.configuration.updateBuildConfiguration": "automatic",
"java.project.referencedLibraries": [
"${HOME}/.bld/dist/bld-2.0.0-SNAPSHOT.jar",
"${HOME}/.bld/dist/bld-1.9.1.jar",
"lib/**/*.jar"
]
}

Binary file not shown.

View file

@ -1,8 +1,8 @@
bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true
bld.downloadLocation=
bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.6
bld.extension-pmd=com.uwyn.rife2:bld-pmd:1.1.2
bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.5
bld.extension-pmd=com.uwyn.rife2:bld-pmd:1.0.1
bld.repositories=MAVEN_CENTRAL,MAVEN_LOCAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.sourceDirectories=
bld.version=2.0.0-SNAPSHOT
bld.version=1.9.1

View file

@ -25,7 +25,8 @@ import rife.bld.publish.PublishScm;
import java.io.IOException;
import java.util.List;
import static rife.bld.dependencies.Repository.*;
import static rife.bld.dependencies.Repository.MAVEN_CENTRAL;
import static rife.bld.dependencies.Repository.RIFE2_RELEASES;
import static rife.bld.dependencies.Scope.compile;
import static rife.bld.dependencies.Scope.test;
import static rife.bld.operations.JavadocOptions.DocLinkOption.NO_MISSING;
@ -34,20 +35,20 @@ public class ExecOperationBuild extends Project {
public ExecOperationBuild() {
pkg = "rife.bld.extension";
name = "ExecOperation";
version = version(1, 0, 2, "SNAPSHOT");
version = version(1, 0, 1);
javaRelease = 17;
downloadSources = true;
autoDownloadPurge = true;
repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL, RIFE2_RELEASES, RIFE2_SNAPSHOTS);
repositories = List.of(MAVEN_CENTRAL, RIFE2_RELEASES);
scope(compile)
.include(dependency("com.uwyn.rife2", "bld", version(2, 0, 0, "SNAPSHOT")));
.include(dependency("com.uwyn.rife2", "bld", version(1, 9, 1)));
scope(test)
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 3)))
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 3)))
.include(dependency("org.assertj", "assertj-core", version(3, 26, 3)));
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 2)))
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 2)))
.include(dependency("org.assertj", "assertj-core", version(3, 26, 0)));
javadocOperation()
.javadocOptions()
@ -90,14 +91,14 @@ public class ExecOperationBuild extends Project {
}
@BuildCommand(summary = "Generates JaCoCo Reports")
public void jacoco() throws Exception {
public void jacoco() throws IOException {
new JacocoReportOperation()
.fromProject(this)
.execute();
}
@BuildCommand(summary = "Runs PMD analysis")
public void pmd() throws Exception {
public void pmd() {
new PmdOperation()
.fromProject(this)
.failOnViolation(true)

View file

@ -18,9 +18,9 @@ package rife.bld.extension;
import rife.bld.BaseProject;
import rife.bld.operations.AbstractOperation;
import rife.bld.operations.exceptions.ExitStatusException;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@ -89,11 +89,9 @@ public class ExecOperation extends AbstractOperation<ExecOperation> {
@Override
public void execute() throws Exception {
if (project_ == null) {
if (LOGGER.isLoggable(Level.SEVERE) && !silent()) {
LOGGER.severe("A project must be specified.");
}
throw new ExitStatusException(ExitStatusException.EXIT_FAILURE);
} else {
final File workDir = Objects.requireNonNullElseGet(workDir_,
() -> new File(project_.workDirectory().getAbsolutePath()));
@ -107,7 +105,7 @@ public class ExecOperation extends AbstractOperation<ExecOperation> {
pb.command(args_.stream().toList());
pb.directory(workDir);
if (LOGGER.isLoggable(Level.INFO) && !silent()) {
if (LOGGER.isLoggable(Level.INFO)) {
LOGGER.info(String.join(" ", args_));
}
@ -116,22 +114,12 @@ public class ExecOperation extends AbstractOperation<ExecOperation> {
if (!err) {
proc.destroy();
if (LOGGER.isLoggable(Level.SEVERE) && !silent()) {
LOGGER.severe("The command timed out.");
}
throw new ExitStatusException(ExitStatusException.EXIT_FAILURE);
throw new IOException("The command timed out.");
} else if (proc.exitValue() != 0 && failOnExit_) {
if (LOGGER.isLoggable(Level.SEVERE) && !silent()) {
LOGGER.severe("The command exit value/status is: " + proc.exitValue());
}
ExitStatusException.throwOnFailure(proc.exitValue());
throw new IOException("The command exit value/status is: " + proc.exitValue());
}
} else {
if (LOGGER.isLoggable(Level.SEVERE) && !silent()) {
LOGGER.severe("Invalid working directory: " + workDir);
}
throw new ExitStatusException(ExitStatusException.EXIT_FAILURE);
}
throw new IOException("Invalid working directory: " + workDir);
}
}