Update notification sample build. 21/16021/2 notification-service
authorKIM JungYong <jyong2.kim@samsung.com>
Fri, 30 Dec 2016 01:55:11 +0000 (10:55 +0900)
committerUze Choi <uzchoi@samsung.com>
Tue, 3 Jan 2017 08:51:55 +0000 (08:51 +0000)
When building sample of notification,
it has seperated codes for each target_os.
but, tizen, linux, windows has same codes but has different build environment.
So tizen, linux, windows sample application codes was merged
by specified each build environments.

Change-Id: Ia8938dad2b791b4435a144d330693c9a81242447
Signed-off-by: KIM JungYong <jyong2.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/16021
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Chihyun Cho <ch79.cho@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/notification/SConscript
service/notification/cpp-wrapper/consumer/SConscript
service/notification/cpp-wrapper/provider/SConscript
service/notification/examples/SConscript
service/notification/examples/cloud_connector.c [moved from service/notification/examples/linux/cloud_connector.c with 100% similarity]
service/notification/examples/cloud_connector.h [moved from service/notification/examples/linux/cloud_connector.h with 100% similarity]
service/notification/examples/linux/SConscript [deleted file]
service/notification/examples/notificationconsumer.c [moved from service/notification/examples/linux/notificationconsumer.c with 100% similarity]
service/notification/examples/notificationprovider.c [moved from service/notification/examples/linux/notificationprovider.c with 100% similarity]

index 7855076..f0a9479 100755 (executable)
@@ -120,6 +120,8 @@ notification_consumer_src = [
     
 notification_provider_env.UserInstallTargetHeader('include/NSProviderInterface.h',\
     'service/notification', 'NSProviderInterface.h')
+notification_provider_env.UserInstallTargetHeader('include/NSCommon.h',\
+    'service/notification', 'NSCommon.h')
 notification_consumer_env.UserInstallTargetHeader('include/NSConsumerInterface.h',\
     'service/notification', 'NSConsumerInterface.h')
 
@@ -148,9 +150,9 @@ if target_os == 'linux':
 if target_os not in ['windows', 'msys_nt']:
     SConscript('cpp-wrapper/SConscript')
 
-
 if target_os == 'android':
     SConscript('android/SConscript')
+    SConscript('examples/android/SConscript')
 
-# Go to build sample apps
-SConscript('examples/SConscript')
+if target_os not in ['android']:
+    SConscript('examples/SConscript')
index 3a4e7c9..acb8409 100755 (executable)
@@ -54,6 +54,11 @@ notification_env.PrependUnique(LIBS = [
        'oc',
        'notification_consumer'
        ])
+       
+notification_env.UserInstallTargetHeader('inc/NSConsumerService.h',\
+    'service/notification', 'NSProviderService.h')
+notification_env.UserInstallTargetHeader('inc/NSProvider.h',\
+    'service/notification', 'NSConsumer.h')
 
 notification_env.AppendUnique(CXXFLAGS = ['-std=c++0x','-frtti'])
 
@@ -100,6 +105,11 @@ Import('notificationCommonSharedObjs')
 notification_consumer_src = [
        env.Glob('src/*.cpp'),notificationCommonSharedObjs]
 
+notification_env.UserInstallTargetHeader('inc/NSConsumerService.h',\
+    'service/notification', 'NSConsumerService.h')
+notification_env.UserInstallTargetHeader('inc/NSProvider.h',\
+    'service/notification', 'NSProvider.h')
+
 consumersdk = notification_env.SharedLibrary('notification_consumer_wrapper', notification_consumer_src)
 notification_env.InstallTarget(consumersdk, 'libnotification_consumer_wrapper')
 notification_env.UserInstallTargetLib(consumersdk, 'libnotification_consumer_wrapper')
index 5ee5908..8dfdac6 100755 (executable)
@@ -111,6 +111,20 @@ notificationCommonSharedObjs = [
 notification_provider_src = [
        env.Glob('src/*.cpp'),notificationCommonSharedObjs]
 
+notification_env.UserInstallTargetHeader('inc/NSProviderService.h',\
+    'service/notification', 'NSProviderService.h')
+notification_env.UserInstallTargetHeader('inc/NSConsumer.h',\
+    'service/notification', 'NSConsumer.h')
+
+notification_env.UserInstallTargetHeader('../common/NSMediaContents.h',\
+    'service/notification', 'NSMediaContents.h')
+notification_env.UserInstallTargetHeader('../common/NSMessage.h',\
+    'service/notification', 'NSMessage.h')
+notification_env.UserInstallTargetHeader('../common/NSSyncInfo.h',\
+    'service/notification', 'NSSyncInfo.h')
+notification_env.UserInstallTargetHeader('../common/NSTopicsList.h',\
+    'service/notification', 'NSTopicsList.h')
+
 providersdk = notification_env.SharedLibrary('notification_provider_wrapper', notification_provider_src)
 notification_env.InstallTarget(providersdk, 'libnotification_provider_wrapper')
 notification_env.UserInstallTargetLib(providersdk, 'libnotification_provider_wrapper')
index c9d00b9..be01342 100644 (file)
@@ -1,10 +1,93 @@
 ##
-# Examples build script
+# Notification examples build script
 ##
+
 Import('env')
 
+lib_env = env.Clone()
+SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
+notification_sample_env = lib_env.Clone()
+
 target_os = env.get('TARGET_OS')
-if target_os in ['linux', 'windows', 'winrt', 'msys_nt']:
-    SConscript('linux/SConscript')
-elif target_os == 'android':
-    SConscript('android/SConscript')
+######################################################################
+# Build flags
+######################################################################
+notification_sample_env.AppendUnique(CPPPATH = ['../include'])
+notification_sample_env.AppendUnique(CPPPATH = ['../src/common'])
+notification_sample_env.AppendUnique(CPPPATH = ['../../../resource/csdk/stack/include'])
+notification_sample_env.AppendUnique(CPPPATH = ['../../../resource/csdk/resource-directory/include'])
+notification_sample_env.AppendUnique(CPPPATH = ['../../../resource/csdk/connectivity/api'])
+
+notification_sample_env.PrependUnique(LIBS = [
+    'oc_logger',
+    'connectivity_abstraction',
+    'coap'
+    ])
+    
+if target_os not in ['windows', 'winrt']:
+    notification_sample_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
+
+if target_os not in ['darwin', 'ios', 'windows', 'winrt']:
+    notification_sample_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
+
+if target_os in ['linux', 'tizen']:
+    notification_sample_env.AppendUnique(LIBS = ['pthread'])
+
+if target_os == 'android':
+    notification_sample_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
+    notification_sample_env.AppendUnique(LIBS = ['gnustl_shared','log'])
+
+    if not env.get('RELEASE'):
+        notification_sample_env.AppendUnique(LIBS = ['log'])
+        
+if target_os in ['windows', 'winrt']:
+    notification_sample_env.AppendUnique(CPPDEFINES = ['SYSTEM_WINDOWS'])
+    notification_sample_env.PrependUnique(LIBS = ['mswsock', 'ws2_32', 'iphlpapi', 'ole32', 'bcrypt', 'Crypt32'])
+    notification_sample_env.PrependUnique(LIBS = ['octbstack_static', 'ocsrm'])
+else:
+    notification_sample_env.PrependUnique(LIBS = ['octbstack'])
+
+if env.get('WITH_CLOUD') == True:
+    notification_sample_env.AppendUnique(CPPDEFINES = ['WITH_CLOUD'])
+
+    cloudConnectorObj = notification_sample_env.Object('cloud_connector.c')
+
+    notification_sample_consumer_src = ['notificationconsumer.c', cloudConnectorObj]
+    notification_sample_provider_src = ['notificationprovider.c', cloudConnectorObj]
+else:
+    notification_sample_consumer_src = 'notificationconsumer.c'
+    notification_sample_provider_src = 'notificationprovider.c'
+
+if env.get('WITH_TCP') == True:
+    notification_sample_env.AppendUnique(CPPDEFINES = ['WITH_TCP'])
+if env.get('SECURED') == '1':
+    notification_sample_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+
+with_mq = env.get('WITH_MQ')
+if 'SUB' in with_mq:
+    notification_sample_env.AppendUnique(CPPDEFINES = ['MQ_SUBSCRIBER', 'WITH_MQ'])
+    print "MQ SUB support"
+
+if 'PUB' in with_mq:
+    notification_sample_env.AppendUnique(CPPDEFINES = ['MQ_PUBLISHER', 'WITH_MQ'])
+    print "MQ PUB support"
+
+if 'BROKER' in with_mq:
+    notification_sample_env.AppendUnique(CPPDEFINES = ['MQ_BROKER', 'WITH_MQ'])
+    print "MQ Broker support"
+
+####################################################################
+# Source files and Targets
+######################################################################
+notification_sample_provider_env = notification_sample_env.Clone()
+notification_sample_provider_env.AppendUnique(LIBS = 'notification_provider')
+notificationprovider = notification_sample_provider_env.Program('notificationprovider', notification_sample_provider_src)
+i_notificationprovider = notification_sample_provider_env.Install(env.get('BUILD_DIR'), notificationprovider)
+
+notification_sample_consumer_env = notification_sample_env.Clone()
+notification_sample_consumer_env.AppendUnique(LIBS = 'notification_consumer')
+notificationconsumer = notification_sample_consumer_env.Program('notificationconsumer', notification_sample_consumer_src)
+i_notificationprovider = notification_sample_consumer_env.Install(env.get('BUILD_DIR'), notificationconsumer)
+
+if env.get('WITH_CLOUD') == True:
+        Export('cloudConnectorObj')
diff --git a/service/notification/examples/linux/SConscript b/service/notification/examples/linux/SConscript
deleted file mode 100644 (file)
index 2df59a0..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-##
-# Notification build script
-##
-
-Import('env')
-
-lib_env = env.Clone()
-SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
-notification_sample_env = lib_env.Clone()
-
-target_os = env.get('TARGET_OS')
-######################################################################
-# Build flags
-######################################################################
-notification_sample_env.AppendUnique(CPPPATH = ['../../include'])
-notification_sample_env.AppendUnique(CPPPATH = ['../../src/common'])
-notification_sample_env.AppendUnique(CPPPATH = ['../../src/provider'])
-notification_sample_env.AppendUnique(CPPPATH = ['../../../../resource/csdk/stack/include'])
-notification_sample_env.AppendUnique(CPPPATH = ['../../../../resource/csdk/resource-directory/include'])
-notification_sample_env.AppendUnique(CPPPATH = ['../../../../resource/csdk/connectivity/api'])
-
-notification_sample_env.PrependUnique(LIBS = [
-    'oc_logger',
-    'connectivity_abstraction',
-    'coap'
-    ])
-    
-if target_os not in ['windows', 'winrt']:
-    notification_sample_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
-
-if target_os not in ['darwin', 'ios', 'windows', 'winrt']:
-    notification_sample_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
-
-if target_os == 'linux':
-    notification_sample_env.AppendUnique(LIBS = ['pthread'])
-
-if target_os == 'android':
-    notification_sample_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
-    notification_sample_env.AppendUnique(LIBS = ['gnustl_shared','log'])
-
-    if not env.get('RELEASE'):
-        notification_sample_env.AppendUnique(LIBS = ['log'])
-        
-if target_os in ['windows', 'winrt']:
-    notification_sample_env.AppendUnique(CPPDEFINES = ['SYSTEM_WINDOWS'])
-    notification_sample_env.PrependUnique(LIBS = ['mswsock', 'ws2_32', 'iphlpapi', 'ole32', 'bcrypt', 'Crypt32'])
-    notification_sample_env.PrependUnique(LIBS = ['octbstack_static', 'ocsrm'])
-else:
-    notification_sample_env.PrependUnique(LIBS = ['octbstack'])
-
-if env.get('WITH_CLOUD') == True:
-    notification_sample_env.AppendUnique(CPPPATH = ['../../src/consumer'])
-    notification_sample_env.AppendUnique(CPPPATH = ['../../src/provider'])
-    notification_sample_env.AppendUnique(CPPDEFINES = ['WITH_CLOUD'])
-
-    cloudConnectorObj = notification_sample_env.Object('cloud_connector.c')
-
-    notification_sample_consumer_src = ['notificationconsumer.c', cloudConnectorObj]
-    notification_sample_provider_src = ['notificationprovider.c', cloudConnectorObj]
-else:
-    notification_sample_consumer_src = 'notificationconsumer.c'
-    notification_sample_provider_src = 'notificationprovider.c'
-
-if env.get('WITH_TCP') == True:
-    notification_sample_env.AppendUnique(CPPDEFINES = ['WITH_TCP'])
-if env.get('SECURED') == '1':
-    notification_sample_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
-
-with_mq = env.get('WITH_MQ')
-if 'SUB' in with_mq:
-    notification_sample_env.AppendUnique(CPPDEFINES = ['MQ_SUBSCRIBER', 'WITH_MQ'])
-    print "MQ SUB support"
-
-if 'PUB' in with_mq:
-    notification_sample_env.AppendUnique(CPPDEFINES = ['MQ_PUBLISHER', 'WITH_MQ'])
-    print "MQ PUB support"
-
-if 'BROKER' in with_mq:
-    notification_sample_env.AppendUnique(CPPDEFINES = ['MQ_BROKER', 'WITH_MQ'])
-    print "MQ Broker support"
-
-####################################################################
-# Source files and Targets
-######################################################################
-notification_sample_provider_env = notification_sample_env.Clone()
-notification_sample_provider_env.AppendUnique(LIBS = 'notification_provider')
-notificationprovider = notification_sample_provider_env.Program('notificationprovider', notification_sample_provider_src)
-i_notificationprovider = notification_sample_provider_env.Install(env.get('BUILD_DIR'), notificationprovider)
-
-notification_sample_consumer_env = notification_sample_env.Clone()
-notification_sample_consumer_env.AppendUnique(LIBS = 'notification_consumer')
-notificationconsumer = notification_sample_consumer_env.Program('notificationconsumer', notification_sample_consumer_src)
-i_notificationprovider = notification_sample_consumer_env.Install(env.get('BUILD_DIR'), notificationconsumer)
-
-if env.get('WITH_CLOUD') == True:
-        Export('cloudConnectorObj')