Permalink
Browse files

update to build on android 2.3 SDK

  • Loading branch information...
remvee committed Dec 7, 2010
1 parent ba02c0f commit c6acabf5956820b726003f24b7af5edfb0923d11
Showing with 62 additions and 74 deletions.
  1. +0 −1 .gitignore
  2. +51 −57 build.xml
  3. +0 −16 compile.clj
  4. +11 −0 default.properties
View
@@ -1,4 +1,3 @@
/bin
-/default.properties
/gen
/local.properties
View
108 build.xml
@@ -1,99 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="ClojureHelloAndroid" default="help">
- <!-- The local.properties file is created and updated by the 'android' tool.
- It contains the path to the SDK. It should *NOT* be checked in in Version
- Control Systems. -->
+<!-- The local.properties file is created and updated by the 'android'
+ tool.
+ It contains the path to the SDK. It should *NOT* be checked into
+ Version Control Systems. -->
<property file="local.properties" />
<!-- The build.properties file can be created by you and is never touched
- by the 'android' tool. This is the place to change some of the default property values
- used by the Ant rules.
+ by the 'android' tool. This is the place to change some of the
+ default property values used by the Ant rules.
Here are some properties you may want to change/update:
- application.package
- the name of your application package as defined in the manifest. Used by the
- 'uninstall' rule.
source.dir
- the name of the source directory. Default is 'src'.
+ The name of the source directory. Default is 'src'.
out.dir
- the name of the output directory. Default is 'bin'.
+ The name of the output directory. Default is 'bin'.
- Properties related to the SDK location or the project target should be updated
- using the 'android' tool with the 'update' action.
+ Properties related to the SDK location or the project target should
+ be updated using the 'android' tool with the 'update' action.
- This file is an integral part of the build system for your application and
- should be checked in in Version Control Systems.
+ This file is an integral part of the build system for your
+ application and should be checked into Version Control Systems.
-->
<property file="build.properties" />
- <!-- The default.properties file is created and updated by the 'android' tool, as well
- as ADT.
- This file is an integral part of the build system for your application and
- should be checked in in Version Control Systems. -->
+ <!-- The default.properties file is created and updated by the 'android'
+ tool, as well as ADT.
+ This file is an integral part of the build system for your
+ application and should be checked into Version Control Systems. -->
<property file="default.properties" />
- <!-- Custom Android task to deal with the project target, and import the proper rules.
+ <!-- Custom Android task to deal with the project target, and import the
+ proper rules.
This requires ant 1.6.0 or above. -->
<path id="android.antlibs">
<pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
<pathelement path="${sdk.dir}/tools/lib/sdklib.jar" />
<pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" />
- <pathelement path="${sdk.dir}/tools/lib/apkbuilder.jar" />
- <pathelement path="${sdk.dir}/tools/lib/jarutils.jar" />
</path>
<taskdef name="setup"
classname="com.android.ant.SetupTask"
classpathref="android.antlibs" />
- <!-- Execute the Android Setup task that will setup some properties specific to the target,
- and import the build rules files.
-
- The rules file is imported from
- <SDK>/platforms/<target_platform>/templates/android_rules.xml
-
- To customize some build steps for your project:
- - copy the content of the main node <project> from android_rules.xml
- - paste it in this build.xml below the <setup /> task.
- - disable the import by changing the setup task below to <setup import="false" />
+<!-- extension targets. Uncomment the ones where you want to do custom work
+ in between standard targets -->
+<!--
+ <target name="-pre-build">
+ </target>
+ <target name="-pre-compile">
+ </target>
- This will ensure that the properties are setup correctly but that your customized
- build steps are used.
- -->
- <setup />
+ [This is typically used for code obfuscation.
+ Compiled code location: ${out.classes.absolute.dir}
+ If this is not done in place, override ${out.dex.input.absolute.dir}]
+ <target name="-post-compile">
+ </target>
+-->
<property name="clojure-jar" location="libs/clojure.jar"/>
- <!-- Compiles this project's .java files into .class files. -->
- <target name="compile" depends="-resource-src, -aidl"
- description="Compiles project's .java files into .class files">
- <!-- If android rules are used for a test project, its classpath should include
- tested project's location -->
- <condition property="extensible.classpath"
- value="${tested.project.absolute.dir}/bin/classes" else=".">
- <isset property="tested.project.absolute.dir" />
- </condition>
- <javac encoding="ascii" target="1.5" debug="true" extdirs=""
- destdir="${out.classes.absolute.dir}"
- bootclasspathref="android.target.classpath"
- verbose="${verbose}" classpath="${extensible.classpath}">
- <src path="${source.absolute.dir}" />
- <src path="${gen.absolute.dir}" />
- <classpath>
- <fileset dir="${external.libs.absolute.dir}" includes="*.jar" />
- </classpath>
- </javac>
-
- <echo>${extensible.classpath}:${source.absolute.dir}</echo>
+ <target name="-post-compile">
<java classname="clojure.lang.Compile"
classpathref="android.target.classpath"
classpath="${clojure-jar}:${extensible.classpath}:${source.absolute.dir}:${out.classes.absolute.dir}">
<sysproperty key="clojure.compile.path" value="${out.classes.absolute.dir}"/>
<arg value="net.remvee.android.hello.ClojureHelloAndroid"/>
</java>
-
</target>
+ <!-- Execute the Android Setup task that will setup some properties
+ specific to the target, and import the build rules files.
+
+ The rules file is imported from
+ <SDK>/platforms/<target_platform>/ant/ant_rules_r#.xml
+
+ To customize existing targets, there are two options:
+ - Customize only one target:
+ - copy/paste the target into this file, *before* the
+ <setup> task.
+ - customize it to your needs.
+ - Customize the whole script.
+ - copy/paste the content of the rules files (minus the top node)
+ into this file, *after* the <setup> task
+ - disable the import of the rules by changing the setup task
+ below to <setup import="false" />.
+ - customize to your needs.
+ -->
+ <setup />
</project>
View
@@ -1,16 +0,0 @@
-(def srcdir (first *command-line-args*))
-(def bindir (second *command-line-args*))
-
-(defn class-name [fname]
- "Strip srcdir and suffix, and replace file separators by dots."
- (.. (if (. fname startsWith srcdir) (. fname substring (. srcdir length)) fname)
- (replaceAll "\\.clj$" "")
- (replace java.io.File/separatorChar \.)
- (replaceAll "^\\." "")))
-
-(loop [args (drop 2 *command-line-args*)]
- (when (first args)
- (let [cn (class-name (first args))]
- (println (str "Compiling " cn ".."))
- (binding [*compile-path* bindir] (compile (symbol cn)))
- (recur (rest args)))))
View
@@ -0,0 +1,11 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-9

0 comments on commit c6acabf

Please sign in to comment.