Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[TIMOB-9150] workaround android NDK project path limitation when packaging a module #2261

Merged
merged 2 commits into from

2 participants

@mstepanov

TIMOB-9150

Test instructions in JIRA.
Should be tested on all supported platforms.

support/module/android/build.xml
@@ -308,14 +308,23 @@ timodule.xml.
<property name="mobilesdk.dir" location="${titanium.platform}/.."/>
<property name="ndk.verbose" value="0"/>
-
- <exec executable="${ndk.build}" dir="@{gendir}" failonerror="true">
+ <property name="tmpdir" value="${java.io.tmpdir}/${user.name}/${ant.project.name}-generated" />
+
+ <mkdir dir="${tmpdir}" />
+ <copy todir="${tmpdir}" preservelastmodified="true" overwrite="true" force="true" includeEmptyDirs="true">

force is since ant 1.8.2, and for example when I test under Ubuntu 10.04, the apt-get options for ant (out of the box -- not sure about updates) don't include 1.8.2, so it failed when I tested. I think overwrite is probably enough.

I tried without force twice in a row (so that the second time would have existing files there already), and it was okay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
support/module/android/build.xml
((18 lines not shown))
<arg value="PYTHON=${python.exec}"/>
<arg value="V=${ndk.verbose}"/>
</exec>
+
+ <move todir="@{gendir}" preservelastmodified="true" overwrite="true" force="true" includeEmptyDirs="true">

ditto re force

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@billdawson

1st round review complete. Functionally works perfectly on OS X and Windows 7. On Ubuntu 10.04 works perfectly if I remove the force attribute from <copy> and <move>.

So we should either remove that, or check that ant is >= 1.8.2 and fail the build early with a helpful message.

Ant 1.8.2 is indeed already over a year old, and it ships on Snow Leopard and Lion. However not on Ubuntu 10.04 (obviously, since that's older than ant 1.8.2).

@billdawson

cr/fr accepted

@billdawson billdawson merged commit 5e45619 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 23, 2012
  1. @mstepanov
Commits on May 25, 2012
  1. @mstepanov
This page is out of date. Refresh to see the latest.
Showing with 13 additions and 4 deletions.
  1. +13 −4 support/module/android/build.xml
View
17 support/module/android/build.xml
@@ -308,14 +308,23 @@ timodule.xml.
<property name="mobilesdk.dir" location="${titanium.platform}/.."/>
<property name="ndk.verbose" value="0"/>
-
- <exec executable="${ndk.build}" dir="@{gendir}" failonerror="true">
+ <property name="tmpdir" value="${java.io.tmpdir}/${user.name}/${ant.project.name}-generated" />
+
+ <mkdir dir="${tmpdir}" />
+ <copy todir="${tmpdir}" preservelastmodified="true" overwrite="true" includeEmptyDirs="true">
+ <fileset dir="@{gendir}"/>
+ </copy>
+ <exec executable="${ndk.build}" dir="${tmpdir}" failonerror="true">
<arg value="TI_MOBILE_SDK=${mobilesdk.dir}"/>
- <arg value="NDK_PROJECT_PATH=@{gendir}"/>
- <arg value="NDK_APPLICATION_MK=@{gendir}/Application.mk"/>
+ <arg value="NDK_PROJECT_PATH=${tmpdir}"/>
+ <arg value="NDK_APPLICATION_MK=${tmpdir}/Application.mk"/>
<arg value="PYTHON=${python.exec}"/>
<arg value="V=${ndk.verbose}"/>
</exec>
+
+ <move todir="@{gendir}" preservelastmodified="true" overwrite="true" includeEmptyDirs="true">
+ <fileset dir="${tmpdir}"/>
+ </move>
</sequential>
</macrodef>
Something went wrong with that request. Please try again.