當前位置: 首頁>>代碼示例>>Java>>正文


Java ParsedCommandLine.hasOption方法代碼示例

本文整理匯總了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;
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:19,代碼來源:DaemonCommandLineConverter.java

示例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;
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:10,代碼來源:CommandLineActionFactory.java

示例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;
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:8,代碼來源:GuiActionsFactory.java

示例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;
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:14,代碼來源:LayoutCommandLineConverter.java

示例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;
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:10,代碼來源:DaemonCommandLineConverter.java

示例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);
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:33,代碼來源:BuildActionsFactory.java

示例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;
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:10,代碼來源:CommandLineActionFactory.java

示例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);
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:33,代碼來源:BuildActionsFactory.java

示例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;
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:14,代碼來源:LayoutCommandLineConverter.java

示例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();
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:7,代碼來源:GradleWrapperMain.java

示例11: logger

import org.gradle.cli.ParsedCommandLine; //導入方法依賴的package包/類
private static Logger logger(ParsedCommandLine options) {
    return new Logger(options.hasOption(GRADLE_QUIET_OPTION));
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:4,代碼來源:GradleWrapperMain.java

示例12: createAction

import org.gradle.cli.ParsedCommandLine; //導入方法依賴的package包/類
public Runnable createAction(CommandLineParser parser, ParsedCommandLine commandLine) {
    if (commandLine.hasOption(GUI)) {
        return new ShowGuiAction();
    }
    return null;
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:7,代碼來源:GuiActionsFactory.java

示例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;
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:7,代碼來源:GuiActionsFactory.java


注:本文中的org.gradle.cli.ParsedCommandLine.hasOption方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。