replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / android / android_api / base / build.gradle
index 82fb651..2d8cbcb 100755 (executable)
@@ -1,29 +1,33 @@
 /*\r
- * //******************************************************************\r
- * //\r
- * // Copyright 2015 Intel Corporation.\r
- * //\r
- * //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
- * //\r
- * // Licensed under the Apache License, Version 2.0 (the "License");\r
- * // you may not use this file except in compliance with the License.\r
- * // You may obtain a copy of the License at\r
- * //\r
- * //      http://www.apache.org/licenses/LICENSE-2.0\r
- * //\r
- * // Unless required by applicable law or agreed to in writing, software\r
- * // distributed under the License is distributed on an "AS IS" BASIS,\r
- * // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * // See the License for the specific language governing permissions and\r
- * // limitations under the License.\r
- * //\r
- * //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
+ *******************************************************************\r
+ *\r
+ * Copyright 2015 Intel Corporation.\r
+ *\r
+ *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *      http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ *\r
+ *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
  */\r
 \r
 apply plugin: 'com.android.library'\r
 \r
 android {\r
-    compileSdkVersion 21\r
+    if (WITH_TRANSPORT_BLE == "0") {\r
+        compileSdkVersion 21\r
+    }else{\r
+        compileSdkVersion 22\r
+    }\r
     buildToolsVersion "20.0.0"\r
     archivesBaseName = "iotivity-base"\r
 \r
@@ -41,7 +45,17 @@ android {
         minSdkVersion 21\r
         targetSdkVersion 21\r
         versionCode 1\r
-        versionName "1.0"\r
+        versionName "1.2.1"\r
+        buildConfigField 'int', 'SECURED', SECURED\r
+        buildConfigField 'int', 'WITH_TCP', WITH_TCP\r
+        buildConfigField 'int', 'WITH_CLOUD', WITH_CLOUD\r
+        buildConfigField "int", 'WITH_MQ_PUB', WITH_MQ_PUB\r
+        buildConfigField "int", 'WITH_MQ_SUB', WITH_MQ_SUB\r
+        buildConfigField "int", 'WITH_MQ_BROKER', WITH_MQ_BROKER\r
+        buildConfigField "String", 'RD_MODE', "\"RD_MODE\""\r
+        buildConfigField "int", 'WITH_TRANSPORT_EDR', WITH_TRANSPORT_EDR\r
+        buildConfigField "int", 'WITH_TRANSPORT_BLE', WITH_TRANSPORT_BLE\r
+        buildConfigField "int", 'WITH_TRANSPORT_NFC', WITH_TRANSPORT_NFC\r
     }\r
     buildTypes {\r
         release {\r
@@ -58,6 +72,22 @@ android {
             manifest.srcFile 'src/main/AndroidManifest.xml'\r
             jniLibs.srcDir 'libs'\r
             jni.srcDirs = [] //disable automatic ndk-build call\r
+            java{\r
+                if (WITH_TRANSPORT_EDR == "0") {\r
+                    exclude "**/ca/CaBtPairingInterface.java"\r
+                    exclude "**/ca/CaEdrInterface.java"\r
+                    println 'excluded EDR interface'\r
+                    }\r
+                if (WITH_TRANSPORT_BLE == "0") {\r
+                    exclude "**/ca/CaLeClientInterface.java"\r
+                    exclude "**/ca/CaLeServerInterface.java"\r
+                    println 'excluded BLE interface'\r
+                    }\r
+                if (WITH_TRANSPORT_NFC == "0") {\r
+                    exclude "**/ca/CaNfcInterface.java"\r
+                    println 'excluded NFC interface'\r
+                    }\r
+            }\r
         }\r
     }\r
 }\r
@@ -93,12 +123,12 @@ task buildNative(type: Exec) {
     if (System.env.ANDROID_NDK_HOME != null) {\r
         //for windows use 'ndk-build.cmd'\r
         //def ndkBuild = new File(System.env.ANDROID_NDK_HOME, 'ndk-build.cmd')\r
-        def ndkBuild = new File(System.env.ANDROID_NDK_HOME, 'ndk-build')\r
-        commandLine ndkBuild, "APP_ABI=$TARGET_ARCH", "APP_OPTIM=$RELEASE", "SECURE=$SECURED"\r
+        def ndkBuild = new File(System.env.ANDROID_NDK_HOME, 'ndk-build')
+        commandLine ndkBuild, "APP_ABI=$TARGET_ARCH", "APP_OPTIM=$RELEASE", "SECURE=$SECURED", "WITH_CLOUD=$WITH_CLOUD", "RD_MODE=$RD_MODE", "WITH_MQ_PUB=$WITH_MQ_PUB", "WITH_MQ_SUB=$WITH_MQ_SUB", "WITH_MQ_BROKER=$WITH_MQ_BROKER", "WITH_TCP=$WITH_TCP"\r
     } else {\r
         println '##################'\r
         println 'Skipping NDK build'\r
         println 'Reason: ANDROID_NDK_HOME not set.'\r
         println '##################'\r
     }\r
-}
\ No newline at end of file
+}\r