AIRã®ãªãªã¼ã¹ãã«ããAntã§èªååãã
FlexBuilderã®ã¡ãã¥ã¼ãExport Release Build...ãããAIRãã¡ã¤ã«ãä½æã§ãããã©ã
ç°å¢æ¯ã«è¨å®ãã¡ã¤ã«ã¨ããã¨ã³ããã¤ã³ãã®URLï¼AIRã®å ´åã¯ã³ã³ãã¤ã«æã«åºå®ãããï¼ã¨ãã®å¤æ´ãããå ´åã¯ã該å½ãããã¡ã¤ã«ãä¿®æ£ããããç½®ãæãããããå¿
è¦ããã£ã¦ããã©ãããã
ã§ãAntã§èªååãã¦ã¿ãã
ããããã¯ã¾ã£ã¦1æ¥åããã£ããã
ãã¹ãç°å¢ç¨(airapp_test_v1.0.air)ã¨ãæ¬çªç°å¢ç¨(airapp_honban_v1.0.air)ã®AIRãã¡ã¤ã«ãAntã§çæããã
â»v1.0ã®ã¨ããã¯-app.xmlã®versionã®å¤ãå
¥ãããã
ä»å対象ã®ããã¸ã§ã¯ãæ§æ
/ build.xml (Antã®ãã«ããã¡ã¤ã«) src/ (AIRããã°ã©ã ã½ã¼ã¹) com/ (ASãMXMLã½ã¼ã¹) css/ icon/ app.properties (ç°å¢ä¾åãã¡ã¤ã«) main.mxml main-app.xml updaterConfig.xml (ç°å¢ä¾åãã¡ã¤ã«) deploy/ (ãã«ãã«å¿ è¦ãªãã¡ã¤ã«ãç°å¢ä¾åãã¡ã¤ã«) test/ (ãã¹ãç°å¢ä¾åãã¡ã¤ã«) app.propertites updaterConfig.xml messaging-config.xml (â»1) proxy-config.xml (â»1) remoting-config.xml (â»1) services-config.xml (â»1) honban/ (æ¬çªç°å¢ä¾åãã¡ã¤ã«) app.propertites updaterConfig.xml messaging-config.xml (â»1) proxy-config.xml (â»1) remoting-config.xml (â»1) services-config.xml (â»1) password.p12 (ãªã¬ãªã¬è¨¼ææ¸) target/ (ãã«ãçµæåºåå )
â»1 endpointãç°å¢æ¯ã«å¤ãã¦ããå¿
è¦ããããã³ã³ãã¤ã«ã¿ã¹ã¯ã§services-config.xmlã渡ãã
ä½ã£ãbuild.xmlãã¡ã¤ã«
<project name="airbuild" basedir="." default="all"> <property name="SDK_HOME" value="C:/Program Files (x86)/Adobe/Flex Builder 3/sdks/flex_sdk_3.4.1.10084/" /> <property name="ADL" value="${SDK_HOME}/bin/adl.exe" /> <property name="ADT.JAR" value="${SDK_HOME}/lib/adt.jar" /> <property name="MXMLC.JAR" value="${SDK_HOME}/lib/mxmlc.jar"/> <!-- Project properties --> <property name="APP_ROOT_DIR" value="./src" /> <property name="AIR_NAME" value="airapp" /> <property name="APP_DESCRIPTOR" value="${APP_ROOT_DIR}/main-app.xml" /> <property name="MAIN_SOURCE_FILE" value="${APP_ROOT_DIR}/main.mxml" /> <property name="RELEASE_DIR" location="./target" /> <property name="DEPLOY_DIR" value="deploy" /> <property name="STORETYPE" value="pkcs12" /> <property name="KEYSTORE" value="deploy/password.p12" /> <property name="PASSWORD" value="password" /> <target name="all"> <!--main-app.xmlãããã¼ã¸ã§ã³ãã²ããããã--> <loadfile property="version" srcFile="${APP_ROOT_DIR}/main-app.xml"> <filterchain> <tokenfilter> <containsregex pattern="<version>.+</version>"/> <trim/> </tokenfilter> <striplinebreaks/> <tokenfilter> <replacestring from="<version>" to=""/> <replacestring from="</version>" to=""/> </tokenfilter> </filterchain> </loadfile> <echo message="v${version} building."></echo> <!-- ãã¹ãç°å¢ç¨ --> <antcall target="package"> <param name="ENV" value="test"/> </antcall> <!-- æ¬çªç°å¢ç¨ --> <antcall target="package"> <param name="ENV" value="honban" /> </antcall> </target> <target name="init" depends="clean"> <echo message="${ENV} initing..." /> <mkdir dir="${RELEASE_DIR}/${ENV}"/> </target> <!-- ã³ã³ãã¤ã«ï¼swfãä½ãï¼ --> <target name="compile" depends="init"> <echo message="${ENV} compiling..." /> <java jar="${MXMLC.JAR}" fork="true" failonerror="true"> <arg value="-debug=false"/> <arg value="+flexlib=${SDK_HOME}/frameworks"/> <arg value="+configname=air"/> <arg value="-services"/> <arg value="${DEPLOY_DIR}/${ENV}/services-config.xml"/> <arg value="-file-specs=${MAIN_SOURCE_FILE}"/> <arg value="-output=${RELEASE_DIR}/${ENV}/main.swf"/> </java> <echo message="${ENV} compiled." /> </target> <!-- AIRãã¡ã¤ã«ã«ãã --> <target name="package" depends="compile"> <copy todir="${RELEASE_DIR}/${ENV}"> <fileset dir="${DEPLOY_DIR}/${ENV}" includes="app.properties,updaterConfig.xml" ></fileset> </copy> <echo message="${ENV} packing..." /> <java jar="${ADT.JAR}" logerror="yes" fork="true"> <arg value="-package" /> <arg value="-storetype" /> <arg value="${STORETYPE}" /> <arg value="-keystore" /> <arg value="${KEYSTORE}" /> <arg value="-storepass" /> <arg value="${PASSWORD}" /> <arg value="${RELEASE_DIR}/${AIR_NAME}_${ENV}_v${version}.air" /> <arg value="${APP_DESCRIPTOR}"/> <arg value="-C"/> <arg value="${APP_ROOT_DIR}"/> <arg value="css"/> <arg value="icon"/> <arg value="-C"/> <arg value="${RELEASE_DIR}/${ENV}"/> <arg value="main.swf"/> <arg value="app.properties"/> <arg value="updaterConfig.xml"/> </java> <echo message="${ENV} packed." /> </target> <target name="clean"> <delete dir="${RELEASE_DIR}/${ENV}" /> </target> </project>
ã³ã³ãã¤ã«ï¼swfãä½ãï¼ããã¨ãã
ã¨ã³ããã¤ã³ãURL
-servicesã§services-config.xmlãæå®ãã¦ããäºã§ã³ã³ãã¤ã«æã«æ±ºã¾ãã¨ã³ããã¤ã³ãã®URLãæå®ã§ããã
Antãã¨ã©ã¼ã«ãªã£ã¦å°ã£ã
compile: [echo] local compiling... [java] è¨å®ãã¡ã¤ã« "C:\Program Files (x86)\Adobe\Flex Builder 3\sdks\flex_sdk_3.4.1.10084\frameworks\air-config.xml" ããã¼ããã¦ãã¾ã [java] ã¨ã©ã¼: Java heap space [java] java.lang.OutOfMemoryError: Java heap space
ã³ã³ãã¤ã«ã§ã¡ã¢ãªã¼ä¸è¶³ã£ã¦ããããªãã ãâ¦ã
ã¨ãããããAntã®JREãSeparete JREãã64bitã®JDKã«å¤æ´ãã¦ãå¼æ°ã«ã-Xmx1024M -XX:MaxPermSize=256mãæå®ããã°éã£ãã
ã¤ãããã³ã³ãã¤ã«æã«ã¡ã¢ãªä½¿ç¨éã800Mãããä¸æãããã©å¤§ä¸å¤«ãï¼
AIRãã¡ã¤ã«ã«ããã¨ãã
証ææ¸ã®ãã¹ã¯ã¼ã
-storepassã§è¨¼ææ¸ã®ãã¹ã¯ã¼ããæå®ã§ããã
ãããæå®ããªãã¨ãã¤ã¾ã§ãã£ã¦ãçµãããªãã