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

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

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

Javac.getClasspath介绍

[英]Gets the classpath to be used for this compilation.
[中]获取用于此编译的类路径。

代码示例

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

extdirs = attributes.getExtdirs();
compileList = attributes.getFileList();
compileClasspath = attributes.getClasspath();
modulepath = attributes.getModulepath();
upgrademodulepath = attributes.getUpgrademodulepath();

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

if (task instanceof Javac) {
       Javac javac = (Javac)task;
       Path path = javac.getClasspath();
       if (path == null) {
        System.out.println("javac: Path is null");
       } else {
        System.out.println("javac: Path is " + path.toString());
       }
     }

代码示例来源:origin: org.eclipse.platform/org.eclipse.ant.ui

private void setClasspath(Javac javacTask, IJavaProject javaProject, IProgressMonitor monitor) throws CoreException {
  try {
    org.apache.tools.ant.types.Path classpath = javacTask.getClasspath();
    if (classpath == null) {
      return;
    }
    String[] classpaths = classpath.list();
    for (int i = 0; i < classpaths.length; i++) {
      String cp = classpaths[i];
      File classpathEntry = new File(cp);
      if (classpathEntry.isFile()) {
        addLibrary(javaProject, new Path(classpathEntry.getAbsolutePath()), monitor);
      } else {
        addContainer(javaProject, new Path(classpathEntry.getAbsolutePath()), monitor);
      }
    }
  }
  catch (BuildException be) {
    IStatus status = new Status(IStatus.ERROR, AntUIPlugin.PI_ANTUI, IStatus.OK, MessageFormat.format(DataTransferMessages.ProjectCreator_0, new Object[] {
        be.getLocalizedMessage() }), be);
    throw new CoreException(status);
  }
}

代码示例来源:origin: org.codehaus.groovy/groovy-ant

jointOptions.add("-F" + key);
} else if (key.contains("classpath")) {
  classpath.add(javac.getClasspath());
} else if ((key.contains("depend"))
    || (key.contains("extdirs"))

代码示例来源:origin: org.kohsuke.droovy/groovy

jointOptions.add("-F" + key);
} else if (key.indexOf("classpath") != -1) {
  classpath.add(javac.getClasspath());
} else if ((key.indexOf("depend") != -1)
    || (key.indexOf("extdirs") != -1)

代码示例来源:origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

jointOptions.add("-F" + key);
} else if (key.contains("classpath")) {
  classpath.add(javac.getClasspath());
} else if ((key.contains("depend"))
    || (key.contains("extdirs"))

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

System.out.println ("Trying FindBugs");
fbtask.setSourcePath(sourcepath);
fbtask.setAuxClasspath(task.getClasspath());
Path destPath = new Path( task.getProject() );
destPath.setPath(task.getDestdir().getAbsolutePath());

代码示例来源:origin: org.codehaus.groovy/groovy-jdk14

jointOptions.add("-F" + key);
} else if (key.contains("classpath")) {
  classpath.add(javac.getClasspath());
} else if ((key.contains("depend"))
    || (key.contains("extdirs"))

代码示例来源:origin: org.codehaus.groovy/groovy-all-minimal

public void compile(List files, CompilationUnit cu) {
    // forward options
    if (javac.getClasspath()==null) {
      javac.setClasspath(compileClasspath);
    }
    if (javac.getSourcepath()==null && compileSourcepath!=null) {
      javac.createSourcepath().add(compileSourcepath);
    }
    if (javac.getEncoding()==null) {
      javac.setEncoding(encoding);
    }
    javac.setDestdir(destDir);
    
    Path p = javac.createSrc();
    p.add(src);
    
    Path tmpDir = new Path(getProject());
    File dir = (File) cu.getConfiguration().getJointCompilationOptions().get("stubDir");
    tmpDir.setLocation(dir);
    p.add(tmpDir);
    javac.execute();
  }
};

相关文章