annotate app/build.gradle @ 447:2907c688955e

add ndk shared object to .apk package
author Carl Byington <carl@five-ten-sg.com>
date Thu, 17 Mar 2016 13:24:58 -0700
parents ced663d2e957
children 7492d2cb7b75
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
447
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
1 task copyDebugLibTask(type: Copy) {
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
2 from 'build/intermediates/binaries/debug/arm/lib/armeabi'
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
3 into 'src/main/jniLibs/armeabi'
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
4 }
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
5 task copyReleaseLibTask(type: Copy) {
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
6 from 'build/intermediates/binaries/release/arm/lib/armeabi'
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
7 into 'src/main/jniLibs/armeabi'
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
8 }
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
9
438
d29cce60f393 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
10 tasks.whenTaskAdded { task ->
447
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
11 if (task.name.contains("merge") && task.name.contains("JniLibFolders")) {
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
12 if (task.name.contains("ArmDebug")) {
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
13 task.dependsOn copyDebugLibTask
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
14 }
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
15 if (task.name.contains("ArmRelease")) {
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
16 task.dependsOn copyReleaseLibTask
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
17 }
438
d29cce60f393 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
18 }
d29cce60f393 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
19 }
d29cce60f393 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
20
447
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
21
438
d29cce60f393 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
22 apply plugin: 'com.android.model.application'
d29cce60f393 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
23
d29cce60f393 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
24 model {
d29cce60f393 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
25 android {
d29cce60f393 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
26 compileSdkVersion = 16
d29cce60f393 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
27 buildToolsVersion = "23.0.2"
447
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
28 buildTypes {
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
29 release {
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
30 minifyEnabled = false
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
31 signingConfig = $("android.signingConfigs.release")
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
32 }
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
33 debug {
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
34 debuggable = true
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
35 ndk {
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
36 debuggable = true
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
37 }
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
38 }
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
39 }
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
40 productFlavors {
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
41 create("arm") {
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
42 ndk.abiFilters.add("armeabi")
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
43 }
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
44 create("x86") {
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
45 ndk.abiFilters.add("x86")
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
46 }
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
47 }
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
48 ndk {
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
49 moduleName = "com_google_ase_Exec"
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
50 cppFlags.add("-Werror")
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
51 ldLibs.add("log")
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
52 }
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
53 sources {
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
54 main {
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
55 jni {
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
56 source {
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
57 srcDir "Exec"
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
58 }
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
59 }
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
60 }
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
61 }
438
d29cce60f393 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
62 defaultConfig.with {
d29cce60f393 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
63 applicationId = "com.five_ten_sg.connectbot"
d29cce60f393 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
64 minSdkVersion.apiLevel = 8
d29cce60f393 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
65 targetSdkVersion.apiLevel = 15
d29cce60f393 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
66 }
d29cce60f393 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
67 }
d29cce60f393 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
68
d29cce60f393 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
69 android.signingConfigs {
447
2907c688955e add ndk shared object to .apk package
Carl Byington <carl@five-ten-sg.com>
parents: 442
diff changeset
70 create("release") {
440
1e3789de6900 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents: 438
diff changeset
71 def console = System.console()
441
592f0ef08d94 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents: 440
diff changeset
72 if (console) {
592f0ef08d94 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents: 440
diff changeset
73 storePassword = new String(console.readPassword("\nkey store password: "))
592f0ef08d94 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents: 440
diff changeset
74 keyPassword = new String(console.readPassword("\nkey alias password: "))
592f0ef08d94 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents: 440
diff changeset
75 }
592f0ef08d94 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents: 440
diff changeset
76 else {
592f0ef08d94 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents: 440
diff changeset
77 def read = System.in.newReader().&readLine
442
ced663d2e957 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents: 441
diff changeset
78 print "\nkey store password"
441
592f0ef08d94 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents: 440
diff changeset
79 storePassword = read()
442
ced663d2e957 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents: 441
diff changeset
80 print "\nkey alias password"
441
592f0ef08d94 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents: 440
diff changeset
81 keyPassword = read()
592f0ef08d94 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents: 440
diff changeset
82 }
438
d29cce60f393 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
83 storeFile = file("../510Connectbot.keystore")
d29cce60f393 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
84 storeType = "jks"
441
592f0ef08d94 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents: 440
diff changeset
85 keyAlias = "510Connectbot"
438
d29cce60f393 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
86 }
d29cce60f393 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
87 }
d29cce60f393 migrate from Eclipse to Android Studio
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
88 }