Fix build fail of notification android.
authorKIM JungYong <jyong2.kim@samsung.com>
Fri, 30 Sep 2016 07:49:20 +0000 (16:49 +0900)
committerUze Choi <uzchoi@samsung.com>
Tue, 4 Oct 2016 04:04:14 +0000 (04:04 +0000)
Android building execute on notification SConscript.
And bug for build fail is fixed.

Change-Id: I6fad802576f34c32f5b2a36e3af23e2a89af2d65
Signed-off-by: KIM JungYong <jyong2.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/12631
Reviewed-by: Chihyun Cho <ch79.cho@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/notification/SConscript
service/notification/android/SConscript
service/notification/android/notification-service/build.gradle
service/notification/android/notification-service/src/main/java/org/iotivity/service/ns/common/Message.java
service/notification/android/notification-service/src/main/jni/Android.mk

index d93276d..407c53c 100755 (executable)
@@ -124,3 +124,6 @@ SConscript('examples/SConscript')
 
 # Go to build c++ wrapper
 SConscript('cpp-wrapper/SConscript')
+
+if target_os == 'android':
+    SConscript('android/SConscript')
index 778e089..7a52422 100755 (executable)
@@ -47,7 +47,7 @@ def ensure_libs(target, source, env):
     return target, [source, env.get('BUILD_DIR') + 'liboc.so',
                             env.get('BUILD_DIR') + 'liboc_logger.so',
                             env.get('BUILD_DIR') + 'libnotification_provider_wrapper.so',
-                            env.get('BUILD_DIR') + 'libnotification_consumer.so']
+                            env.get('BUILD_DIR') + 'libnotification_consumer_wrapper.so']
 
 
 jdk_env = Environment(ENV=os.environ)
@@ -55,5 +55,9 @@ jdk_env['BUILDERS']['Gradle'] = Builder(action = env.get('ANDROID_GRADLE') +
     ' build -bservice/notification/android/build.gradle -PTARGET_ARCH=%s -PRELEASE=%s --stacktrace' %(ANDROID_TARGET_ARCH, ANDROID_RELEASE),
     emitter = ensure_libs)
 jdk_env['BUILD_DIR'] = env.get('BUILD_DIR')
-jdk_env.Gradle(target="notification-service/objs",
+cmdBuildNotification = jdk_env.Gradle(target="notification-service/objs",
     source="notification-service/src/main/java/org/iotivity/service/ns/consumer/ConsumerService.java")
+
+Depends(cmdBuildNotification, env.get('baseAAR'))
+
+env.AppendUnique(notificationAAR = cmdBuildNotification)
index 50c7205..1ec0f55 100644 (file)
@@ -41,6 +41,11 @@ android {
         versionCode 1
         versionName "1.0"
     }
+    repositories {        
+        flatDir {
+            dirs '../../../../android/android_api/base/build/outputs/aar'
+        }
+    }
     buildTypes {
         release {
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
@@ -64,7 +69,7 @@ android {
 
 dependencies {
     compile fileTree(dir: 'libs', include: ['*.jar'])
-
+    compile ":iotivity-base-${TARGET_ARCH}-${RELEASE}@aar"
     androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.0'
     androidTestCompile 'com.google.dexmaker:dexmaker:1.0'
     androidTestCompile 'org.mockito:mockito-core:1.10.19'
index 4d2f2cd..e0e2407 100755 (executable)
@@ -168,7 +168,7 @@ public class Message
         mTopic = topic;
     }
 
-    public void setExtraInfo(OCRepresentation extraInfo)
+    public void setExtraInfo(OcRepresentation extraInfo)
     {
         mExtraInfo = extraInfo;
     }
index 7dbcb90..61cfe77 100755 (executable)
@@ -15,6 +15,12 @@ LOCAL_SRC_FILES := $(OIC_LIB_PATH)/libnotification_consumer_wrapper.so
 include $(PREBUILT_SHARED_LIBRARY)
 
 include $(CLEAR_VARS)
+OIC_LIB_PATH := $(ROOT_PATH)/android/android_api/base/libs/$(TARGET_ARCH_ABI)
+LOCAL_MODULE := android-ocstack
+LOCAL_SRC_FILES := $(OIC_LIB_PATH)/libocstack-jni.so
+include $(PREBUILT_SHARED_LIBRARY)
+
+include $(CLEAR_VARS)
 LOCAL_MODULE := notification_consumer_jni
 LOCAL_CPPFLAGS := -std=c++0x -frtti -fexceptions
 LOCAL_LDLIBS := -llog
@@ -25,7 +31,8 @@ LOCAL_SHARED_LIBRARIES += oc_logger_core
 LOCAL_SHARED_LIBRARIES += oc_logger
 LOCAL_SHARED_LIBRARIES += octbstack
 LOCAL_SHARED_LIBRARIES += oc
-LOCAL_SHARED_LIBRARIES += ocstack-jni
+LOCAL_SHARED_LIBRARIES += android-ocstack
+LOCAL_SHARED_LIBRARIES += notification_consumer
 LOCAL_SHARED_LIBRARIES += notification_consumer_wrapper
 
 OIC_SRC_DIR := ../../../../../..
@@ -74,7 +81,7 @@ LOCAL_SHARED_LIBRARIES += oc_logger_core
 LOCAL_SHARED_LIBRARIES += oc_logger
 LOCAL_SHARED_LIBRARIES += octbstack
 LOCAL_SHARED_LIBRARIES += oc
-LOCAL_SHARED_LIBRARIES += ocstack-jni
+LOCAL_SHARED_LIBRARIES += android-ocstack
 LOCAL_SHARED_LIBRARIES += notification_provider
 LOCAL_SHARED_LIBRARIES += notification_provider_wrapper