当前位置: 首页>>代码示例>>Java>>正文


Java GradleConnector.useGradleUserHomeDir方法代码示例

本文整理汇总了Java中org.gradle.tooling.GradleConnector.useGradleUserHomeDir方法的典型用法代码示例。如果您正苦于以下问题:Java GradleConnector.useGradleUserHomeDir方法的具体用法?Java GradleConnector.useGradleUserHomeDir怎么用?Java GradleConnector.useGradleUserHomeDir使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.gradle.tooling.GradleConnector的用法示例。


在下文中一共展示了GradleConnector.useGradleUserHomeDir方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createProjectConnection

import org.gradle.tooling.GradleConnector; //导入方法依赖的package包/类
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);
    }

    GradleVersion gradleVersion = executer.getGradleVersion();
    if (gradleVersion.equals(GradleVersion.current())) {
        connector.useInstallation(gradle.getGradleHomeDir());
    } else {
        connector.useGradleVersion(gradleVersion.getVersion());
    }

    return connector.connect();
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:18,代码来源:GradleBuildComparison.java

示例2: createConnector

import org.gradle.tooling.GradleConnector; //导入方法依赖的package包/类
/**
 * Creates a new Gradle connector for the context.
 * @param context the target context
 * @return a connector
 */
public static GradleConnector createConnector(GradleContext context) {
    GradleConnector connector = GradleConnector.newConnector();
    connector.forProjectDirectory(context.getProjectDirectory().getAbsoluteFile());
    String versionLabel;
    if (context.getGradleDistribution() != null) {
        versionLabel = context.getGradleDistribution().toString();
        connector.useDistribution(context.getGradleDistribution());
    } else {
        String version = context.getGradleVersion();
        version = version == null ? GradleVersion.current().getVersion() : version;
        versionLabel = version;
        URI distribution = toDistributionUri(version, context.isUseHttps());
        if (distribution != null) {
            connector.useDistribution(distribution);
        } else {
            connector.useGradleVersion(version);
        }
    }
    context.information(MessageFormat.format(
            Messages.GradleUtil_infoPrepareDaemon,
            versionLabel));
    if (context.getGradleUserHomeDir() != null) {
        connector.useGradleUserHomeDir(context.getGradleUserHomeDir().getAbsoluteFile());
    }
    return connector;
}
 
开发者ID:asakusafw,项目名称:asakusafw-shafu,代码行数:32,代码来源:GradleUtil.java

示例3: main

import org.gradle.tooling.GradleConnector; //导入方法依赖的package包/类
public static void main(String[] args) {
    // Configure the connector and create the connection
    GradleConnector connector = GradleConnector.newConnector();

    if (args.length > 0) {
        connector.useInstallation(new File(args[0]));
        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();
        launcher.forTasks("help");
        launcher.setStandardOutput(System.out);
        launcher.setStandardError(System.err);

        // Run the build
        launcher.run();
    } finally {
        // Clean up
        connection.close();
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:29,代码来源:Main.java

示例4: getGradleConnector

import org.gradle.tooling.GradleConnector; //导入方法依赖的package包/类
@NotNull
private static GradleConnector getGradleConnector(@NotNull BuilderExecutionSettings executionSettings) {
  GradleConnector connector = GradleConnector.newConnector();
  if (connector instanceof DefaultGradleConnector) {
    DefaultGradleConnector defaultConnector = (DefaultGradleConnector)connector;

    if (executionSettings.isEmbeddedModeEnabled()) {
      LOG.info("Using Gradle embedded mode.");
      defaultConnector.embedded(true);
    }

    defaultConnector.setVerboseLogging(executionSettings.isVerboseLoggingEnabled());
  }

  connector.forProjectDirectory(executionSettings.getProjectDir());

  File gradleHomeDir = executionSettings.getGradleHomeDir();
  if (gradleHomeDir != null) {
    connector.useInstallation(gradleHomeDir);
  }

  File gradleServiceDir = executionSettings.getGradleServiceDir();
  if (gradleServiceDir != null) {
    connector.useGradleUserHomeDir(gradleServiceDir);
  }

  return connector;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:AndroidGradleTargetBuilder.java

示例5: main

import org.gradle.tooling.GradleConnector; //导入方法依赖的package包/类
public static void main(String[] args) {
    // Configure the connector and create the connection
    GradleConnector connector = GradleConnector.newConnector();

    if (args.length > 0) {
        connector.useInstallation(new File(args[0]));
        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();
        launcher.forTasks("help");
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        launcher.setStandardOutput(outputStream);
        launcher.setStandardError(outputStream);

        // Run the build
        launcher.run();
    } finally {
        // Clean up
        connection.close();
    }
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:30,代码来源:Main.java


注:本文中的org.gradle.tooling.GradleConnector.useGradleUserHomeDir方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。