forked from javese/FBReaderJ
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
95 lines (84 loc) · 3.34 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="FBReaderJ" default="package">
<property file="local.properties" />
<property file="build.properties" />
<property file="default.properties" />
<path id="android.antlibs">
<pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
<pathelement path="${sdk.dir}/tools/lib/sdklib.jar" />
<pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" />
<pathelement path="${sdk.dir}/tools/lib/apkbuilder.jar" />
<pathelement path="${sdk.dir}/tools/lib/jarutils.jar" />
</path>
<taskdef name="setup"
classname="com.android.ant.SetupTask"
classpathref="android.antlibs" />
<setup />
<target name="init" description="Initialization...">
<fail message="Ant 1.7.0 or higher is required. Please upgrade your ant.">
<condition>
<not>
<antversion property="ant.version" atleast="1.7.0"/>
</not>
</condition>
</fail>
</target>
<target name="native" unless="native.libraries.are.uptodate">
<fail message="Native libraries are not up-to-date. Please run ndk-build manually.">
<condition>
<os family="windows" />
</condition>
</fail>
<echo message="Building native libraries..."/>
<exec executable="${ndk.dir}/ndk-build" />
<echo message="DONE (Building native libraries)"/>
</target>
<target name="check.native.libraries" depends="init">
<echo message="Checking if native libraries are up-to-date..."/>
<condition property="native.libraries.are.uptodate" value="true">
<and>
<!-- Check if libDeflatingDecompressor exists and is up to date -->
<available file="./libs/armeabi/libDeflatingDecompressor.so" />
<uptodate targetfile="libs/armeabi/libDeflatingDecompressor.so">
<srcfiles dir="jni/DeflatingDecompressor" includes="**/*.cpp"/>
</uptodate>
<!-- Check if libLineBreak exists and is up to date -->
<available file="./libs/armeabi/libLineBreak.so" />
<uptodate property="libLineBreak-build-is-not-required" targetfile="libs/armeabi/libLineBreak.so">
<srcfiles dir="jni/LineBreak" includes="**/*.cpp,**/*.c,**/*.h"/>
</uptodate>
</and>
</condition>
<echo message="DONE (Checking if native libraries are up-to-date)"/>
</target>
<target name="resources" depends="init, check.native.libraries">
<echo message="Cleaning up the 'res/drawable' folder..." />
<delete dir="res/drawable/">
<files includes="**"/>
</delete>
<echo message="DONE (Cleaning up the 'res/drawable' folder)" />
<echo message="Copying icons files to 'res/drawable/' folder..." />
<copy todir="res/drawable" verbose="false" overwrite="true" flatten="true">
<fileset file="icons/fbreader.png" />
<fileset dir="icons/" includes="*/*" />
</copy>
<echo message="DONE (Copying icons files to 'res/drawable/' folder)" />
</target>
<target name="package" depends="init, resources, native, release" />
<target name="dbg" depends="init, resources, native, debug" />
<target name="clean">
<echo message="Deleting temporary files..." />
<delete dir="gen" />
<delete dir="bin" />
<delete dir="res/drawable" />
<delete dir="out" />
<delete dir="obj" />
<echo message="DONE (Deleting temporary files)" />
</target>
<target name="distclean" depends="clean">
<echo message="Deleting native libraries..." />
<delete dir="libs/armeabi" />
<delete dir="libs/armeabi-v7" />
<echo message="DONE (Deleting native libraries)" />
</target>
</project>