在SVN上这个项目的目录如下所示,其中网络地址是192.168.xx.xx
http://网络地址/home/svn/myproject/MyWorld/
..
.classpath
.project
.settings/
AndroidManifest.xml
assets/
bin/
default.properties
gen/
proguard.cfg
res/
src/
使用Ubuntu作为服务器,安装了ant,现在缺少一个build.xml来编译我的项目,求指教,我的build.xml应当怎么写?
在网上搜了一个比较全的,但是我看不懂,我的服务器上没有安装Android SDK,项目中所引用的包貌似也没有到什么lib的目录下面,还有我的网址是数字的,他的是http://autoandroid.googlecode.com/svn/trunk/samples/notepad/,然后xmls就写成下面这样,我现在很疑惑,怎样将SVN上的项目在我的服务器上持续集成,就差这个build.xml文件,到底该怎么写?
<?xml version="1.0" encoding="utf-8"?>
<project name="notepad" default="precommit" xmlns:android="antlib:com.googlecode.autoandroid.ant"> <!-- Requires ant 1.7 or better --> <taskdef uri="antlib:com.googlecode.autoandroid.ant" classpath="lib/android-ant.jar"/>
<android:home/> <!-- Set the detected android-home property to the sdk root. --> <!-- Dependencies --> <fileset dir="lib" id="main.jars">
<include name="positron.jar"/>
</fileset>
<fileset dir="lib" id="test.jars">
<include name="positron.jar"/>
<include name="junit.jar"/>
</fileset> <!-- Rules --> <target name="clean" description="Delete the output directories.">
<delete dir="target"/>
</target> <target name="resource-src" description="Generate the R.java file for this project's resources.">
<android:aapt>
<arg value="package"/>
<arg value="-m"/>
<arg value="-J"/>
<arg file="src"/> <!-- Create R.java in the source directory -->
<arg value="-M"/>
<arg file="AndroidManifest.xml"/>
<arg value="-S"/>
<arg file="res"/>
<arg value="-I"/>
<arg file="${android-home}/android.jar"/>
</android:aapt>
</target> <target name="compile-main" depends="resource-src" description="Compile the java source.">
<mkdir dir="target/main-classes"/>
<javac encoding="ascii" target="1.5" debug="true" extdirs=""
srcdir="src" destdir="target/main-classes"
bootclasspath="${android-home}/android.jar">
<classpath>
<fileset refid="main.jars"/>
</classpath>
</javac>
</target> <target name="dex" depends="compile-main" description="Convert the .class files into .dex files.">
<property name="classes.dex" location="target/classes.dex"/>
<android:dx inputref="main.jars">
<arg value="--dex"/>
<arg value="--output=${classes.dex}"/>
<arg path="target/main-classes"/>
</android:dx>
</target> <target name="package-res" description="Put the project's resources into the output package file.">
<android:aapt>
<arg value="package"/>
<arg value="-f"/>
<arg value="-M"/>
<arg file="AndroidManifest.xml"/>
<arg value="-S"/>
<arg file="res"/>
<!-- No assets directory -->
<arg value="-I"/>
<arg file="${android-home}/android.jar"/>
<arg value="-F"/>
<arg file="target/notepad.ap_"/>
</android:aapt>
</target> <target name="package-apk" depends="dex, package-res" description="Package the application and sign it with a debug key.">
<android:apk-builder>
<arg file="target/notepad.apk"/>
<arg value="-z"/>
<arg file="target/notepad.ap_"/>
<arg value="-f"/>
<arg file="target/classes.dex"/>
<arg value="-rf"/>
<arg file="src"/>
<arg value="-rj"/>
<arg file="lib"/>
</android:apk-builder>
</target> <target name="start-emulator" description="Start an emulator.">
<android:adb><arg value="start-server"/></android:adb>
<android:start-emulator only-if-not-running="true">
<arg line="-skin 320x480 -no-boot-anim"/>
</android:start-emulator>
</target> <target name="stop-emulator" description="Stop the emulator we started.">
<android:stop-emulator/>
</target> <target name="install" depends="package-apk, start-emulator" description="Install the package on the default emulator.">
<android:adb>
<arg value="install"/>
<arg value="-r"/>
<arg file="target/notepad.apk"/>
</android:adb>
</target> <target name="demo" depends="install" description="Run the application until Return is hit.">
<input>Have fun with the demo, press Return when you're done.</input>
</target> <target name="compile-stories" depends="compile-main" description="Compile the stories.">
<mkdir dir="target/story-classes"/>
<javac target="1.5" debug="true" srcdir="stories" destdir="target/story-classes">
<classpath>
<pathelement location="target/main-classes"/>
<fileset refid="test.jars"/>
<pathelement location="${android-home}/android.jar"/>
</classpath>
</javac>
</target> <target name="run-stories" depends="compile-stories" description="Run the stories on an existing emulator">
<mkdir dir="target/junit-reports"/>
<junit haltonfailure="true" fork="true" forkMode="once" printsummary="true">
<sysproperty key="positron.instrumentedPackage" value="com.example.android.notepad"/>
<sysproperty key="positron.apk" file="target/notepad.apk"/>
<formatter type="plain"/>
<batchtest todir="target/junit-reports">
<fileset dir="target/story-classes"/>
</batchtest>
<classpath>
<pathelement location="target/main-classes"/>
<pathelement location="target/story-classes"/>
<fileset refid="test.jars"/>
</classpath>
</junit>
</target> <target name="precommit" depends="clean, install, run-stories, stop-emulator" description="If this passes you are safe to commit."/></project>
http://网络地址/home/svn/myproject/MyWorld/
..
.classpath
.project
.settings/
AndroidManifest.xml
assets/
bin/
default.properties
gen/
proguard.cfg
res/
src/
使用Ubuntu作为服务器,安装了ant,现在缺少一个build.xml来编译我的项目,求指教,我的build.xml应当怎么写?
在网上搜了一个比较全的,但是我看不懂,我的服务器上没有安装Android SDK,项目中所引用的包貌似也没有到什么lib的目录下面,还有我的网址是数字的,他的是http://autoandroid.googlecode.com/svn/trunk/samples/notepad/,然后xmls就写成下面这样,我现在很疑惑,怎样将SVN上的项目在我的服务器上持续集成,就差这个build.xml文件,到底该怎么写?
<?xml version="1.0" encoding="utf-8"?>
<project name="notepad" default="precommit" xmlns:android="antlib:com.googlecode.autoandroid.ant"> <!-- Requires ant 1.7 or better --> <taskdef uri="antlib:com.googlecode.autoandroid.ant" classpath="lib/android-ant.jar"/>
<android:home/> <!-- Set the detected android-home property to the sdk root. --> <!-- Dependencies --> <fileset dir="lib" id="main.jars">
<include name="positron.jar"/>
</fileset>
<fileset dir="lib" id="test.jars">
<include name="positron.jar"/>
<include name="junit.jar"/>
</fileset> <!-- Rules --> <target name="clean" description="Delete the output directories.">
<delete dir="target"/>
</target> <target name="resource-src" description="Generate the R.java file for this project's resources.">
<android:aapt>
<arg value="package"/>
<arg value="-m"/>
<arg value="-J"/>
<arg file="src"/> <!-- Create R.java in the source directory -->
<arg value="-M"/>
<arg file="AndroidManifest.xml"/>
<arg value="-S"/>
<arg file="res"/>
<arg value="-I"/>
<arg file="${android-home}/android.jar"/>
</android:aapt>
</target> <target name="compile-main" depends="resource-src" description="Compile the java source.">
<mkdir dir="target/main-classes"/>
<javac encoding="ascii" target="1.5" debug="true" extdirs=""
srcdir="src" destdir="target/main-classes"
bootclasspath="${android-home}/android.jar">
<classpath>
<fileset refid="main.jars"/>
</classpath>
</javac>
</target> <target name="dex" depends="compile-main" description="Convert the .class files into .dex files.">
<property name="classes.dex" location="target/classes.dex"/>
<android:dx inputref="main.jars">
<arg value="--dex"/>
<arg value="--output=${classes.dex}"/>
<arg path="target/main-classes"/>
</android:dx>
</target> <target name="package-res" description="Put the project's resources into the output package file.">
<android:aapt>
<arg value="package"/>
<arg value="-f"/>
<arg value="-M"/>
<arg file="AndroidManifest.xml"/>
<arg value="-S"/>
<arg file="res"/>
<!-- No assets directory -->
<arg value="-I"/>
<arg file="${android-home}/android.jar"/>
<arg value="-F"/>
<arg file="target/notepad.ap_"/>
</android:aapt>
</target> <target name="package-apk" depends="dex, package-res" description="Package the application and sign it with a debug key.">
<android:apk-builder>
<arg file="target/notepad.apk"/>
<arg value="-z"/>
<arg file="target/notepad.ap_"/>
<arg value="-f"/>
<arg file="target/classes.dex"/>
<arg value="-rf"/>
<arg file="src"/>
<arg value="-rj"/>
<arg file="lib"/>
</android:apk-builder>
</target> <target name="start-emulator" description="Start an emulator.">
<android:adb><arg value="start-server"/></android:adb>
<android:start-emulator only-if-not-running="true">
<arg line="-skin 320x480 -no-boot-anim"/>
</android:start-emulator>
</target> <target name="stop-emulator" description="Stop the emulator we started.">
<android:stop-emulator/>
</target> <target name="install" depends="package-apk, start-emulator" description="Install the package on the default emulator.">
<android:adb>
<arg value="install"/>
<arg value="-r"/>
<arg file="target/notepad.apk"/>
</android:adb>
</target> <target name="demo" depends="install" description="Run the application until Return is hit.">
<input>Have fun with the demo, press Return when you're done.</input>
</target> <target name="compile-stories" depends="compile-main" description="Compile the stories.">
<mkdir dir="target/story-classes"/>
<javac target="1.5" debug="true" srcdir="stories" destdir="target/story-classes">
<classpath>
<pathelement location="target/main-classes"/>
<fileset refid="test.jars"/>
<pathelement location="${android-home}/android.jar"/>
</classpath>
</javac>
</target> <target name="run-stories" depends="compile-stories" description="Run the stories on an existing emulator">
<mkdir dir="target/junit-reports"/>
<junit haltonfailure="true" fork="true" forkMode="once" printsummary="true">
<sysproperty key="positron.instrumentedPackage" value="com.example.android.notepad"/>
<sysproperty key="positron.apk" file="target/notepad.apk"/>
<formatter type="plain"/>
<batchtest todir="target/junit-reports">
<fileset dir="target/story-classes"/>
</batchtest>
<classpath>
<pathelement location="target/main-classes"/>
<pathelement location="target/story-classes"/>
<fileset refid="test.jars"/>
</classpath>
</junit>
</target> <target name="precommit" depends="clean, install, run-stories, stop-emulator" description="If this passes you are safe to commit."/></project>
解决方案 »
- JNI 的 char 转jstring的中文崩溃的问题
- 小弟新手刚导入源代码就出现错误是甚么
- 最近在做播放器例子,有几个问题要请教各位!!!!!!!!!!!!!!!
- 请问关于intent的问题
- 如何开发直播流
- 新手问题,关于Id查找
- UDP广播发送图片,只能发送几K大小的图片,求助!
- 安卓源码编译出现问题“out/target/product/generic/obj/STATIC_LIBRARIES/\_intermediates/\.a”
- 关于用LocationManager获得自身的经纬度
- Android开发遇到问题,请大神指教!!
- widget相对位置的完成在antivity的哪个生命周期阶段实现
- android 中GPS的使有问题
进入代码目录 执行android update project -t target
会生成一个build.xml不用改,直接再执行ant release/debug