Fix recipe problem, set up bukkit autobuilding. Fails at the minute for a bukkit mcp update

This commit is contained in:
Christian 2012-07-07 12:21:22 -04:00
parent 00d0701166
commit af36bb2bc0
7 changed files with 49 additions and 53 deletions

View File

@ -4,3 +4,5 @@ bin/
/target
/build.properties
/build
/ironchestversion.properties
/tmpbukkit

View File

@ -29,9 +29,10 @@
<target name="writeversion" depends="buildenvsetup">
<exec executable="${python.exe}" dir="${basedir}" failonerror="true">
<arg value="${basedir}/getversion.py" />
<arg value="${mcp.home}" />
</exec>
<propertyfile file="ironchestversion.properties">
<entry key="ironchest.build.number" type="int" value="${version.build}"/>
<entry key="ironchest.build.build.number" type="int" value="${version.build}"/>
</propertyfile>
</target>
@ -51,10 +52,10 @@
<condition property="python.exe" value="${mcp.home}/runtime/bin/python/python_mcp" else="python">
<os family="Windows" />
</condition>
<condition property="bukkitporting.dir" value="${env.WORKSPACE}/bukkitportingtools" else="${mcdev.home}/bukkitportingtools">
<condition property="bukkitporting.dir" value="${env.WORKSPACE}/bukkitportingtools" else="${dev.home}/bukkitportingtools">
<isset property="env.WORKSPACE" />
</condition>
<property name="bukkit.tmpdir" location="${basedir}/build/bukkit" />
<property name="bukkit.tmpdir" location="${basedir}/tmpbukkit" />
<property name="bukkit.mcp.srcdir" location="${bukkit.tmpdir}/src" />
<property name="mcp.obfoutput" location="${mcp.home}/reobf" />
<property name="client.mcp.obfoutput" location="${mcp.obfoutput}/minecraft" />
@ -65,14 +66,9 @@
<property name="common.src.dir" location="${basedir}/common" />
<property name="client.src.dir" location="${basedir}/client" />
<property name="server.src.dir" location="${basedir}/server" />
<property name="deploy.dir" location="${user.home}/.minecraft/mods" />
<property name="bukkit.src.dir" location="${server.src.dir}" />
<property name="deploy.dir" location="${user.home}/.minecraft/mods" />
<property name="resource.dir" location="${basedir}/resources" />
<property name="bukkitporting.srgtools" location="${bukkitporting.dir}/bin/SrgTools.jar" />
<property name="bukkitporting.asm" location="${bukkitporting.dir}/bin/asm-all-3.3.1.jar" />
<property name="bukkitporting.translatedjar" location="${bukkitporting.dir}/jar/generated/craftbukkit-1.2.5-R1.1-MCPC-SNAPSHOT-73.MCP.jar" />
<property name="bukkitporting.srg" location="${bukkitporting.dir}/mappings/generated/server_mcp_bukkit_1.2.5.srg" />
<property name="bukkit.mcp.jar" location="${bukkitporting.translatedjar}" />
<condition property="version.build" value="${env.BUILD_NUMBER}" else="1">
<isset property="env.BUILD_NUMBER" />
</condition>
@ -172,7 +168,7 @@
</jar>
</target>
<target name="build" depends="merge-client,merge-server,build-client,build-server" />
<target name="build" depends="merge-client,merge-server,build-client,build-server,build-bukkit" />
<target name="buildandclean" depends="build">
<antcall target="clean" />
@ -192,44 +188,27 @@
</delete>
</target>
<target name="compile-bukkit" depends="init">
<target name="merge-bukkit" depends="init">
<mkdir dir="${bukkit.tmpdir}"/>
<mkdir dir="${bukkit.mcp.srcdir}"/>
<antcall target="merge-source">
<param name="side" value="bukkit" />
</antcall>
<mkdir dir="${bukkit.tmpdir}/compiled" />
<javac target="1.6" source="1.6" destdir="${bukkit.tmpdir}/compiled">
<src path="${bukkit.mcp.srcdir}" />
<classpath path="${bukkit.mcp.jar}" />
</javac>
</target>
<target name="jar-bukkit" depends="init,compile-bukkit">
<jar destfile="${bukkit.tmpdir}/${modname}-bukkit-tmp.jar" basedir="${bukkit.tmpdir}/compiled" />
</target>
<target name="translate-bukkit" depends="init,jar-bukkit">
<target name="build-bukkit" depends="init,merge-bukkit">
<property name="jarname" value="${basedir}/target/${modname}-bukkit-${version}.jar" />
<path id="bukkit.compile.ref"/>
<mkdir dir="${basedir}/target" />
<java classname="nl.hardijzer.fw.applysrg.ApplySrg" failonerror="true" fork="true">
<classpath>
<pathelement location="${bukkitporting.asm}" />
<pathelement location="${bukkitporting.srgtools}" />
</classpath>
<arg value="--srg" />
<arg value="${bukkitporting.srg}" />
<arg value="--inheritance" />
<arg value="${bukkit.mcp.jar}" />
<arg value="--inheritance" />
<arg value="${bukkit.tmpdir}/${modname}-bukkit-tmp.jar" />
<arg value="--in" />
<arg value="${bukkit.tmpdir}/${modname}-bukkit-tmp.jar" />
<arg value="--out" />
<arg value="${basedir}/target/${modname}-bukkit-${version}.jar" />
</java>
<ant dir="${bukkitporting.dir}" target="convert-mcp-to-bukkit">
<reference refid="bukkit.compile.ref" />
<property name="modname" value="ironchest"/>
<property name="bukkit.output.jar" value="${jarname}"/>
<property name="bukkit.mcp.srcdir" value="${bukkit.mcp.srcdir}"/>
</ant>
<delete dir="${bukkit.tmpdir}"/>
</target>
<target name="build-bukkit" depends="init,translate-bukkit"/>
<target name="deploy" depends="init,build-client">
<property name="jarname" value="${modname}-client-${version}" />
<move file="${deploy.dir}/${jarname}.zip" tofile="${deploy.dir}/${jarname}.zip.${timestamp}" failonerror="false" verbose="true" />

View File

@ -52,7 +52,7 @@ public enum ChestChangerType {
}
public ItemChestChanger buildItem(Configuration cfg, int id) {
int itemId = Integer.parseInt(cfg.getOrCreateIntProperty(itemName, Configuration.CATEGORY_ITEM, id).value);
int itemId = cfg.getOrCreateIntProperty(itemName, Configuration.CATEGORY_ITEM, id).getInt(id);
item = new ItemChestChanger(itemId, this);
return item;
}

View File

@ -25,7 +25,7 @@ public enum IronChestType {
GOLD(81, 9, true, "Gold Chest", "goldchest.png", 1, Arrays.asList("ingotGold"), TileEntityGoldChest.class, "mmmmPmmmm", "mGmG4GmGm"),
DIAMOND(108, 12, true, "Diamond Chest", "diamondchest.png", 2, Arrays.asList("gemDiamond"), TileEntityDiamondChest.class, "GGGmPmGGG", "GGGG4Gmmm"),
COPPER(45, 9, false, "Copper Chest", "copperchest.png", 3, Arrays.asList("ingotCopper"), TileEntityCopperChest.class, "mmmmCmmmm"),
SILVER(72, 9, false, "Silver Chest", "silverchest.png", 4, Arrays.asList("ingotSilver"), TileEntitySilverChest.class, "mmmm0mmmm", "mGmG3GmGm"),
SILVER(72, 9, false, "Silver Chest", "silverchest.png", 4, Arrays.asList("ingotSilver"), TileEntitySilverChest.class, "mmmm3mmmm", "mGmG0GmGm"),
CRYSTAL(108, 12, true, "Crystal Chest", "crystalchest.png", 5, Arrays.asList("blockGlass"), TileEntityCrystalChest.class, "GGGGPGGGG"),
WOOD(0,0,false,"","",-1,Arrays.asList("blockPlanks"),null);
int size;

View File

@ -10,7 +10,6 @@
******************************************************************************/
package cpw.mods.ironchest;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.ReflectionHelper;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.Item;

View File

@ -37,7 +37,7 @@ public class mod_IronChest extends NetworkMod {
@Override
public void load() {
MinecraftForge.versionDetect("IronChest", 3, 3, 7);
MinecraftForge.versionDetect("IronChest", 3, 3, 8);
ModContainer fml=ModLoaderModContainer.findContainerFor(this);
if (fml.getMetadata()!=null) {
fml.getMetadata().version=Version.fullVersionString();
@ -47,9 +47,9 @@ public class mod_IronChest extends NetworkMod {
Configuration cfg = new Configuration(cfgFile);
try {
cfg.load();
int bId = cfg.getOrCreateBlockIdProperty("ironChests", 502).getInt(502);
int bId = cfg.getOrCreateBlockIdProperty("ironChests", 181).getInt(181);
ironChestBlock = new BlockIronChest(bId);
ChestChangerType.buildItems(cfg, 19501);
ChestChangerType.buildItems(cfg, 29501);
} catch (Exception e) {
ModLoader.getLogger().severe("IronChest was unable to load it's configuration successfully");
e.printStackTrace(System.err);

View File

@ -5,6 +5,15 @@ import fnmatch
import re
import subprocess, shlex
mcp_home = sys.argv[1]
mcp_dir = os.path.abspath(mcp_home)
print(mcp_dir)
sys.path.append(mcp_dir)
from runtime.commands import Commands
Commands._version_config = os.path.join(mcp_dir,Commands._version_config)
def cmdsplit(args):
if os.sep == '\\':
args = args.replace('\\', '\\\\')
@ -35,12 +44,19 @@ def main():
print("Git not found")
vers="v1.0-0-deadbeef"
(major,minor,rev,githash)=re.match("v(\d+).(\d+)-(\d+)-(.*)",vers).groups()
(mcpversion,mcclientversion,mcserverversion) = re.match("[.\w]+ \(data: ([.\w]+), client: ([.\w.]+), server: ([.\w.]+)\)",Commands.fullversion()).groups()
with open("ironchestversion.properties","w") as f:
f.write("%s=%s\n" %("ironchest.build.major.number",major))
f.write("%s=%s\n" %("ironchest.build.minor.number",minor))
f.write("%s=%s\n" %("ironchest.build.revision.number",rev))
f.write("%s=%s\n" %("ironchest.build.githash",githash))
f.write("%s=%s\n" %("ironchest.build.mcversion","1.2.5"))
f.write("%s=%s\n" %("ironchest.build.mcpversion",mcpversion))
f.write("%s=%s\n" %("ironchest.build.mcclientversion",mcclientversion))
f.write("%s=%s\n" %("ironchest.build.mcserverversion",mcserverversion))
print("Version information: IronChest %s.%s.%s using MCP %s for c:%s, s:%s" % (major, minor, rev, mcpversion, mcclientversion, mcserverversion))
if __name__ == '__main__':
main()