Examples of StartParameter


Examples of org.gradle.StartParameter

            // the error reporting below is applied to as much code as possible
            CommandLineActionFactory actionFactory = createActionFactory();
            Action<ExecutionListener> action = actionFactory.convert(Arrays.asList(args));
            action.execute(buildCompleter);
        } catch (Throwable e) {
            BuildExceptionReporter exceptionReporter = new BuildExceptionReporter(new StreamingStyledTextOutputFactory(System.err), new StartParameter(), new GradleLauncherMetaData());
            exceptionReporter.reportException(e);
            buildCompleter.onFailure(e);
        }
        buildCompleter.exit();
    }
View Full Code Here

Examples of org.gradle.StartParameter

        this.connector = connector;
        launcherFactory = new DefaultGradleLauncherFactory(loggingServices);
    }

    public static void main(String[] args) {
        StartParameter startParameter = new DefaultCommandLineConverter().convert(Arrays.asList(args));
        DaemonConnector connector = new DaemonConnector(startParameter.getGradleUserHomeDir());
        new DaemonMain(new LoggingServiceRegistry(), connector).run();
    }
View Full Code Here

Examples of org.gradle.StartParameter

    private void doRunWithLogging(Connection<Object> connection, Stoppable serverControl, ExecutionListener executionListener) {
        Command command = (Command) connection.receive();
        try {
            doRunWithExceptionHandling(command, serverControl, executionListener);
        } catch (Throwable throwable) {
            BuildExceptionReporter exceptionReporter = new BuildExceptionReporter(loggingServices.get(StyledTextOutputFactory.class), new StartParameter(), command.getClientMetaData());
            exceptionReporter.reportException(throwable);
            executionListener.onFailure(throwable);
        }
    }
View Full Code Here

Examples of org.gradle.StartParameter

        build((Build) command, executionListener);
    }

    private void build(Build build, ExecutionListener executionListener) {
        DefaultCommandLineConverter converter = new DefaultCommandLineConverter();
        StartParameter startParameter = new StartParameter();
        startParameter.setCurrentDir(build.getCurrentDir());
        converter.convert(build.getArgs(), startParameter);
        LoggingManagerInternal loggingManager = loggingServices.getFactory(LoggingManagerInternal.class).create();
        loggingManager.setLevel(startParameter.getLogLevel());
        loggingManager.start();

        Properties sysProperties = new Properties();
        sysProperties.putAll(System.getProperties());

        try {
            RunBuildAction action = new RunBuildAction(startParameter, loggingServices, new DefaultBuildRequestMetaData(build.getClientMetaData(), build.getStartTime())) {
                @Override
                GradleLauncherFactory createGradleLauncherFactory(ServiceRegistry loggingServices) {
                    return launcherFactory;
                }
            };
            action.execute(executionListener);
        } catch (Throwable throwable) {
            BuildExceptionReporter exceptionReporter = new BuildExceptionReporter(loggingServices.get(StyledTextOutputFactory.class), new StartParameter(), build.getClientMetaData());
            exceptionReporter.reportException(throwable);
            executionListener.onFailure(throwable);
        }

        loggingManager.stop();
View Full Code Here

Examples of org.gradle.StartParameter

        }
        if (commandLine.hasOption(GUI)) {
            return new ActionAdapter(new ShowGuiAction());
        }

        StartParameter startParameter = new StartParameter();
        startParameterConverter.convert(commandLine, startParameter);
        DaemonConnector connector = new DaemonConnector(startParameter.getGradleUserHomeDir());
        GradleLauncherMetaData clientMetaData = new GradleLauncherMetaData();
        long startTime = ManagementFactory.getRuntimeMXBean().getStartTime();

        if (commandLine.hasOption(FOREGROUND)) {
            return new ActionAdapter(new DaemonMain(loggingServices, connector));
View Full Code Here

Examples of org.gradle.StartParameter

    public static void update(ArtifactoryClientConfiguration config, Project project) {
        Properties props = new Properties();
        // First aggregate properties from parent to child
        fillProperties(project, props);
        // Then start parameters
        StartParameter startParameter = project.getGradle().getStartParameter();
        Map<String, String> startProps = startParameter.getProjectProperties();
        props.putAll(BuildInfoExtractorUtils.filterStringEntries(startProps));

        // Then System properties
        Properties mergedProps = BuildInfoExtractorUtils.mergePropertiesWithSystemAndPropertyFile(props, config.info.getLog());
        // Then special buildInfo properties
View Full Code Here

Examples of org.gradle.StartParameter

        return requests;
    }

    private StartParameter configureStartParameter(ProviderOperationParameters parameters, Map<String, String> properties) {
        // Important that this is constructed on the client so that it has the right gradleHomeDir and other state internally
        StartParameter startParameter = new StartParameter();

        startParameter.setProjectDir(parameters.getProjectDir());
        if (parameters.getGradleUserHomeDir() != null) {
            startParameter.setGradleUserHomeDir(parameters.getGradleUserHomeDir());
        }

        List<InternalLaunchable> launchables = parameters.getLaunchables(null);
        if (launchables != null) {
            startParameter.setTaskRequests(unpack(launchables));
        } else if (parameters.getTasks() != null) {
            startParameter.setTaskNames(parameters.getTasks());
        }

        new PropertiesToStartParameterConverter().convert(properties, startParameter);

        List<String> arguments = parameters.getArguments(Collections.<String>emptyList());
        if (arguments != null) {
            DefaultCommandLineConverter converter = new DefaultCommandLineConverter();
            try {
                converter.convert(arguments, startParameter);
            } catch (CommandLineArgumentException e) {
                throw new InternalUnsupportedBuildArgumentException(
                    "Problem with provided build arguments: " + arguments + ". "
                    + "\n" + e.getMessage()
                    + "\nEither it is not a valid build option or it is not supported in the target Gradle version."
                    + "\nNot all of the Gradle command line options are supported build arguments."
                    + "\nExamples of supported build arguments: '--info', '-u', '-p'."
                    + "\nExamples of unsupported build options: '--daemon', '-?', '-v'."
                    + "\nPlease find more information in the javadoc for the BuildLauncher class.", e);
            }
        }

        if (parameters.isSearchUpwards() != null) {
            startParameter.setSearchUpwards(parameters.isSearchUpwards());
        }

        if (parameters.getBuildLogLevel() != null) {
            startParameter.setLogLevel(parameters.getBuildLogLevel());
        }

        return startParameter;
    }
View Full Code Here

Examples of org.gradle.StartParameter

        this.settingsProcessor = settingsProcessor;
        this.buildSourceBuilder = buildSourceBuilder;
    }

    public SettingsInternal findAndLoadSettings(GradleInternal gradle) {
        StartParameter startParameter = gradle.getStartParameter();
        SettingsInternal settings = findSettingsAndLoadIfAppropriate(gradle, startParameter);

        ProjectSpec spec = ProjectSpecs.forStartParameter(startParameter, settings);

        if (spec.containsProject(settings.getProjectRegistry())) {
            setDefaultProject(spec, settings);
            return settings;
        }

        // Try again with empty settings
        StartParameter noSearchParameter = startParameter.newInstance();
        noSearchParameter.useEmptySettings();
        settings = findSettingsAndLoadIfAppropriate(gradle, noSearchParameter);

        // Set explicit build file, if required
        if (noSearchParameter.getBuildFile() != null) {
            ProjectDescriptor rootProject = settings.getRootProject();
            rootProject.setBuildFileName(noSearchParameter.getBuildFile().getName());
        }
        setDefaultProject(spec, settings);

        return settings;
    }
View Full Code Here

Examples of org.gradle.StartParameter

                                                              StartParameter startParameter) {
        SettingsLocation settingsLocation = findSettings(startParameter);

        // We found the desired settings file, now build the associated buildSrc before loading settings.  This allows
        // the settings script to reference classes in the buildSrc.
        StartParameter buildSrcStartParameter = startParameter.newBuild();
        buildSrcStartParameter.setCurrentDir(new File(settingsLocation.getSettingsDir(), BaseSettings.DEFAULT_BUILD_SRC_DIR));
        ClassLoaderScope buildSourceClassLoader = buildSourceBuilder.buildAndCreateClassLoader(buildSrcStartParameter);

        return settingsProcessor.process(gradle, settingsLocation, buildSourceClassLoader, startParameter);
    }
View Full Code Here

Examples of org.gradle.StartParameter

            processEnvironment.maybeSetEnvironmentVariable(entry.getKey(), entry.getValue());
        }
        Map<String, String> implicitJvmSystemProperties = getImplicitJvmSystemProperties();
        System.getProperties().putAll(implicitJvmSystemProperties);

        StartParameter parameter = new StartParameter();
        parameter.setCurrentDir(getWorkingDir());
        parameter.setShowStacktrace(ShowStacktrace.ALWAYS);

        CommandLineParser parser = new CommandLineParser();
        DefaultCommandLineConverter converter = new DefaultCommandLineConverter();
        converter.configure(parser);
        ParsedCommandLine parsedCommandLine = parser.parse(getAllArgs());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.