org.gradle.api.Project.getAnt()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(166)

本文整理了Java中org.gradle.api.Project.getAnt()方法的一些代码示例,展示了Project.getAnt()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Project.getAnt()方法的具体详情如下:
包路径:org.gradle.api.Project
类名称:Project
方法名:getAnt

Project.getAnt介绍

暂无

代码示例

代码示例来源:origin: com.liferay/com.liferay.gradle.plugins.node

private File _download(String url, File destinationFile)
  throws IOException {
  String protocol = url.substring(0, url.indexOf(':'));
  String proxyPassword = System.getProperty(protocol + ".proxyPassword");
  String proxyUser = System.getProperty(protocol + ".proxyUser");
  if (Validator.isNotNull(proxyPassword) &&
    Validator.isNotNull(proxyUser)) {
    Project project = getProject();
    String nonProxyHosts = System.getProperty(
      protocol + ".nonProxyHosts");
    String proxyHost = System.getProperty(protocol + ".proxyHost");
    String proxyPort = System.getProperty(protocol + ".proxyPort");
    AntBuilder antBuilder = project.getAnt();
    Map<String, String> args = new HashMap<>();
    args.put("nonproxyhosts", nonProxyHosts);
    args.put("proxyhost", proxyHost);
    args.put("proxypassword", proxyPassword);
    args.put("proxyport", proxyPort);
    args.put("proxyuser", proxyUser);
    antBuilder.invokeMethod("setproxy", args);
  }
  return FileUtil.get(getProject(), url, destinationFile);
}

代码示例来源:origin: gradle.plugin.com.liferay/gradle-plugins-node

private File _download(String url, File destinationFile)
  throws IOException {
  String protocol = url.substring(0, url.indexOf(':'));
  String proxyPassword = System.getProperty(protocol + ".proxyPassword");
  String proxyUser = System.getProperty(protocol + ".proxyUser");
  if (Validator.isNotNull(proxyPassword) &&
    Validator.isNotNull(proxyUser)) {
    Project project = getProject();
    String nonProxyHosts = System.getProperty(
      protocol + ".nonProxyHosts");
    String proxyHost = System.getProperty(protocol + ".proxyHost");
    String proxyPort = System.getProperty(protocol + ".proxyPort");
    AntBuilder antBuilder = project.getAnt();
    Map<String, String> args = new HashMap<>();
    args.put("nonproxyhosts", nonProxyHosts);
    args.put("proxyhost", proxyHost);
    args.put("proxypassword", proxyPassword);
    args.put("proxyport", proxyPort);
    args.put("proxyuser", proxyUser);
    antBuilder.invokeMethod("setproxy", args);
  }
  return FileUtil.get(getProject(), url, destinationFile);
}

代码示例来源:origin: MinecraftForge/ForgeGradle

public String getBuildNumber() throws IOException
  {
    if (this.buildNumber == null)
    {
      AntBuilder ant = getProject().getAnt();

      File buildNumberFile = new File(this.getTemporaryDir(), "build.number");  
      BuildNumber buildNumber = (BuildNumber)ant.invokeMethod("buildnumber");
      buildNumber.setFile(buildNumberFile);
      buildNumber.execute();
      
      Properties props = new Properties();
      props.load(Files.newReader(buildNumberFile, Charsets.ISO_8859_1));
      this.buildNumber = props.getProperty("build.number");
    }
    
    return this.buildNumber;
  }
}

代码示例来源:origin: MinecraftForge/ForgeGradle

@TaskAction
public void doTask() throws IOException
{
  final Map<String, Entry<byte[], Long>> ignoredStuff = Maps.newHashMap();
  File input = getInputFile();
  File toSign = new File(getTemporaryDir(), input.getName() + ".unsigned.tmp");
  File signed = new File(getTemporaryDir(), input.getName() + ".signed.tmp");
  File output = getOutputFile();
  // load in input jar, and create temp jar
  processInputJar(input, toSign, ignoredStuff);
  // SIGN!
  Map<String, Object> map = Maps.newHashMap();
  map.put("alias", getAlias());
  map.put("storePass", getStorePass());
  map.put("jar", toSign.getAbsolutePath());
  map.put("signedJar", signed.getAbsolutePath());
  if (!Strings.isNullOrEmpty(getKeyPass()))
    map.put("keypass", getKeyPass());
  if (!Strings.isNullOrEmpty(getKeyStore()))
    map.put("keyStore", getKeyStore());
  getProject().getAnt().invokeMethod("signjar", map);
  // write out
  writeOutputJar(signed, output, ignoredStuff);
}

代码示例来源:origin: gradle.plugin.com.liferay/gradle-plugins-tlddoc-builder

Project project = getProject();
final AntBuilder antBuilder = project.getAnt();

代码示例来源:origin: gradle.plugin.de.otto.shopoffice/otto-classycle-plugin

classycle.setMergeInnerClasses(true);
classycle.setDefinitionFile(definitionFile);
classycle.setProject(task.getProject().getAnt().getAntProject());
for (final File classesDir : existingClassesDirs) {
  final FileSet fileSet = new FileSet();

代码示例来源:origin: gradle.plugin.pl.squirrel/classycle-gradle-plugin

@Override
  public void execute(Task task) {
    if (!classDir.isDirectory()) {
      log.debug("Class directory doesn't exist, skipping: " + classDir);
      return;
    }
    reportFile.getParentFile().mkdirs();
    try {
      log.debug("Running classycle analysis on: " + classDir);
      DependencyCheckingTask classycle = new DependencyCheckingTask();
      classycle.setReportFile(reportFile);
      classycle.setFailOnUnwantedDependencies(true);
      classycle.setMergeInnerClasses(true);
      classycle.setDefinitionFile(definitionFile);
      classycle.setProject(project.getAnt().getAntProject());
      FileSet fileSet = new FileSet();
      fileSet.setDir(classDir);
      fileSet.setProject(classycle.getProject());
      classycle.add(fileSet);
      classycle.execute();
    } catch (Exception e) {
      throw new RuntimeException(
          "Classycle check failed: " + e.getMessage() + ". See report at "
              + clickableFileUrl(reportFile), e);
    }
  }
});

代码示例来源:origin: gradle.plugin.mpern.sap.commerce/commerce-gradle-plugin

args.put("format", "MD5SUM");
args.put("fileext", ".MD5");
p.getAnt().invokeMethod("checksum", args);
Path resolve = zipPackage.getDestinationDir().toPath().resolve(zipPackage.getArchiveName() + ".MD5");
Path target = zipPackage.getDestinationDir().toPath().resolve(zipPackage.getBaseName() + ".md5");

相关文章