2010-11-23 9 views

답변

1

개미 사전 컴파일 당신이 당신의 목표 요소 내에 넣을 수 있습니다 :

<replaceregexp 
    file="yourFile.as" 
    match="private static const CONST_PARAM:String = '.*';" 
    replace="private static const CONST_PARAM:String = 'Your new const value';"> 
</replaceregexp> 

고유 한 빌드 시간을 컴파일 할 때마다하려는 경우에 특히 유용합니다. 당신의 Main.as 클래스 다음

<tstamp> 
    <format property="timestamp" pattern="MM/dd/yyyy hh:mm:ss" /> 
</tstamp> 
<replaceregexp 
    file="../src/Main.as" 
    match="private const BUILD_TIME:String = '.*';" 
    replace="private const BUILD_TIME:String = '${timestamp}';"> 
</replaceregexp> 

: 당신의 ANT 사전 컴파일에서

package Main{ 
    import flash.display.Sprite; 

    public class Main extends Sprite{ 

     private const BUILD_TIME:String = 'dummy value'; 

     public function Main() { 
      trace("\n Main.as build-time:" + BUILD_TIME); 
     } 
    } 
} 
그것은 그것이 업데이트되지 않았기 때문에 당신의 SWF가 예기치 않게 작동하고 공통의 문제를 해결하는 데 도움이

스테이징 서버.

관련 문제