forked from cbanack/comic-vine-scraper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
108 lines (82 loc) · 4 KB
/
build.xml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?xml version="1.0" encoding = 'utf-8'?>
<!DOCTYPE project>
<project name="Comic Vine Scraper" default="dist" basedir="." >
<description>
A master build file for the 'Comic Vine Scraper' project.
</description>
<!-- Global Properties -->
<property name="build.dir" location="build"/>
<property name="zip.dir" location="${build.dir}/zip"/>
<property name="src.dir" location="src"/>
<!-- paths within the project where ironpython should sure
for imported .py files. you must update this list if
you add new folders with source code in them. -->
<path id="include.paths">
<pathelement location="${src.dir}/py"/>
<pathelement location="${src.dir}/py/book"/>
<pathelement location="${src.dir}/py/database"/>
<pathelement location="${src.dir}/py/database/comicvine"/>
<pathelement location="${src.dir}/py/gui"/>
<pathelement location="${src.dir}/py/gui/forms"/>
<pathelement location="${src.dir}/py/tests"/>
<pathelement location="${src.dir}/py/utils"/>
<pathelement location="${src.dir}/resources/"/>
<pathelement location="${src.dir}/resources/languages"/>
<pathelement location="${basedir}/tools/comicrack"/>
</path>
<!-- ================================================================= -->
<target name="run"
description="--> Runs comic vine scraper with some sample input.">
<exec executable="ipy.exe" dir="${basedir}">
<env key="IRONPYTHONPATH" path="${toString:include.paths}"></env>
<arg value="${basedir}/tools/launcher/Launcher.py"/>
<arg value="${basedir}/tools/testdata/sample.pickled"/>
</exec>
</target>
<!-- ================================================================= -->
<target name="test"
description="--> Runs comic vine scraper in unit test mode.">
<exec executable="ipy.exe" dir="${basedir}">
<env key="IRONPYTHONPATH" path="${toString:include.paths}"></env>
<arg value="${src.dir}/py/tests/test_all.py"/>
</exec>
</target>
<!-- ================================================================= -->
<target name="dist" depends="clean"
description="--> Creates the distributable .crplugin file.">
<!-- creates a timestamp to use in the echoed output below -->
<tstamp>
<format property="date" pattern="MMMM-d-yyyy 'at' hh:mm:ss a"/>
</tstamp>
<!-- loads special properties (Version, Name, etc) from package.ini -->
<loadproperties srcFile="${src.dir}/resources/package.ini"/>
<!-- build all the directories we'll need to work with -->
<echo level="info" message="Building '${Name} v${Version}' on ${date}..."/>
<mkdir dir="${build.dir}" />
<mkdir dir="${zip.dir}" />
<!-- copy the entire source directory to the zip dir, flattening it,
and skipping empty directories. -->
<copy todir="${zip.dir}" flatten="true" includeemptydirs="false">
<fileset dir="${src.dir}">
<exclude name="**/__init__.py"/>
<exclude name="**/tests/**"/>
</fileset>
</copy>
<!-- insert the correct version string into the main script file before
it gets zipped up. -->
<replace file="${zip.dir}/resources.py" token="!DEV!"
value="${Version}" />
<!-- zip up the zip dir, thus making a valid ComicRack script package -->
<zip destfile="${build.dir}/ComicVineScraper-${Version}.crplugin"
basedir="${zip.dir}" whenempty="fail"/>
<!-- the zip directory isn't needed anymore, so remove it -->
<delete dir="${zip.dir}" quiet="true"/>
</target>
<!-- ================================================================= -->
<target name="clean"
description="--> Deletes all materials generated by the this build.">
<delete quiet="true" includeemptydirs="true">
<fileset dir="${build.dir}"/>
</delete>
</target>
</project>