当前位置: 首页>>代码示例>>Java>>正文


Java PropertySet.setProject方法代码示例

本文整理汇总了Java中org.apache.tools.ant.types.PropertySet.setProject方法的典型用法代码示例。如果您正苦于以下问题:Java PropertySet.setProject方法的具体用法?Java PropertySet.setProject怎么用?Java PropertySet.setProject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.tools.ant.types.PropertySet的用法示例。


在下文中一共展示了PropertySet.setProject方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testSerialRun_SingleModule_WithPropertySets_AndInheritedPropertiesByDefault

import org.apache.tools.ant.types.PropertySet; //导入方法依赖的package包/类
public void testSerialRun_SingleModule_WithPropertySets_AndInheritedPropertiesByDefault()
{
    final ModuleInfo moduleInfo = new ModuleInfo("foo/", moduleLoader);
    moduleInfo.addAttribute("1", "2");
    moduleLoader.modules.put("foo/", moduleInfo);
    
    final MockCallTargetTask task1 = new MockCallTargetTask(project);
    project.tasks.add(task1);
    
    task.init();
    task.setTarget("testTarget");
    task.setModuleRefId("moduleRef");
    task.createModule().setPath("foo");
    task.addConfigured(moduleLoader);
    
    final PropertySet propSet1 = new PropertySet();
    propSet1.setProject(project);
    propSet1.appendName("123");
    propSet1.appendName("hello");
    propSet1.appendName("no_such_property");
    final PropertySet propSet2 = new PropertySet();
    propSet2.setProject(project);
    propSet2.appendName("qwerty");
    task.addPropertyset(propSet1);
    task.addPropertyset(propSet2);
    
    project.setProperty("123", "456");
    project.setProperty("12345", "45678");
    project.setProperty("hello", "universe");
    project.setProperty("qwerty", "board");
    
    task.perform();
    
    TestUtil.assertCallTargetState(task1, true, "testTarget", true, false, "moduleRef", moduleInfo,
            TestUtil.<String, Object>map("123", "456", "12345", "45678", "hello", "universe", "qwerty", "board"));
}
 
开发者ID:dzidzitop,项目名称:ant_modular,代码行数:37,代码来源:CallTargetForModules_SerialUseTest.java

示例2: testSerialRun_SingleModule_WithPropertySets_AndInheritedPropertiesForced

import org.apache.tools.ant.types.PropertySet; //导入方法依赖的package包/类
public void testSerialRun_SingleModule_WithPropertySets_AndInheritedPropertiesForced()
{
    final ModuleInfo moduleInfo = new ModuleInfo("foo/", moduleLoader);
    moduleInfo.addAttribute("1", "2");
    moduleLoader.modules.put("foo/", moduleInfo);
    
    final MockCallTargetTask task1 = new MockCallTargetTask(project);
    project.tasks.add(task1);
    
    task.init();
    task.setTarget("testTarget");
    task.setModuleRefId("moduleRef");
    task.createModule().setPath("foo");
    task.addConfigured(moduleLoader);
    task.setInheritAll(true);
    
    final PropertySet propSet1 = new PropertySet();
    propSet1.setProject(project);
    propSet1.appendName("123");
    propSet1.appendName("hello");
    propSet1.appendName("no_such_property");
    final PropertySet propSet2 = new PropertySet();
    propSet2.setProject(project);
    propSet2.appendName("qwerty");
    task.addPropertyset(propSet1);
    task.addPropertyset(propSet2);
    
    project.setProperty("123", "456");
    project.setProperty("12345", "45678");
    project.setProperty("hello", "universe");
    project.setProperty("qwerty", "board");
    
    task.perform();
    
    TestUtil.assertCallTargetState(task1, true, "testTarget", true, false, "moduleRef", moduleInfo,
            TestUtil.<String, Object>map("123", "456", "12345", "45678", "hello", "universe", "qwerty", "board"));
}
 
开发者ID:dzidzitop,项目名称:ant_modular,代码行数:38,代码来源:CallTargetForModules_SerialUseTest.java

示例3: testSerialRun_SingleModule_WithPropertySets_PropertiesNotInherited

import org.apache.tools.ant.types.PropertySet; //导入方法依赖的package包/类
public void testSerialRun_SingleModule_WithPropertySets_PropertiesNotInherited()
{
    final ModuleInfo moduleInfo = new ModuleInfo("foo/", moduleLoader);
    moduleInfo.addAttribute("1", "2");
    moduleLoader.modules.put("foo/", moduleInfo);
    
    final MockCallTargetTask task1 = new MockCallTargetTask(project);
    project.tasks.add(task1);
    
    task.init();
    task.setTarget("testTarget");
    task.setModuleRefId("moduleRef");
    task.createModule().setPath("foo");
    task.addConfigured(moduleLoader);
    task.setInheritAll(false);
    
    final PropertySet propSet1 = new PropertySet();
    propSet1.setProject(project);
    propSet1.appendName("123");
    propSet1.appendName("hello");
    propSet1.appendName("no_such_property");
    final PropertySet propSet2 = new PropertySet();
    propSet2.setProject(project);
    propSet2.appendName("qwerty");
    task.addPropertyset(propSet1);
    task.addPropertyset(propSet2);
    
    project.setProperty("123", "456");
    project.setProperty("12345", "45678");
    project.setProperty("hello", "universe");
    project.setProperty("qwerty", "board");
    
    task.perform();
    
    TestUtil.assertCallTargetState(task1, true, "testTarget", false, false, "moduleRef", moduleInfo,
            TestUtil.<String, Object>map("123", "456", "hello", "universe", "qwerty", "board"));
}
 
开发者ID:dzidzitop,项目名称:ant_modular,代码行数:38,代码来源:CallTargetForModules_SerialUseTest.java

示例4: setPrefix

import org.apache.tools.ant.types.PropertySet; //导入方法依赖的package包/类
/**
 * If the prefix is set, then only properties which start with this
 * prefix string will be recorded. If regex is not set and  if this
 * is never set, or it is set to an empty string or <tt>null</tt>,
 * then all properties will be recorded.
 *
 * <p>For example, if the attribute is set as:</p>
 * <pre>&lt;echoproperties  prefix="ant." /&gt;</pre>
 * then the property "ant.home" will be recorded, but "ant-example"
 * will not.
 *
 * @param  prefix  The new prefix value
 */
public void setPrefix(String prefix) {
    if (prefix != null && prefix.length() != 0) {
        this.prefix = prefix;
        PropertySet ps = new PropertySet();
        ps.setProject(getProject());
        ps.appendPrefix(prefix);
        addPropertyset(ps);
    }
}
 
开发者ID:apache,项目名称:ant,代码行数:23,代码来源:EchoProperties.java

示例5: setRegex

import org.apache.tools.ant.types.PropertySet; //导入方法依赖的package包/类
/**
 * If the regex is set, then only properties whose names match it
 * will be recorded.  If prefix is not set and if this is never set,
 * or it is set to an empty string or <tt>null</tt>, then all
 * properties will be recorded.
 *
 * <p>For example, if the attribute is set as:</p>
 * <pre>&lt;echoproperties  prefix=".*ant.*" /&gt;</pre>
 * then the properties "ant.home" and "user.variant" will be recorded,
 * but "ant-example" will not.
 *
 * @param  regex  The new regex value
 *
 * @since Ant 1.7
 */
public void setRegex(String regex) {
    if (!(regex == null || regex.isEmpty())) {
        this.regex = regex;
        PropertySet ps = new PropertySet();
        ps.setProject(getProject());
        ps.appendRegex(regex);
        addPropertyset(ps);
    }
}
 
开发者ID:apache,项目名称:ant,代码行数:25,代码来源:EchoProperties.java


注:本文中的org.apache.tools.ant.types.PropertySet.setProject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。