Package org.apache.tools.ant.taskdefs

Examples of org.apache.tools.ant.taskdefs.Ant$PropertyType


        assertEquals(1, t.getAbstractTransactionAction().size());
       
        UpdateType u = (UpdateType) t.getAbstractTransactionAction().get(0);
        assertEquals(1, u.getProperty().size());
       
        PropertyType p = u.getProperty().get(0);
        assertEquals("population", p.getValueReference().getValue().getLocalPart());
        assertEquals("4070000", p.getValue());
       
        Id id = (Id) u.getFilter();
        assertNotNull(id);
        assertTrue(id.getIDs().contains("BuiltUpA_1M.10131"));
    }
View Full Code Here


        }

        // persistence-context-properties
        PersistenceProperty[] properties = annotation.properties();
        for (PersistenceProperty property : properties) {
            PropertyType propertyType = persistenceContextRef.addNewPersistenceProperty();
            XsdStringType propertyName = propertyType.addNewName();
            propertyName.setStringValue(property.name());
            XsdStringType propertyValue = propertyType.addNewValue();
            propertyValue.setStringValue(property.value());
        }

        // injection targets
        if (method != null || field != null) {
View Full Code Here

        if (dataSource.getPropertyArray() == null || dataSource.getPropertyArray().length == 0) {
            String[] properties = dsDefinition.properties();
            if (properties != null) {
                for (String property : properties) {
                    String[] tokens = property.split("=");
                    PropertyType propertyType = dataSource.addNewProperty();
                    propertyType.addNewName().setStringValue(tokens[0]);
                    propertyType.addNewValue().setStringValue(tokens[1]);                   
                }              
            }
        }
       
        return dataSource;
View Full Code Here

        File f = getBuildFile(event);
        if (f.exists()) {
            if (onlyOnce && isBuilt(f)) {
                Message.verbose("target build file already built, skipping: " + f);
            } else {
                Ant ant = new Ant();
                Project project = (Project) IvyContext
                        .peekInContextStack(IvyTask.ANT_PROJECT_CONTEXT_KEY);
                if (project == null) {
                    project = new Project();
                    project.init();
                }

                ant.setProject(project);
                ant.setTaskName("ant");

                ant.setAntfile(f.getAbsolutePath());
                ant.setInheritAll(false);
                String target = getTarget();
                if (target != null) {
                    ant.setTarget(target);
                }
                Map atts = event.getAttributes();
                for (Iterator iter = atts.keySet().iterator(); iter.hasNext();) {
                    String key = (String) iter.next();
                    String value = (String) atts.get(key);
                    if (value != null) {
                        Property p = ant.createProperty();
                        p.setName(prefix == null ? key : prefix + key);
                        p.setValue(value);
                    }
                }

                Message.verbose("triggering build: " + f + " target=" + target + " for " + event);
                try {
                    ant.execute();
                } catch (BuildException e) {
                    Message.verbose("Exception occurred while executing target " + target);
                    throw e;
                }
                markBuilt(f);
View Full Code Here

                         final Project project )
        throws BuildException
    {
        validate();

        final Ant ant = (Ant)project.createTask( "ant" );
        ant.setInheritAll( false );
        ant.setAntfile( m_antfile.getName() );

        try
        {
            final File dir =
                m_antfile.getParentFile().getCanonicalFile();
            ant.setDir( dir );
        }
        catch( final IOException ioe )
        {
            throw new BuildException( ioe.getMessage(), ioe );
        }

        if( null != m_target )
        {
            ant.setTarget( m_target );
        }

        ant.execute();

        return m_destfile;
    }
View Full Code Here

    public File resolve(final Extension extension,
                         final Project project)
        throws BuildException {
        validate();

        final Ant ant = (Ant) project.createTask("ant");
        ant.setInheritAll(false);
        ant.setAntfile(m_antfile.getName());

        try {
            final File dir =
                m_antfile.getParentFile().getCanonicalFile();
            ant.setDir(dir);
        } catch (final IOException ioe) {
            throw new BuildException(ioe.getMessage(), ioe);
        }

        if (null != m_target) {
            ant.setTarget(m_target);
        }

        ant.execute();

        return m_destfile;
    }
View Full Code Here

      }
      System.out.println();
    }
   
    for (BuildBundleDescriptor descriptor : buildOrder) {
      Ant antTask = new Ant(this);
      File buildFile = descriptor.getBuildFile();
      System.out.println("Building " + buildFile);
      antTask.setAntfile(buildFile.toString());
      antTask.setDir(buildFile.getParentFile());
      if (buildTarget != null) {
        antTask.setTarget(buildTarget);
      }
      antTask.setInheritAll(inheritAll);
      antTask.setInheritRefs(inheritRefs);
      antTask.execute();
    }
   
  }
View Full Code Here

        File f = getBuildFile(event);
        if (f.exists()) {
            if (onlyOnce && isBuilt(f)) {
                Message.verbose("target build file already built, skipping: " + f);
            } else {
                Ant ant = new Ant();
                Project project = (Project) IvyContext.peekInContextStack(
                    IvyTask.ANT_PROJECT_CONTEXT_KEY);
                if (project == null) {
                    project = new Project();
                    project.init();
                }

                ant.setProject(project);
                ant.setTaskName("ant");

                ant.setAntfile(f.getAbsolutePath());
                ant.setInheritAll(false);
                String target = getTarget();
                if (target != null) {
                    ant.setTarget(target);
                }
                Map atts = event.getAttributes();
                for (Iterator iter = atts.keySet().iterator(); iter.hasNext();) {
                    String key = (String) iter.next();
                    String value = (String) atts.get(key);
                    Property p = ant.createProperty();
                    p.setName(prefix == null ? key : prefix + key);
                    p.setValue(value);
                }

                Message.verbose("triggering build: " + f + " target=" + target + " for " + event);
                try {
                    ant.execute();
                } catch (BuildException e) {
                    Message.verbose("Exception occurred while executing target " + target);
                    e.printStackTrace(); // TODO: remove when finished debugging
                    throw e;
                }
View Full Code Here

        File f = getBuildFile(event);
        if (f.exists()) {
            if (onlyOnce && isBuilt(f)) {
                Message.verbose("target build file already built, skipping: " + f);
            } else {
                Ant ant = new Ant();
                Project project = (Project) IvyContext.getContext().peek(
                    IvyTask.ANT_PROJECT_CONTEXT_KEY);
                if (project == null) {
                    project = new Project();
                    project.init();
                }

                ant.setProject(project);
                ant.setTaskName("ant");

                ant.setAntfile(f.getAbsolutePath());
                ant.setInheritAll(false);
                String target = getTarget();
                if (target != null) {
                    ant.setTarget(target);
                }
                Map atts = event.getAttributes();
                for (Iterator iter = atts.keySet().iterator(); iter.hasNext();) {
                    String key = (String) iter.next();
                    String value = (String) atts.get(key);
                    Property p = ant.createProperty();
                    p.setName(prefix == null ? key : prefix + key);
                    p.setValue(value);
                }

                Message.verbose("triggering build: " + f + " target=" + target + " for " + event);
                MessageImpl impl = IvyContext.getContext().getMessageImpl();
                try {
                    IvyContext.getContext().setMessageImpl(null);
                    try {
                        ant.execute();
                    } catch (BuildException e) {
                        Message.verbose("Exception occurred while executing target " + target);
                        e.printStackTrace(); // TODO: remove when finished debugging
                        throw e;
                    }
View Full Code Here

    File f = getBuildFile(event);
    if (f.exists()) {
      if (_onlyonce && isBuilt(f)) {
        Message.verbose("target build file already built, skipping: "+f);
      } else {
        Ant ant = new Ant();
        Project project = (Project)IvyContext.getContext().get(IvyTask.ANT_PROJECT_CONTEXT_KEY);
        if (project == null) {
          project = new Project();
          project.init();
        }
       
        ant.setProject(project);
        ant.setTaskName("ant");
       
        ant.setAntfile(f.getAbsolutePath());
        ant.setInheritAll(false);
        String target = getTarget();
        if (target != null) {
          ant.setTarget(target);
        }
        Map atts = event.getAttributes();
        for (Iterator iter = atts.keySet().iterator(); iter.hasNext();) {
          String key = (String) iter.next();
          String value = (String) atts.get(key);
          Property p = ant.createProperty();
          p.setName(_prefix == null?key:_prefix+key);
          p.setValue(value);
        }
       
        Message.verbose("triggering build: "+f+" target="+target+" for "+event);
                MessageImpl impl = IvyContext.getContext().getMessageImpl();
                try {
                  IvyContext.getContext().setMessageImpl(null);
                  try {
                    ant.execute();
                  } catch (BuildException e) {
                    Message.verbose("Exception occurred while executing target " + target);
                    e.printStackTrace(); // TODO: remove when finished debugging
                    throw e;
                  }
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.taskdefs.Ant$PropertyType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.