2 *******************************************************************
\r
4 * Copyright 2015 Intel Corporation.
\r
6 *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
\r
8 * Licensed under the Apache License, Version 2.0 (the "License");
\r
9 * you may not use this file except in compliance with the License.
\r
10 * You may obtain a copy of the License at
\r
12 * http://www.apache.org/licenses/LICENSE-2.0
\r
14 * Unless required by applicable law or agreed to in writing, software
\r
15 * distributed under the License is distributed on an "AS IS" BASIS,
\r
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
17 * See the License for the specific language governing permissions and
\r
18 * limitations under the License.
\r
20 *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
\r
30 classpath 'com.android.tools.build:gradle:1.3.0'
\r
32 // NOTE: Do not place your application dependencies here; they belong
\r
33 // in the individual module build.gradle files
\r
44 apply plugin: 'com.android.library'
\r
50 srcDirs 'src/main/java', '../common/src/main/java'
\r
52 manifest.srcFile 'src/main/AndroidManifest.xml'
\r
53 jniLibs.srcDir "$buildDir/native-libs"
\r
54 jni.srcDirs = [] //disable automatic ndk-build call
\r
58 compileSdkVersion 21
\r
59 buildToolsVersion "20.0.0"
\r
60 archivesBaseName = "iotivity-base"
\r
62 libraryVariants.all { variant ->
\r
63 variant.outputs.each { output ->
\r
64 def outputFile = output.outputFile
\r
65 if (outputFile != null && outputFile.name.endsWith('.aar')) {
\r
66 def fileName = "${archivesBaseName}-${TARGET_ARCH}-${RELEASE}.aar"
\r
67 output.outputFile = new File(outputFile.parent, fileName)
\r
80 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
\r
91 compile fileTree(dir: 'libs', include: ['*.jar'])
\r
94 task copyNativeLibs(type: Copy) {
\r
95 String[] libraries = [
\r
96 'libca-interface.so',
\r
97 'libconnectivity_abstraction.so',
\r
98 'libgnustl_shared.so',
\r
101 'libocstack-jni.so',
\r
104 if ("$SECURED" == '1')
\r
106 'libocprovision.so',
\r
109 from(new File("$BUILD_DIR")) { include libraries }
\r
110 into new File(buildDir, "native-libs/$TARGET_ARCH")
\r
113 tasks.withType(JavaCompile) { compileTask -> compileTask.dependsOn copyNativeLibs }
\r
115 tasks.withType(com.android.build.gradle.tasks.PackageApplication) { pkgTask ->
\r
116 pkgTask.jniFolders = new HashSet<File>()
\r
117 pkgTask.jniFolders.add(new File(buildDir, 'native-libs'))
\r