Package org.gradle.tooling

Examples of org.gradle.tooling.GradleConnector.forProjectDirectory()


public class ToolingApiGradleHandleFactory implements GradleHandleFactory {

    public GradleHandle start(File directory, List<String> arguments) {
        GradleConnector connector = GradleConnector.newConnector();
        connector.forProjectDirectory(directory);
        ProjectConnection connection = connector.connect();
        BuildLauncher launcher = connection.newBuild();
        String[] argumentArray = new String[arguments.size()];
        arguments.toArray(argumentArray);
        launcher.withArguments(argumentArray);
View Full Code Here


        File projectDir = FileUtil.toFile(projectDirObj);
        if (projectDir == null) {
            throw new RuntimeException("Missing project directory: " + projectDirObj);
        }

        connector.forProjectDirectory(projectDir);

        OperationInitializer setup = GradleModelLoader.modelBuilderSetup(project, progress);

        // FIXME: Currently we just fetch IdeaProject and rely on that to fetch
        //   the sources. Then the source locator query will find the sources
View Full Code Here

        GradleModelLoader.ModelBuilderSetup targetSetup = createTargetSetup(taskDef, progress);

        Throwable commandError = null;

        GradleConnector gradleConnector = GradleModelLoader.createGradleConnector(cancelToken, project);
        gradleConnector.forProjectDirectory(projectDir);
        ProjectConnection projectConnection = null;
        try {
            projectConnection = gradleConnector.connect();

            BuildLauncher buildLauncher = projectConnection.newBuild();
View Full Code Here

        File projectDir = project.getProjectDirectoryAsFile();

        LOGGER.log(Level.INFO, "Loading Gradle project from directory: {0}", projectDir);

        GradleConnector gradleConnector = createGradleConnector(cancelToken, project);
        gradleConnector.forProjectDirectory(projectDir);
        ProjectConnection projectConnection = null;

        NbModelLoader.Result loadedModels;
        try {
            projectConnection = gradleConnector.connect();
View Full Code Here

        if (projectDir == null) throw new NullPointerException("projectDir");
        if (task == null) throw new NullPointerException("task");

        GradleConnector connector = GradleConnector.newConnector();
        connector.useGradleVersion(gradleVersion);
        connector.forProjectDirectory(projectDir);

        if (connector instanceof DefaultGradleConnector) {
            ((DefaultGradleConnector)connector).daemonMaxIdleTime(60, TimeUnit.SECONDS);
        }
View Full Code Here

    GradleConnector gradleConnector = GradleConnector.newConnector();
    gradleConnector.useGradleVersion(this.gradleVersion);

    ((DefaultGradleConnector) gradleConnector).embedded(true);
    return gradleConnector.forProjectDirectory(projectDirectory).connect();
  }
}
View Full Code Here

        }
    }

    private ProjectConnection createProjectConnection(ComparableGradleBuildExecuter executer) {
        GradleConnector connector = GradleConnector.newConnector();
        connector.forProjectDirectory(executer.getSpec().getProjectDir());
        File gradleUserHomeDir = gradle.getStartParameter().getGradleUserHomeDir();
        if (gradleUserHomeDir != null) {
            connector.useGradleUserHomeDir(gradleUserHomeDir);
        }
View Full Code Here

            if (args.length > 1) {
                connector.useGradleUserHomeDir(new File(args[1]));
            }
        }

        connector.forProjectDirectory(new File("."));

        ProjectConnection connection = connector.connect();
        try {
            // Configure the build
            BuildLauncher launcher = connection.newBuild();
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.