Welcome to mirror list, hosted at ThFree Co, Russian Federation.

custom_rules.xml « android - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7c8a58b202f3db414cf3936e36e103f0fd19e12e (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<?xml version="1.0" encoding="UTF-8"?>
<project name="MapsWithMe" default="help">

  <property name="arch" value="multiarch" />

  <condition property="build.type.multi">
    <equals arg1="${arch}" arg2="multiarch"/>
  </condition>

  <condition property="ndk.buildcommand.suffix" value=".cmd" else="">
    <os family="windows" />
  </condition>

  <target name="-setup-architectures">

    <if condition="${build.type.multi}">
      <then>
	<property name="mwm.ndk.abi" value="armeabi armeabi-v7a mips x86"/>
      </then>
      <else>
	<property name="mwm.ndk.abi" value="${arch}"/>
      </else>
    </if>

    <echo> ************************************************ </echo>
    <echo> ***** BUILDING THE FOLLOWING ARCHITECTURES ***** </echo>
    <echo> ***** ${mwm.ndk.abi}  </echo>
    <echo> ************************************************ </echo>

  </target>

  <property name="jni.absolute.dir" location="jni" />

  <target name="clean" depends="android_rules.clean">
    <exec executable="${ndk.dir}/ndk-build${ndk.buildcommand.suffix}" failonerror="true">
      <arg value="clean"/>
    </exec>
  </target>

  <target name="-ndk-production" depends="-setup-architectures">
    <exec executable="bash" failonerror="true">
      <env key="NDK_ABI_TO_BUILD" value="${mwm.ndk.abi}"/>
      <arg value="${mwm.tools.dir}/autobuild/android.sh"/>
      <arg value="production"/>
    </exec>
    <exec executable="touch">
      <arg value="${jni.absolute.dir}/com/mapswithme/core/jni_helper.cpp"/>
    </exec>
    <exec executable="${ndk.dir}/ndk-build${ndk.buildcommand.suffix}" failonerror="true">
      <arg value="NDK_DEBUG=0"/>
      <arg value="PRODUCTION=1"/>
      <arg value="V=1"/>
    </exec>
  </target>

  <target name="-set-production-mode" depends="android_rules.-set-mode-check">
    <property name="out.packaged.file" location="${out.absolute.dir}/${ant.project.name}-production-unsigned.apk" />
    <property name="out.final.file" location="${out.absolute.dir}/${ant.project.name}-production.apk" />
    <property name="build.is.mode.set" value="true" />

    <!-- record the current build target -->
    <property name="build.target" value="production" />
    
    <property name="build.is.instrumented" value="false" />

    <!-- production mode is only valid if the manifest does not explicitly                                                                                                     
         set debuggable to true. default is false. -->
    <xpath input="AndroidManifest.xml" expression="/manifest/application/@android:debuggable"
           output="build.is.packaging.debug" default="false"/>
    
    <!-- signing mode: production -->
    <property name="build.is.signing.debug" value="false" />
    
    <if condition="${build.is.packaging.debug}">
      <then>
        <echo>*************************************************</echo>
        <echo>****  Android Manifest has debuggable=true   ****</echo>
        <echo>** Doing DEBUG packaging with PRODUCTION keys ***</echo>
        <echo>*************************************************</echo>
      </then>
      <else>
        <!-- property only set in release mode.                                                                                                                            
             Useful for if/unless attributes in target node                                                                                                                
             when using Ant before 1.8 -->
        <property name="build.is.mode.release" value="true"/>
      </else>
    </if>
  </target>

  <target name="production" depends="-ndk-production, -set-production-mode,                                                                                
				     android_rules.-release-obfuscation-check, android_rules.-package, android_rules.-release-nosign"
          if="has.keystore" description="Production target - almost the same as release, but with real word config.">
    <!-- only create apk if *not* a library project -->
    <do-only-if-not-library elseText="Library project: do not create apk..." >
      <sequential>
        <property name="out.unaligned.file" location="${out.absolute.dir}/${ant.project.name}-production-unaligned.apk" />
        <!-- Signs the APK -->
        <echo>Signing final apk...</echo>
        <signjar
           jar="${out.packaged.file}"
           signedjar="${out.unaligned.file}"
           keystore="${key.store}"
           storepass="${key.store.password}"
           alias="${key.alias}"
           keypass="${key.alias.password}"
           verbose="${verbose}" />
	
        <!-- Zip aligns the APK -->
        <zipalign-helper in.package="${out.unaligned.file}"
                         out.package="${out.final.file}" />
        <echo>Release Package: ${out.final.file}</echo>
      </sequential>
    </do-only-if-not-library>
    <record-build-info />
  </target>

  <target name="-ndk-release" depends="-setup-architectures">
    <exec executable="bash" failonerror="true">
      <arg value="${mwm.tools.dir}/autobuild/android.sh"/>
      <arg value="release"/>
    </exec>
    <exec executable="touch">
      <arg value="${jni.absolute.dir}/com/mapswithme/core/jni_helper.cpp"/>
    </exec>
    <exec executable="${ndk.dir}/ndk-build${ndk.buildcommand.suffix}" failonerror="true">
      <arg value="NDK_DEBUG=0"/>
      <arg value="V=1"/>
    </exec>
  </target>

  <target name="release" depends="-ndk-release, android_rules.release">
  </target>

  <target name="-ndk-debug" depends="-setup-architectures">
    <exec executable="bash" failonerror="true">
      <arg value="${mwm.tools.dir}/autobuild/android.sh"/>
      <arg value="debug"/>
    </exec>
    <exec executable="touch">
      <arg value="${jni.absolute.dir}/com/mapswithme/core/jni_helper.cpp"/>
    </exec>
    <exec executable="${ndk.dir}/ndk-build${ndk.buildcommand.suffix}" failonerror="true">
      <arg value="NDK_DEBUG=1"/>
      <arg value="V=1"/>
    </exec>
  </target>

  <target name="debug" depends="-ndk-debug, android_rules.debug">
  </target>

</project>