1

これは Open lazlo 4.9 の有効な ant ビルド スクリプトですか。このファイルでそれを構築することはできません。

<project name="test" default="TestClient" basedir=".">
    <property name="src"   value="${basedir}/src"/>
    <property name="webappDir" value="../webapp"/>

    <property environment="env"/>
    <property name="lzbin" value="${env.LPS_HOME}/WEB-INF/lps/server/bin"/>

    <!-- use the correct compiler script based on platform -->
    <condition property="lzc" value="${lzbin}/lzc">
        <os family="unix"/>
    </condition>

    <condition property="lzc" value="${lzbin}/lzc.bat">
        <os family="windows"/>
    </condition>

    <property name="TestClient.lzx" value="${basedir}/src/TestClient.lzx"/>
    <property name="TestClient.swf" value="${basedir}/src/TestClient.swf"/>
    <property name="TestClient.lzx.swf" value="${TestClient.lzx}.swf"/>
    <property name="modules" value="${basedir}/src/modules"/>



    <target name="TestClient" description="compile TestClient.lzx">
        <echo message="${lzc}"/>
        <exec executable="${lzc}" failonerror="true">
            <arg value="${TestClient.lzx}"/>
            <arg value='"--runtime=swf10"'/>
        </exec>
        <copy file="${TestClient.lzx.swf}" todir="${webappDir}"/>
        <delete file="${TestClient.swf}"/>
        <delete file="${TestClient.lzx.swf}"/>
    </target>

    <target name="Debug" description="update files on webapp folder from tdc/src">
        <unzip src="${basedir}/../openlaszlo-4.9.0-servlet.war" dest="${webappDir}">            
            <patternset>
                <exclude name="**/WEB-INF/web.xml"/>
                <exclude name="**/META-INF/MANIFEST.MF"/>
                <exclude name="**/my-apps/copy-of-hello.lzx"/>
            </patternset>
        </unzip>
        <copy file="${TestClient.lzx}" todir="${webappDir}" overwrite="false"/>
        <copy file="${basedir}/../etc/proxy.properties" todir="${webappDir}/WEB-INF/classes" overwrite="false"/>

        <copy file="${basedir}/../webLZDebug.xml" tofile="${webappDir}/WEB-INF/web.xml" overwrite="true" />
        <copy file="${webappDir}/tutorial.html" tofile="${webappDir}/debug.html" overwrite="true" />
        <replace file="${webappDir}/debug.html">
            <replacetoken><![CDATA[lzEmbed({url: 'TestClient.lzx.swf?lzt=swf&folder=calif&servletUrl=http://127.0.0.1:12345/servlet/fixed&eliminatorResource=resources/eliminator.swf&__lzhistconn='+top.connuid+'&__lzhisturl=' + escape('includes/h.html?h='), bgcolor: '#6691B4"',  width: '100%', height: '100%'});]]></replacetoken>
            <replacevalue><![CDATA[lzEmbed({url: 'TestClient.lzx?debug=true&lzt=swf&folder=calif&servletUrl=http://127.0.0.1:12345/servlet/fixed&eliminatorResource=resources/eliminator.swf&__lzhistconn='+top.connuid+'&__lzhisturl=' + escape('includes/h.html?h='), bgcolor: '#6691B4"',  width: '100%', height: '100%'});]]></replacevalue>
        </replace>

        <copy todir="${webappDir}/modules" overwrite="true">
            <fileset dir="${ctbmodules}"></fileset>
        </copy>


    </target>

    <target name="help" description="describes usage">
        <echo>

        </echo>
    </target>
</project>

私はすでにこのスタックオーバーフローの投稿を見ました。

Apache Ant を使用して OpenLaszlo DHTML アプリケーションを構築する方法と、 このようなスクリプトを準備します。

ただし、以前のビルド スクリプトに問題があるかどうかを確認したいだけです。

4

1 に答える 1

1

28 行目で、ランタイム引数を囲む余分な引用符を削除する必要があります。それ以外の

<arg value='"--runtime=swf10"'/>

そのはず

<arg value="--runtime=swf10"/>

次に、lzc コマンドにはオプション -o または --output があり、出力ファイルを定義できます。デフォルトでは、lzc コマンドは 2 つの SWF ファイルを生成します。

lzc TestClient.lzx  --runtime=swf10

TestClient.lzx.swf10.swf と TestClient.swf10.swf を生成します。-o オプションを使用すると、ファイル名を直接指定できます。

lzc --runtime=swf10 -o TestClient.swf TestClient.lzx 
Compiling: TestClient.lzx to TestClient.swf

build.xml の変更されたセクションは次のとおりです。

<property name="TestClient.lzx" value="${basedir}/src/TestClient.lzx"/>
<property name="TestClient.swf" value="TestClient.swf"/>
<property name="modules" value="${basedir}/src/modules"/>

<target name="TestClient" description="compile TestClient.lzx">
    <echo message="${lzc}"/>
    <exec executable="${lzc}" failonerror="true">
        <arg value="${TestClient.lzx}"/>
        <arg value="--runtime=swf10"/>
        <arg value="-o" />
        <arg value="${TestClient.swf}" />
    </exec>
    <move file="src/${TestClient.swf}" todir="${webappDir}"/>
</target>

${TestClient.swf} プロパティにパスを追加しないでください。パスを追加すると、lzc コマンドがファイル名の前にフォルダー構造を作成します。そして、コピー後に生成された SWF ファイルを削除するのではなく、移動するだけです。Ant の出力は次のとおりです。

raju@T500:~/flex4.6/build-test$ ant
Buildfile: /home/raju/flex4.6/build-test/build.xml

TestClient:
     [echo] /home/raju/src/svn/openlaszlo/trunk/WEB-INF/lps/server/bin/lzc
     [exec] Compiling: /home/raju/flex4.6/build-test/src/TestClient.lzx to TestClient.swf
     [move] Moving 1 file to /home/raju/flex4.6/webapp

BUILD SUCCESSFUL

そして結果のディレクトリ構造。

├── build-test/
│   ├── build.xml
│   └── src
│       └── TestClient.lzx
└── webapp/
    └── TestClient.swf
于 2012-08-23T16:50:30.497 に答える