Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ethauvin committed Nov 27, 2023
1 parent 609b347 commit f73526b
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 19 deletions.
1 change: 1 addition & 0 deletions .idea/libraries/bld.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/bld/bld-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true
bld.extension-pmd=com.uwyn.rife2:bld-pmd:0.9.3
bld.extension-pmd=com.uwyn.rife2:bld-pmd:0.9.4
bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.1
bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.downloadLocation=
Expand Down
35 changes: 23 additions & 12 deletions src/bld/java/rife/bld/extension/ExecOperationBuild.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class ExecOperationBuild extends Project {
public ExecOperationBuild() {
pkg = "rife.bld.extension";
name = "ExecOperation";
version = version(0, 9, 0);
version = version(0, 9, 1, "SNAPSHOT");

javaRelease = 17;
downloadSources = true;
Expand All @@ -45,13 +45,13 @@ public ExecOperationBuild() {
scope(compile)
.include(dependency("com.uwyn.rife2", "bld", version(1, 7, 5)));
scope(test)
.include(dependency("org.jsoup", "jsoup", version(1, 16, 2)))
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 0)))
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 0)))
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 1)))
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 1)))
.include(dependency("org.assertj", "assertj-core", version(3, 24, 2)));

javadocOperation()
.javadocOptions()
.author()
.docLint(NO_MISSING)
.link("https://rife2.github.io/bld/")
.link("https://rife2.github.io/rife2/");
Expand All @@ -61,15 +61,26 @@ public ExecOperationBuild() {
.info()
.groupId("com.uwyn.rife2")
.artifactId("bld-exec")
.description("Command Line Execution Extension for bld ")
.description("Command Line Execution Extension for bld")
.url("https://github.com/rife2/bld-exec")
.developer(new PublishDeveloper().id("ethauvin").name("Erik C. Thauvin").email("[email protected]")
.url("https://erik.thauvin.net/"))
.license(new PublishLicense().name("The Apache License, Version 2.0")
.url("http://www.apache.org/licenses/LICENSE-2.0.txt"))
.scm(new PublishScm().connection("scm:git:https://github.com/rife2/bld-exec.git")
.developerConnection("scm:git:[email protected]:rife2/bld-exec.git")
.url("https://github.com/rife2/bld-exec"))
.developer(
new PublishDeveloper()
.id("ethauvin")
.name("Erik C. Thauvin")
.email("[email protected]")
.url("https://erik.thauvin.net/")
)
.license(
new PublishLicense()
.name("The Apache License, Version 2.0")
.url("http://www.apache.org/licenses/LICENSE-2.0.txt")
)
.scm(
new PublishScm()
.connection("scm:git:https://github.com/rife2/bld-exec.git")
.developerConnection("scm:git:[email protected]:rife2/bld-exec.git")
.url("https://github.com/rife2/bld-exec")
)
.signKey(property("sign.key"))
.signPassphrase(property("sign.passphrase"));
}
Expand Down
25 changes: 19 additions & 6 deletions src/main/java/rife/bld/extension/ExecOperation.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ public class ExecOperation extends AbstractOperation<ExecOperation> {
* Configures the command and arguments to be executed.
* <p>
* For example:
* <p><ul>
* <li>{@code command("cmd", "/c", "stop.bat")}</li>
* <li>{@code command("./stop.sh"}</li>
* </ul></p>
*
* @see #command(Collection)
* <ul>
* <li>{@code command("cmd", "/c", "stop.bat")}</li>
* <li>{@code command("./stop.sh"}</li>
* </ul>
*
* @param arg one or more arguments
* @return this operation instance
* @see #command(Collection)
*/
public ExecOperation command(String... arg) {
args_.addAll(List.of(arg));
Expand All @@ -59,6 +61,8 @@ public ExecOperation command(String... arg) {
/**
* Configures the command and arguments to be executed.
*
* @param args the list of arguments
* @return this operation instance
* @see #command(String...)
*/
public ExecOperation command(Collection<String> args) {
Expand All @@ -74,6 +78,7 @@ public void execute() throws Exception {
if (project_ == null) {
LOGGER.severe("A project must be specified.");
}

var errorMessage = new StringBuilder(27);

final File workDir;
Expand Down Expand Up @@ -134,6 +139,8 @@ public void execute() throws Exception {
/**
* Configure the failure mode.
*
* @param fail one or more failure modes
* @return this operation instance
* @see ExecFail
*/
public ExecOperation fail(ExecFail... fail) {
Expand All @@ -143,6 +150,9 @@ public ExecOperation fail(ExecFail... fail) {

/**
* Configures an Exec operation from a {@link BaseProject}.
*
* @param project the project
* @return this operation instance
*/
public ExecOperation fromProject(BaseProject project) {
project_ = project;
Expand All @@ -161,6 +171,9 @@ private List<String> readStream(InputStream stream) {

/**
* Configures the working directory.
*
* @param dir the directory path
* @return this operation instance
*/
public ExecOperation workDir(String dir) {
workDir_ = dir;
Expand Down

0 comments on commit f73526b

Please sign in to comment.