Jump to content

Request this be added in the tutorials sections of the wiki


REDX36

Recommended Posts

I wrote this tutorial on making an ANT build script for Forge/MCP:

 


 

This tutorial is about creating an ANT build script to easily produce .zip's of your mod.

 

Step 1: Install ANT. On Mac/Linux, it should be already installed, but on Windows, you need to download it from http://ant.apache.org/bindownload.cgi.

 

Step 2: Create a file build.xml in your Forge workspace (/forge, not /forge/mcp). If you have your code in a Github repository elsewhere in the hierarchy, put it there, I will tell you how to make it work later.

 

Step 3: Fill build.xml with these contents, and edit anywhere that has {STUFF}.

 

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

<project name="{NAME}" basedir="{Root direcotry, use ../'s to move up to the Forge workspace if you use a Github repository that is elsewhere.}" default="build">

<target name="build">

	<delete dir="build" />
	<delete dir="mcp/reobf" />

	<mkdir dir="build" />

	<exec executable="recompile.bat" dir="mcp" resolveexecutable="true" osfamily="windows"></exec>

	<exec executable="reobfuscate.bat" dir="mcp" resolveexecutable="true" osfamily="windows"></exec>

	<exec executable="recompile.sh" dir="mcp" resolveexecutable="true" osfamily="unix"></exec>

	<exec executable="reobfuscate.sh" dir="mcp" resolveexecutable="true" osfamily="unix"></exec>

	<copy todir="build">

		<fileset dir="mcp/reobf/minecraft" excludes=".git/**" />
		<fileset dir="mcp/src/minecraft/{PATH TO PACKAGE}">

			<exclude name=".git/**"/>
			<exclude name="**/*.java"/>
			<exclude name="**/*.xml"/>

		</fileset>

	</copy>

	<zip destfile="build/{NAME OF ZIP}.zip">

		<fileset dir="build" />

	</zip>

</target>

</project>

 

Step 4: To run this script, run the command 'ant' in the directory it is located.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.