本文整理匯總了Java中org.gradle.cli.ParsedCommandLine.hasOption方法的典型用法代碼示例。如果您正苦於以下問題:Java ParsedCommandLine.hasOption方法的具體用法?Java ParsedCommandLine.hasOption怎麽用?Java ParsedCommandLine.hasOption使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.gradle.cli.ParsedCommandLine
的用法示例。
在下文中一共展示了ParsedCommandLine.hasOption方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: convert
import org.gradle.cli.ParsedCommandLine; //導入方法依賴的package包/類
public DaemonParameters convert(ParsedCommandLine args, DaemonParameters target) throws CommandLineArgumentException {
if (args.hasOption(FOREGROUND)) {
target.setForeground(true);
}
if (args.hasOption(STOP)) {
target.setStop(true);
}
if (args.hasOption(STATUS)) {
target.setStatus(true);
}
if (args.hasOption(NO_DAEMON)) {
target.setEnabled(false);
} else if (args.hasOption(DAEMON)) {
target.setEnabled(true);
}
return target;
}
示例2: createAction
import org.gradle.cli.ParsedCommandLine; //導入方法依賴的package包/類
public Runnable createAction(CommandLineParser parser, ParsedCommandLine commandLine) {
if (commandLine.hasOption(HELP)) {
return new ShowUsageAction(parser);
}
if (commandLine.hasOption(VERSION)) {
return new ShowVersionAction();
}
return null;
}
示例3: createAction
import org.gradle.cli.ParsedCommandLine; //導入方法依賴的package包/類
public Runnable createAction(CommandLineParser parser, ParsedCommandLine commandLine) {
if (commandLine.hasOption(GUI)) {
DeprecationLogger.nagUserOfToolReplacedWithExternalOne("Gradle GUI", "an IDE with support for Gradle e.g. Eclipse, IntelliJ or NetBeans");
return new ShowGuiAction();
}
return null;
}
示例4: convert
import org.gradle.cli.ParsedCommandLine; //導入方法依賴的package包/類
public BuildLayoutParameters convert(ParsedCommandLine options, BuildLayoutParameters target) throws CommandLineArgumentException {
Transformer<File, String> resolver = new BasicFileResolver(target.getCurrentDir());
if (options.hasOption(NO_SEARCH_UPWARDS)) {
target.setSearchUpwards(false);
}
if (options.hasOption(PROJECT_DIR)) {
target.setProjectDir(resolver.transform(options.option(PROJECT_DIR).getValue()));
}
if (options.hasOption(GRADLE_USER_HOME)) {
target.setGradleUserHomeDir(resolver.transform(options.option(GRADLE_USER_HOME).getValue()));
}
return target;
}
示例5: convert
import org.gradle.cli.ParsedCommandLine; //導入方法依賴的package包/類
public DaemonParameters convert(ParsedCommandLine args, DaemonParameters target) throws CommandLineArgumentException {
if (args.hasOption(NO_DAEMON)) {
return target.setEnabled(false);
}
if (args.hasOption(DAEMON)) {
return target.setEnabled(true);
}
return target;
}
示例6: createAction
import org.gradle.cli.ParsedCommandLine; //導入方法依賴的package包/類
public Runnable createAction(CommandLineParser parser, ParsedCommandLine commandLine) {
BuildLayoutParameters layout = new BuildLayoutParameters();
layoutConverter.convert(commandLine, layout);
Map<String, String> properties = new HashMap<String, String>();
layoutToPropertiesConverter.convert(layout, properties);
propertiesConverter.convert(commandLine, properties);
StartParameter startParameter = new StartParameter();
propertiesToStartParameterConverter.convert(properties, startParameter);
commandLineConverter.convert(commandLine, startParameter);
DaemonParameters daemonParameters = new DaemonParameters(layout, startParameter.getSystemPropertiesArgs());
propertiesToDaemonParametersConverter.convert(properties, daemonParameters);
daemonConverter.convert(commandLine, daemonParameters);
if (commandLine.hasOption(STOP)) {
return stopAllDaemons(daemonParameters, loggingServices);
}
if (commandLine.hasOption(FOREGROUND)) {
ForegroundDaemonConfiguration conf = new ForegroundDaemonConfiguration(
daemonParameters.getUid(), daemonParameters.getBaseDir(), daemonParameters.getIdleTimeout());
return new ForegroundDaemonAction(loggingServices, conf);
}
if (daemonParameters.isEnabled()) {
return runBuildWithDaemon(startParameter, daemonParameters, loggingServices);
}
if (canUseCurrentProcess(daemonParameters)) {
return runBuildInProcess(startParameter, daemonParameters, loggingServices);
}
return runBuildInSingleUseDaemon(startParameter, daemonParameters, loggingServices);
}
示例7: createAction
import org.gradle.cli.ParsedCommandLine; //導入方法依賴的package包/類
public Action<? super ExecutionListener> createAction(CommandLineParser parser, ParsedCommandLine commandLine) {
if (commandLine.hasOption(HELP)) {
return Actions.toAction(new ShowUsageAction(parser));
}
if (commandLine.hasOption(VERSION)) {
return Actions.toAction(new ShowVersionAction());
}
return null;
}
示例8: createAction
import org.gradle.cli.ParsedCommandLine; //導入方法依賴的package包/類
public Action<? super ExecutionListener> createAction(CommandLineParser parser, ParsedCommandLine commandLine) {
BuildLayoutParameters layout = new BuildLayoutParameters();
layoutConverter.convert(commandLine, layout);
Map<String, String> properties = new HashMap<String, String>();
layoutToPropertiesConverter.convert(layout, properties);
propertiesConverter.convert(commandLine, properties);
StartParameter startParameter = new StartParameter();
propertiesToStartParameterConverter.convert(properties, startParameter);
commandLineConverter.convert(commandLine, startParameter);
DaemonParameters daemonParameters = new DaemonParameters(layout);
propertiesToDaemonParametersConverter.convert(properties, daemonParameters);
daemonConverter.convert(commandLine, daemonParameters);
if (commandLine.hasOption(STOP)) {
return stopAllDaemons(daemonParameters, loggingServices);
}
if (commandLine.hasOption(FOREGROUND)) {
ForegroundDaemonConfiguration conf = new ForegroundDaemonConfiguration(
daemonParameters.getUid(), daemonParameters.getBaseDir(), daemonParameters.getIdleTimeout());
return Actions.toAction(new ForegroundDaemonMain(conf));
}
if (daemonParameters.isEnabled()) {
return runBuildWithDaemon(startParameter, daemonParameters, loggingServices);
}
if (canUseCurrentProcess(daemonParameters)) {
return runBuildInProcess(startParameter, daemonParameters, loggingServices);
}
return runBuildInSingleUseDaemon(startParameter, daemonParameters, loggingServices);
}
示例9: convert
import org.gradle.cli.ParsedCommandLine; //導入方法依賴的package包/類
public BuildLayoutParameters convert(ParsedCommandLine options, BuildLayoutParameters target) throws CommandLineArgumentException {
FileResolver resolver = fileLookup.getFileResolver(target.getProjectDir());
if (options.hasOption(NO_SEARCH_UPWARDS)) {
target.setSearchUpwards(false);
}
if (options.hasOption(PROJECT_DIR)) {
target.setProjectDir(resolver.resolve(options.option(PROJECT_DIR).getValue()));
}
if (options.hasOption(GRADLE_USER_HOME)) {
target.setGradleUserHomeDir(resolver.resolve(options.option(GRADLE_USER_HOME).getValue()));
}
return target;
}
示例10: gradleUserHome
import org.gradle.cli.ParsedCommandLine; //導入方法依賴的package包/類
private static File gradleUserHome(ParsedCommandLine options) {
if (options.hasOption(GRADLE_USER_HOME_OPTION)) {
return new File(options.option(GRADLE_USER_HOME_OPTION).getValue());
}
return GradleUserHomeLookup.gradleUserHome();
}
示例11: logger
import org.gradle.cli.ParsedCommandLine; //導入方法依賴的package包/類
private static Logger logger(ParsedCommandLine options) {
return new Logger(options.hasOption(GRADLE_QUIET_OPTION));
}
示例12: createAction
import org.gradle.cli.ParsedCommandLine; //導入方法依賴的package包/類
public Runnable createAction(CommandLineParser parser, ParsedCommandLine commandLine) {
if (commandLine.hasOption(GUI)) {
return new ShowGuiAction();
}
return null;
}
示例13: createAction
import org.gradle.cli.ParsedCommandLine; //導入方法依賴的package包/類
public Action<? super ExecutionListener> createAction(CommandLineParser parser, ParsedCommandLine commandLine) {
if (commandLine.hasOption(GUI)) {
return Actions.toAction(new ShowGuiAction());
}
return null;
}