Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [platform-ant-dev] Eclipse v2.1.2 ant problems

Thanks for the help - it was my mistake.  Configured the custom tasks as types :-) Sorry for any problems ...
 
Regards,
Douglas WF Acheson


From: platform-ant-dev-admin@xxxxxxxxxxx [mailto:platform-ant-dev-admin@xxxxxxxxxxx] On Behalf Of Darin Swanson
Sent: March 9, 2004 7:54 PM
To: platform-ant-dev@xxxxxxxxxxx
Subject: Re: [platform-ant-dev] Eclipse v2.1.2 ant problems


Can you please provide the buildfile? How are you defining your task (taskdef?)

In the Eclipse output it does not look like your task is executed (no output for the modifyProperty task)?

Thanks
Darins



"Douglas WF Acheson" <dwfa@xxxxxxx>
Sent by: platform-ant-dev-admin@xxxxxxxxxxx

03/09/04 04:41 PM
Please respond to platform-ant-dev

       
        To:        <platform-ant-dev@xxxxxxxxxxx>
        cc:        
        Subject:        [platform-ant-dev] Eclipse v2.1.2 ant problems



Hello,

 I am using v2.1.2 of eclipse.  I have created a new ant task (code below).
This works fine using ant from a command line (the property is changed).
But, under eclipse it does not work; here is the output

command line:

info:
    [echo] *** ant.version       Apache Ant version 1.5.3 compiled on April
16 2003 ...
    [echo] *** ant.java.version  1.3 ...
    [echo] *** java.version      1.3.1_10 ...
    [echo] *** java.home         C:\Apps\Java\j2se\v1.3.1-10\jre ...
    [echo] *** Using user        property file
C:\Home\make\properties\localWin32.properties ...
    [echo] *** Using project     property file
c:/home/make/projectMake.properties ...

dwfa:
    [echo] Property dwfa = dwfa
[modifyProperty] Changing value for property dwfa
    [echo] Property dwfa = ceb

BUILD SUCCESSFUL
Total time: 1 second

eclipse output:

info:
       [echo] *** ant.version       Apache Ant version 1.5.3 compiled on
April 9 2003 ...
       [echo] *** ant.java.version  1.3 ...
       [echo] *** java.version      1.3.1_10 ...
       [echo] *** java.home         C:\Apps\Java\j2se\v1.3.1-10\jre ...
       [echo] *** Using user        property file
c:\home\make\properties\localWin32.properties ...
       [echo] *** Using project     property file
c:/home/make/projectMake.properties ...

dwfa:
       [echo] Property dwfa = dwfa
       [echo] Property dwfa = dwfa
BUILD SUCCESSFUL
Total time: 370 milliseconds

<--------------------->

The task is:

<target name = "dwfa">
  <property name = "dwfa" value = "dwfa"/>
  <echo>Property dwfa = ${dwfa}</echo>
  <modifyProperty name = "dwfa" value = "ceb"/>
  <echo>Property dwfa = ${dwfa}</echo>
</target>

My expectation is that it should work the same for both.  Any help would be
appreciated.

Regards,
Douglas WF Acheson

<---------------------------->
package ca.dwfa.ant.tasks ;


import org.apache.tools.ant.BuildException ; import
org.apache.tools.ant.Project ; import org.apache.tools.ant.taskdefs.Property
;

/**
*
*/
public class ModifyProperty extends Property {
                /**
                 * The entry point
                 */
                public void execute() throws BuildException
                {
                                 if ((name != null) && (value != null))
                                 {
                                                  modifyProperty(name, value);
                                 }
                                 else
                                 {
                                                  super.execute();
                                 }
                } //end method execute
               
                /**
                 * this is how I modify a property
                 */
                protected void modifyProperty(String name, String value)
                                 throws BuildException
                {
                                 Project project = getProject() ;
                                 if (project.getProperty(name) == null) // property does not
exist
                                 {
                                                  addProperty(name, value) ;
                                 }                                  
                                 else
                                 {
System.out.println("Changing value for property " + name)  ;
                                                  project.setProperty(name, value) ;
                                 }
                } // end method modifyProperty
} // end class ModifyProperty


_______________________________________________
platform-ant-dev mailing list
platform-ant-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-ant-dev



Back to the top