Here's a working Ant script(this is run in an exploded web application 
dir, but that's easy to change):

         <java jar="${flex.mxmlc.jar}" dir="${app.dir}" fork="true">
           <arg line="-flexlib ${flex.dist.lib} -configuration 
WEB-INF/flex/flex-config.xml -webroot . -o index.mxml.swf index.mxml"/>
         </java>

Note that when using the jar= argument to <java>, one doesn't specify a 
classpath.  That's probably your problem.

.       .    .  . ...j


Brett Palmer wrote:
> I've been trying to create a platform neutral build for our flex
> application using Ant and mxmlc.jar but I can't get the configuration
> to work.  When I run the build I always get an class not found
> exception for the "flex/tools/Mxmlc" class.  I can build flex with Ant
> if I use the mxmlc.exe compiler directly from Ant, but I wanted the
> build to work without requiring the compiler script or executable.
> 
> Here is my current Ant target that is not working:
> 
> <target name="compile_flex_jar" depends="init, flex_classpath">
> 
>   <echo message="mxmlc.jar = ${mxmlc.jar}"/>
>   <echo message="flex_config = ${flex_config}"/>
>   <echo message="flex_file = ${flex_file}"/>
>   <echo message="flex.class.path = ${flex.class.path}"/>
>   <echo message="flex_jars.dir = ${flex_jars.dir}"/>
>   <echo message="flex_home.dir = ${flex_home.dir}"/>
> 
>   <java jar="${mxmlc.jar}" fork="true" dir="c:\dev\in2m\in2m\flex"
> failonerror="true" >
> 
>     <jvmarg value="-Dassert -Dapplication.home=${env.FLEX_HOME}
> -Xms256M -Xmx512M" />
>     <classpath>
>           <path refid="flex.class.path"/>                
>               <pathelement 
> location="c:/dev/in2m/in2m/flex/webapp/mvelopes/WEB-INF/flex/jars/mxmlc.jar"/>
>             </classpath>
>               <arg value="-configuration ${flex_config} ${flex_file}" />
>   </java>
>       
> </target>
> 
> Even when I hard code the mxmlc.jar file in the class path executing
> mxmlc.jar doesn't find the correct class.
> 
> Is anyone else using Ant and mxmlc.jar to compile their Flex files and
> if so can you post a solution showing the correct configuration?
> 
> Thanks in advance for your help.
> 
> 
> Brett
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 
> 



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to