Hi,
if I'm not wrong here's what you want to do:
net.pkg.utils.foo
to
net/pkg/utils/foo
I've not seen any replace tasks except for those meant for handling
files. You could do something like this:
<target name="replace-class-with-path">
<property name="pkg.full" value="net.pkg.utils.foo"/>
<property name="temp" value=".temp"/>
<echo file="${temp}" message="${pkg.full}"/>
<loadfile property="pkg.path" srcfile="${temp}">
<filterchain>
<replacestring from="." to="/"/>
</filterchain>
</loadfile>
<delete file="${temp}"/>
<echo message="${pkg.path}"/>
</target>
which is lame, because a file is created just for it to work. You
could, on the other hand, write your own task, and remove the need for
using files.
On 3/16/06, Sascha Balkau <[EMAIL PROTECTED]> wrote:
> Hi folks,
>
> What is a good way to use the package namespace for the main class in an Ant
> build file so that it works properly with MTASC?
>
> Currently when starting a new project in Eclipse, I'm setting up a property
> in the build file that has the filesystem path to the package in that the
> main class resides ...
>
> ...
> <property name="mainclass" value="Main.as"/>
> <property name="mainpackage" value="somepackage/nestedpackage/"/>
> ...
> <property name="source" location="src"/>
> ...
>
> Later in the build file I'm using a target to compile with MTASC which has
> an argument like this ...
>
> <arg value="-main"/>
> <arg value="${source}/${mainpackage}${mainclass}"/>
>
> This is of course pretty unpractical. It works but I have to enter the
> package name with slashes which is a disadvantage when I want to use the
> package name for example to create a class file on-the-fly.
>
> So I was wondering what approach others use to define the package name in
> their build files?
> I'm just starting to use as2ant so I'm not sure how the situation works
> there.
>
>
> Sascha
>
>
> _______________________________________________
> osflash mailing list
> [email protected]
> http://osflash.org/mailman/listinfo/osflash_osflash.org
>
--
Ray Chuan
_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org