summaryrefslogtreecommitdiffstats
path: root/testing/android/native_test_apk.xml
blob: fff76710f789e965caf0c7a1955cda4e793dfe6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2012 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<project name="replaceme" default="debug" basedir=".">

  <description>
    Building native test runner ChromeNativeTests_replaceme.apk
  </description>

  <property environment="env"/>
  <property name="sdk.dir" location="${env.ANDROID_SDK_ROOT}"/>
  <property name="sdk.version" value="${env.ANDROID_SDK_VERSION}"/>
  <property name="toolchain.dir" location="${env.ANDROID_TOOLCHAIN}"/>
  <property name="src" location="."/>
  <property name="source.dir" location="java"/>
  <property name="target.abi" value="${APP_ABI}"/>

  <property name="target" value="android-${env.ANDROID_SDK_VERSION}"/>
  <path id="native.libs.gdbserver">
    <fileset file="${toolchain.dir}/../../gdbserver"/>
  </path>

  <condition property="location.base" 
             value="${sdk.dir}" 
             else="${sdk.dir}/platforms/android-${sdk.version}">
    <isset property="env.ANDROID_BUILD_TOP"/>
  </condition>

  <!-- We expect PRODUCT_DIR to be set like the gyp var
       (e.g. $ROOT/out/Debug) -->
  <!-- TODO(jrg): ideally we need this to run before -build-setup, where
       directories are made based on this variable. -->
  <target name="-pre-build">
    <if>
      <condition>
        <isset property="PRODUCT_DIR" />
      </condition>
      <else>
        <fail message="PRODUCT_DIR env var not set?" />
      </else>
    </if>
  </target>

  <property name="out.dir" location="${PRODUCT_DIR}/replaceme_apk"/>

  <property name="resource.absolute.dir" value="res"/>
  <property name="gen.absolute.dir" value="${out.dir}/gen"/>

  <!-- Nilesh: this is what we should transition to.
       TODO(jrg): make sure we transition; will involve gyp changes
       for placing jar outputs in new directory. 
       When we transition we'll probably also want to change
       generate_native_test.py to copy the jars into java/libs, not
       just libs (see line 124 or so).
    -->
  <!--
  <property name="jar.libs.dir" value="${out.dir}/java/libs"/>
  <property name="native.libs.absolute.dir" location="${out.dir}/libs" />
  -->

  <target name="-post-compile">
    <!-- copy gdbserver to main libs directory if building debug. -->
    <if>
      <condition>
        <equals arg1="${build.target}" arg2="debug" />
      </condition>
      <then>
        <echo message="Copying gdbserver to the apk to enable native debugging"/>
        <copy todir="${out.dir}/libs/${target.abi}">
          <path refid="native.libs.gdbserver"/>
        </copy>
      </then>
    </if>
  </target>

  <import file="${sdk.dir}/tools/ant/build.xml" />

</project>