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

x33g5p2x  于2022-01-17 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(146)

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

AntBuilder.invokeMethod介绍

暂无

代码示例

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

  1. private File _download(String url, File destinationFile)
  2. throws IOException {
  3. String protocol = url.substring(0, url.indexOf(':'));
  4. String proxyPassword = System.getProperty(protocol + ".proxyPassword");
  5. String proxyUser = System.getProperty(protocol + ".proxyUser");
  6. if (Validator.isNotNull(proxyPassword) &&
  7. Validator.isNotNull(proxyUser)) {
  8. Project project = getProject();
  9. String nonProxyHosts = System.getProperty(
  10. protocol + ".nonProxyHosts");
  11. String proxyHost = System.getProperty(protocol + ".proxyHost");
  12. String proxyPort = System.getProperty(protocol + ".proxyPort");
  13. AntBuilder antBuilder = project.getAnt();
  14. Map<String, String> args = new HashMap<>();
  15. args.put("nonproxyhosts", nonProxyHosts);
  16. args.put("proxyhost", proxyHost);
  17. args.put("proxypassword", proxyPassword);
  18. args.put("proxyport", proxyPort);
  19. args.put("proxyuser", proxyUser);
  20. antBuilder.invokeMethod("setproxy", args);
  21. }
  22. return FileUtil.get(getProject(), url, destinationFile);
  23. }

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

  1. private File _download(String url, File destinationFile)
  2. throws IOException {
  3. String protocol = url.substring(0, url.indexOf(':'));
  4. String proxyPassword = System.getProperty(protocol + ".proxyPassword");
  5. String proxyUser = System.getProperty(protocol + ".proxyUser");
  6. if (Validator.isNotNull(proxyPassword) &&
  7. Validator.isNotNull(proxyUser)) {
  8. Project project = getProject();
  9. String nonProxyHosts = System.getProperty(
  10. protocol + ".nonProxyHosts");
  11. String proxyHost = System.getProperty(protocol + ".proxyHost");
  12. String proxyPort = System.getProperty(protocol + ".proxyPort");
  13. AntBuilder antBuilder = project.getAnt();
  14. Map<String, String> args = new HashMap<>();
  15. args.put("nonproxyhosts", nonProxyHosts);
  16. args.put("proxyhost", proxyHost);
  17. args.put("proxypassword", proxyPassword);
  18. args.put("proxyport", proxyPort);
  19. args.put("proxyuser", proxyUser);
  20. antBuilder.invokeMethod("setproxy", args);
  21. }
  22. return FileUtil.get(getProject(), url, destinationFile);
  23. }

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

  1. public String getBuildNumber() throws IOException
  2. {
  3. if (this.buildNumber == null)
  4. {
  5. AntBuilder ant = getProject().getAnt();
  6. File buildNumberFile = new File(this.getTemporaryDir(), "build.number");
  7. BuildNumber buildNumber = (BuildNumber)ant.invokeMethod("buildnumber");
  8. buildNumber.setFile(buildNumberFile);
  9. buildNumber.execute();
  10. Properties props = new Properties();
  11. props.load(Files.newReader(buildNumberFile, Charsets.ISO_8859_1));
  12. this.buildNumber = props.getProperty("build.number");
  13. }
  14. return this.buildNumber;
  15. }
  16. }

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

  1. @TaskAction
  2. public void doTask() throws IOException
  3. {
  4. final Map<String, Entry<byte[], Long>> ignoredStuff = Maps.newHashMap();
  5. File input = getInputFile();
  6. File toSign = new File(getTemporaryDir(), input.getName() + ".unsigned.tmp");
  7. File signed = new File(getTemporaryDir(), input.getName() + ".signed.tmp");
  8. File output = getOutputFile();
  9. // load in input jar, and create temp jar
  10. processInputJar(input, toSign, ignoredStuff);
  11. // SIGN!
  12. Map<String, Object> map = Maps.newHashMap();
  13. map.put("alias", getAlias());
  14. map.put("storePass", getStorePass());
  15. map.put("jar", toSign.getAbsolutePath());
  16. map.put("signedJar", signed.getAbsolutePath());
  17. if (!Strings.isNullOrEmpty(getKeyPass()))
  18. map.put("keypass", getKeyPass());
  19. if (!Strings.isNullOrEmpty(getKeyStore()))
  20. map.put("keyStore", getKeyStore());
  21. getProject().getAnt().invokeMethod("signjar", map);
  22. // write out
  23. writeOutputJar(signed, output, ignoredStuff);
  24. }

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

  1. getExtPath();
  2. ant.invokeMethod("javac",
  3. ImmutableMap.builder()
  4. .put("srcDir", tempSrc.getCanonicalPath())

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

  1. ant.invokeMethod("javac", ImmutableMap.builder()
  2. .put("srcDir", resourceDir.getCanonicalPath())
  3. .put("destDir", compiled.getCanonicalPath())

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

  1. args.put("publicId", publicId);
  2. antBuilder.invokeMethod("dtd", args);
  3. args.put("namespace", namespace);
  4. antBuilder.invokeMethod("schema", args);

代码示例来源:origin: ibinti/bugvm

  1. getAnt().invokeMethod("delete", new java.util.HashMap<String, Object>() {
  2. getAnt().invokeMethod("chmod", new java.util.HashMap<String, Object>() {

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

  1. antBuilder.invokeMethod("schemavalidate", new Object[] {args, closure});

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

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

相关文章