2013년 12월 21일 토요일

ANT building on android development

If you want to make a script for building, installing and rebooting device, ant build is needed.
Next steps may can help you do make a script or batching.

1. install jdk on your system

2. install ant on your system

3. If you have a custom library or want to just reference jar files, do modify android-sdk/tools/ant/build.xml likes follow. In this example, library added ordered by XXX, YYY, ZZZ.
I remove two lines from original code because do not include jar on my code.

<!-- Compiles this project's .java files into .class files. -->
    <target name="-compile" depends="-pre-build, -build-setup, -code-gen, -pre-compile">
        <do-only-if-manifest-hasCode elseText="hasCode = false. Skipping...">
            <!-- merge the project's own classpath and the tested project's classpath -->
            <path id="project.javac.classpath">
                <path refid="project.all.jars.path" />
                <path refid="tested.project.classpath" />
                <path path="${java.compiler.classpath}" />
            </path>
            <javac encoding="${java.encoding}"
                    source="${java.source}" target="${java.target}"
                    debug="true" extdirs="" includeantruntime="false"
                    destdir="${out.classes.absolute.dir}"
                    verbose="${verbose}"
                    fork="${need.javac.fork}">
                <src path="${source.absolute.dir}" />
                <src path="${gen.absolute.dir}" />
                <compilerarg line="${java.compilerargs}" />
                <classpath>
                          <fileset dir="/User/kwangjo/ANTBUILD" includes="XXX.jar" />
                          <fileset dir="/User/kwangjo/ANTBUILD" includes="YYY.jar" />
                          <fileset dir="/User/kwangjo/ANTBUILD" includes="ZZZ.jar" />
                </classpath>   
            </javac>


This code is same thing on your eclipse menu as follow.



4. you can make build script like as follows
 android update project --name YOURPROJECT -p ./

5. you can implements keystore file on ant.property, next is just sample. you input your own string matching with your keystore. This step is just optional.

key.store=YOUR keystore path
key.alias=YOUR keystore alias
key.store.password=password

key.alias.password=password

6. build your project, you can also do "ant debug"
ant release

댓글 없음:

댓글 쓰기

RPI is not good handling DHT11

Hello? This is failure story about converting c code to python. There is GPIO controlling library on Python such as RPI, wiringPI. But...