Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ant:srcdir属性必须为非空_Ant - Fatal编程技术网

ant:srcdir属性必须为非空

ant:srcdir属性必须为非空,ant,Ant,基本设置 蚂蚁新手;苹果操作系统 我想做的事 我使用的命令 git克隆git@github.com:MIT DB Class/simple-DB-hw.git cd简单数据库硬件 brew安装ant 蚂蚁试验 在最后一个命令后得到的内容 Buildfile:/Users/evan/Desktop/tmp1/simple db hw/build.xml 汇编: 构建失败/Users/evan/Desktop/tmp1/simple db hw/BUILD.xml:169:The 执行此行时

基本设置

蚂蚁新手;苹果操作系统

我想做的事

我使用的命令

  • git克隆git@github.com:MIT DB Class/simple-DB-hw.git
  • cd简单数据库硬件
  • brew安装ant
  • 蚂蚁试验
在最后一个命令后得到的内容


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

汇编:

构建失败/Users/evan/Desktop/tmp1/simple db hw/BUILD.xml:169:The 执行此行时发生以下错误: /Users/evan/Desktop/tmp1/simple db hw/build.xml:46: /Users/evan/Desktop/tmp1/simple db hw/build.xml:46:srcdir属性 必须为非空

总时间:0秒


相关文件

以下是build.xml文件:

我尝试过的事情

自制安装ant的问题
?我尝试从下载1.10.2.tar.gz,得到了相同的结果

问题


怎么了?任何建议都将不胜感激。谢谢大家!

问题出在
编译
宏定义中。它试图引用名为
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
也应以相同的方式进行更改。

实际上缺少
src
目录。