mirror of
https://github.com/ethauvin/bld.git
synced 2025-04-25 16:27:11 -07:00
Added more command files tests
This commit is contained in:
parent
d72e6ebc2e
commit
0382444c0c
7 changed files with 63 additions and 41 deletions
|
@ -159,7 +159,7 @@ public abstract class AbstractToolProviderOperation<T extends AbstractToolProvid
|
|||
}
|
||||
|
||||
public String nextToken() throws IOException {
|
||||
skipWhitespaceOrComments();
|
||||
trimWhitespaceOrComments();
|
||||
if (ch_ == -1) {
|
||||
return null;
|
||||
}
|
||||
|
@ -208,7 +208,7 @@ public abstract class AbstractToolProviderOperation<T extends AbstractToolProvid
|
|||
}
|
||||
|
||||
|
||||
private void skipWhitespaceOrComments() throws IOException {
|
||||
private void trimWhitespaceOrComments() throws IOException {
|
||||
while (ch_ != -1) {
|
||||
if (Character.isWhitespace(ch_)) { // Skip whitespaces
|
||||
ch_ = input_.read();
|
||||
|
|
|
@ -15,7 +15,7 @@ import java.util.Map;
|
|||
* @since 2.0.2
|
||||
*/
|
||||
public class JpackageOperation extends AbstractToolProviderOperation<JpackageOperation> {
|
||||
private final List<String> fileOptions_ = new ArrayList<>();
|
||||
private final List<String> cmdFiles_ = new ArrayList<>();
|
||||
private final JpackageOptions jpackageOptions_ = new JpackageOptions();
|
||||
|
||||
public JpackageOperation() {
|
||||
|
@ -24,7 +24,7 @@ public class JpackageOperation extends AbstractToolProviderOperation<JpackageOpe
|
|||
|
||||
@Override
|
||||
public void execute() throws Exception {
|
||||
toolArgs(fileOptions_.stream().map(opt -> '@' + opt).toList());
|
||||
toolArgs(cmdFiles_.stream().map(opt -> '@' + opt).toList());
|
||||
toolArgs(jpackageOptions_);
|
||||
super.execute();
|
||||
}
|
||||
|
@ -35,17 +35,17 @@ public class JpackageOperation extends AbstractToolProviderOperation<JpackageOpe
|
|||
* @return the list of files
|
||||
*/
|
||||
public List<String> fileOptions() {
|
||||
return fileOptions_;
|
||||
return cmdFiles_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read options and/or mode from a file.
|
||||
* Read options and/or mode from file(s).
|
||||
*
|
||||
* @param file one or more file
|
||||
* @return this operation instance
|
||||
*/
|
||||
public JpackageOperation fileOptions(String... file) {
|
||||
fileOptions_.addAll(List.of(file));
|
||||
public JpackageOperation cmdFiles(String... file) {
|
||||
cmdFiles_.addAll(List.of(file));
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue