1
0
Fork 0
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:
unknown 2010-11-09 21:16:21 +02:00
parent 3572d060db
commit 1defc7c685
2 changed files with 113 additions and 32 deletions

View file

@ -25,7 +25,7 @@ with your debug key (in this case, you can skip step 3).
If you are Windows user If you are Windows user
2a. Run ndk-build (a program from Android NDK directory) in your project catalog; 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. This program only runs from Cygwin >= 1.7, please read NDK docs for details.
2b. Run ./createRawResources.py script. Read and try config cygwin using 'cygwin_installation_and_configuration.pdf'
2c. Run 'ant release'. 2b. Run 'ant release'.
3. Sign your package manually. 3. Sign your package manually.

View file

@ -15,26 +15,107 @@
<taskdef name="setup" <taskdef name="setup"
classname="com.android.ant.SetupTask" classname="com.android.ant.SetupTask"
classpathref="android.antlibs" /> classpathref="android.antlibs" />
<setup /> <setup />
<target name="native"> <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" unless="native.lib.is.built">
<echo message="Try to build 'libDeflatingDecompressor.so', 'libLineBreak.so'...."/>
<exec executable="${ndk.dir}/ndk-build" /> <exec executable="${ndk.dir}/ndk-build" />
</target> </target>
<target name="resources"> <target name="check.native.libs.are.present" depends="init">
<exec executable="./createRawResources.py" /> <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>
<target name="package" depends="native,resources,release" /> <target name="resources" depends="init, check.native.libs.are.present">
<target name="dbg" depends="native,resources,debug" />
<!-- 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"> <target name="clean">
<echo message="Clean all temporary folders..." />
<delete dir="gen" /> <delete dir="gen" />
<delete dir="bin" /> <delete dir="bin" />
<delete dir="res/raw" /> <delete dir="res/raw" />
<delete dir="res/drawable" /> <delete dir="res/drawable" />
<delete dir="out" />
<delete dir="libs/armeabi" /> <delete dir="libs/armeabi" />
<delete dir="obj" /> <delete dir="obj" />
</target> </target>
<!--<target name="release" depends="clean, resources, package"/>-->
</project> </project>