本文整理匯總了Java中org.apache.tools.ant.Project.setBaseDir方法的典型用法代碼示例。如果您正苦於以下問題:Java Project.setBaseDir方法的具體用法?Java Project.setBaseDir怎麽用?Java Project.setBaseDir使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.tools.ant.Project
的用法示例。
在下文中一共展示了Project.setBaseDir方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: doScanSuite
import org.apache.tools.ant.Project; //導入方法依賴的package包/類
private static void doScanSuite(Map<String,Entry> entries, File suite, Map<String,Object> properties, Project project) throws IOException {
Project fakeproj = new Project();
fakeproj.setBaseDir(suite); // in case ${basedir} is used somewhere
Property faketask = new Property();
faketask.setProject(fakeproj);
faketask.setFile(new File(suite, "nbproject/private/private.properties".replace('/', File.separatorChar)));
faketask.execute();
faketask.setFile(new File(suite, "nbproject/project.properties".replace('/', File.separatorChar)));
faketask.execute();
String modulesS = fakeproj.getProperty("modules");
if (modulesS == null) {
throw new IOException("No definition of modules in " + suite);
}
String[] modules = Path.translatePath(fakeproj, modulesS);
for (int i = 0; i < modules.length; i++) {
File module = new File(modules[i]);
if (!module.isDirectory()) {
throw new IOException("No such module " + module + " referred to from " + suite);
}
if (!scanPossibleProject(module, entries, properties, null, ModuleType.SUITE, project, null)) {
throw new IOException("No valid module found in " + module + " referred to from " + suite);
}
}
}
示例2: setUp
import org.apache.tools.ant.Project; //導入方法依賴的package包/類
@Override
protected void setUp() throws Exception {
clearWorkDir();
String prop = System.getProperty("nb_all");
assertNotNull("${nb_all} defined", prop);
nball = new File(prop);
File baseDir = new File(getWorkDir(), "basedir");
baseDir.mkdirs();
File destDir = new File(getWorkDir(), "destdir");
destDir.mkdirs();
p = new Project();
p.init();
p.setBaseDir(nball);
p.setProperty("netbeans.dest.dir", destDir.getAbsolutePath());
p.setProperty("nb_all", nball.getAbsolutePath());
File clusters = new File(new File(nball, "nbbuild"), "cluster.properties");
assertTrue("cluster.properties file exists", clusters.exists());
Properties clusterProps = new Properties();
try (FileInputStream is = new FileInputStream(clusters)) {
clusterProps.load(is);
}
for (Entry<Object, Object> en : clusterProps.entrySet()) {
p.setProperty(en.getKey().toString(), en.getValue().toString());
}
}
示例3: setUp
import org.apache.tools.ant.Project; //導入方法依賴的package包/類
protected void setUp() throws Exception {
super.setUp();
clearWorkDir();
Project prj = new Project();
prj.setBaseDir(getWorkDir());
path = new Path(prj);
vp = new ValidatePath();
vp.setPath(path);
}
示例4: newFixTestDependencies
import org.apache.tools.ant.Project; //導入方法依賴的package包/類
private FixTestDependencies newFixTestDependencies() throws IOException, BuildException {
Project project = new Project();
project.setBaseDir(getWorkDir());
FixTestDependencies ftd = new FixTestDependencies();
ftd.setProject(project);
return ftd;
}
示例5: getProject
import org.apache.tools.ant.Project; //導入方法依賴的package包/類
private Project getProject() throws IOException {
Project project = new Project();
project.setBaseDir(getWorkDir());
return project;
}
示例6: setUp
import org.apache.tools.ant.Project; //導入方法依賴的package包/類
protected @Override void setUp() throws Exception {
clearWorkDir();
project = new Project();
project.setBaseDir(getWorkDir());
}