Commit e4b8825d9440a2018c3d487fa7866e381e63970a

Authored by Mumfrey
1 parent d3ec7c49

adding LiteLoaderToSrg ant scripts and jenkins configurations

ant/build_liteloader.xml
... ... @@ -39,17 +39,27 @@
39 39 <target name="setup_development">
40 40 <property name="skipremoval" value="DEV" />
41 41 <property name="md5.outfile" value="${md5.dir}/client_${outmd5set}.md5" />
  42 + <property name="artefact.name" value="${ant.project.name}-${mcversion}" />
42 43 </target>
43 44  
44 45 <target name="setup_production">
45 46 <property name="skipremoval" value="" />
46 47 <property name="md5.outfile" value="${md5.dir}/client_${outmd5set}_production.md5" />
  48 + <property name="artefact.name" value="${ant.project.name}-${mcversion}" />
  49 + </target>
  50 +
  51 + <target name="setup_jenkins">
  52 + <property name="skipremoval" value="" />
  53 + <property name="md5.outfile" value="${md5.dir}/client_${outmd5set}_production.md5" />
  54 + <property name="artefact.name" value="${ant.project.name}-${mcversion}-SNAPSHOT" />
47 55 </target>
48 56  
49 57 <!-- Main target -->
50 58 <target name="development" depends="setup_development, findmcp, setdirsold, setdirsnew, build" description="Entry point for MCP and upstream builds" />
51 59  
52   - <target name="production" depends="setup_production, findmcp, setdirsold, setdirsnew, build" description="Entry point for production builds" />
  60 + <target name="production" depends="setup_production, findmcp, setdirsold, setdirsnew, build, mcpjar" description="Entry point for production builds" />
  61 +
  62 + <target name="jenkins" depends="setup_jenkins, findmcp, setdirsold, setdirsnew, build, mcpjar" description="Entry point for CI builds" />
53 63  
54 64 <target name="setdirsnew" description="Set the MCP source directories for the new layout" unless="mcpsrc.exists">
55 65 <echo level="info" message="Setting MCP source directories for NEW configuration" />
... ... @@ -239,7 +249,7 @@
239 249  
240 250 <mkdir dir="${dist.dir}" />
241 251  
242   - <jar destfile="${dist.dir}/${ant.project.name}-${mcversion}.${filetype}" duplicate="preserve" index="true" manifestencoding="UTF-8">
  252 + <jar destfile="${dist.dir}/${artefact.name}.${filetype}" duplicate="preserve" index="true" manifestencoding="UTF-8">
243 253 <manifest>
244 254 <attribute name="Built-By" value="MCP (http://mcp.ocean-labs.de)" />
245 255 <attribute name="Implementation-Vendor" value="${author}" />
... ... @@ -259,10 +269,10 @@
259 269  
260 270 <mkdir dir="${dist.dir}" />
261 271  
262   - <delete file="${dist.dir}/${ant.project.name}-${version}-mcpnames.${filetype}" />
263   - <delete file="${dist.dir}/${ant.project.name}-${version}-mcpnames-sources.${filetype}" />
  272 + <delete file="${dist.dir}/${artefact.name}-mcpnames.${filetype}" />
  273 + <delete file="${dist.dir}/${artefact.name}-mcpnames-sources.${filetype}" />
264 274  
265   - <jar destfile="${dist.dir}/${ant.project.name}-${version}-mcpnames.${filetype}" duplicate="preserve" index="true" manifestencoding="UTF-8">
  275 + <jar destfile="${dist.dir}/${artefact.name}-mcpnames.${filetype}" duplicate="preserve" index="true" manifestencoding="UTF-8">
266 276 <manifest>
267 277 <attribute name="Built-By" value="MCP (http://mcp.ocean-labs.de)" />
268 278 <attribute name="Implementation-Vendor" value="${author}" />
... ... @@ -275,7 +285,7 @@
275 285 </manifest>
276 286 <fileset dir="${eclipse}/LiteLoader/bin" />
277 287 </jar>
278   - <jar destfile="${dist.dir}/${ant.project.name}-${version}-mcpnames-sources.${filetype}" duplicate="preserve" index="false" filesetmanifest="skip">
  288 + <jar destfile="${dist.dir}/${artefact.name}-mcpnames-sources.${filetype}" duplicate="preserve" index="false" filesetmanifest="skip">
279 289 <fileset dir="${eclipse}/LiteLoader/java/common" />
280 290 <fileset dir="${eclipse}/LiteLoader/java/client" />
281 291 <fileset dir="${eclipse}/LiteLoader/debug" />
... ... @@ -287,7 +297,7 @@
287 297  
288 298 <target name="deploy" depends="production" description="Deploy artifact to local minecraft installation in APPDATA">
289 299 <mkdir dir="${env.APPDATA}/.minecraft/libraries/com/mumfrey/liteloader/${mcversion}"/>
290   - <copy todir="${env.APPDATA}/.minecraft/libraries/com/mumfrey/liteloader/${mcversion}" file="${dist.dir}/${ant.project.name}-${mcversion}.${filetype}" failonerror="false" overwrite="true" />
291   - <copy todir="${eclipse}/LiteLoaderInstaller/src/main/resources" file="${dist.dir}/${ant.project.name}-${mcversion}.${filetype}" failonerror="false" overwrite="true" />
  300 + <copy todir="${env.APPDATA}/.minecraft/libraries/com/mumfrey/liteloader/${mcversion}" file="${dist.dir}/${artefact.name}.${filetype}" failonerror="false" overwrite="true" />
  301 + <copy todir="${eclipse}/LiteLoaderInstaller/src/main/resources" file="${dist.dir}/${artefact.name}.${filetype}" failonerror="false" overwrite="true" />
292 302 </target>
293 303 </project>
294 304 \ No newline at end of file
... ...
ant/build_srgjar.xml 0 โ†’ 100644
  1 +<?xml version="1.0" encoding="ISO-8859-1"?>
  2 +<project name="liteloadertosrg" basedir="." default="build" xmlns:ivy="antlib:org.apache.ivy.ant">
  3 +
  4 + <property name="project.name" value="liteloader" />
  5 + <property name="version" value="1.8" />
  6 + <property name="author" value="Mumfrey" />
  7 +
  8 + <property name="mcp.dir" location="../../.." />
  9 + <property name="mcp.temp.dir" location="${mcp.dir}/temp" />
  10 + <property name="minecraft.src.dir" location="${mcp.dir}/src/minecraft" />
  11 + <property name="lib.dir" location="./lib" />
  12 + <property name="temp.dir" location="./temp" />
  13 + <property name="out.dir" location="${temp.dir}/out" />
  14 + <property name="dist.dir" location="${mcp.dir}/build/dist" />
  15 + <property name="src.dir" location="${temp.dir}/src" />
  16 + <property name="map.file" location="${temp.dir}/range.map" />
  17 + <property name="insrg.file" location="${mcp.temp.dir}/client_ro_srg.srg" />
  18 + <property name="outsrg.file" location="${temp.dir}/remap.srg" />
  19 + <property name="liteloader.src.base" location="../java" />
  20 +
  21 + <property name="python_windows" location="${mcp.dir}/runtime/bin/python/python_mcp.exe" />
  22 + <property name="python_linux" location="/usr/bin/python" />
  23 +
  24 + <path id="class.path">
  25 + <fileset dir="${lib.dir}">
  26 + <include name="**/*.jar" />
  27 + </fileset>
  28 + </path>
  29 +
  30 + <target name="build">
  31 + <property name="artefact" location="${dist.dir}/${project.name}-${version}-srgnames-sources.jar" />
  32 + <ivy:configure file="ivysettings.xml" />
  33 + <antcall target="jar" />
  34 + </target>
  35 +
  36 + <target name="jenkins">
  37 + <property name="artefact" location="${dist.dir}/${project.name}-${version}-SNAPSHOT-srgnames-sources.jar" />
  38 + <ivy:configure file="ivysettings.xml" />
  39 + <antcall target="jar" />
  40 + </target>
  41 +
  42 + <path id="classpath">
  43 + <fileset dir="${ivy.lib.dir}">
  44 + <include name="**/*.jar"/>
  45 + </fileset>
  46 + </path>
  47 +
  48 + <target name="clean">
  49 + <echo message="Cleaning working directories..." />
  50 +
  51 + <delete dir="${temp.dir}" failonerror="false" />
  52 +
  53 + <mkdir dir="${src.dir}"/>
  54 + <mkdir dir="${out.dir}"/>
  55 + <mkdir dir="${temp.dir}"/>
  56 + </target>
  57 +
  58 + <target name="init" depends="clean">
  59 + <echo message="Aggregating sources..." />
  60 +
  61 + <copy todir="${src.dir}" overwrite="true">
  62 + <fileset dir="${minecraft.src.dir}">
  63 + <exclude name="*.java" />
  64 + </fileset>
  65 + <fileset dir="${liteloader.src.base}/common">
  66 + <exclude name="**/Jump.java" />
  67 + </fileset>
  68 + <fileset dir="${liteloader.src.base}/client" />
  69 + </copy>
  70 +
  71 + <echo message="Fetching dependencies..." />
  72 + </target>
  73 +
  74 + <target name="reobfSrg" depends="init">
  75 + <echo message="Running reobf to generate srgs..." />
  76 +
  77 + <exec executable="${python_windows}" dir="${mcp.dir}" osfamily="windows">
  78 + <arg value="runtime/reobfuscate.py" />
  79 + <arg value="--srgnames" />
  80 + <arg value="--client" />
  81 + </exec>
  82 +
  83 + <exec executable="${python_linux}" dir="${mcp.dir}" osfamily="unix">
  84 + <arg value="runtime/reobfuscate.py" />
  85 + <arg value="--srgnames" />
  86 + <arg value="--client" />
  87 + </exec>
  88 + </target>
  89 +
  90 + <target name="extractRanges" depends="reobfSrg">
  91 + <echo message="Extracting ranges from source..." />
  92 +
  93 + <java classname="net.minecraftforge.srg2source.ast.RangeExtractor" output="${temp.dir}/extractRanges.log">
  94 + <classpath refid="class.path" />
  95 + <arg value="${src.dir}" />
  96 + <arg value="${lib.dir}" />
  97 + <arg value="${map.file}" />
  98 + </java>
  99 + </target>
  100 +
  101 + <target name="flipsrg" depends="extractRanges">
  102 + <echo message="Remapping SRG file..." />
  103 +
  104 + <copy file="${insrg.file}" tofile="${outsrg.file}" overwrite="true" />
  105 + <replaceregexp file="${outsrg.file}" byline="true" match="(FD|CL): ([^\s]+) ([^\s]+)" replace="\1: \3 \2" />
  106 + <replaceregexp file="${outsrg.file}" byline="true" match="MD: ([^\s]+) ([^\s]+) ([^\s]+) ([^\s]+)" replace="MD: \3 \4 \1 \2" />
  107 + </target>
  108 +
  109 + <target name="applyRanges" depends="flipsrg">
  110 + <echo message="Remapping ranges in source..." />
  111 +
  112 + <java classname="net.minecraftforge.srg2source.rangeapplier.RangeApplier" output="${temp.dir}/applyRanges.log">
  113 + <classpath refid="class.path" />
  114 + <arg value="--srcRoot=${src.dir}" />
  115 + <arg value="--srcRangeMap=${map.file}" />
  116 + <arg value="--srgFiles=${outsrg.file}" />
  117 + <arg value="--outDir=${out.dir}" />
  118 + </java>
  119 + </target>
  120 +
  121 + <target name="jar" depends="applyRanges">
  122 + <echo message="Building src jar..." />
  123 +
  124 + <jar destfile="${artefact}" duplicate="preserve" index="true" manifestencoding="UTF-8">
  125 + <manifest>
  126 + <attribute name="Implementation-Vendor" value="${author}" />
  127 + <attribute name="Implementation-Title" value="${ant.project.name}" />
  128 + <attribute name="Implementation-Version" value="${version}" />
  129 + </manifest>
  130 + <fileset dir="${out.dir}">
  131 + <exclude name="net/minecraft/**" />
  132 + </fileset>
  133 + </jar>
  134 + </target>
  135 +</project>
0 136 \ No newline at end of file
... ...
ant/ivy.xml 0 โ†’ 100644
  1 +<?xml version="1.0" encoding="ISO-8859-1"?>
  2 +<ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
  3 + <info organisation="com.mumfrey" module="liteloader" status="integration">
  4 + <ivyauthor name="Adam Mummery-Smith" />
  5 + </info>
  6 + <dependencies>
  7 + <dependency org="org.ow2.asm" name="asm-debug-all" rev="4.1" />
  8 + <dependency org="com.google.guava" name="guava" rev="15.0" />
  9 + <dependency org="net.sf.opencsv" name="opencsv" rev="2.3" />
  10 + <dependency org="net.sf.jopt-simple" name="jopt-simple" rev="4.6" />
  11 + <dependency org="org.eclipse.jgit" name="org.eclipse.jgit" rev="3.2.0.201312181205-r" />
  12 + <dependency org="org.eclipse.core" name="contenttype" rev="3.4.200-v20130326-1255" />
  13 + <dependency org="org.eclipse.core" name="jobs" rev="3.5.300-v20130429-1813" />
  14 + <dependency org="org.eclipse.core" name="runtime" rev="3.9.0-v20130326-1255" />
  15 + <dependency org="org.eclipse" name="osgi" rev="3.9.1-v20130814-1242" />
  16 + <dependency org="org.eclipse.text" name="org.eclipse.text" rev="3.5.101" />
  17 + <dependency org="org.eclipse.equinox" name="common" rev="3.6.200-v20130402-1505" />
  18 + <dependency org="org.eclipse.equinox" name="preferences" rev="3.5.100-v20130422-1538" />
  19 + <dependency org="org.eclipse.jdt" name="org.eclipse.jdt.core" rev="3.10.0.v20131029-1755" />
  20 + <dependency org="net.minecraftforge.srg2source" name="Srg2Source" rev="3.2-SNAPSHOT" />
  21 + </dependencies>
  22 +</ivy-module>
... ...
ant/ivysettings.xml 0 โ†’ 100644
  1 +<?xml version="1.0" encoding="ISO-8859-1"?>
  2 +<ivysettings>
  3 + <settings defaultResolver="srg2source" />
  4 + <resolvers>
  5 + <chain name="srg2source">
  6 + <ibiblio name="m2" m2compatible="true" />
  7 + <ibiblio name="forge" m2compatible="true" root="http://files.minecraftforge.net/maven/"/>
  8 + <ibiblio name="eclipse" m2compatible="true" root="https://repo.eclipse.org/content/groups/eclipse/"/>
  9 + </chain>
  10 + </resolvers>
  11 +</ivysettings>
0 12 \ No newline at end of file
... ...