Ant 此构建脚本是否为openlazlo 4.9编译的有效构建脚本

Ant 此构建脚本是否为openlazlo 4.9编译的有效构建脚本,ant,build,openlaszlo,lzx,Ant,Build,Openlaszlo,Lzx,这是OpenLaszlo4.9的有效ant构建脚本吗。我不能用这个文件来构建它 <project name="test" default="TestClient" basedir="."> <property name="src" value="${basedir}/src"/> <property name="webappDir" value="../webapp"/> <property environment="env

这是OpenLaszlo4.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>

我会准备一个这样的剧本


但是,我只想确认前面的构建脚本是否存在任何问题。

在第28行中,您必须删除runtime参数周围的额外引号。而不是

<arg value='"--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>
以及由此产生的目录结构

├── build-test/
│   ├── build.xml
│   └── src
│       └── TestClient.lzx
└── webapp/
    └── TestClient.swf

在第28行中,必须删除runtime参数周围的额外引号。而不是

<arg value='"--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>
以及由此产生的目录结构

├── build-test/
│   ├── build.xml
│   └── src
│       └── TestClient.lzx
└── webapp/
    └── TestClient.swf

我用脚本做了一次测试运行,在Ubuntu11.10上用OpenLaszlo 5.0主干和OpenLaszlo 4.9运行时没有任何问题。您的脚本不是有效的Ant构建脚本,因为它缺少根元素,标记。。@r.bitter:我已经更新了脚本,您能告诉我它是否有效吗?我用脚本做了一次测试运行,在Ubuntu11.10上使用OpenLaszlo 5.0主干和OpenLaszlo 4.9都可以正常工作。您的脚本不是有效的Ant构建脚本,因为它缺少根元素,即标记。。@r.bitter:我已经更新了脚本,您能告诉我它是否有效吗?