Skip to content

Commit aca0354

Browse files
committed
upgraded project to work with latest android SDK
ran "android update project --path ." and merged our customizations Change-Id: I2a174f2406d70f765d28e4161dba778d971c5dfe Reviewed-on: http://review.couchbase.org/10668 Tested-by: Marty Schoch <[email protected]> Reviewed-by: Marty Schoch <[email protected]>
1 parent b3e5afd commit aca0354

File tree

2 files changed

+63
-57
lines changed

2 files changed

+63
-57
lines changed

build.xml

Lines changed: 59 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,49 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project name="." default="help">
2+
<project name="Android-Couchbase" default="help">
33

4-
<!-- The local.properties file is created and updated by the 'android'
5-
tool.
6-
It contains the path to the SDK. It should *NOT* be checked into
7-
Version Control Systems. -->
8-
<property file="local.properties" />
4+
<!-- The local.properties file is created and updated by the 'android' tool.
5+
It contains the path to the SDK. It should *NOT* be checked into
6+
Version Control Systems. -->
7+
<loadproperties srcFile="local.properties" />
98

10-
<!-- The build.properties file can be created by you and is never touched
11-
by the 'android' tool. This is the place to change some of the
12-
default property values used by the Ant rules.
9+
<!-- The ant.properties file can be created by you. It is only edited by the
10+
'android' tool to add properties to it.
11+
This is the place to change some Ant specific build properties.
1312
Here are some properties you may want to change/update:
1413
1514
source.dir
1615
The name of the source directory. Default is 'src'.
1716
out.dir
1817
The name of the output directory. Default is 'bin'.
1918
19+
For other overridable properties, look at the beginning of the rules
20+
files in the SDK, at tools/ant/build.xml
21+
2022
Properties related to the SDK location or the project target should
2123
be updated using the 'android' tool with the 'update' action.
2224
2325
This file is an integral part of the build system for your
2426
application and should be checked into Version Control Systems.
2527
2628
-->
27-
<property file="build.properties" />
29+
<property file="ant.properties" />
2830

29-
<!-- The default.properties file is created and updated by the 'android'
31+
<!-- The project.properties file is created and updated by the 'android'
3032
tool, as well as ADT.
33+
34+
This contains project specific properties such as project target, and library
35+
dependencies. Lower level build properties are stored in ant.properties
36+
(or in .classpath for Eclipse projects).
37+
3138
This file is an integral part of the build system for your
3239
application and should be checked into Version Control Systems. -->
33-
<property file="default.properties" />
40+
<loadproperties srcFile="project.properties" />
3441

35-
36-
<!-- Required pre-setup import -->
37-
<import file="${sdk.dir}/tools/ant/pre_setup.xml" />
42+
<!-- quick check on sdk.dir -->
43+
<fail
44+
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'"
45+
unless="sdk.dir"
46+
/>
3847

3948

4049
<!-- extension targets. Uncomment the ones where you want to do custom work
@@ -45,69 +54,66 @@
4554
<target name="-pre-compile">
4655
</target>
4756
48-
[This is typically used for code obfuscation.
49-
Compiled code location: ${out.classes.absolute.dir}
50-
If this is not done in place, override ${out.dex.input.absolute.dir}]
57+
/* This is typically used for code obfuscation.
58+
Compiled code location: ${out.classes.absolute.dir}
59+
If this is not done in place, override ${out.dex.input.absolute.dir} */
5160
<target name="-post-compile">
5261
</target>
5362
-->
5463

55-
<!-- Execute the Android Setup task that will setup some properties
56-
specific to the target, and import the build rules files.
57-
58-
The rules file is imported from
59-
<SDK>/tools/ant/
60-
Depending on the project type it can be either:
61-
- main_rules.xml
62-
- lib_rules.xml
63-
- test_rules.xml
64+
<!-- Import the actual build file.
6465
6566
To customize existing targets, there are two options:
6667
- Customize only one target:
6768
- copy/paste the target into this file, *before* the
68-
<setup> task.
69+
<import> task.
6970
- customize it to your needs.
70-
- Customize the whole script.
71+
- Customize the whole content of build.xml
7172
- copy/paste the content of the rules files (minus the top node)
72-
into this file, *after* the <setup> task
73-
- disable the import of the rules by changing the setup task
74-
below to <setup import="false" />.
73+
into this file, replacing the <import> task.
7574
- customize to your needs.
75+
76+
***********************
77+
****** IMPORTANT ******
78+
***********************
79+
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
80+
in order to avoid having your file be overridden by tools such as "android update project"
7681
-->
77-
<setup />
82+
<!-- version-tag: 1 -->
83+
<import file="${sdk.dir}/tools/ant/build.xml" />
7884

7985
<!-- added by marty, per this discussion http://code.google.com/p/android/issues/detail?id=13024 -->
8086
<path id="android.libraries.src"><path refid="project.libraries.src" /></path>
8187
<path id="android.libraries.jars"><path refid="project.libraries.jars" /></path>
8288

83-
<target name="couchbase-jar" depends="compile">
84-
<jar destfile="bin/couchbase.jar">
85-
<fileset dir="bin/classes">
86-
<include name="**/*"/>
87-
<exclude name="**/R*"/>
88-
</fileset>
89-
<fileset dir="src">
90-
<include name="**/*"/>
91-
</fileset>
92-
</jar>
93-
</target>
89+
<target name="couchbase-jar" depends="-compile">
90+
<jar destfile="bin/couchbase.jar">
91+
<fileset dir="bin/classes">
92+
<include name="**/*"/>
93+
<exclude name="**/R*"/>
94+
</fileset>
95+
<fileset dir="src">
96+
<include name="**/*"/>
97+
</fileset>
98+
</jar>
99+
</target>
94100

95101
<target name="jni">
96102
<exec dir="${basedir}/jni" executable="sh">
97103
<arg line="${ndk.dir}/ndk-build"/>
98104
</exec>
99105
</target>
100106

101-
<target name="javadoc">
102-
<javadoc
103-
destdir="bin/docs"
104-
windowtitle="Android Couchbase">
107+
<target name="javadoc">
108+
<javadoc
109+
destdir="bin/docs"
110+
windowtitle="Android Couchbase">
105111

106-
<packageset dir="src" defaultexcludes="yes">
107-
<include name="com/couchbase/android/**"/>
108-
</packageset>
112+
<packageset dir="src" defaultexcludes="yes">
113+
<include name="com/couchbase/android/**"/>
114+
</packageset>
109115

110-
</javadoc>
111-
</target>
116+
</javadoc>
117+
</target>
112118

113119
</project>
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# This file is automatically generated by Android Tools.
22
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3-
#
3+
#
44
# This file must be checked in Version Control Systems.
5-
#
5+
#
66
# To customize properties used by the Ant build system use,
7-
# "build.properties", and override values to adapt the script to your
7+
# "ant.properties", and override values to adapt the script to your
88
# project structure.
99

10+
android.library=true
1011
# Project target.
1112
target=android-7
12-
android.library=true

0 commit comments

Comments
 (0)