comparison 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
comparison
equal deleted inserted replaced
446:5ce5235adde6 447:2907c688955e
1 task copyDebugLibTask(type: Copy) {
2 from 'build/intermediates/binaries/debug/arm/lib/armeabi'
3 into 'src/main/jniLibs/armeabi'
4 }
5 task copyReleaseLibTask(type: Copy) {
6 from 'build/intermediates/binaries/release/arm/lib/armeabi'
7 into 'src/main/jniLibs/armeabi'
8 }
9
1 tasks.whenTaskAdded { task -> 10 tasks.whenTaskAdded { task ->
2 if (task.name.contains("lint")) { 11 if (task.name.contains("merge") && task.name.contains("JniLibFolders")) {
3 task.enabled = false 12 if (task.name.contains("ArmDebug")) {
13 task.dependsOn copyDebugLibTask
14 }
15 if (task.name.contains("ArmRelease")) {
16 task.dependsOn copyReleaseLibTask
17 }
4 } 18 }
5 } 19 }
20
6 21
7 apply plugin: 'com.android.model.application' 22 apply plugin: 'com.android.model.application'
8 23
9 model { 24 model {
10 def signConf
11
12 android { 25 android {
13 compileSdkVersion = 16 26 compileSdkVersion = 16
14 buildToolsVersion = "23.0.2" 27 buildToolsVersion = "23.0.2"
15 28 buildTypes {
29 release {
30 minifyEnabled = false
31 signingConfig = $("android.signingConfigs.release")
32 }
33 debug {
34 debuggable = true
35 ndk {
36 debuggable = true
37 }
38 }
39 }
40 productFlavors {
41 create("arm") {
42 ndk.abiFilters.add("armeabi")
43 }
44 create("x86") {
45 ndk.abiFilters.add("x86")
46 }
47 }
48 ndk {
49 moduleName = "com_google_ase_Exec"
50 cppFlags.add("-Werror")
51 ldLibs.add("log")
52 }
53 sources {
54 main {
55 jni {
56 source {
57 srcDir "Exec"
58 }
59 }
60 }
61 }
16 defaultConfig.with { 62 defaultConfig.with {
17 applicationId = "com.five_ten_sg.connectbot" 63 applicationId = "com.five_ten_sg.connectbot"
18 minSdkVersion.apiLevel = 8 64 minSdkVersion.apiLevel = 8
19 targetSdkVersion.apiLevel = 15 65 targetSdkVersion.apiLevel = 15
20 } 66 }
21 } 67 }
22 68
23 compileOptions.with {
24 sourceCompatibility = JavaVersion.VERSION_1_7
25 targetCompatibility = JavaVersion.VERSION_1_7
26 }
27
28 android.ndk {
29 moduleName = "com_google_ase_Exec"
30 cppFlags.add("-Werror")
31 ldLibs.add("log")
32 }
33
34 android.sources {
35 main {
36 jni {
37 source {
38 srcDir "Exec"
39 }
40 }
41 }
42 }
43
44 android.signingConfigs { 69 android.signingConfigs {
45 create("signed") { 70 create("release") {
46 def console = System.console() 71 def console = System.console()
47 if (console) { 72 if (console) {
48 storePassword = new String(console.readPassword("\nkey store password: ")) 73 storePassword = new String(console.readPassword("\nkey store password: "))
49 keyPassword = new String(console.readPassword("\nkey alias password: ")) 74 keyPassword = new String(console.readPassword("\nkey alias password: "))
50 } 75 }
56 keyPassword = read() 81 keyPassword = read()
57 } 82 }
58 storeFile = file("../510Connectbot.keystore") 83 storeFile = file("../510Connectbot.keystore")
59 storeType = "jks" 84 storeType = "jks"
60 keyAlias = "510Connectbot" 85 keyAlias = "510Connectbot"
61 signConf = it
62 } 86 }
63 } 87 }
64
65 android.buildTypes {
66 release {
67 minifyEnabled = false
68 signingConfig = signConf
69 //proguardFiles.add(file('proguard-rules.txt'))
70 }
71 debug {
72 debuggable = true
73 }
74 }
75
76 android.productFlavors {
77 create("arm") {
78 ndk.abiFilters.add("armeabi")
79 }
80 create("x86") {
81 ndk.abiFilters.add("x86")
82 }
83 }
84
85 } 88 }