Posts Tagged ‘build’

Problem

You need to change flex sdk directory ( flex version ) in ANT build.xml file without specifying absolute directory path.

1) use Flex Builder 3 or Flash Builder 4 ‘s Flex SDK directory

2) use enviroment variable

<!--  use 'env' as enviroment variable  -->
<property environment="env" />

<!--  Default Flex SDK directory -->
<property name="FLEX_SDK" value="C:\Flex\sdk\3.5.0.12683" />

<!-- Set SDK directory from enviroment variable -->
<condition property="FLEX_HOME" value="${env.FLEX_HOME}">
  <isset property="env.FLEX_HOME" />
</condition>
	
<!--  
set Flash(Flex) Builder's SDK directory 
In my case value is 'C:\Program Files (x86)\Adobe\Adobe Flash Builder 4\sdks\4.1.0' 
-->
<condition property="FLEX_HOME" value="${application.home}">
  <isset property="application.home" />
</condition>

<target name="compc">
     <echo>FLEX_HOME: ${FLEX_HOME}</echo>
     <compc output="dist/swcfilename.swc">
          <load-config filename="${FLEX_HOME}/frameworks/air-config.xml" />
          <source-path path-element="${basedir}/src" />
          <include-sources dir="${basedir}/src" includes="*" />
          <include-libraries file="${basedir}/libs" />
     </compc>
</target>

You can see complete build.xml file at HERE.

Point1

condition tag.

<condition property="FLEX_HOME" value="${application.home}">
  <isset property="application.home" />
</condition>
Point2

When you execute ‘ant’ , please check
[Run in the same JRE as the workspace]

Flash(Flex) builder does not include ANT view by default,
So please see the blog or search yourself.

RSS
Add to Google
2017年1月
« 2月    
1234567
891011121314
15161718192021
22232425262728
293031