gpt4 book ai didi

ant: srcdir 属性必须非空

转载 作者:行者123 更新时间:2023-12-03 19:35:55 24 4
gpt4 key购买 nike

基本设置

Ant 新手;苹果系统

我想做什么

https://github.com/MIT-DB-Class/course-info-2017/blob/master/lab1.md#1-getting-started .

我使用的命令

  • git clone git@github.com:MIT-DB-Class/simple-db-hw.git
  • cd 简单数据库硬件
  • 酿造安装 Ant
  • Ant 测试

  • 最后一条命令后我得到了什么

    Buildfile: /Users/evan/Desktop/tmp1/simple-db-hw/build.xml

    compile:

    BUILD FAILED /Users/evan/Desktop/tmp1/simple-db-hw/build.xml:169: The following error occurred while executing this line: /Users/evan/Desktop/tmp1/simple-db-hw/build.xml:46: /Users/evan/Desktop/tmp1/simple-db-hw/build.xml:46: srcdir attribute must be non-empty

    Total time: 0 seconds



    相关文件

    这是build.xml: https://gist.github.com/YikSanChan/9ce29ec239db525cd9d4bd62baa62095

    我尝试过的东西
    homebrew install ant 的问题?我试图从 http://ant.apache.org/bindownload.cgi 下载 1.10.2.tar.gz并得到相同的结果。

    问题

    怎么了?任何建议表示赞赏。谢谢!

    最佳答案

    问题出在 Compile宏定义。它尝试引用名为 srcdir 的属性。但它是使用 ${} 作为标准属性引用编写的语法,而不是使用 @{} 的属性语法.

    所以在第 46 行尝试改变这个:

    <macrodef name="Compile">
    <attribute name="srcdir"/>
    <attribute name="destdir"/>
    <element name="compileoptions" implicit="true" optional="true"/>
    <sequential>
    <mkdir dir="@{destdir}"/>
    <!-- avoids needing ant clean when changing interfaces -->
    <depend srcdir="${srcdir}" destdir="${destdir}" cache="${depcache}"/>
    <javac srcdir="@{srcdir}" destdir="@{destdir}" includeAntRuntime="no"
    debug="${compile.debug}" source="${sourceversion}">
    <compilerarg value="-Xlint:unchecked" />
    <!--<compilerarg value="-Xlint:deprecation" />-->
    <compileoptions/>
    </javac>
    </sequential>
    </macrodef>

    进入这个:
    <macrodef name="Compile">
    <attribute name="srcdir"/>
    <attribute name="destdir"/>
    <element name="compileoptions" implicit="true" optional="true"/>
    <sequential>
    <mkdir dir="@{destdir}"/>
    <!-- avoids needing ant clean when changing interfaces -->
    <depend srcdir="@{srcdir}" destdir="@{destdir}" cache="${depcache}"/>
    <javac srcdir="@{srcdir}" destdir="@{destdir}" includeAntRuntime="no"
    debug="${compile.debug}" source="${sourceversion}">
    <compilerarg value="-Xlint:unchecked" />
    <!--<compilerarg value="-Xlint:deprecation" />-->
    <compileoptions/>
    </javac>
    </sequential>
    </macrodef>

    另请注意 destdir也应该以同样的方式改变。

    关于ant: srcdir 属性必须非空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49104089/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com