태터데스크 관리자

도움말
닫기
적용하기   첫페이지 만들기

태터데스크 메시지

저장하였습니다.

이건 직접 해본건 아니고 다른분이 만드신 것을 IP, 계정정보, 디렉토리 정보등만을 변경한 것

build4Android.properties
#####################################################
#        MD BUILD & DEPLOY ELEMENTS DEFINE          #
#####################################################

lib.dir=/usr/local/apache-ant-1.8.1/lib
app.root.dir=/home3/Android
android.src.dir=${app.root.dir}/AntWorkspace
android.ipc.dir=${app.root.dir}/IpcBridge
android.home.dir=/usr/local/android-sdk-linux_x86/platforms/android-7

mccabe.src.dir=${app.root.dir}/MD_mccabe
mccabe.out.dir=${app.root.dir}/outfiles
android.src_org.dir=${app.root.dir}/MD

################BUILD INFO############################
android.build.dir = ${android.src.dir}/bin
android.asset.dir = ${android.src.dir}/assets

## not used ###mccabe.build.dir = ${mccabe.src.dir}/bin
## not used ###mccabe.asset.dir = ${mccabe.src.dir}/assets

######################################################

##################LIB INFO############################
svnant.jar=${lib.dir}/svnant.jar
svnClientAdapter.jar=${lib.dir}/svnClientAdapter.jar
svnjavahl.jar=${lib.dir}/svnjavahl.jar
######################################################


################SVN INFO##############################
svnant.latest.url=svn://192.168.147.123/Android/trunk/source/Android/MD
svnant.this.url=svn://192.168.147.123/Android/trunk/source/Android/MD
svnant.ipc.url=svn://192.168.147.123/Android/trunk/source/Android/IpcBridge

svnant.checkin.url=svn://121.252.153.131/Android/trunk/binary/Android

svnant.repository.user=temp.account
svnant.repository.passwd=abcd1234
######################################################

##################keystore############################
keystore=md.keystore
storepass=android1
alias=md
keypass=android1
######################################################

#################Hudson Workspace#####################
hudson.workspace=/home/CTIP/HUDSON/jobs/MD project/workspace
mccabe.hudson.workspace=/home/CTIP/HUDSON/jobs/MD for Android_McCabe/workspace




build4Android.xml
<?xml version="1.0"?>
<project name="build4Android" basedir="." default="all" xmlns:android="antlib:com.googlecode.autoandroid.ant">

    <taskdef uri="antlib:com.googlecode.autoandroid.ant" classpath="${lib.dir}/android-ant.jar"/>
       
    <android:home />
 
  <!--  all properties are in build.properties -->
  <property file="build4Android.properties" />

  <!-- path to the svnant libraries. Usually they will be located in ANT_HOME/lib -->
  <!--
  <path id="project.classpath">
    <pathelement location="${svnjavahl.jar}" />
    <pathelement location="${svnant.jar}" />
    <pathelement location="${svnClientAdapter.jar}" />
  </path> 
 
  <taskdef resource="svntask.properties" classpathref="project.classpath"/>
  -->

     <path id="src.classpath">
        <fileset dir="${android.src.dir}/libs" includes="*.jar,*.zip" />
        <pathelement location="${android.build.dir}" />
    </path>

    <target name="all" depends="clean , init , checkout  , resource-src , compile_gen , compile , dex , package-res , package-apk , jarsign , apk-dist"   />
<!--<target name="all" depends="clean , init , checkout  , resource-src , aidl , compile_gen , compile , dex , package-res , lib-dist , package-apk , checkin" />-->
     
  <!-- 01.Clean Dircctory -->
  <target name="clean">
    <echo message="Delete the Build and Dist Directory of Android" />
        <delete dir="${android.src.dir}"/> 
  </target>

  <!--02.Make Dircctory -->
  <target name="init">
    <echo message="Make the Build and Dist Directory of Android" />
        <mkdir dir="${android.src.dir}/gen"/> 
        <mkdir dir="${android.src.dir}/bin"/> 
  </target>

  <!-- 03.Latest Source Download from SVN Server  -->
  <!--   
  <target name="checkout">
    <echo message="Latest Source Download from SVN Server" />
    <svn username="${svnant.repository.user}" password="${svnant.repository.passwd}">
      <checkout url="${svnant.this.url}" destPath="../Android" />
    </svn>
  </target>
 
  <target name="checkout">
    <exec executable="svn">
      <arg value="co"/>
      <arg value="${svnant.this.url}"/>
      <arg value="MD"/>
   </exec>
    <exec executable="svn">
      <arg value="co"/>
      <arg value="${svnant.ipc.url}"/>
      <arg value="IpcBridge"/>
   </exec>
  </target>-->

  <!-- 03.Latest Source Download from P4 Server  -->
  <target name="checkout">
    <exec executable="/home/perforce/p4v/bin/p4">
      <arg value="-c"/>
      <arg value="Perforce_Android"/>
      <arg value="-p"/>
      <arg value="192.168.111.222:6001"/>
      <arg value="-u"/>
      <arg value="perforceuser"/>
      <arg value="-P"/>
      <arg value="perforcepassword"/>
      <arg value="sync"/>
      <arg value="-f"/>
   </exec>
  </target>

  <!-- 04.Create R.java in the source directory  -->
      <target name="resource-src">
    <echo message="Generate the R.java file for this project's resources" />
        <android:aapt>
             <arg value="package" />
              <arg value="-m" />
              <arg value="-J" />
              <arg file="${android.src.dir}/gen" />
              <arg value="-M" />
              <arg file="${android.src.dir}/AndroidManifest.xml" />
              <arg value="-S" />
               <arg file="${android.src.dir}/res" />
              <arg value="-I" />
              <arg file="${android.home.dir}/android.jar" />
         </android:aapt>
    </target>

  <!-- 06.Compile R.java in the source directory  -->
    <target name="compile_gen">
    <echo message="Compile R.java source" />
        <javac
            encoding="utf-8"
            target="1.5"
            srcdir="${android.src.dir}/gen"
            destdir="${android.build.dir}"
            debug="No"
            nowarn="true"
            includes="**/*.java"
            bootclasspath="${android.home.dir}/android.jar"
            fork="true"
            includeantruntime="false">
            <classpath refid="src.classpath" />
        </javac>
    </target>
   

  <!-- 07.Compile java in the source directory  -->
    <target name="compile">
    <echo message="Compile java source" />
        <javac
            encoding="utf-8"
            target="1.5"
            srcdir="${android.src.dir}/src"
            destdir="${android.build.dir}"
            debug="No"
            nowarn="true"
            includes="**/*.java"
            bootclasspath="${android.home.dir}/android.jar"
            fork="true"
            includeantruntime="false">
            <classpath refid="src.classpath" />
        </javac>
    </target>

  <!-- 08.Make dex file  -->
    <target name="dex">
    <echo message="Convert the .class files into .dex files" />
          <property name="classes.dex" location="${android.build.dir}/classes.dex" />
               <sequential>
        <apply executable="/usr/local/android-sdk-linux_x86/platforms/android-7/tools/dx" failonerror="true" parallel="true">
                          <arg value="--dex" />
                 <arg value="--output=${classes.dex}" />
                 <arg path="${android.build.dir}" />
                 <fileset dir="${android.src.dir}/libs" includes="IpcBridge.jar" />
            </apply>
        </sequential>
    </target>
   
  <!-- 09.Package Res file  -->
    <target name="package-res">
    <echo message="Put the project's resources into the output package file. - resources.ap_" />
        <android:aapt>
            <arg value="package" />
            <arg value="-f" />
            <arg value="-M" />
            <arg file="${android.src.dir}/AndroidManifest.xml" />
<!--
            <arg value="-A" />
            <arg file="${android.src.dir}/assets" />
-->
            <arg value="-S" />
            <arg file="${android.src.dir}/res" />
             <arg value="-I" />
             <arg file="${android-home}/android.jar" />
             <arg value="-F" />
             <arg file="${android.build.dir}/resources.ap_" />
          </android:aapt>
      </target>   

  <!-- 11.Package all the application  -->
      <target name="package-apk">
        <echo message="Package the application and sign it with a debug key. - MD.apk" />
          <sequential>
            <apply executable="/usr/local/android-sdk-linux_x86/tools/apkbuilder" failonerror="true" parallel="true">
                  <arg file="${android.build.dir}/output.apk" />
                <arg value="-u" />
                  <arg value="-z" />
                  <arg file="${android.build.dir}/resources.ap_" />
<!--
                  <arg value="-rf" />
                  <arg file="${android.src.dir}/assets" />
-->
                  <arg value="-f" />
                  <arg file="${android.build.dir}/classes.dex" />
                  <arg value="-rf" />
                  <arg file="${android.src.dir}/src" />
                  <arg value="-rj" />
                  <arg file="${android.src.dir}/libs" />
                  <arg value="-nf" />
                  <arg file="${android.src.dir}/libs" />
                  <fileset file="${android.src.dir}/libs" />
            </apply>
        </sequential>
    </target>

  <!-- 12.Sign all the application  -->
<target name="jarsign">
    <signjar jar="${android.src.dir}/bin/output.apk"
     keystore ="/home3/Android/MD_P1/md.keystore"
     storepass="${storepass}"
     alias="${alias}"
     keypass="${keypass}">
    </signjar>
</target>

<!-- 13.APK File Move to Hudson Workspace  -->
    <target name="apk-dist">
        <echo message="MD.apk Lib Copy to Hudson Workspace" />
        <copy todir="${hudson.workspace}" >
            <fileset dir="${android.src.dir}/bin" >
                <include name="output.apk" />
            </fileset>
        </copy>
    </target>

 <!-- 15.APK호출  -->
  <target name="mccabe">
        <ant antfile="build4android4mccabe.xml"/>   
  </target>

 <!-- 14.Latest Apk Check in SVN Server  -->
  <target name="checkin">
    <exec executable="svn">
      <arg value="ci"/>
      <arg value="../md/build/md.apk"/>
      <arg value="-m"/>
      <arg value="apk upload"/>
    </exec>
  </target>

</project>




Posted by 인터돌

댓글을 달아 주세요