-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.xml
More file actions
69 lines (60 loc) · 2.45 KB
/
build.xml
File metadata and controls
69 lines (60 loc) · 2.45 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<project
name="lr-stash"
default="install"
basedir="."
>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<property name="pluginFolderName" value="${ant.project.name}.lrplugin" />
<property name="pluginFolder" location="${build}/${pluginFolderName}"/>
<property name="pluginDeploymentUnit" location="${dist}/${pluginFolderName}.zip"/>
<target name="clean">
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
<target name="init" depends="clean">
<mkdir dir="${pluginFolder}" />
<mkdir dir="${dist}"/>
<copy overwrite="true" file="logo.png" tofile="${pluginFolder}/logo.png" />
<copy overwrite="true" file="README.txt" tofile="${pluginFolder}/README.txt" />
</target>
<target name="modify-version">
<tstamp />
<exec executable="${git}" outputproperty="revision" failifexecutionfails="false" errorproperty="">
<arg value="describe"/>
<arg value="--always"/>
<arg value="HEAD"/>
</exec>
<property name="versionString" value="${DSTAMP} - ${TSTAMP} - ${revision}" />
<replaceregexp file="Info.lua"
match="VERSION = \{major=([\d]+), minor=([\d]+), revision=(0[xX][0-9a-fA-F]+)(.*)"
replace="VERSION = {major=${DSTAMP}, minor=${TSTAMP}, revision=0x${revision}\4"
byline="true"
/>
</target>
<target name="compile" depends="init">
<apply executable="${luac}" type="file" verbose="true">
<arg value="-s" />
<arg value="-o" />
<targetfile />
<fileset dir=".">
<include name="**/*.lua" />
</fileset>
<mapper type="glob" from="*.lua" to="${pluginFolder}/*.lua" />
</apply>
</target>
<target name="dist" depends="modify-version, compile">
<zip destfile="${pluginDeploymentUnit}" basedir="${build}">
</zip>
</target>
<target name="install" depends="dist">
<unzip src="${pluginDeploymentUnit}" dest="${lrPluginFolder}" overwrite="true" />
</target>
<target name="test" depends="modify-version">
<copy todir="${lrPluginFolder}/${pluginFolderName}" overwrite="true" >
<fileset dir=".">
<include name="**/*.lua"/>
</fileset>
</copy>
</target>
</project>