Amasha,
there is
1) .classpath - an XML file
2) build.xml - also an XML file
3) ${basedir} - your build file's folder
4) ${ant.file} - your build file
5) http://ant.apache.org/manual/CoreTasks/style.html - a task allowing
you to execute a XSLT stylesheet
That's pretty all you need to run a XSLT stylesheet on your Ant build
file. That stylesheet would run a XPATH query against .classpath to
extract the "excluding" entries you are looking for and insert them in
your build file where appropriate.
The only downside is, that something like
$ ant update-me-from-classpath compile
is not working, cause Ant does not have something like "eval()".
Instead you would need to do something like
$ ant update-me-from-classpath
$ ant compile
However, I personally regard it as a bad idea to create build.xml out
of .classpath. It should be the other way round.
// Regards.
On Fri, Mar 26, 2010 at 9:49 AM, amasha <[email protected]> wrote:
>
> I have a .classpath:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <classpath>
> <classpathentry excluding="com/orange/homescreen/pil/android21impl
> /WallpaperInterfaceImpl.java|com/orange/homescreen/pil/android21impl/UIInterfaceImpl.java"
> kind="src" path="src"/>
> <classpathentry exported="true" kind="con"
> path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
> <classpathentry kind="src" path="gen"/>
> <classpathentry kind="output" path="bin"/>
> </classpath>
>
> And I want compile the source coding by ant. The ant script:
> <target name="compile" depends="-resource-src, -aidl"
> description="Compiles
> project's .java files into .class files">
> <!-- If android rules are used for a test project, its
> classpath should
> include
> tested project's location -->
> <condition property="extensible.classpath"
> value="${tested.project.absolute.dir}/bin/classes" else=".">
> <isset property="tested.project.absolute.dir" />
> </condition>
> <javac encoding="ascii" target="1.5" debug="true" extdirs=""
> destdir="${out.classes.absolute.dir}"
> bootclasspathref="android.target.classpath" verbose="${verbose}"
> classpath="${extensible.classpath}">
> <src path="${source.absolute.dir}" />
> <src path="${gen.absolute.dir}" />
> <exclude
> name="${source-clients}/android21impl/WallpaperInterfaceImpl.java" />
> <exclude
> name="${source-clients}/android21impl/UIInterfaceImpl.java" />
> <classpath>
> <fileset dir="${external.libs.absolute.dir}"
> includes="*.jar" />
> </classpath>
> </javac>
> </target>
>
> In ant script. I must update my ant script manul, because
>
> <exclude name="${source-clients}/android21impl/WallpaperInterfaceImpl.java"
> />
> <exclude name="${source-clients}/android21impl/UIInterfaceImpl.java" />
>
> often change following the .classpath file.
>
> So I want to know how can i do this auto following .classpath by ant script?
>
> Please help me
>
> Thank you
> --
> View this message in context:
> http://old.nabble.com/Ant-xmlproperty-question-tp27714461p28039514.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
--
Wolfgang Häfelinger
häfelinger IT - Applied Software Architecture
http://www.haefelinger.it
+31 648 27 61 59
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]