-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcustom_rules.xml
More file actions
29 lines (27 loc) · 994 Bytes
/
custom_rules.xml
File metadata and controls
29 lines (27 loc) · 994 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?xml version="1.0" encoding="UTF-8"?>
<project>
<macrodef name="apply-dirty-integer">
<attribute name="source"/>
<sequential>
<copy overwrite="true" file="@{source}" tofile="@{source}.tmp">
<filterchain>
<tokenfilter>
<replaceregex
pattern="(\w+) int (\w+)\s*=\s*0x([0-9-a-f]{8});"
replace="\1 int \2 = Integer.valueOf(0x\3);"/>
</tokenfilter>
</filterchain>
</copy>
<move file="@{source}.tmp" tofile="@{source}"/>
</sequential>
</macrodef>
<!-- Basically changes resource definition
from:
public static final int field = xxxxxxxx;
to
public static final int field = Integer.valueOf(xxxxxxxx);
-->
<target name="-pre-compile">
<apply-dirty-integer source="gen/tk/dweller/resourcehack/R.java"/>
</target>
</project>