Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
Update Neko to latest SDK build system.
Browse files Browse the repository at this point in the history
  • Loading branch information
sattvik committed Mar 29, 2012
1 parent 30bf682 commit 067990e
Show file tree
Hide file tree
Showing 8 changed files with 131 additions and 74 deletions.
29 changes: 13 additions & 16 deletions README.asciidoc
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -47,14 +47,15 @@ Clojure 1.2::
Android SDK Tools:: Android SDK Tools::
Neko has been developed with the latest revision of the Android SDK tools, Neko has been developed with the latest revision of the Android SDK tools,
and is compatible with r14 and up of the Android SDK. and is compatible with r17 and up of the Android SDK.
+ +
WARNING: Revision 14 of the Android SDK introduced some major changes in the WARNING: Revisions 14 and 17 of the Android SDK introduced changes in the Ant
Ant build system. Neko has been updated to use the new build system. You will build system. Neko has been updated to use the build system in r17. You will
probably need to change your project if you have been using an older version of probably need to change your project if you have been using an older version of
Neko/SDK. For more detailed information, Neko/SDK. For more detailed information, check the Android Tools Project site
http://tools.android.com/recent/buildchangesinrevision14[check the Android for information about the breaking changes in
Tools Project Site]. http://tools.android.com/recent/buildchangesinrevision14[r14] and
http://tools.android.com/recent/dealingwithdependenciesinandroidprojects[r17].
Android Platform SDK 7 (2.1/Eclair) or newer:: Android Platform SDK 7 (2.1/Eclair) or newer::
In order to maintain backwards-compatibility, Neko does not support any APIs In order to maintain backwards-compatibility, Neko does not support any APIs
Expand Down Expand Up @@ -86,8 +87,9 @@ be either a relative or absolute path.
`1` to `custom`. If you do not do this, Android may overwrite your changes. `1` to `custom`. If you do not do this, Android may overwrite your changes.
For most projects, that is all you have to do. So long as your Clojure source For most projects, that is all you have to do. So long as your Clojure source
files are in `src/clojure` and you have placed a Clojure JAR file in `libs`, files are in `src/clojure` and you have placed a Clojure JAR file in `libs`
Ant will now automatically find and compile all of your Clojure code. directory of your Neko installation, Ant will now automatically find and
compile all of your Clojure code.
=== Reflection warnings === === Reflection warnings ===
Expand All @@ -104,14 +106,9 @@ project in which you have enabled Clojure support.
=== Test and library projects === === Test and library projects ===
If your project is a test or library project, you should not place a copy of As of r17 of the Android SDK, you should now be able to place a copy of the
the Clojure library in the `libs` directory. If you do this, when building an Clojure JAR in the `libs` directory of Neko and it should automatically be
application that uses your library or when building your test project, the `dx` picked up by any projects that depend on it.
tool will fail due to multiple inclusions of the same Clojure classes.
In these circumstances, you should either set a `clojure.jar` property in your
project’s `ant.properties` file or in the `clojure.properties` file as
described in the previous section.
Also, if you are developing an Android library project, you should add the Also, if you are developing an Android library project, you should add the
following line to your `ant.properties` file: following line to your `ant.properties` file:
Expand Down
20 changes: 13 additions & 7 deletions build-support/clojure.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -58,18 +58,19 @@
</condition> </condition>
<javac encoding="${java.encoding}" <javac encoding="${java.encoding}"
source="${java.source}" target="${java.target}" source="${java.source}" target="${java.target}"
debug="true" extdirs="" debug="true" extdirs="" includeantruntime="false"
destdir="${out.classes.absolute.dir}" destdir="${out.classes.absolute.dir}"
bootclasspathref="android.target.classpath" bootclasspathref="android.target.classpath"
verbose="${verbose}" verbose="${verbose}"
classpath="${extensible.classpath}" classpath="${extensible.classpath}"
classpathref="jar.libs.ref" classpathref="project.libraries.jars"
includeantruntime="false"> fork="${need.javac.fork}">
<src path="${source.absolute.dir}" /> <src path="${source.absolute.dir}" />
<src path="${gen.absolute.dir}" /> <src path="${gen.absolute.dir}" />
<classpath> <classpath>
<fileset dir="${extensible.libs.classpath}" includes="*.jar" /> <fileset dir="${extensible.libs.classpath}" includes="*.jar" />
</classpath> </classpath>
<compilerarg line="${java.compilerargs}" />
</javac> </javac>
<java classname="clojure.main" <java classname="clojure.main"
classpath="${clojure.jar}" classpath="${clojure.jar}"
Expand All @@ -81,7 +82,7 @@
<classpath> <classpath>
<pathelement path="${extensible.classpath}"/> <pathelement path="${extensible.classpath}"/>
<pathelement path="${clojure.source.absolute.dir}"/> <pathelement path="${clojure.source.absolute.dir}"/>
<path refid="jar.libs.ref"/> <path refid="project.libraries.jars"/>
<fileset dir="${extensible.libs.classpath}" includes="*.jar" /> <fileset dir="${extensible.libs.classpath}" includes="*.jar" />
<pathelement path="${clojure.out.classes.absolute.dir}"/> <pathelement path="${clojure.out.classes.absolute.dir}"/>
</classpath> </classpath>
Expand All @@ -101,8 +102,13 @@
<echo>Custom jar packaging exclusion: ${android.package.excludes}</echo> <echo>Custom jar packaging exclusion: ${android.package.excludes}</echo>
</then> </then>
</if> </if>

<propertybyreplace name="manifest.package.path" input="${manifest.package}" replace="." with="/" />

<jar destfile="${out.library.jar.file}"> <jar destfile="${out.library.jar.file}">
<fileset dir="${out.classes.absolute.dir}" excludes="**/R.class **/R$*.class"/> <fileset dir="${out.classes.absolute.dir}"
includes="**/*.class"
excludes="${manifest.package.path}/R.class ${manifest.package.path}/R$*.class ${manifest.package.path}/Manifest.class ${manifest.package.path}/Manifest$*.class ${manifest.package.path}/BuildConfig.class"/>
<fileset dir="${source.absolute.dir}" excludes="**/*.java ${android.package.excludes}" /> <fileset dir="${source.absolute.dir}" excludes="**/*.java ${android.package.excludes}" />
</jar> </jar>
</then> </then>
Expand All @@ -118,9 +124,9 @@
mode="overwrite" mode="overwrite"
instrpath="${out.absolute.dir}/classes" instrpath="${out.absolute.dir}/classes"
outdir="${out.absolute.dir}/classes"> outdir="${out.absolute.dir}/classes">
<filter excludes="${manifest.package}.R,${manifest.package}.R$$*,${manifest.package}.BuildConfig" />
<filter value="${emma.filter}" />
</instr> </instr>
<!-- TODO: exclusion filters on R*.class and allowing custom exclusion from
user defined file -->
</emma> </emma>
</then> </then>
</if> </if>
Expand Down
32 changes: 15 additions & 17 deletions build.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- The local.properties file is created and updated by the 'android' tool. <!-- 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 It contains the path to the SDK. It should *NOT* be checked into
Version Control Systems. --> Version Control Systems. -->
<loadproperties srcFile="local.properties" /> <property file="local.properties" />


<!-- The ant.properties file can be created by you. It is only edited by the <!-- The ant.properties file can be created by you. It is only edited by the
'android' tool to add properties to it. 'android' tool to add properties to it.
Expand Down Expand Up @@ -41,25 +41,23 @@


<!-- quick check on sdk.dir --> <!-- quick check on sdk.dir -->
<fail <fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'" message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var"
unless="sdk.dir" unless="sdk.dir"
/> />



<!--
<!-- extension targets. Uncomment the ones where you want to do custom work Import per project custom build rules if present at the root of the project.
in between standard targets --> This is the place to put custom intermediary targets such as:
<!-- -pre-build
<target name="-pre-build"> -pre-compile
</target> -post-compile (This is typically used for code obfuscation.
<target name="-pre-compile"> Compiled code location: ${out.classes.absolute.dir}
</target> If this is not done in place, override ${out.dex.input.absolute.dir})
-post-package
/* This is typically used for code obfuscation. -post-build
Compiled code location: ${out.classes.absolute.dir} -pre-clean
If this is not done in place, override ${out.dex.input.absolute.dir} */ -->
<target name="-post-compile"> <import file="custom_rules.xml" optional="true" />
</target>
-->


<import file="build-support/clojure.xml" /> <import file="build-support/clojure.xml" />


Expand Down
20 changes: 20 additions & 0 deletions proguard-project.txt
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,20 @@
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
32 changes: 15 additions & 17 deletions test-app/build.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- The local.properties file is created and updated by the 'android' tool. <!-- 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 It contains the path to the SDK. It should *NOT* be checked into
Version Control Systems. --> Version Control Systems. -->
<loadproperties srcFile="local.properties" /> <property file="local.properties" />


<!-- The ant.properties file can be created by you. It is only edited by the <!-- The ant.properties file can be created by you. It is only edited by the
'android' tool to add properties to it. 'android' tool to add properties to it.
Expand Down Expand Up @@ -41,25 +41,23 @@


<!-- quick check on sdk.dir --> <!-- quick check on sdk.dir -->
<fail <fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'" message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var"
unless="sdk.dir" unless="sdk.dir"
/> />



<!--
<!-- extension targets. Uncomment the ones where you want to do custom work Import per project custom build rules if present at the root of the project.
in between standard targets --> This is the place to put custom intermediary targets such as:
<!-- -pre-build
<target name="-pre-build"> -pre-compile
</target> -post-compile (This is typically used for code obfuscation.
<target name="-pre-compile"> Compiled code location: ${out.classes.absolute.dir}
</target> If this is not done in place, override ${out.dex.input.absolute.dir})
-post-package
/* This is typically used for code obfuscation. -post-build
Compiled code location: ${out.classes.absolute.dir} -pre-clean
If this is not done in place, override ${out.dex.input.absolute.dir} */ -->
<target name="-post-compile"> <import file="custom_rules.xml" optional="true" />
</target>
-->


<import file="../build-support/clojure.xml" /> <import file="../build-support/clojure.xml" />


Expand Down
20 changes: 20 additions & 0 deletions test-app/proguard-project.txt
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,20 @@
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
32 changes: 15 additions & 17 deletions test/build.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- The local.properties file is created and updated by the 'android' tool. <!-- 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 It contains the path to the SDK. It should *NOT* be checked into
Version Control Systems. --> Version Control Systems. -->
<loadproperties srcFile="local.properties" /> <property file="local.properties" />


<!-- The ant.properties file can be created by you. It is only edited by the <!-- The ant.properties file can be created by you. It is only edited by the
'android' tool to add properties to it. 'android' tool to add properties to it.
Expand Down Expand Up @@ -41,25 +41,23 @@


<!-- quick check on sdk.dir --> <!-- quick check on sdk.dir -->
<fail <fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'" message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var"
unless="sdk.dir" unless="sdk.dir"
/> />



<!--
<!-- extension targets. Uncomment the ones where you want to do custom work Import per project custom build rules if present at the root of the project.
in between standard targets --> This is the place to put custom intermediary targets such as:
<!-- -pre-build
<target name="-pre-build"> -pre-compile
</target> -post-compile (This is typically used for code obfuscation.
<target name="-pre-compile"> Compiled code location: ${out.classes.absolute.dir}
</target> If this is not done in place, override ${out.dex.input.absolute.dir})
-post-package
/* This is typically used for code obfuscation. -post-build
Compiled code location: ${out.classes.absolute.dir} -pre-clean
If this is not done in place, override ${out.dex.input.absolute.dir} */ -->
<target name="-post-compile"> <import file="custom_rules.xml" optional="true" />
</target>
-->


<import file="../build-support/clojure.xml" /> <import file="../build-support/clojure.xml" />


Expand Down
20 changes: 20 additions & 0 deletions test/proguard-project.txt
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,20 @@
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

0 comments on commit 067990e

Please sign in to comment.