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


Java Project.setProperty方法代碼示例

本文整理匯總了Java中org.apache.tools.ant.Project.setProperty方法的典型用法代碼示例。如果您正苦於以下問題:Java Project.setProperty方法的具體用法?Java Project.setProperty怎麽用?Java Project.setProperty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.tools.ant.Project的用法示例。


在下文中一共展示了Project.setProperty方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: execute

import org.apache.tools.ant.Project; //導入方法依賴的package包/類
@Override
public void execute() {
    Project p = getProject();

    Properties props = readProperties(propertyFile);
    toolName = props.getProperty("tool.name");
    if (toolName != null) {
        toolArgs = props.getProperty(toolName + ".args", "");
    }

    if (toolProperty == null ||
        askIfUnset && (toolName == null
            || (argsProperty != null && toolArgs == null))) {
        showGUI(props);
    }

    // finally, return required values, if any
    if (toolProperty != null && !(toolName == null || toolName.equals(""))) {
        p.setProperty(toolProperty, toolName);

        if (argsProperty != null && toolArgs != null)
            p.setProperty(argsProperty, toolArgs);
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:25,代碼來源:SelectToolTask.java

示例2: execute

import org.apache.tools.ant.Project; //導入方法依賴的package包/類
/**
 * Executes the task. If the source property was specified, its value is
 * evaluated and set as the value of the target property. Otherwise the literal
 * string value is used.
 */
public void execute() {        
    final Project project = getProject();
    final String string = (source != null) ? 
        project.getProperty(Utils.resolveProperty(source, project)) : 
        value;
    final String resolved = Utils.resolveProperty(string, project);
    log("Setting " + property + " to " + resolved);
    project.setProperty(property, resolved);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:15,代碼來源:SetProperty.java

示例3: 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

示例4: testDependencies

import org.apache.tools.ant.Project; //導入方法依賴的package包/類
public void testDependencies() throws Exception {
    CreateDependencies d = new CreateDependencies();
    
    Project prj = new Project();
    DirSet ds = new DirSet();
    File dependencies = new File(nb_all, "dependencies");

    ds.setProject(prj);
    ds.setDir(nb_all);
    prj.addReference("x", ds);
    prj.setProperty("nb_all", nb_all.getAbsolutePath());
    d.setProject(prj);
    d.getProject();
    d.setRefid("x");
    d.setDependencies(dependencies);
    d.execute();

    assertFileContent(dependencies,
                      "This project's dependencies\n" +
                      "\n" +
                      "\n" +
                      "Runtime dependencies:\n" +
                      "=====================\n" +
                      "\n" +
                      "From: XC\n" +
                      "  - XA: XB (XD)\n" +
                      "    License: Test license\n" +
                      "\n");
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:30,代碼來源:CreateDependenciesTest.java

示例5: testCompileTimeDependencies

import org.apache.tools.ant.Project; //導入方法依賴的package包/類
public void testCompileTimeDependencies() throws Exception {
    CreateDependencies d = new CreateDependencies();
    
    Project prj = new Project();
    DirSet ds = new DirSet();
    File dependencies = new File(nb_all, "dependencies");

    ds.setProject(prj);
    ds.setDir(nb_all);
    prj.addReference("x", ds);
    prj.setProperty("nb_all", nb_all.getAbsolutePath());
    d.setProject(prj);
    d.getProject();
    d.setRefid("x");
    d.setDependencies(dependencies);
    d.setSourceDependencies(true);
    d.execute();

    assertFileContent(dependencies,
                      "This project's dependencies\n" +
                      "\n" +
                      "\n" +
                      "Runtime dependencies:\n" +
                      "=====================\n" +
                      "\n" +
                      "From: XC\n" +
                      "  - XA: XB (XD)\n" +
                      "    License: Test license\n" +
                      "\n" +
                      "\n" +
                      "Compile time dependencies:\n" +
                      "==========================\n" +
                      "\n" +
                      "From: XC2\n" +
                      "  - XA2: XB2 (XD2)\n" +
                      "    License: Test license2\n" +
                      "\n");
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:39,代碼來源:CreateDependenciesTest.java

示例6: execute

import org.apache.tools.ant.Project; //導入方法依賴的package包/類
@Override
public void execute() throws BuildException {
    if (classpath == null) {
        throw new BuildException("Classpath must be set.");
    }
    if (targetProperty == null) {
        throw new BuildException("Target property must be set.");
    }
    
    Project p = getProject();

    String translated = translate(classpath);
    
    p.setProperty(targetProperty, translated);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:16,代碼來源:TranslateClassPath.java

示例7: createProperties

import org.apache.tools.ant.Project; //導入方法依賴的package包/類
private void createProperties(IEclipseProject project) {
    Project p = getProject();

    p.setProperty(PROP_PROJECTNAME, project.getName());

    // Variables for all dependent projects directories
    for (IEclipseProject d : project.getDependencies()) {
        String name = d.getName();
        p.setProperty(PROP_PROJECT_PREFIX + name + PROP_DIR_SUFFIX, d
                .getLocation().toString());
        p.setProperty(PROP_WORK_PREFIX + name + PROP_DIR_SUFFIX,
                getWorkDir(name).toString());
        p.setProperty(PROP_PACKAGE_PREFIX + name + PROP_DIR_SUFFIX,
                getPackageDir(name).toString());

        name = ESS_PREFIX + name;

        p.setProperty(
                PROP_PROJECT_PREFIX + name + PROP_DIR_SUFFIX,
                d.getLocation()
                        .toString()
                        .replace(SEPARATOR + OSCM_PREFIX,
                                SEPARATOR + ESS_PREFIX + OSCM_PREFIX)
                        .replace(ESS_BUILD, OSCM_BUILD));
        p.setProperty(
                PROP_WORK_PREFIX + name + PROP_DIR_SUFFIX,
                getWorkDir(name)
                        .toString()
                        .replace(SEPARATOR + OSCM_PREFIX,
                                SEPARATOR + ESS_PREFIX + OSCM_PREFIX)
                        .replace(ESS_BUILD, OSCM_BUILD));
        p.setProperty(
                PROP_PACKAGE_PREFIX + name + PROP_DIR_SUFFIX,
                getPackageDir(name)
                        .toString()
                        .replace(SEPARATOR + OSCM_PREFIX,
                                SEPARATOR + ESS_PREFIX + OSCM_PREFIX)
                        .replace(ESS_BUILD, OSCM_BUILD));
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:41,代碼來源:DependencyPropertiesTask.java


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