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


Java WrapperExecutor类代码示例

本文整理汇总了Java中org.gradle.wrapper.WrapperExecutor的典型用法代码示例。如果您正苦于以下问题:Java WrapperExecutor类的具体用法?Java WrapperExecutor怎么用?Java WrapperExecutor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: updateDefaultWrapperConfiguration

import org.gradle.wrapper.WrapperExecutor; //导入依赖的package包/类
private static void updateDefaultWrapperConfiguration(@NotNull String linkedProjectPath) {
  try {
    final File wrapperPropertiesFile = GradleUtil.findDefaultWrapperPropertiesFile(linkedProjectPath);
    if (wrapperPropertiesFile == null) return;
    final WrapperConfiguration wrapperConfiguration = GradleUtil.getWrapperConfiguration(linkedProjectPath);
    if (wrapperConfiguration == null) return;
    String currentDistributionUri = wrapperConfiguration.getDistribution().toString();
    if (StringUtil.endsWith(currentDistributionUri, ALL_ZIP_DISTRIBUTION_URI_SUFFIX)) return;

    final String distributionUri =
      currentDistributionUri.substring(0, currentDistributionUri.lastIndexOf('-')) + ALL_ZIP_DISTRIBUTION_URI_SUFFIX;

    wrapperConfiguration.setDistribution(new URI(distributionUri));
    Properties wrapperProperties = new Properties();
    wrapperProperties.setProperty(WrapperExecutor.DISTRIBUTION_URL_PROPERTY, wrapperConfiguration.getDistribution().toString());
    wrapperProperties.setProperty(WrapperExecutor.DISTRIBUTION_BASE_PROPERTY, wrapperConfiguration.getDistributionBase());
    wrapperProperties.setProperty(WrapperExecutor.DISTRIBUTION_PATH_PROPERTY, wrapperConfiguration.getDistributionPath());
    wrapperProperties.setProperty(WrapperExecutor.ZIP_STORE_BASE_PROPERTY, wrapperConfiguration.getZipBase());
    wrapperProperties.setProperty(WrapperExecutor.ZIP_STORE_PATH_PROPERTY, wrapperConfiguration.getZipPath());
    GUtil.saveProperties(wrapperProperties, new File(wrapperPropertiesFile.getPath()));
    LocalFileSystem.getInstance().refreshIoFiles(Collections.singletonList(wrapperPropertiesFile));
  }
  catch (Exception e) {
    LOG.error(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:UseDistributionWithSourcesNotificationProvider.java

示例2: writeProperties

import org.gradle.wrapper.WrapperExecutor; //导入依赖的package包/类
private void writeProperties(File propertiesFileDestination) {
    Properties wrapperProperties = new Properties();
    wrapperProperties.put(WrapperExecutor.DISTRIBUTION_URL_PROPERTY, getDistributionUrl());
    wrapperProperties.put(WrapperExecutor.DISTRIBUTION_BASE_PROPERTY, distributionBase.toString());
    wrapperProperties.put(WrapperExecutor.DISTRIBUTION_PATH_PROPERTY, distributionPath);
    wrapperProperties.put(WrapperExecutor.ZIP_STORE_BASE_PROPERTY, archiveBase.toString());
    wrapperProperties.put(WrapperExecutor.ZIP_STORE_PATH_PROPERTY, archivePath);
    GUtil.saveProperties(wrapperProperties, propertiesFileDestination);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:10,代码来源:Wrapper.java

示例3: getDefaultDistribution

import org.gradle.wrapper.WrapperExecutor; //导入依赖的package包/类
/**
 * Returns the default distribution to use for the specified project.
 */
public Distribution getDefaultDistribution(File projectDir, boolean searchUpwards) {
    BuildLayout layout = new BuildLayoutFactory().getLayoutFor(projectDir, searchUpwards);
    WrapperExecutor wrapper = WrapperExecutor.forProjectDirectory(layout.getRootDirectory());
    if (wrapper.getDistribution() != null) {
        return new ZippedDistribution(wrapper.getConfiguration(), executorFactory, distributionBaseDir);
    }
    return getDownloadedDistribution(GradleVersion.current().getVersion());
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:12,代码来源:DistributionFactory.java


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