org.apache.tools.ant.taskdefs.Javac.getProject()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(129)

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

Javac.getProject介绍

暂无

代码示例

代码示例来源:origin: org.apache.ant/ant

/**
 * The classpath to use when loading the compiler implementation
 * if it is not a built-in one.
 *
 * @return Path
 * @since Ant 1.8.0
 */
public Path createCompilerClasspath() {
  return facade.getImplementationClasspath(getProject());
}

代码示例来源:origin: org.apache.ant/ant

/**
 * Get the value of source.
 * @return value of source.
 */
public String getSource() {
  return source != null
    ? source : getProject().getProperty(MagicNames.BUILD_JAVAC_SOURCE);
}

代码示例来源:origin: org.apache.ant/ant

/**
 * Gets the target VM that the classes will be compiled for.
 * @return the target VM
 */
public String getTarget() {
  return targetAttribute != null
    ? targetAttribute
    : getProject().getProperty(MagicNames.BUILD_JAVAC_TARGET);
}

代码示例来源:origin: org.apache.ant/ant

/**
 * Adds a path to modulesourcepath.
 * @return a modulesourcepath to be configured
 * @since 1.9.7
 */
public Path createModulesourcepath() {
  if (moduleSourcepath == null) {
    moduleSourcepath = new Path(getProject());
  }
  return moduleSourcepath.createPath();
}

代码示例来源:origin: org.apache.ant/ant

/**
 * Adds a path to extdirs.
 * @return a path to be configured
 */
public Path createExtdirs() {
  if (extdirs == null) {
    extdirs = new Path(getProject());
  }
  return extdirs.createPath();
}

代码示例来源:origin: org.apache.ant/ant

/**
 * Adds a path to sourcepath.
 * @return a sourcepath to be configured
 */
public Path createSourcepath() {
  if (compileSourcepath == null) {
    compileSourcepath = new Path(getProject());
  }
  return compileSourcepath.createPath();
}

代码示例来源:origin: org.apache.ant/ant

/**
 * Adds a path to the classpath.
 * @return a class path to be configured
 */
public Path createClasspath() {
  if (compileClasspath == null) {
    compileClasspath = new Path(getProject());
  }
  return compileClasspath.createPath();
}

代码示例来源:origin: org.apache.ant/ant

/**
 * Adds a path to the bootclasspath.
 * @return a path to be configured
 */
public Path createBootclasspath() {
  if (bootclasspath == null) {
    bootclasspath = new Path(getProject());
  }
  return bootclasspath.createPath();
}

代码示例来源:origin: org.apache.ant/ant

/**
 * Adds a path to the modulepath.
 * @return a modulepath to be configured
 * @since 1.9.7
 */
public Path createModulepath() {
  if (modulepath == null) {
    modulepath = new Path(getProject());
  }
  return modulepath.createPath();
}

代码示例来源:origin: org.apache.ant/ant

/**
 * Adds a path to the upgrademodulepath.
 * @return an upgrademodulepath to be configured
 * @since 1.9.7
 */
public Path createUpgrademodulepath() {
  if (upgrademodulepath == null) {
    upgrademodulepath = new Path(getProject());
  }
  return upgrademodulepath.createPath();
}

代码示例来源:origin: org.apache.ant/ant

/**
 * Adds a path for source compilation.
 *
 * @return a nested src element.
 */
public Path createSrc() {
  if (src == null) {
    src = new Path(getProject());
  }
  return src.createPath();
}

代码示例来源:origin: org.apache.ant/ant

private void collectFileListFromSourcePath() {
  for (String filename : src.list()) {
    final File srcDir = getProject().resolveFile(filename);
    if (!srcDir.exists()) {
      throw new BuildException("srcdir \""
                   + srcDir.getPath()
                   + "\" does not exist!", getLocation());
    }
    final DirectoryScanner ds = this.getDirectoryScanner(srcDir);
    scanDir(srcDir, destDir != null ? destDir : srcDir, ds.getIncludedFiles());
  }
}

代码示例来源:origin: org.apache.ant/ant

private void collectFileListFromModulePath() {
  final FileUtils fu = FileUtils.getFileUtils();
  for (String pathElement : moduleSourcepath.list()) {
    boolean valid = false;
    for (Map.Entry<String, Collection<File>> modules : resolveModuleSourcePathElement(
      getProject().getBaseDir(), pathElement).entrySet()) {
      final String moduleName = modules.getKey();
      for (File srcDir : modules.getValue()) {
        if (srcDir.exists()) {
          valid = true;
          final DirectoryScanner ds = getDirectoryScanner(srcDir);
          final String[] files = ds.getIncludedFiles();
          scanDir(srcDir, fu.resolveFile(destDir, moduleName), files);
        }
      }
    }
    if (!valid) {
      throw new BuildException("modulesourcepath \""
                   + pathElement
                   + "\" does not exist!", getLocation());
    }
  }
}

代码示例来源:origin: org.apache.ant/ant

/**
 * The implementation for this particular task.
 *
 * <p>Defaults to the build.compiler property but can be overridden
 * via the compiler attribute.</p>
 *
 * <p>This method does not take the fork attribute into
 * account.</p>
 *
 * @see #getCompiler
 * @return the compiler.
 *
 * @since Ant 1.5
 */
public String getCompilerVersion() {
  facade.setMagicValue(getProject().getProperty("build.compiler"));
  return facade.getImplementation();
}

代码示例来源:origin: org.apache.ant/ant

+ "\" does not exist or is not a directory", getLocation());
if (includeAntRuntime == null && getProject().getProperty("build.sysclasspath") == null) {
  log(getLocation()
    + "warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds",

代码示例来源:origin: org.apache.ant/ant

generateMissingPackageInfoClasses(destDir != null
                   ? destDir
                   : getProject()
                   .resolveFile(src.list()[0]));
} catch (final IOException x) {
getProject().setNewProperty(
  errorProperty, "true");

代码示例来源:origin: org.apache.ant/ant

/**
 * Executes the task.
 * @exception BuildException if an error occurs
 */
@Override
public void execute() throws BuildException {
  checkParameters();
  resetFileLists();
  // scan source directories and dest directory to build up
  // compile list
  if (hasPath(src)) {
    collectFileListFromSourcePath();
  } else {
    assert hasPath(moduleSourcepath) : "Either srcDir or moduleSourcepath must be given";
    collectFileListFromModulePath();
  }
  compile();
  if (updatedProperty != null
    && taskSuccess
    && compileList.length != 0) {
    getProject().setNewProperty(updatedProperty, "true");
  }
}

代码示例来源:origin: org.apache.ant/ant

compileSourcepath = attributes.getSourcepath();
moduleSourcepath = attributes.getModulesourcepath();
project = attributes.getProject();
location = attributes.getLocation();
includeAntRuntime = attributes.getIncludeantruntime();

代码示例来源:origin: stackoverflow.com

fbtask.setSourcePath(sourcepath);
fbtask.setAuxClasspath(task.getClasspath());
Path destPath = new Path( task.getProject() );
destPath.setPath(task.getDestdir().getAbsolutePath());
fbtask.setAuxAnalyzepath(destPath);
fbtask.setOutputFile(getFileName(task.getProject()));
fbtask.setProject(task.getProject());

相关文章

微信公众号

最新文章

更多