2
0
Fork 0
mirror of https://github.com/ethauvin/bld.git synced 2025-04-25 16:27:11 -07:00

Renamed fileOptions to cmdFiles

This commit is contained in:
Erik C. Thauvin 2024-08-04 20:16:55 -07:00
parent 62a324068f
commit a06ce8eaaa
Signed by: erik
GPG key ID: 776702A6A2DA330E
4 changed files with 64 additions and 63 deletions

View file

@ -15,14 +15,35 @@ import java.util.Map;
* @since 2.0.2
*/
public class JlinkOperation extends AbstractToolProviderOperation<JlinkOperation> {
private final List<String> cmdFiles_ = new ArrayList<>();
private final List<String> disabledPlugins_ = new ArrayList<>();
private final JlinkOptions jlinkOptions_ = new JlinkOptions();
private final List<String> fileOptions_ = new ArrayList<>();
public JlinkOperation() {
super("jlink");
}
/**
* Read options and/or mode from file(s).
*
* @param file one or more file
* @return this operation instance
*/
public JlinkOperation cmdFiles(String... file) {
cmdFiles_.addAll(List.of(file));
return this;
}
/**
* Retrieves the list of files containing options or mode.
*
* @return the list of files
*/
public List<String> cmdFiles() {
return cmdFiles_;
}
/**
* Disable the plugin mentioned.
*
@ -36,23 +57,12 @@ public class JlinkOperation extends AbstractToolProviderOperation<JlinkOperation
@Override
public void execute() throws Exception {
toolArgsFromFile(fileOptions_);
toolArgsFromFile(cmdFiles_);
disabledPlugins_.forEach(plugin -> toolArgs("--disable-plugin", plugin));
toolArgs(jlinkOptions_);
super.execute();
}
/**
* Retrieves the list of options for the jlink tool.
* <p>
* This is a modifiable list that can be retrieved and changed.
*
* @return the map of jlink options
*/
public JlinkOptions jlinkOptions() {
return jlinkOptions_;
}
/**
* Provides a list of options to provide to the jlink tool.
* <p>
@ -67,22 +77,13 @@ public class JlinkOperation extends AbstractToolProviderOperation<JlinkOperation
}
/**
* Read options and/or mode from a file.
* Retrieves the list of options for the jlink tool.
* <p>
* This is a modifiable list that can be retrieved and changed.
*
* @param file one or more file
* @return this operation instance
* @return the map of jlink options
*/
public JlinkOperation fileOptions(String... file) {
fileOptions_.addAll(List.of(file));
return this;
}
/**
* Retrieves the list of files containing options or mode.
*
* @return the list of files
*/
public List<String> fileOptions() {
return fileOptions_;
public JlinkOptions jlinkOptions() {
return jlinkOptions_;
}
}

View file

@ -15,7 +15,7 @@ import java.util.Map;
* @since 2.0.2
*/
public class JmodOperation extends AbstractToolProviderOperation<JmodOperation> {
private final List<String> fileOptions_ = new ArrayList<>();
private final List<String> cmdFiles = new ArrayList<>();
private final JmodOptions jmodOptions_ = new JmodOptions();
private String jmodFile_;
private OperationMode operationMode_;
@ -24,13 +24,33 @@ public class JmodOperation extends AbstractToolProviderOperation<JmodOperation>
super("jmod");
}
/**
* Retrieves the list of files containing options or mode.
*
* @return the list of files
*/
public List<String> cmdFiles() {
return cmdFiles;
}
/**
* Read options and/or mode from file(s).
*
* @param file one or more file
* @return this operation instance
*/
public JmodOperation cmdFiles(String... file) {
cmdFiles.addAll(List.of(file));
return this;
}
@Override
public void execute() throws Exception {
if (operationMode_ != null) {
toolArgs(operationMode_.mode);
}
toolArgsFromFile(fileOptions_);
toolArgsFromFile(cmdFiles);
toolArgs(jmodOptions_);
if (jmodFile_ != null) {
@ -40,26 +60,6 @@ public class JmodOperation extends AbstractToolProviderOperation<JmodOperation>
super.execute();
}
/**
* Retrieves the list of files containing options or mode.
*
* @return the list of files
*/
public List<String> fileOptions() {
return fileOptions_;
}
/**
* Read options and/or mode from a file.
*
* @param file one or more file
* @return this operation instance
*/
public JmodOperation fileOptions(String... file) {
fileOptions_.addAll(List.of(file));
return this;
}
/**
* Retrieves the name of the JMOD file to create or from which to retrieve information.
*