mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-03 17:59:33 +02:00
ant build script is changed so the running Python script is not necessary anymore
all necessary files are renamed and copied to appropriate folders using ANT only commands and targets ANT version 1.7> is necessary, version check is added to script
This commit is contained in:
parent
3572d060db
commit
1defc7c685
2 changed files with 113 additions and 32 deletions
|
@ -25,7 +25,7 @@ with your debug key (in this case, you can skip step 3).
|
|||
If you are Windows user
|
||||
2a. Run ndk-build (a program from Android NDK directory) in your project catalog;
|
||||
This program only runs from Cygwin >= 1.7, please read NDK docs for details.
|
||||
2b. Run ./createRawResources.py script.
|
||||
2c. Run 'ant release'.
|
||||
Read and try config cygwin using 'cygwin_installation_and_configuration.pdf'
|
||||
2b. Run 'ant release'.
|
||||
|
||||
3. Sign your package manually.
|
||||
|
|
141
build.xml
141
build.xml
|
@ -1,40 +1,121 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="FBReaderJ" default="package">
|
||||
<property file="local.properties" />
|
||||
<property file="build.properties" />
|
||||
<property file="default.properties" />
|
||||
<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>
|
||||
<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" />
|
||||
<taskdef name="setup"
|
||||
classname="com.android.ant.SetupTask"
|
||||
classpathref="android.antlibs" />
|
||||
<setup />
|
||||
|
||||
<setup />
|
||||
<target name="init" description="Initialization...">
|
||||
<condition property="Ant17isOnline">
|
||||
<and>
|
||||
<antversion property="ant.version" atleast="1.7.0"/>
|
||||
</and>
|
||||
</condition>
|
||||
<fail message="ANT with version at least 1.7 should be present !!! Update your local '${ant.version}' first.">
|
||||
<condition>
|
||||
<not>
|
||||
<isset property="Ant17isOnline"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
</target>
|
||||
|
||||
<target name="native">
|
||||
<exec executable="${ndk.dir}/ndk-build" />
|
||||
</target>
|
||||
<target name="native" unless="native.lib.is.built">
|
||||
<echo message="Try to build 'libDeflatingDecompressor.so', 'libLineBreak.so'...."/>
|
||||
<exec executable="${ndk.dir}/ndk-build" />
|
||||
</target>
|
||||
|
||||
<target name="resources">
|
||||
<exec executable="./createRawResources.py" />
|
||||
</target>
|
||||
<target name="check.native.libs.are.present" depends="init">
|
||||
<echo message="Check if Native Libs 'libDeflatingDecompressor.so', 'libLineBreak.so' are present..."/>
|
||||
<condition property="native.lib.is.built" >
|
||||
<available property="native.lib.is.built" file="./libs/armeabi/libDeflatingDecompressor.so" />
|
||||
</condition>
|
||||
<echo message="Native Libs 'libDeflatingDecompressor.so', 'libLineBreak.so' are present? = '${native.lib.is.built}'"/>
|
||||
</target>
|
||||
|
||||
<target name="package" depends="native,resources,release" />
|
||||
<target name="dbg" depends="native,resources,debug" />
|
||||
<target name="resources" depends="init, check.native.libs.are.present">
|
||||
|
||||
<!-- Delete all files from /res/raw , /res/drawable -->
|
||||
<echo message="Clean up folders 'res/raw', 'res/drawable/'..." />
|
||||
<delete dir="gen/text_search/" />
|
||||
<delete file="res/raw/**" includes="**" />
|
||||
<delete file="res/drawable/**" includes="**" />
|
||||
<echo message="DONE! Clean up folders 'res/raw', 'res/drawable/'..." />
|
||||
|
||||
<!-- Copy all /icons/ files into /res/drawable EXCEPT /icons/text_search folder -->
|
||||
<echo message="Copying /icons files to 'res/drawable/' folder" />
|
||||
<copy todir="res/drawable" verbose="false" overwrite="true">
|
||||
<fileset file="icons/fbreader.png" excludes=".svn" />
|
||||
<fileset dir="icons/tree/" includes="**" excludes=".svn" />
|
||||
<fileset dir="icons/menu/" includes="**" excludes=".svn" />
|
||||
<fileset dir="icons/tabs/" includes="**" excludes=".svn" />
|
||||
<fileset dir="icons/others/" includes="**" excludes=".svn" />
|
||||
</copy>
|
||||
<echo message="DONE! Copying /icons files to 'res/drawable/' folder" />
|
||||
|
||||
<!-- Copy all icons/text_search and prepare for file name changing -->
|
||||
<echo message="Copying 'search_text' files to temporal folder" />
|
||||
<copy todir="gen/text_search/" verbose="false" overwrite="true">
|
||||
<fileset dir="icons/text_search/" includes="**" excludes=".svn" />
|
||||
</copy>
|
||||
<echo message="DONE! Copying 'search_text' files to temporal folder" />
|
||||
|
||||
<!-- Rename file names like 'close-active.png' to 'close_active.png' -->
|
||||
<echo message="Renaming file names with '*-*' into '*_*' names" />
|
||||
<move todir="gen/text_search/">
|
||||
<fileset dir="gen/text_search/" />
|
||||
<mapper>
|
||||
<mapper type="regexp" from="^([a-z0-9A-Z_:@?=+,!~+%$]+)(-)([a-z0-9A-Z_:@?=+,!~+%$]+)\.(xml|png)$" to="\1_\3.\4" />
|
||||
</mapper>
|
||||
</move>
|
||||
<echo message="DONE! Renaming file names with '*-*' into '*_*' names" />
|
||||
|
||||
<!-- Append 'text_search_' for changing file name from 'close_active.png' to 'text_search_close_active.png' -->
|
||||
<echo message="Append 'text_search+' to 'xxx_xxx.*' file name..." />
|
||||
<move todir="gen/text_search/">
|
||||
<fileset dir="gen/text_search/" />
|
||||
<mapper>
|
||||
<mapper type="glob" from="*.xml" to="text_search_*.xml" />
|
||||
<mapper type="glob" from="*.png" to="text_search_*.png" />
|
||||
</mapper>
|
||||
</move>
|
||||
<echo message="DONE! Append 'text_search+' to 'xxx_xxx.*' file name..." />
|
||||
|
||||
<echo message="Copy files like 'text_search_close_active.png' to /res/drawable..." />
|
||||
<copy todir="res/drawable/" verbose="false" overwrite="true">
|
||||
<fileset dir="gen/text_search/" includes="**" excludes=".svn" />
|
||||
</copy>
|
||||
<echo message="DONE! Copy files like 'text_search_close_active.png' to /res/drawable..." />
|
||||
<!--<exec executable="./createRawResources.py" />-->
|
||||
<!--<exec executable="${ndk.dir}/ndk-build" />-->
|
||||
</target>
|
||||
|
||||
<target name="package" depends="init, resources, native, release" />
|
||||
<target name="dbg" depends="init, resources, native, debug" />
|
||||
|
||||
<target name="clean">
|
||||
<echo message="Clean all temporary folders..." />
|
||||
<delete dir="gen" />
|
||||
<delete dir="bin" />
|
||||
<delete dir="res/raw" />
|
||||
<delete dir="res/drawable" />
|
||||
<delete dir="out" />
|
||||
<delete dir="libs/armeabi" />
|
||||
<delete dir="obj" />
|
||||
</target>
|
||||
|
||||
<!--<target name="release" depends="clean, resources, package"/>-->
|
||||
|
||||
<target name="clean">
|
||||
<delete dir="gen" />
|
||||
<delete dir="bin" />
|
||||
<delete dir="res/raw" />
|
||||
<delete dir="res/drawable" />
|
||||
<delete dir="libs/armeabi" />
|
||||
<delete dir="obj" />
|
||||
</target>
|
||||
</project>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue