我的ant构建文件在启动时崩溃



当我尝试运行我创建的.xml文件构建时,我得到这个错误。我最初并没有创建这个代码。网上有一个教程,我使用了它。我试着联系业主,但他不回复

Build Failed
Delete doen't support the "di" attribute

它与以下代码有关:

<delete di="${build.dir.development}forgemcpreobfminecraft" />

下面是所有的代码:

    <?xml version="1.0" ?> 
    <project name="Top" default="build">
    <!-- Files which hold information -->
    <property file="build.properties" prefix="build"/>
    <property file="build_number.properties" prefix="build_number"/>
    <!-- Delete files which were used in previous build -->
    <target name="clean">
        <delete file="${build.dir.development}forgemcpsrcminecraftmcmod.info" />
        <delete dir="${build.dir.development}forgemcpsrcminecraftcomNoobMod" />
        <delete di="${build.dir.development}forgemcpreobfminecraft" />
    </target>
    <!-- Increment build number -->
    <target name="increment_build_number">
        <propertyfile file="build_number.properties">
            <entry key="build_number" type="int" operation="+" default="1"/>
        </propertyfile>
    </target>
    <!-- Copy your project to MCP-->
    <target name="prep">
        <copy todir="${build.dir.development}forgemcpsrcminecraft">
            <fileset dir="${build.dir.development}sourceNoobModcommon"/>
        </copy>
    </target>
    <!-- Recompile and Reobfuscate your project inside /MCP -->
    <target name="recompile">
        <exec dir="${build.dir.development}forgemcp" executable="cmd" osfamily="windows">
            <arg line="/c recompile.bat" />
        </exec>
        <exec dir="${build.dir.development}forgemcp" executable="bash" osfamily="unix">
            <arg line="recompile.sh" />
        </exec>
    </target>
    <target name="reobfuscate">
        <exec dir="${build.dir.development}forgemcp" executable="cmd" osfamily="windows">
            <arg line="/c reobfuscate_srg.bat" />
        </exec>
        <exec dir="${build.dir.development}forgemcp" executable="bash" osfamily="unix">
            <arg line="reobfuscate_srg.sh" />
        </exec>
    </target>
    <!-- THE ACTUAL BUILDING PART -->
    <!-- The actual build, where we call the targets -->
    <target name="build">
        <!-- Prep for the build -->
        <antcall target="clean" />
        <antcall target="increment_build_number" />
        <antcall target="prep" />
        <antcall target="recompile" />      
        <antcall target="reobfuscate" />
        <!-- Build the jar -->
        <mkdir dir="${build.dir.release}${build.release.minecraft.version}${build.release.mod.version}" />
        <jar destfile="${build.dir.release}${build.release.minecraft.version}${build.release.mod.version}Noob Mod  -${build.release.mod.version}.jar">
            <fileset dir="${build.dir.development}forgemcpsrcminecraft" includes="mcmod.info" />
            <fileset dir="${build.dir.development}forgemcpreobfminecraft" />
            <fileset dir="${build.dir.development}sourceNoobModresources" excludes="**/xcf/**" />
            <delete dir="${build.dir.development}forgemcpsrcminecraftcomNoobMod" />
        </jar>
        <!-- Clean up the MCP source now that we are done -->
        <antcall target="clean" />
    </target>
</project>

di改为dir

<delete di="${build.dir.development}forgemcpreobfminecraft" />

上面的行是错误的,因为它使用了delete di

<delete dir="${build.dir.development}forgemcpreobfminecraft" />

尝试在顶部声明xml版本

<?xml version="1.0" encoding="UTF-8"?>

如果更适合您,您可以将版本更改为2.0。

我不会把它叫做崩溃。这更像是由于语法错误而无法运行。让我们看看你的错误信息:


构建失败Delete不支持"di"属性

正如您所发现的,它与这一行有关:

<delete di="${build.dir.development}forgemcpreobfminecraft" />

如果您查找在线蚂蚁手册中的删除任务,您将看到确实没有di属性。

有一个dir属性,我想这就是你真正的意思。

相关内容

  • 没有找到相关文章

最新更新