Fix build error with scons-4.4.0 version which is based on python3
[platform/upstream/iotivity.git] / service / notification / android / SConscript
old mode 100644 (file)
new mode 100755 (executable)
index 3b23482..5def5aa
@@ -14,7 +14,7 @@ os.environ['ANDROID_HOME'] = env.get('ANDROID_HOME')
 os.environ['ANDROID_NDK_HOME'] = env.get('ANDROID_NDK')
 
 if not os.path.exists(android_home + '/platforms/android-21') or not os.path.exists(android_home + '/build-tools/20.0.0'):
-    print '''
+    print('''
 ***************************************** Info ********************************
 *   Either 'Android API 21' is not installed or 'Android SDK Build Tools      *
 *   20.0.0' is not installed. The Android SDK Manager will now open. Please   *
@@ -39,17 +39,25 @@ if not os.path.exists(android_home + '/platforms/android-21') or not os.path.exi
 *******************************************************************************
 
 ...Opening Android SDK Manager now. Once you are finished, the build will continue.
-'''
+''')
     os.system(android_home + '/tools/android')
 
 
 def ensure_libs(target, source, env):
-    return target, [source, env.get('BUILD_DIR') + 'liboc.so', env.get('BUILD_DIR') + 'liboc_logger.so']
+    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_wrapper.so']
+
 
 jdk_env = Environment(ENV=os.environ)
 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")
+jdk_env.Clean(cmdBuildNotification, './build')
+Depends(cmdBuildNotification, env.get('baseAAR'))
+
+env.AppendUnique(notificationAAR = cmdBuildNotification)