简体   繁体   English

Eclipse中的Ant构建失败:无法从控制台理解错误

[英]Ant build in Eclipse failing: Unable to understand the error from console

I am running build.xml from within Eclipse. 我正在Eclipse中运行build.xml。 I got several errors while building, and most of them got solved by fixing the folder paths. 我在构建时遇到了几个错误,并且大多数错误都通过修复文件夹路径得到了解决。 I am working in office network, and realized, C:/ has many security restrictions. 我在办公室网络中工作,并且意识到C:/具有许多安全限制。 So, I moved the project to D:/. 因此,我将项目移至D:/。 After that all the folders getting created. 之后,将创建所有文件夹。 But, then I got stuck with the following error. 但是,然后我陷入了以下错误。 I am new to Ant, and hence, I am unable to understand what the error means. 我是Ant的新手,因此,我无法理解错误的含义。 Hence, I am not sure what to search for! 因此,我不确定要搜索什么! I looked up lots of ant build failure, but nothing related to this. 我查看了很多蚂蚁构建失败的信息,但与此无关。

Here is the ant build.xml: 这是ant build.xml:

<?xml version="1.0"?>
<!-- ======================================================================                                               
     Load Test application   

     ====================================================================== -->
<project 
    name="Load Test application" 
    default="build"
    basedir=".">

    <!-- project properties -->
    <property environment="env"/>

    <!-- Flex SDK settings -->
    <property file="./flex.properties" />

    <!-- Project settings -->
    <property file="./build.properties" />

    <!-- dirs -->
    <property 
        name="release.build.dir" 
        location="${build.dir}/release/"/>
    <property 
        name="debug.build.dir" 
        location="${build.dir}/debug/"/>
    <property 
        name="lib.swc" 
        location="${lib.cairngorm.swc}"/>
    <!-- files -->
    <property 
        name="mxmlc.jar" 
        location="${FLEX_HOME}/lib/mxmlc.jar"/>
    <property 
        name="main.application.release.out" 
        location="${release.build.dir}/${output.swf.name}.swf"/>
    <property 
        name="main.application.debug.out" 
        location="${debug.build.dir}/${output.swf.name}-debug.swf"/>
    <!-- wrapper -->
    <property 
        name="wrapper.dir" 
        location="${FLEX_HOME}/templates/express-installation-with-history"/>
    <property 
        name="output.debug.html" 
        location="${debug.build.dir}/${output.swf.name}-debug.html"/>
    <property 
        name="output.release.html" 
        location="${release.build.dir}/${output.swf.name}.html"/>
    <property 
        name="swf.width" 
        value="100%"/>
    <property 
        name="swf.height" 
        value="100%"/>
    <property 
        name="swf.version.major" 
        value="9"/>
    <property 
        name="swf.version.minor" 
        value="0"/>
    <property 
        name="swf.version.revision" 
        value="0"/>
    <property 
        name="swf.application" 
        value="${output.swf.name}"/>
    <property 
        name="swf.swf" 
        value="${output.swf.name}"/>
    <property 
        name="swf.bgcolor" 
        value="#FFFFFF"/>

    <description>
        Red5 Load Test
    </description>

    <!-- ================================= 
          target: build              
         ================================= -->
    <target 
        name="build" 
        depends="clean,
                 init,
                 compile.release,
                 compile.debug,
                 make.release.wrapper,
                 make.debug.wrapper,
                 docs" 
        description="--> ${swf.release.title} application">
    </target>

    <!-- - - - - - - - - - - - - - - - - - 
          target: make.release.wrapper
         - - - - - - - - - - - - - - - - - -->
    <target 
        name="make.release.wrapper">
        <make.wrapper
            width="${swf.width}"
            height="${swf.height}"
            title="${swf.release.title}"
            version.major="${swf.version.major}"
            version.minor="${swf.version.minor}"
            version.revision="${swf.version.revision}"
            application="${swf.application}}"
            swf="${swf.swf}"
            bgcolor="${swf.bgcolor}"
            wrapper.dir="${wrapper.dir}"
            output.dir="${release.build.dir}"
            output.html="${output.release.html}" />
    </target>

    <!-- - - - - - - - - - - - - - - - - - 
          target: make.debug.wrapper
         - - - - - - - - - - - - - - - - - -->
    <target 
        name="make.debug.wrapper">
        <make.wrapper
            width="${swf.width}"
            height="${swf.height}"
            title="${swf.debug.title}"
            version.major="${swf.version.major}"
            version.minor="${swf.version.minor}"
            version.revision="${swf.version.revision}"
            application="${swf.application}}"
            swf="${swf.swf}-debug"
            bgcolor="${swf.bgcolor}"
            wrapper.dir="${wrapper.dir}"
            output.dir="${debug.build.dir}"
            output.html="${output.debug.html}" />
    </target>

    <!-- - - - - - - - - - - - - - - - - - 
          target: compile.release
         - - - - - - - - - - - - - - - - - -->
    <target 
        name="compile.release">
        <mxmlc.compile
            in="${main.application}"
            out="${main.application.release.out}"
            additional='-benchmark -optimize=true -title "${swf.release.title}" -description "${swf.release.title}"' />
    </target>

    <!-- - - - - - - - - - - - - - - - - - 
          target: compile.debug
         - - - - - - - - - - - - - - - - - -->
    <target 
        name="compile.debug">
        <mxmlc.compile
            in="${main.application}"
            out="${main.application.debug.out}"
            additional="-debug=true -benchmark" />
    </target>

    <!-- - - - - - - - - - - - - - - - - - 
          target: clean                      
         - - - - - - - - - - - - - - - - - -->
    <target 
        name="clean">
        <delete 
            dir="${asdoc.output.dir}" 
            failOnError="false" 
            includeEmptyDirs="true" />
        <delete 
            dir="${build.dir}" 
            failOnError="false" 
            includeEmptyDirs="true" />
    </target>

    <!-- - - - - - - - - - - - - - - - - - 
          target: init                      
         - - - - - - - - - - - - - - - - - -->
    <target 
        name="init">
        <mkdir 
            dir="${build.dir}"/>
        <mkdir 
            dir="${release.build.dir}"/>
        <mkdir 
            dir="${debug.build.dir}"/>
    </target>

    <!-- - - - - - - - - - - - - - - - - - 
          target: docs
         - - - - - - - - - - - - - - - - - -->
    <target 
        name="docs">
        <mkdir dir="${asdoc.output.dir}"/>
        <exec executable="${asdoc.exe}" failonerror="false">
            <arg line='-source-path ${src.dir}'/>
            <arg line='-doc-sources ${asdoc.domainextensions}'/>
                    <arg value='-load-config=${flex.config.xml}'/>
            <arg line='-output ${asdoc.output.dir}'/>
            <arg line='-templates-path "${asdoc.templates.dir}"'/>
            <arg line='-left-frameset-width ${asdoc.framewidth}'/>
            <arg line='-benchmark'/>
        </exec>
    </target>

    <!-- = = = = = = = = = = = = = = = = =
          macrodef: mxmlc.compile          
         = = = = = = = = = = = = = = = = = -->
    <macrodef name="mxmlc.compile">
        <attribute name="in" />
        <attribute name="out" />
        <attribute 
            name="additional"
            default="" />
        <attribute 
            name="config" 
            default="${flex.config.xml}" />
        <sequential>
            <java
                jar="${mxmlc.jar}"
                fork="true"
                maxmemory="512m"
                failonerror="true">
                <arg line="-source-path ${src.dir}"/>
                <arg value="-library-path+=${lib.swc}"/>
                <arg value="+flexlib=${FLEX_HOME}/frameworks"/>
                <arg value="-load-config=@{config}"/>
                <arg value="-output=@{out}"/>
                <arg line="@{additional}"/>
                <arg value="@{in}" />
            </java>
        </sequential>
    </macrodef>

    <!-- = = = = = = = = = = = = = = = = =
          macrodef: make.wrapper          
         = = = = = = = = = = = = = = = = = -->
    <macrodef name="make.wrapper">
        <attribute name="width" default="100%" />
        <attribute name="height" default="100%" />
        <attribute name="title" default="" />
        <attribute name="version.major" default="9" />
        <attribute name="version.minor" default="0" />
        <attribute name="version.revision" default="0" />
        <attribute name="application" default="" />
        <attribute name="swf" default="" />
        <attribute name="bgcolor" default="#869ca7" />
        <attribute name="wrapper.dir" />
        <attribute name="output.dir" />
        <attribute name="output.html" />
        <sequential>
            <copy todir="@{output.dir}">
                <fileset dir="@{wrapper.dir}">
                    <exclude name="**/index.template.html" />
                </fileset>
            </copy>
            <copy 
                file="@{wrapper.dir}/index.template.html"
                tofile="@{output.html}" />
            <replaceregexp 
                file="@{output.html}"
                flags="gs"
                match="\$\{width\}"
                replace="@{width}"/>
            <replaceregexp 
                file="@{output.html}"
                flags="gs"
                match="\$\{height\}"
                replace="@{height}"/>
            <replaceregexp 
                file="@{output.html}"
                flags="gs"
                match="\$\{title\}"
                replace="@{title}"
                encoding="utf-8"/>
            <replaceregexp 
                file="@{output.html}"
                flags="gs"
                match="\$\{version_major\}"
                replace="@{version.major}"/>
            <replaceregexp 
                file="@{output.html}"
                flags="gs"
                match="\$\{version_minor\}"
                replace="@{version.minor}"/>
            <replaceregexp 
                file="@{output.html}"
                flags="gs"
                match="\$\{version_revision\}"
                replace="@{version.revision}"/>
            <replaceregexp 
                file="@{output.html}"
                flags="gs"
                match="\$\{application\}"
                replace="@{application}"/>
            <replaceregexp 
                file="@{output.html}"
                flags="gs"
                match="\$\{bgcolor\}"
                replace="@{bgcolor}"/>
            <replaceregexp 
                file="@{output.html}"
                flags="gs"
                match="\$\{swf\}"
                replace="@{swf}"/>
        </sequential>
    </macrodef>
</project>

Here's the console output: 这是控制台输出:

Buildfile: D:\Documents\intern\khoa\LOADTEST\loadTestClient\build.xml
clean:
   [delete] Deleting directory D:\Documents\intern\khoa\LOADTEST\loadTestClient\bin
init:
    [mkdir] Created dir: D:\Documents\intern\khoa\LOADTEST\loadTestClient\bin
    [mkdir] Created dir: D:\Documents\intern\khoa\LOADTEST\loadTestClient\bin\release
    [mkdir] Created dir: D:\Documents\intern\khoa\LOADTEST\loadTestClient\bin\debug
compile.release:
     [java] Loading configuration file D:\software\flex_sdk_4.6\frameworks\flex-config.xml
     [java] Initial setup: 170ms
     [java] start loading swcs 31ms Running Total: 201ms
     [java] Loaded 31 SWCs: 1105ms
     [java] precompile: 1939ms
     [java] D:\Documents\intern\khoa\LOADTEST\loadTestClient\src\functions.as(45): Warning: 'application' has been deprecated since 4.0.  Please use 'FlexGlobals.topLevelApplication'.
     [java]         if (pattern.test(Application.application.url) == true) {
     [java] D:\Documents\intern\khoa\LOADTEST\loadTestClient\src\functions.as(46): Warning: 'application' has been deprecated since 4.0.  Please use 'FlexGlobals.topLevelApplication'.
     [java]             var results:Array = pattern.exec(Application.application.url);
     [java] Required RSLs:
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/framework_4.6.0.23201.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/tlf/2.0.0.232/textLayout_2.0.0.232.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/spark_4.6.0.23201.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/sparkskins_4.6.0.23201.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/mx_4.6.0.23201.swz with 1 failover.
     [java] Files: 622 Time: 4152ms
     [java] Linking... 72ms
     [java] Optimizing... 123ms
     [java] SWF Encoding... 13ms
     [java] D:\Documents\intern\khoa\LOADTEST\loadTestClient\bin\release\loadtest.swf (53496 bytes)
     [java] postcompile: 207ms
     [java] Total time: 5670ms
     [java] Peak memory usage: 83 MB (Heap: 53, Non-Heap: 30)
compile.debug:
     [java] Loading configuration file D:\software\flex_sdk_4.6\frameworks\flex-config.xml
     [java] Initial setup: 63ms
     [java] start loading swcs 8ms Running Total: 71ms
     [java] Loaded 31 SWCs: 262ms
     [java] precompile: 503ms
     [java] D:\Documents\intern\khoa\LOADTEST\loadTestClient\src\functions.as(45): Warning: 'application' has been deprecated since 4.0.  Please use 'FlexGlobals.topLevelApplication'.
     [java]         if (pattern.test(Application.application.url) == true) {
     [java] D:\Documents\intern\khoa\LOADTEST\loadTestClient\src\functions.as(46): Warning: 'application' has been deprecated since 4.0.  Please use 'FlexGlobals.topLevelApplication'.
     [java]             var results:Array = pattern.exec(Application.application.url);
     [java] Required RSLs:
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/framework_4.6.0.23201.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/tlf/2.0.0.232/textLayout_2.0.0.232.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/spark_4.6.0.23201.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/sparkskins_4.6.0.23201.swz with 1 failover.
     [java]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/mx_4.6.0.23201.swz with 1 failover.
     [java] Files: 622 Time: 2050ms
     [java] Linking... 33ms
     [java] SWF Encoding... 13ms
     [java] D:\Documents\intern\khoa\LOADTEST\loadTestClient\bin\debug\loadtest-debug.swf (95353 bytes)
     [java] postcompile: 46ms
     [java] Total time: 2433ms
     [java] Peak memory usage: 83 MB (Heap: 53, Non-Heap: 30)
make.release.wrapper:

BUILD FAILED
D:\Documents\intern\khoa\LOADTEST\loadTestClient\build.xml:111: The following error occurred while executing this line:
D:\Documents\intern\khoa\LOADTEST\loadTestClient\build.xml:247: D:\software\flex_sdk_4.6\templates\express-installation-with-history does not exist.

Total time: 10 seconds

build.xml:111 is: output.html="${output.release.html}" /> build.xml:111是: output.html="${output.release.html}" />

build.xml:247: <copy todir="@{output.dir}"> build.xml:247: <copy todir="@{output.dir}">

Any help is appreciated! 任何帮助表示赞赏! Thanks! 谢谢!

The logs says: 日志说:

D:\\software\\flex_sdk_4.6\\templates\\express-installation-with-history does not exist. D:\\ software \\ flex_sdk_4.6 \\ templates \\ express-installation-with-history不存在。

It is thrown due to the following line in build.xml: 由于build.xml中的以下行而将其抛出:

<property 
        name="wrapper.dir" 
        location="${FLEX_HOME}/templates/express-installation-with-history"/>

Solutions: 解决方案:

  • Extension of the file is missing, add it in build.xml. 缺少文件扩展名,将其添加到build.xml中。 (.exe, .swz etc) (.exe,.swz等)
  • File does not exist in the location. 该位置不存在文件。 Check it in explorer, and place the file at the location. 在资源管理器中检查它,并将文件放在该位置。 (D:\\software\\flex_sdk_4.6\\templates\\express-installation-with-history) (d:\\ SOFTWARE \\ flex_sdk_4.6 \\模板\\快速安装包含历史)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM