當前位置: 首頁>>代碼示例>>Java>>正文


Java Project.setBaseDir方法代碼示例

本文整理匯總了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);
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:25,代碼來源:ModuleListParser.java

示例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());
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:33,代碼來源:InsertModuleAllTargetsTest.java

示例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);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:10,代碼來源:ValidatePathTest.java

示例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;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:FixTestDependenciesTest.java

示例5: getProject

import org.apache.tools.ant.Project; //導入方法依賴的package包/類
private Project getProject() throws IOException {
    Project project = new Project();
    project.setBaseDir(getWorkDir());
    return project;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:6,代碼來源:TestDistFilterTest.java

示例6: setUp

import org.apache.tools.ant.Project; //導入方法依賴的package包/類
protected @Override void setUp() throws Exception {
    clearWorkDir();
    project = new Project();
    project.setBaseDir(getWorkDir());
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:6,代碼來源:SortSuiteModulesTest.java


注:本文中的org.apache.tools.ant.Project.setBaseDir方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。