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
目录。