Compare commits
3 commits
013c6a0de6
...
8b80ca1bc0
Author | SHA1 | Date | |
---|---|---|---|
8b80ca1bc0 | |||
b1c8c49fbc | |||
9e8479ab30 |
7 changed files with 32 additions and 18 deletions
4
.github/workflows/bld.yml
vendored
4
.github/workflows/bld.yml
vendored
|
@ -12,12 +12,12 @@ jobs:
|
|||
|
||||
steps:
|
||||
- name: Checkout source repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up JDK ${{ matrix.java-version }}
|
||||
uses: actions/setup-java@v3
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: "zulu"
|
||||
java-version: ${{ matrix.java-version }}
|
||||
|
|
10
.github/workflows/pages.yml
vendored
10
.github/workflows/pages.yml
vendored
|
@ -30,14 +30,14 @@ jobs:
|
|||
|
||||
steps:
|
||||
- name: Checkout source repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v3
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
distribution: "zulu"
|
||||
java-version: 17
|
||||
|
||||
- name: Build Javadocs
|
||||
|
@ -50,8 +50,8 @@ jobs:
|
|||
uses: actions/upload-pages-artifact@v1
|
||||
with:
|
||||
# Upload generated Javadocs repository
|
||||
path: 'build/javadoc/'
|
||||
path: "build/javadoc/"
|
||||
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v1
|
||||
uses: actions/deploy-pages@v1
|
||||
|
|
|
@ -19,12 +19,13 @@
|
|||
</properties>
|
||||
</rule>
|
||||
|
||||
|
||||
<!-- CODE STYLE -->
|
||||
<rule ref="category/java/codestyle.xml">
|
||||
<exclude name="AtLeastOneConstructor"/>
|
||||
<exclude name="ClassNamingConventions"/>
|
||||
<exclude name="ConfusingTernary"/>
|
||||
<exclude name="CommentDefaultAccessModifier"/>
|
||||
<exclude name="ConfusingTernary"/>
|
||||
<exclude name="FieldNamingConventions"/>
|
||||
<exclude name="LocalVariableCouldBeFinal"/>
|
||||
<exclude name="LongVariable"/>
|
||||
|
@ -34,8 +35,9 @@
|
|||
<exclude name="ShortClassName"/>
|
||||
<exclude name="ShortMethodName"/>
|
||||
<exclude name="ShortVariable"/>
|
||||
<exclude name="UselessParentheses"/>
|
||||
<exclude name="UseExplicitTypes"/>
|
||||
<exclude name="UseUnderscoresInNumericLiterals"/>
|
||||
<exclude name="UselessParentheses"/>
|
||||
</rule>
|
||||
|
||||
<rule ref="category/java/codestyle.xml/UnnecessaryImport">
|
||||
|
@ -51,8 +53,6 @@
|
|||
<exclude name="AvoidUncheckedExceptionsInSignatures"/>
|
||||
<exclude name="CognitiveComplexity"/>
|
||||
<exclude name="CyclomaticComplexity"/>
|
||||
<exclude name="ExcessiveClassLength"/>
|
||||
<exclude name="ExcessiveMethodLength"/>
|
||||
<exclude name="ExcessiveParameterList"/>
|
||||
<exclude name="ExcessivePublicCount"/>
|
||||
<exclude name="GodClass"/>
|
||||
|
@ -106,4 +106,4 @@
|
|||
<!-- SECURITY -->
|
||||
<rule ref="category/java/security.xml">
|
||||
</rule>
|
||||
</ruleset>
|
||||
</ruleset>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
bld.downloadExtensionJavadoc=false
|
||||
bld.downloadExtensionSources=true
|
||||
bld.extension-pmd=com.uwyn.rife2:bld-pmd:0.9.7
|
||||
bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.3
|
||||
bld.extension-pmd=com.uwyn.rife2:bld-pmd:0.9.8
|
||||
bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.5
|
||||
bld.repositories=MAVEN_CENTRAL,MAVEN_LOCAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
|
||||
bld.downloadLocation=
|
||||
bld.sourceDirectories=
|
||||
|
|
|
@ -35,13 +35,14 @@ public class ExecOperationBuild extends Project {
|
|||
public ExecOperationBuild() {
|
||||
pkg = "rife.bld.extension";
|
||||
name = "ExecOperation";
|
||||
version = version(0, 9, 2);
|
||||
version = version(0, 9, 3);
|
||||
|
||||
javaRelease = 17;
|
||||
|
||||
downloadSources = true;
|
||||
autoDownloadPurge = true;
|
||||
repositories = List.of(MAVEN_CENTRAL, RIFE2_RELEASES);
|
||||
|
||||
repositories = List.of(MAVEN_CENTRAL, RIFE2_RELEASES);
|
||||
scope(compile)
|
||||
.include(dependency("com.uwyn.rife2", "bld", version(1, 9, 0)));
|
||||
scope(test)
|
||||
|
@ -73,7 +74,7 @@ public class ExecOperationBuild extends Project {
|
|||
.license(
|
||||
new PublishLicense()
|
||||
.name("The Apache License, Version 2.0")
|
||||
.url("http://www.apache.org/licenses/LICENSE-2.0.txt")
|
||||
.url("https://www.apache.org/licenses/LICENSE-2.0.txt")
|
||||
)
|
||||
.scm(
|
||||
new PublishScm()
|
||||
|
|
|
@ -38,6 +38,7 @@ public class ExecOperation extends AbstractOperation<ExecOperation> {
|
|||
private final List<String> args_ = new ArrayList<>();
|
||||
private final Set<ExecFail> fail_ = new HashSet<>();
|
||||
private BaseProject project_;
|
||||
private int timeout = 30;
|
||||
private String workDir_;
|
||||
|
||||
/**
|
||||
|
@ -98,7 +99,7 @@ public class ExecOperation extends AbstractOperation<ExecOperation> {
|
|||
}
|
||||
|
||||
var proc = pb.start();
|
||||
var err = proc.waitFor(30, TimeUnit.SECONDS);
|
||||
var err = proc.waitFor(timeout, TimeUnit.SECONDS);
|
||||
var stdout = readStream(proc.getInputStream());
|
||||
var stderr = readStream(proc.getErrorStream());
|
||||
|
||||
|
@ -180,6 +181,17 @@ public class ExecOperation extends AbstractOperation<ExecOperation> {
|
|||
return lines;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the command timeout.
|
||||
*
|
||||
* @param timeout The timeout in seconds
|
||||
* @return this operation instance
|
||||
*/
|
||||
public ExecOperation timeout(int timeout) {
|
||||
this.timeout = timeout;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configures the working directory.
|
||||
*
|
||||
|
|
|
@ -50,6 +50,7 @@ class ExecOperationTest {
|
|||
tmpFile.deleteOnExit();
|
||||
new ExecOperation()
|
||||
.fromProject(new Project())
|
||||
.timeout(10)
|
||||
.command("touch", tmpFile.getName())
|
||||
.fail(ExecFail.NORMAL)
|
||||
.execute();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue