target_os = env.get('TARGET_OS')
-if target_os not in ['arduino','darwin', 'windows']:
+if target_os not in ['arduino', 'darwin', 'windows']:
# Build resource-encapsulation project
SConscript('resource-encapsulation/SConscript')
SConscript('scene-manager/SConscript')
# Build notification-service project
- if target_os in ['linux','android','tizen','ios']:
+ if target_os in ['linux', 'android', 'tizen', 'ios']:
SConscript('notification/SConscript')
# Build simulator module
SConscript('coap-http-proxy/SConscript')
# Build EasySetup module
-if target_os in ['arduino', 'android', 'ios', 'linux','tizen']:
+if target_os in ['arduino', 'android', 'ios', 'linux', 'tizen']:
SConscript('easy-setup/SConscript')
local_env = env.Clone()
if local_env.get('LOGGING'):
- local_env.AppendUnique(CPPDEFINES = ['-DTB_LOG'])
+ local_env.AppendUnique(CPPDEFINES=['-DTB_LOG'])
if env.get('RELEASE'):
- local_env.AppendUnique(CCFLAGS = ['-Os'])
- local_env.AppendUnique(CPPDEFINES = ['NDEBUG'])
+ local_env.AppendUnique(CCFLAGS=['-Os'])
+ local_env.AppendUnique(CPPDEFINES=['NDEBUG'])
else:
- local_env.AppendUnique(CCFLAGS = ['-g'])
+ local_env.AppendUnique(CCFLAGS=['-g'])
target_os = env.get('TARGET_OS')
src_dir = env.get('SRC_DIR')
######################################################################
# Build flags
######################################################################
-local_env.AppendUnique(CPPPATH = ['include',
- os.path.join(src_dir, 'resource/csdk/include'),
- os.path.join(src_dir, 'resource/csdk/stack/include'),
- os.path.join(src_dir, 'resource/csdk/connectivity/common/inc/'),
- os.path.join(src_dir, 'resource/csdk/security/include'),
- os.path.join(src_dir, 'extlibs/cjson'),
- ])
+local_env.AppendUnique(CPPPATH=[
+ 'include',
+ os.path.join(src_dir, 'resource/csdk/include'),
+ os.path.join(src_dir, 'resource/csdk/stack/include'),
+ os.path.join(src_dir, 'resource/csdk/connectivity/common/inc/'),
+ os.path.join(src_dir, 'resource/csdk/security/include'),
+ os.path.join(src_dir, 'extlibs/cjson'),
+])
with_upstream_libcoap = local_env.get('WITH_UPSTREAM_LIBCOAP')
if with_upstream_libcoap == '1':
- local_env.AppendUnique(CPPPATH = ['#extlibs/libcoap/libcoap/include'])
+ local_env.AppendUnique(CPPPATH=['#/extlibs/libcoap/libcoap/include'])
else:
- local_env.AppendUnique(CPPPATH = ['#resource/csdk/connectivity/lib/libcoap-4.1.1/include'])
-
-local_env.PrependUnique(LIBS = ['cjson', 'oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'coap'])
+ local_env.AppendUnique(
+ CPPPATH=['#/resource/csdk/connectivity/lib/libcoap-4.1.1/include'])
+
+local_env.PrependUnique(LIBS=[
+ 'cjson',
+ 'oc',
+ 'octbstack',
+ 'oc_logger',
+ 'connectivity_abstraction',
+ 'coap',
+])
if target_os not in ['windows']:
- local_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-Wextra'])
+ local_env.AppendUnique(CXXFLAGS=['-O2', '-g', '-Wall', '-Wextra'])
if target_os in ['linux', 'tizen']:
- local_env.AppendUnique(LIBS = ['pthread', 'curl', 'm'])
+ local_env.AppendUnique(LIBS=['pthread', 'curl', 'm'])
if target_os == 'android':
- local_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
- local_env.AppendUnique(LIBS = ['gnustl_static'])
+ local_env.AppendUnique(CXXFLAGS=['-frtti', '-fexceptions'])
+ local_env.AppendUnique(LIBS=['gnustl_static'])
if not env.get('RELEASE'):
- local_env.AppendUnique(LIBS = ['log'])
+ local_env.AppendUnique(LIBS=['log'])
######################################################################
# Source files and Targets
######################################################################
# Link with gcov if building in debug mode
if target_os in ['linux']:
if not env.get('RELEASE'):
- local_env.PrependUnique(LIBS = ['gcov'])
- local_env.AppendUnique(CXXFLAGS = ['--coverage'])
- local_env.AppendUnique(CFLAGS = ['--coverage'])
+ local_env.PrependUnique(LIBS=['gcov'])
+ local_env.AppendUnique(CXXFLAGS=['--coverage'])
+ local_env.AppendUnique(CFLAGS=['--coverage'])
proxy_src = [
- './src/CoapHttpHandler.c',
- './src/CoapHttpMap.c',
- './src/CoapHttpParser.c',
+ './src/CoapHttpHandler.c',
+ './src/CoapHttpMap.c',
+ './src/CoapHttpParser.c',
]
-if target_os in ['tizen'] :
+if target_os in ['tizen']:
proxysdk = local_env.SharedLibrary('coap_http_proxy', proxy_src)
-else :
+else:
proxysdk = local_env.StaticLibrary('coap_http_proxy', proxy_src)
local_env.InstallTarget(proxysdk, 'coap_http_proxy')
local_env.UserInstallTargetLib(proxysdk, 'coap_http_proxy')
-local_env.UserInstallTargetHeader('include/CoapHttpHandler.h', 'service/coap-http-proxy', 'CoapHttpHandler.h')
-
+local_env.UserInstallTargetHeader(
+ 'include/CoapHttpHandler.h', 'service/coap-http-proxy', 'CoapHttpHandler.h')
######################################################################
# Samples for the proxy
######################################################################
# Build flags
######################################################################
-proxy_sample_app_env.AppendUnique(CPPPATH = ['../include'])
+proxy_sample_app_env.AppendUnique(CPPPATH=['../include'])
if target_os not in ['windows']:
- proxy_sample_app_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-Wextra', '-std=c++0x'])
+ proxy_sample_app_env.AppendUnique(
+ CXXFLAGS=['-O2', '-g', '-Wall', '-Wextra', '-std=c++0x'])
else:
- proxy_sample_app_env.PrependUnique(LIBS = ['m'])
+ proxy_sample_app_env.PrependUnique(LIBS=['m'])
if target_os in ['linux']:
if not env.get('RELEASE'):
- proxy_sample_app_env.PrependUnique(LIBS = ['gcov'])
+ proxy_sample_app_env.PrependUnique(LIBS=['gcov'])
-proxy_sample_app_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
-proxy_sample_app_env.AppendUnique(RPATH = [env.get('BUILD_DIR')])
-proxy_sample_app_env.PrependUnique(LIBS = ['coap_http_proxy', 'oc', 'octbstack', 'curl', 'connectivity_abstraction', 'cjson', 'm'])
-proxy_sample_app_env.AppendUnique(CPPPATH = ['#resource/csdk/security/include'])
+proxy_sample_app_env.AppendUnique(LIBPATH=[env.get('BUILD_DIR')])
+proxy_sample_app_env.AppendUnique(RPATH=[env.get('BUILD_DIR')])
+proxy_sample_app_env.PrependUnique(LIBS=[
+ 'coap_http_proxy',
+ 'oc',
+ 'octbstack',
+ 'curl',
+ 'connectivity_abstraction',
+ 'cjson',
+ 'm'
+])
+proxy_sample_app_env.AppendUnique(CPPPATH=['#/resource/csdk/security/include'])
if env.get('SECURED') == '1':
- proxy_sample_app_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+ proxy_sample_app_env.AppendUnique(
+ LIBS=['mbedtls', 'mbedx509', 'mbedcrypto'])
####################################################################
# Source files and Targets
env.AppendTarget('coap_http_proxy')
if env.get('SECURED') == '1':
- proxy_sample_src_dir = proxy_sample_app_env.get('SRC_DIR') + '/service/coap-http-proxy/samples/'
- proxy_sample_build_dir = proxy_sample_app_env.get('BUILD_DIR') +'/service/coap-http-proxy/samples'
- proxy_sample_app_env.Alias("install", proxy_sample_app_env.Install( proxy_sample_build_dir,
- proxy_sample_src_dir + 'oic_svr_db_server.dat'))
- proxy_sample_app_env.Alias("install", proxy_sample_app_env.Install( proxy_sample_build_dir,
- proxy_sample_src_dir + 'oic_svr_db_client_devowner.dat'))
\ No newline at end of file
+ proxy_sample_src_dir = proxy_sample_app_env.get(
+ 'SRC_DIR') + '/service/coap-http-proxy/samples/'
+ proxy_sample_build_dir = proxy_sample_app_env.get(
+ 'BUILD_DIR') + '/service/coap-http-proxy/samples'
+ proxy_sample_app_env.Alias(
+ "install",
+ proxy_sample_app_env.Install(
+ proxy_sample_build_dir,
+ proxy_sample_src_dir + 'oic_svr_db_server.dat'))
+ proxy_sample_app_env.Alias(
+ "install",
+ proxy_sample_app_env.Install(
+ proxy_sample_build_dir,
+ proxy_sample_src_dir + 'oic_svr_db_client_devowner.dat'))
import os
import os.path
+from tools.scons.RunTest import run_test
##
# CoAP-HTTP Proxy Unit Test build script
CoAP_test_env = gtest_env.Clone()
if CoAP_test_env.get('RELEASE'):
- CoAP_test_env.AppendUnique(CCFLAGS = ['-Os'])
- CoAP_test_env.AppendUnique(CPPDEFINES = ['NDEBUG'])
+ CoAP_test_env.AppendUnique(CCFLAGS=['-Os'])
+ CoAP_test_env.AppendUnique(CPPDEFINES=['NDEBUG'])
else:
- CoAP_test_env.AppendUnique(CCFLAGS = ['-g'])
+ CoAP_test_env.AppendUnique(CCFLAGS=['-g'])
if CoAP_test_env.get('LOGGING'):
- CoAP_test_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
+ CoAP_test_env.AppendUnique(CPPDEFINES=['TB_LOG'])
#SConscript('#service/third_party_libs.scons', 'lib_env')
# Build flags 'coap_http_proxy','oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'coap', 'cjson'])
######################################################################
-CoAP_test_env.AppendUnique(LIBPATH = [CoAP_test_env.get('BUILD_DIR')])
-CoAP_test_env.AppendUnique(LIBS = ['coap_http_proxy', 'octbstack', 'connectivity_abstraction', 'coap', 'cjson'])
+CoAP_test_env.AppendUnique(LIBPATH=[CoAP_test_env.get('BUILD_DIR')])
+CoAP_test_env.AppendUnique(LIBS=[
+ 'coap_http_proxy',
+ 'octbstack',
+ 'connectivity_abstraction',
+ 'coap',
+ 'cjson',
+])
if target_os not in ['windows']:
- CoAP_test_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0'])
+ CoAP_test_env.AppendUnique(
+ CXXFLAGS=['-O2', '-g', '-Wall', '-fmessage-length=0'])
if not CoAP_test_env.get('RELEASE'):
- CoAP_test_env.PrependUnique(LIBS = ['gcov'])
- CoAP_test_env.AppendUnique(CXXFLAGS = ['--coverage'])
-
-CoAP_test_env.AppendUnique(CPPPATH = ['#/extlibs/hippomocks/hippomocks',
- '../include',
- '#/resource/csdk/include',
- '#/resource/csdk/stack/include',
- '#/resource/csdk/connectivity/common/inc/',
- '#/resource/csdk/connectivity/lib/libcoap-4.1.1',
- '#/extlibs/cjson',
- ])
+ CoAP_test_env.PrependUnique(LIBS=['gcov'])
+ CoAP_test_env.AppendUnique(CXXFLAGS=['--coverage'])
+
+CoAP_test_env.AppendUnique(CPPPATH=[
+ '#/extlibs/hippomocks/hippomocks',
+ '../include',
+ '#/resource/csdk/include',
+ '#/resource/csdk/stack/include',
+ '#/resource/csdk/connectivity/common/inc/',
+ '#/resource/csdk/connectivity/lib/libcoap-4.1.1',
+ '#/extlibs/cjson',
+])
if CoAP_test_env.get('SECURED') == '1':
- CoAP_test_env.AppendUnique(CPPPATH = ['#/resource/csdk/security/include/'])
+ CoAP_test_env.AppendUnique(CPPPATH=['#/resource/csdk/security/include/'])
with_upstream_libcoap = CoAP_test_env.get('WITH_UPSTREAM_LIBCOAP')
if with_upstream_libcoap == '1':
- CoAP_test_env.AppendUnique(CPPPATH = ['#/extlibs/libcoap/libcoap/include'])
+ CoAP_test_env.AppendUnique(CPPPATH=['#/extlibs/libcoap/libcoap/include'])
else:
- CoAP_test_env.AppendUnique(CPPPATH = ['#/resource/csdk/connectivity/lib/libcoap-4.1.1/include'])
+ CoAP_test_env.AppendUnique(
+ CPPPATH=['#/resource/csdk/connectivity/lib/libcoap-4.1.1/include'])
#CoAP_test_env.AppendUnique(CPPPATH = ['#/service/resource-encapsulation/include'])
#CoAP_test_env.AppendUnique(CPPPATH = ['../../resource-encapsulation/src/common/primitiveResource/include'])
-CoAP_test_env.AppendUnique(CPPPATH = ['#/service/resource-encapsulation/src/common/utils/include'])
+CoAP_test_env.AppendUnique(
+ CPPPATH=['#/service/resource-encapsulation/src/common/utils/include'])
if target_os in ['linux']:
- CoAP_test_env.AppendUnique(LIBS = ['pthread', 'curl'])
+ CoAP_test_env.AppendUnique(LIBS=['pthread', 'curl'])
if CoAP_test_env.get('SECURED') == '1':
- CoAP_test_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto',])
+ CoAP_test_env.AppendUnique(LIBS=[
+ 'mbedtls',
+ 'mbedx509',
+ 'mbedcrypto',
+ ])
######################################################################
# Build Test
######################################################################
if CoAP_test_env.get('TEST') == '1':
if target_os in ['linux']:
- from tools.scons.RunTest import run_test
- run_test(CoAP_test_env,
- '',
+ run_test(CoAP_test_env, '',
'service/coap-http-proxy/unittests/CoAP_unit_test',
CoAP_unit_test)
######################################################################
Import('env')
-es_target = env.get ('TARGET_OS')
+es_target = env.get('TARGET_OS')
service_easy_setup_env = env.Clone()
if es_target in ['android', 'ios', 'linux', 'tizen']:
SConscript('enrollee/SConscript')
if es_target in ['android', 'linux', 'tizen']:
- service_easy_setup_env.UserInstallTargetHeader('inc/escommon.h', 'service/easy-setup', 'escommon.h')
+ service_easy_setup_env.UserInstallTargetHeader(
+ 'inc/escommon.h', 'service/easy-setup', 'escommon.h')
target_os = enrollee_env.get('TARGET_OS')
if enrollee_env.get('RELEASE'):
- enrollee_env.AppendUnique(CCFLAGS = ['-Os'])
- enrollee_env.AppendUnique(CPPDEFINES = ['NDEBUG'])
+ enrollee_env.AppendUnique(CCFLAGS=['-Os'])
+ enrollee_env.AppendUnique(CPPDEFINES=['NDEBUG'])
else:
- enrollee_env.AppendUnique(CCFLAGS = ['-g'])
+ enrollee_env.AppendUnique(CCFLAGS=['-g'])
if enrollee_env.get('LOGGING'):
- enrollee_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
+ enrollee_env.AppendUnique(CPPDEFINES=['TB_LOG'])
######################################################################
# Build flags
######################################################################
-enrollee_env.PrependUnique(CPPPATH = [
- '#/resource/c_common/oic_malloc/include',
- '#/resource/include',
- '#/resource/csdk/logger/include',
- '#/resource/oc_logger/include',
- '#/resource/csdk/include',
- '#/resource/csdk/stack/include',
- '#/resource/csdk/logger/include',
- '#/resource/csdk/security/include',
- '#/resource/csdk/connectivity/api',
- '#/extlibs/cjson',
- '#/service/easy-setup/inc',
- '#/service/easy-setup/enrollee/inc',
- '#/service/easy-setup/enrollee/src'])
+enrollee_env.PrependUnique(CPPPATH=[
+ '#/resource/c_common/oic_malloc/include',
+ '#/resource/include',
+ '#/resource/csdk/logger/include',
+ '#/resource/oc_logger/include',
+ '#/resource/csdk/include',
+ '#/resource/csdk/stack/include',
+ '#/resource/csdk/logger/include',
+ '#/resource/csdk/security/include',
+ '#/resource/csdk/connectivity/api',
+ '#/extlibs/cjson',
+ '#/service/easy-setup/inc',
+ '#/service/easy-setup/enrollee/inc',
+ '#/service/easy-setup/enrollee/src'
+])
if target_os not in ['linux', 'tizen']:
- enrollee_env.PrependUnique(CPPPATH = [
- '#extlibs/sqlite3'])
+ enrollee_env.PrependUnique(CPPPATH=['#extlibs/sqlite3'])
if enrollee_env.get('SECURED') == '1':
- enrollee_env.AppendUnique(CPPPATH = [
+ enrollee_env.AppendUnique(CPPPATH=[
'#/resource/csdk/security/provisioning/include',
'#/resource/csdk/security/provisioning/include/internal',
- '#/resource/csdk/security/provisioning/include/oxm'])
- enrollee_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+ '#/resource/csdk/security/provisioning/include/oxm'
+ ])
+ enrollee_env.AppendUnique(LIBS=['mbedtls', 'mbedx509', 'mbedcrypto'])
if target_os not in ['windows']:
- enrollee_env.AppendUnique(CXXFLAGS = ['-Wall', '-std=c++0x'])
+ enrollee_env.AppendUnique(CXXFLAGS=['-Wall', '-std=c++0x'])
if not env.get('RELEASE'):
- enrollee_env.PrependUnique(LIBS = ['gcov'])
- enrollee_env.AppendUnique(CCFLAGS = ['--coverage'])
+ enrollee_env.PrependUnique(LIBS=['gcov'])
+ enrollee_env.AppendUnique(CCFLAGS=['--coverage'])
######################################################################
# Linux Enrollee
######################################################################
if target_os in ['linux']:
- enrollee_env.AppendUnique(LIBS = ['pthread', 'dl'])
- enrollee_env.AppendUnique(LIBPATH = [enrollee_env.get('BUILD_DIR')])
- enrollee_env.AppendUnique(RPATH = [enrollee_env.get('BUILD_DIR')])
- enrollee_env.AppendUnique(CXXFLAGS = ['-pthread'])
- enrollee_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'pthread', 'connectivity_abstraction'])
+ enrollee_env.AppendUnique(LIBS=['pthread', 'dl'])
+ enrollee_env.AppendUnique(LIBPATH=[enrollee_env.get('BUILD_DIR')])
+ enrollee_env.AppendUnique(RPATH=[enrollee_env.get('BUILD_DIR')])
+ enrollee_env.AppendUnique(CXXFLAGS=['-pthread'])
+ enrollee_env.PrependUnique(LIBS=[
+ 'oc',
+ 'octbstack',
+ 'oc_logger',
+ 'pthread',
+ 'connectivity_abstraction',
+ ])
if enrollee_env.get('SECURED') == '1':
- enrollee_env.PrependUnique(LIBS = ['ocprovision', 'ocpmapi'])
+ enrollee_env.PrependUnique(LIBS=['ocprovision', 'ocpmapi'])
######################################################################
# Tizen Enrollee
######################################################################
if target_os == 'tizen':
- enrollee_env.AppendUnique(LIBPATH = [enrollee_env.get('BUILD_DIR')])
- enrollee_env.AppendUnique(RPATH = [enrollee_env.get('BUILD_DIR')])
- enrollee_env.AppendUnique(CXXFLAGS = ['-pthread'])
- enrollee_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'pthread', 'connectivity_abstraction'])
+ enrollee_env.AppendUnique(LIBPATH=[enrollee_env.get('BUILD_DIR')])
+ enrollee_env.AppendUnique(RPATH=[enrollee_env.get('BUILD_DIR')])
+ enrollee_env.AppendUnique(CXXFLAGS=['-pthread'])
+ enrollee_env.PrependUnique(LIBS=[
+ 'oc',
+ 'octbstack',
+ 'oc_logger',
+ 'pthread',
+ 'connectivity_abstraction',
+ ])
######################################################################
# Arduino Enrollee
######################################################################
if target_os == 'arduino':
- enrollee_env.AppendUnique(LIBPATH = [enrollee_env.get('BUILD_DIR')])
- enrollee_env.AppendUnique(RPATH = [enrollee_env.get('BUILD_DIR')])
- enrollee_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'pthread', 'connectivity_abstraction'])
+ enrollee_env.AppendUnique(LIBPATH=[enrollee_env.get('BUILD_DIR')])
+ enrollee_env.AppendUnique(RPATH=[enrollee_env.get('BUILD_DIR')])
+ enrollee_env.PrependUnique(LIBS=[
+ 'oc',
+ 'octbstack',
+ 'oc_logger',
+ 'pthread',
+ 'connectivity_abstraction',
+ ])
######################################################################
# Source files and Targets
es_enrollee_src = None
if target_os in ['linux', 'tizen']:
- es_enrollee_common_src = ['./src/easysetup.c','./src/resourcehandler.c']
- enrollee_sdk_shared = enrollee_env.SharedLibrary('ESEnrolleeSDK', es_enrollee_common_src)
- enrollee_sdk_static = enrollee_env.StaticLibrary('ESEnrolleeSDK', es_enrollee_common_src)
- enrollee_env.InstallTarget([enrollee_sdk_shared, enrollee_sdk_static], 'libESEnrollee')
- enrollee_env.UserInstallTargetLib([enrollee_sdk_shared, enrollee_sdk_static], 'libESEnrollee')
- enrollee_env.UserInstallTargetHeader('inc/ESEnrolleeCommon.h', 'service/easy-setup', 'ESEnrolleeCommon.h')
- enrollee_env.UserInstallTargetHeader('inc/easysetup.h', 'service/easy-setup', 'easysetup.h')
+ es_enrollee_common_src = ['./src/easysetup.c', './src/resourcehandler.c']
+ enrollee_sdk_shared = enrollee_env.SharedLibrary('ESEnrolleeSDK',
+ es_enrollee_common_src)
+ enrollee_sdk_static = enrollee_env.StaticLibrary('ESEnrolleeSDK',
+ es_enrollee_common_src)
+ enrollee_env.InstallTarget([enrollee_sdk_shared, enrollee_sdk_static],
+ 'libESEnrollee')
+ enrollee_env.UserInstallTargetLib(
+ [enrollee_sdk_shared, enrollee_sdk_static], 'libESEnrollee')
+ enrollee_env.UserInstallTargetHeader(
+ 'inc/ESEnrolleeCommon.h', 'service/easy-setup', 'ESEnrolleeCommon.h')
+ enrollee_env.UserInstallTargetHeader('inc/easysetup.h',
+ 'service/easy-setup', 'easysetup.h')
if target_os == 'arduino':
- es_enrollee_common_src = ['./src/easysetup.c','./src/resourcehandler.c']
- enrollee_sdk_static = enrollee_env.StaticLibrary('ESEnrolleeSDK', es_enrollee_common_src)
+ es_enrollee_common_src = ['./src/easysetup.c', './src/resourcehandler.c']
+ enrollee_sdk_static = enrollee_env.StaticLibrary('ESEnrolleeSDK',
+ es_enrollee_common_src)
enrollee_env.InstallTarget(enrollee_sdk_static, 'libESEnrolleeSDK')
enrollee_env.UserInstallTargetLib(enrollee_sdk_static, 'libESEnrollee')
#Build UnitTestcases for Enrollee
if enrollee_env.get('SECURED') == '0':
SConscript('../enrollee/unittests/SConscript')
-
# Notification Unit Test build script
##
-from tools.scons.RunTest import run_test;
+from tools.scons.RunTest import run_test
+
Import('env')
if env.get('RELEASE'):
- env.AppendUnique(CCFLAGS = ['-Os'])
- env.AppendUnique(CPPDEFINES = ['NDEBUG'])
+ env.AppendUnique(CCFLAGS=['-Os'])
+ env.AppendUnique(CPPDEFINES=['NDEBUG'])
else:
- env.AppendUnique(CCFLAGS = ['-g'])
+ env.AppendUnique(CCFLAGS=['-g'])
if env.get('LOGGING'):
- env.AppendUnique(CPPDEFINES = ['TB_LOG'])
+ env.AppendUnique(CPPDEFINES=['TB_LOG'])
lib_env = SConscript('#extlibs/gtest/SConscript')
rd_mode = env.get('RD_MODE')
######################################################################
# Build flags
######################################################################
-easysetup_test_env.AppendUnique(LIBPATH = [lib_env.get('BUILD_DIR')])
-easysetup_test_env.PrependUnique(LIBS = [
- 'connectivity_abstraction', 'oc', 'octbstack', 'oc_logger', 'coap',
+easysetup_test_env.AppendUnique(LIBPATH=[lib_env.get('BUILD_DIR')])
+easysetup_test_env.PrependUnique(LIBS=[
+ 'connectivity_abstraction',
+ 'oc',
+ 'octbstack',
+ 'oc_logger',
+ 'coap',
])
if target_os not in ['windows', 'winrt']:
- easysetup_test_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
+ easysetup_test_env.AppendUnique(
+ CXXFLAGS=['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
-easysetup_test_env.AppendUnique(CXXFLAGS = ['-pthread'])
-easysetup_test_env.AppendUnique(LIBS = ['pthread'])
+easysetup_test_env.AppendUnique(CXXFLAGS=['-pthread'])
+easysetup_test_env.AppendUnique(LIBS=['pthread'])
-easysetup_test_env.PrependUnique(CPPPATH = [
+easysetup_test_env.PrependUnique(CPPPATH=[
'#/extlibs/hippomocks/hippomocks',
'#/resource/include',
'#/resource/csdk/connectivity/api',
])
if easysetup_test_env.get('SECURED') == '1':
- easysetup_test_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+ easysetup_test_env.AppendUnique(LIBS=['mbedtls', 'mbedx509', 'mbedcrypto'])
######################################################################
# Build Test
######################################################################
easysetup_enrollee_test_env = easysetup_test_env.Clone()
-easysetup_enrollee_test_env.AppendUnique(LIBS = ['ESEnrolleeSDK', 'ESMediatorRich'])
+easysetup_enrollee_test_env.AppendUnique(
+ LIBS=['ESEnrolleeSDK', 'ESMediatorRich'])
easysetup_enrollee_test_src = env.Glob('./ESEnrolleeTest.cpp')
-easysetup_enrollee_test = easysetup_enrollee_test_env.Program('easysetup_enrollee_test', easysetup_enrollee_test_src)
+easysetup_enrollee_test = easysetup_enrollee_test_env.Program(
+ 'easysetup_enrollee_test', easysetup_enrollee_test_src)
Alias("easysetup_enrollee_test", easysetup_enrollee_test)
env.AppendTarget('easysetup_enrollee_test')
if env.get('TEST') == '1':
if target_os in ['linux'] and env.get('SECURED') != '1':
- from tools.scons.RunTest import run_test
- run_test(easysetup_enrollee_test_env,
-# temporary blocking until valigrind error resolved in /resource layer
-# 'service_easy-setup_enrollee_unittests_easysetup_enrollee_test.memcheck',
- '',
- 'service/easy-setup/enrollee/unittests/easysetup_enrollee_test',
- easysetup_enrollee_test)
+ run_test(
+ easysetup_enrollee_test_env,
+ # 'service_easy-setup_enrollee_unittests_easysetup_enrollee_test.memcheck',
+ '', # TODO enable previous line when valigrind error resolved in resource layer
+ 'service/easy-setup/enrollee/unittests/easysetup_enrollee_test',
+ easysetup_enrollee_test)
# Build easy-setup Mediator Rich [C++] SDK
SConscript('richsdk/SConscript')
-
-
easysetup_path = os.curdir
if env.get('RELEASE'):
- env.AppendUnique(CCFLAGS = ['-Os'])
- env.AppendUnique(CPPDEFINES = ['NDEBUG'])
+ env.AppendUnique(CCFLAGS=['-Os'])
+ env.AppendUnique(CPPDEFINES=['NDEBUG'])
else:
- env.AppendUnique(CCFLAGS = ['-g'])
+ env.AppendUnique(CCFLAGS=['-g'])
if env.get('LOGGING'):
- env.AppendUnique(CPPDEFINES = ['TB_LOG'])
+ env.AppendUnique(CPPDEFINES=['TB_LOG'])
# Easysetup provides reference implemenation of Arduino Enrollee.
# Mediator applications developed on different platforms will be default defining the
##### The following lines must be uncommented, if target Enrollee is not Arduino
target_enrollee = env.get('ES_TARGET_ENROLLEE')
if target_enrollee == 'arduino':
- print "REMOTE_ARDUINO_ENROLEE flag is defined."
- print "The Mediator application will be working only with Arduino Enrollee."
- env.AppendUnique(CPPDEFINES = ['REMOTE_ARDUINO_ENROLEE'])
+ print "REMOTE_ARDUINO_ENROLEE flag is defined."
+ print "The Mediator application will be working only with Arduino Enrollee."
+ env.AppendUnique(CPPDEFINES=['REMOTE_ARDUINO_ENROLEE'])
# Add third party libraries
lib_env = env.Clone()
######################################################################
# Build flags
######################################################################
-easy_setup_env.AppendUnique(CPPPATH = [
+easy_setup_env.AppendUnique(CPPPATH=[
'inc',
'src',
'../../inc',
'#/resource/csdk/include',
'#/resource/csdk/stack/include',
'#/resource/oc_logger/include'
- ])
+])
if target_os not in ['windows']:
- easy_setup_env.AppendUnique(CXXFLAGS = ['-Wall', '-std=c++0x'])
+ easy_setup_env.AppendUnique(CXXFLAGS=['-Wall', '-std=c++0x'])
-if target_os in ['linux','tizen']:
- easy_setup_env.AppendUnique(LIBS = ['pthread', 'dl', 'coap'])
+if target_os in ['linux', 'tizen']:
+ easy_setup_env.AppendUnique(LIBS=['pthread', 'dl', 'coap'])
if target_os in ['android']:
- easy_setup_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
- if env.get('SECURED') == '1':
- easy_setup_env.AppendUnique(LIBPATH = [env.get('SRC_DIR')+'/java/iotivity-android/build/native-libs/armeabi'])
- easy_setup_env.AppendUnique(RPATH = [env.get('BUILD_DIR')])
- easy_setup_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
- easy_setup_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'gnustl_shared'])
- if env.get('SECURED') == '1':
- easy_setup_env.AppendUnique(LIBS = ['ocpmapi','ocprovision'])
- if not env.get('RELEASE'):
- easy_setup_env.AppendUnique(LIBS = ['log'])
-
-if target_os in ['linux','tizen']:
- easy_setup_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
- easy_setup_env.AppendUnique(RPATH = [env.get('BUILD_DIR')])
- easy_setup_env.AppendUnique(CXXFLAGS = ['-pthread'])
- easy_setup_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger'])
- if env.get('SECURED') == '1':
- easy_setup_env.AppendUnique(LIBS = ['ocpmapi', 'ocprovision'])
-
-if target_os in ['android','ios','linux','tizen']:
- easy_setup_env.PrependUnique(CPPPATH = [
- env.get('SRC_DIR') + '/resource/c_common/oic_malloc/include',
- env.get('SRC_DIR') + '/resource/include',
- env.get('SRC_DIR') + '/resource/csdk/logger/include',
- env.get('SRC_DIR') + '/resource/csdk/include',
- env.get('SRC_DIR') + '/resource/csdk/stack/include',
- env.get('SRC_DIR') + '/resource/csdk/logger/include',
- env.get('SRC_DIR') + '/resource/csdk/security/include',
- env.get('SRC_DIR') + '/extlibs/cjson',
- env.get('SRC_DIR') + '/service/easy-setup/inc'])
- if target_os not in ['linux', 'tizen']:
- easy_setup_env.PrependUnique(CPPPATH = [env.get('SRC_DIR') + '/extlibs/sqlite3'])
- if env.get('SECURED') == '1':
- with_upstream_libcoap = easy_setup_env.get('WITH_UPSTREAM_LIBCOAP')
- if with_upstream_libcoap == '1':
- easy_setup_env.AppendUnique(CPPPATH = ['#extlibs/libcoap/libcoap/include'])
- else:
- easy_setup_env.AppendUnique(CPPPATH = [env.get('SRC_DIR') + '/resource/csdk/connectivity/lib/libcoap-4.1.1/include'])
- easy_setup_env.AppendUnique(CPPPATH = [
- env.get('SRC_DIR') + '/resource/csdk/security/provisioning/include',
- env.get('SRC_DIR') + '/resource/csdk/security/include/internal',
- env.get('SRC_DIR') + '/resource/csdk/connectivity/api/',
- env.get('SRC_DIR') + '/resource/csdk/security/provisioning/include/internal',
- env.get('SRC_DIR') + '/resource/csdk/security/provisioning/include/cloud',
- env.get('SRC_DIR') + '/resource/csdk/security/provisioning/include/oxm'])
- easy_setup_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+ easy_setup_env.AppendUnique(LIBPATH=[env.get('BUILD_DIR')])
+ if env.get('SECURED') == '1':
+ easy_setup_env.AppendUnique(LIBPATH=[
+ env.get('SRC_DIR') +
+ '/java/iotivity-android/build/native-libs/armeabi'
+ ])
+ easy_setup_env.AppendUnique(RPATH=[env.get('BUILD_DIR')])
+ easy_setup_env.AppendUnique(CXXFLAGS=['-frtti', '-fexceptions'])
+ easy_setup_env.PrependUnique(LIBS=[
+ 'oc',
+ 'octbstack',
+ 'oc_logger',
+ 'connectivity_abstraction',
+ 'gnustl_shared'
+ ])
+ if env.get('SECURED') == '1':
+ easy_setup_env.AppendUnique(LIBS=['ocpmapi', 'ocprovision'])
+ if not env.get('RELEASE'):
+ easy_setup_env.AppendUnique(LIBS=['log'])
+
+if target_os in ['linux', 'tizen']:
+ easy_setup_env.AppendUnique(LIBPATH=[env.get('BUILD_DIR')])
+ easy_setup_env.AppendUnique(RPATH=[env.get('BUILD_DIR')])
+ easy_setup_env.AppendUnique(CXXFLAGS=['-pthread'])
+ easy_setup_env.PrependUnique(LIBS=[
+ 'oc',
+ 'octbstack',
+ 'oc_logger',
+ ])
+ if env.get('SECURED') == '1':
+ easy_setup_env.AppendUnique(LIBS=['ocpmapi', 'ocprovision'])
+
+if target_os in ['android', 'ios', 'linux', 'tizen']:
+ easy_setup_env.PrependUnique(CPPPATH=[
+ env.get('SRC_DIR') + '/resource/c_common/oic_malloc/include',
+ env.get('SRC_DIR') + '/resource/include',
+ env.get('SRC_DIR') + '/resource/csdk/logger/include',
+ env.get('SRC_DIR') + '/resource/csdk/include',
+ env.get('SRC_DIR') + '/resource/csdk/stack/include',
+ env.get('SRC_DIR') + '/resource/csdk/logger/include',
+ env.get('SRC_DIR') + '/resource/csdk/security/include',
+ env.get('SRC_DIR') + '/extlibs/cjson',
+ env.get('SRC_DIR') + '/service/easy-setup/inc'
+ ])
+ if target_os not in ['linux', 'tizen']:
+ easy_setup_env.PrependUnique(
+ CPPPATH=[env.get('SRC_DIR') + '/extlibs/sqlite3'])
+ if env.get('SECURED') == '1':
+ with_upstream_libcoap = easy_setup_env.get('WITH_UPSTREAM_LIBCOAP')
+ if with_upstream_libcoap == '1':
+ easy_setup_env.AppendUnique(
+ CPPPATH=['#extlibs/libcoap/libcoap/include'])
+ else:
+ easy_setup_env.AppendUnique(CPPPATH=[
+ env.get('SRC_DIR') +
+ '/resource/csdk/connectivity/lib/libcoap-4.1.1/include'
+ ])
+ easy_setup_env.AppendUnique(CPPPATH=[
+ env.get('SRC_DIR') + '/resource/csdk/security/provisioning/include',
+ env.get('SRC_DIR') + '/resource/csdk/security/include/internal',
+ env.get('SRC_DIR') + '/resource/csdk/connectivity/api/',
+ env.get('SRC_DIR') + '/resource/csdk/security/provisioning/include/internal',
+ env.get('SRC_DIR') + '/resource/csdk/security/provisioning/include/cloud',
+ env.get('SRC_DIR') + '/resource/csdk/security/provisioning/include/oxm'
+ ])
+ easy_setup_env.AppendUnique(LIBS=['mbedtls', 'mbedx509', 'mbedcrypto'])
if not env.get('RELEASE') and target_os not in ['ios']:
- easy_setup_env.PrependUnique(LIBS = ['gcov'])
- easy_setup_env.AppendUnique(CCFLAGS = ['--coverage'])
+ easy_setup_env.PrependUnique(LIBS=['gcov'])
+ easy_setup_env.AppendUnique(CCFLAGS=['--coverage'])
######################################################################
# Source files and Targets
######################################################################
-print"easysetup_path %s" % easysetup_path
+print "easysetup_path %s" % easysetup_path
es_src = None
-if target_os in ['android','ios','linux','tizen']:
- if env.get('SECURED') == '1':
- env.AppendUnique(es_src = [os.path.join(easysetup_path, 'src/EnrolleeSecurity.cpp')])
-
- es_common_src = ['src/RemoteEnrollee.cpp',
- 'src/EnrolleeResource.cpp',
- 'src/CloudResource.cpp',
- 'src/EasySetup.cpp',
- 'src/ESException.cpp']
-
- env.AppendUnique(es_src = es_common_src)
-
- es_sdk_static = easy_setup_env.StaticLibrary('ESMediatorRich', env.get('es_src'))
- easy_setup_env.InstallTarget(es_sdk_static, 'libESMediatorRich')
- if target_os not in ['ios']:
- es_sdk_shared = easy_setup_env.SharedLibrary('ESMediatorRich', env.get('es_src'))
- easy_setup_env.UserInstallTargetLib(es_sdk_shared, 'libESMediatorRich')
- easy_setup_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libESMediatorRich.so'])
-
-filenames = [ 'ESException.h', 'ESRichCommon.h', 'EasySetup.hpp', 'RemoteEnrollee.h' ]
+if target_os in ['android', 'ios', 'linux', 'tizen']:
+ if env.get('SECURED') == '1':
+ env.AppendUnique(
+ es_src=[os.path.join(easysetup_path, 'src/EnrolleeSecurity.cpp')])
+
+ es_common_src = [
+ 'src/RemoteEnrollee.cpp',
+ 'src/EnrolleeResource.cpp',
+ 'src/CloudResource.cpp',
+ 'src/EasySetup.cpp',
+ 'src/ESException.cpp',
+ ]
+
+ env.AppendUnique(es_src=es_common_src)
+
+ es_sdk_static = easy_setup_env.StaticLibrary('ESMediatorRich',
+ env.get('es_src'))
+ easy_setup_env.InstallTarget(es_sdk_static, 'libESMediatorRich')
+ if target_os not in ['ios']:
+ es_sdk_shared = easy_setup_env.SharedLibrary('ESMediatorRich',
+ env.get('es_src'))
+ easy_setup_env.UserInstallTargetLib(es_sdk_shared, 'libESMediatorRich')
+ easy_setup_env.AppendUnique(
+ LINKFLAGS=['-Wl,-soname,libESMediatorRich.so'])
+
+filenames = [
+ 'ESException.h',
+ 'ESRichCommon.h',
+ 'EasySetup.hpp',
+ 'RemoteEnrollee.h'
+]
for filename in filenames:
- easy_setup_env.UserInstallTargetHeader('inc/' + filename, "service/easy-setup", filename)
+ easy_setup_env.UserInstallTargetHeader(
+ 'inc/' + filename, "service/easy-setup", filename)
print "Files path is %s" % env.get('es_src')
################################################ ######################
if target_os in ['android']:
- SConscript('android/SConscript')
+ SConscript('android/SConscript')
######################################################################
# Build RichSDK Mediator Sample App
################################################ ######################
if target_os in ['linux']:
- SConscript('../../sampleapp/mediator/linux/richsdk_sample/SConscript')
+ SConscript('../../sampleapp/mediator/linux/richsdk_sample/SConscript')
if target_os in ['android']:
- SConscript('../../sampleapp/mediator/android/SConscript')
-
+ SConscript('../../sampleapp/mediator/android/SConscript')
######################################################################
#Build UnitTestcases for Mediator[RichSDK]
################################################ ######################
if env.get('SECURED') == '0':
- if target_os == 'linux':
- SConscript('unittests/SConscript')
-
+ if target_os == 'linux':
+ SConscript('unittests/SConscript')
ANDROID_TARGET_ARCH = env.get('TARGET_ARCH')
if env.get('RELEASE'):
- ANDROID_RELEASE="release"
+ ANDROID_RELEASE = "release"
else:
- ANDROID_RELEASE="debug"
+ ANDROID_RELEASE = "debug"
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'):
+if not os.path.exists(android_home +
+ '/platforms/android-21') or not os.path.exists(
+ android_home + '/build-tools/20.0.0'):
print '''
***************************************** Info ********************************
* Either 'Android API 21' is not installed or 'Android SDK Build Tools *
#SConscript("../../../../../../android/android_api/SConscript")
+
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') + 'libESMediatorRich.so']
+ return target, [
+ source,
+ env.get('BUILD_DIR') + 'liboc.so',
+ env.get('BUILD_DIR') + 'liboc_logger.so',
+ env.get('BUILD_DIR') + 'libESMediatorRich.so'
+ ]
+
jdk_env = Environment(ENV=os.environ)
-jdk_env['BUILDERS']['Gradle'] = Builder(action = env.get('ANDROID_GRADLE') +
- ' build -bservice/easy-setup/mediator/richsdk/android/build.gradle -PTARGET_ARCH=%s -PRELEASE=%s --stacktrace' %(ANDROID_TARGET_ARCH, ANDROID_RELEASE),
- emitter = ensure_libs)
+jdk_env['BUILDERS']['Gradle'] = Builder(
+ action=env.get('ANDROID_GRADLE') +
+ ' build -bservice/easy-setup/mediator/richsdk/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')
-cmdBuildEasysetup=jdk_env.Gradle(target="EasySetupCore/objs",
- source="EasySetupCore/src/main/java/org/iotivity/service/easysetup/mediator/EasySetup.java")
-jdk_env.Clean(cmdBuildEasysetup, Dir('#/service/easy-setup/mediator/richsdk/android/build/'))
-jdk_env.Clean(cmdBuildEasysetup, Dir('#/service/easy-setup/mediator/richsdk/android/EasySetupCore/build/'))
+cmdBuildEasysetup = jdk_env.Gradle(
+ target="EasySetupCore/objs",
+ source=
+ "EasySetupCore/src/main/java/org/iotivity/service/easysetup/mediator/EasySetup.java"
+)
+jdk_env.Clean(cmdBuildEasysetup,
+ Dir('#/service/easy-setup/mediator/richsdk/android/build/'))
+jdk_env.Clean(
+ cmdBuildEasysetup,
+ Dir('#/service/easy-setup/mediator/richsdk/android/EasySetupCore/build/'))
Depends(cmdBuildEasysetup, env.get('baseAAR'))
-env.AppendUnique(easysetupAAR = cmdBuildEasysetup)
\ No newline at end of file
+env.AppendUnique(easysetupAAR=cmdBuildEasysetup)
# Notification Unit Test build script
##
+from tools.scons.RunTest import run_test
+
Import('env')
if env.get('RELEASE'):
- env.AppendUnique(CCFLAGS = ['-Os'])
- env.AppendUnique(CPPDEFINES = ['NDEBUG'])
+ env.AppendUnique(CCFLAGS=['-Os'])
+ env.AppendUnique(CPPDEFINES=['NDEBUG'])
else:
- env.AppendUnique(CCFLAGS = ['-g'])
+ env.AppendUnique(CCFLAGS=['-g'])
if env.get('LOGGING'):
- env.AppendUnique(CPPDEFINES = ['TB_LOG'])
+ env.AppendUnique(CPPDEFINES=['TB_LOG'])
gtest_env = SConscript('#extlibs/gtest/SConscript')
lib_env = gtest_env.Clone()
# Build flags
######################################################################
-easysetup_test_env.AppendUnique(LIBPATH = [lib_env.get('BUILD_DIR')])
-easysetup_test_env.PrependUnique(LIBS = [
- 'connectivity_abstraction', 'oc', 'octbstack', 'oc_logger', 'coap',
+easysetup_test_env.AppendUnique(LIBPATH=[lib_env.get('BUILD_DIR')])
+easysetup_test_env.PrependUnique(LIBS=[
+ 'connectivity_abstraction',
+ 'oc',
+ 'octbstack',
+ 'oc_logger',
+ 'coap',
])
if target_os not in ['windows', 'winrt']:
- easysetup_test_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
+ easysetup_test_env.AppendUnique(
+ CXXFLAGS=['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
-easysetup_test_env.AppendUnique(CXXFLAGS = ['-pthread'])
-easysetup_test_env.AppendUnique(LIBS = ['pthread'])
+easysetup_test_env.AppendUnique(CXXFLAGS=['-pthread'])
+easysetup_test_env.AppendUnique(LIBS=['pthread'])
-easysetup_test_env.PrependUnique(CPPPATH = [
+easysetup_test_env.PrependUnique(CPPPATH=[
'#/extlibs/hippomocks/hippomocks',
'#/resource/csdk/include',
'#/resource/csdk/connectivity/api',
if env.get('SECURED') == '1':
if env.get('WITH_TCP') == True:
- easysetup_test_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+ easysetup_test_env.AppendUnique(
+ LIBS=['mbedtls', 'mbedx509', 'mbedcrypto'])
######################################################################
# Build Test
######################################################################
easysetup_mediator_test_env = easysetup_test_env.Clone()
-easysetup_mediator_test_env.AppendUnique(LIBS = ['ESEnrolleeSDK', 'ESMediatorRich'])
-
-easysetup_mediator_test_src = env.Glob(src_dir + '/service/easy-setup/mediator/richsdk/unittests/ESMediatorTest.cpp')
-easysetup_mediator_test = easysetup_mediator_test_env.Program('easysetup_mediator_test', easysetup_mediator_test_src)
+easysetup_mediator_test_env.AppendUnique(
+ LIBS=['ESEnrolleeSDK', 'ESMediatorRich'])
+
+easysetup_mediator_test_src = env.Glob(
+ src_dir +
+ '/service/easy-setup/mediator/richsdk/unittests/ESMediatorTest.cpp')
+easysetup_mediator_test = easysetup_mediator_test_env.Program(
+ 'easysetup_mediator_test', easysetup_mediator_test_src)
Alias("easysetup_mediator_test", easysetup_mediator_test)
env.AppendTarget('easysetup_mediator_test')
-# TODO: fix this test on supported configurations and remove commented lines
if env.get('TEST') == '1':
if target_os in ['linux'] and env.get('SECURED') != '1':
- from tools.scons.RunTest import run_test
- run_test(easysetup_mediator_test_env,
-# 'service_easy-setup_mediator_richsdk_unittests_easysetup_mediator_test.memcheck',
- '',
- 'service/easy-setup/mediator/richsdk/unittests/easysetup_mediator_test',
- easysetup_mediator_test)
+ run_test(
+ easysetup_mediator_test_env,
+ # 'service_easy-setup_mediator_richsdk_unittests_easysetup_mediator_test.memcheck',
+ '', # TODO: fix this test and enable previous line
+ 'service/easy-setup/mediator/richsdk/unittests/easysetup_mediator_test',
+ easysetup_mediator_test)
######################################################################
# Build flags
######################################################################
-enrollee_env.PrependUnique(CPPPATH = [
- env.get('SRC_DIR') + '/resource/oc_logger/include',
- env.get('SRC_DIR') + '/resource/csdk/logger/include',
- env.get('SRC_DIR') + '/resource/csdk/include',
- env.get('SRC_DIR') + '/resource/csdk/stack/include',
- env.get('SRC_DIR') + '/extlibs/cjson',
- env.get('SRC_DIR') + '/service/easy-setup/inc',
- env.get('SRC_DIR') + '/service/easy-setup/enrollee/arduino/wifi',
- env.get('SRC_DIR') + '/service/easy-setup/enrollee/inc',
- env.get('SRC_DIR') + '/service/easy-setup/enrollee/src'])
-
-enrollee_env.AppendUnique(CPPDEFINES = ['TB_LOG', 'ESWIFI'])
-
-enrollee_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
-
-enrollee_env.PrependUnique(LIBS = ['octbstack','ocsrm','connectivity_abstraction','coap', 'ESEnrolleeSDK'])
+enrollee_env.PrependUnique(CPPPATH=[
+ env.get('SRC_DIR') + '/resource/oc_logger/include',
+ env.get('SRC_DIR') + '/resource/csdk/logger/include',
+ env.get('SRC_DIR') + '/resource/csdk/include',
+ env.get('SRC_DIR') + '/resource/csdk/stack/include',
+ env.get('SRC_DIR') + '/extlibs/cjson',
+ env.get('SRC_DIR') + '/service/easy-setup/inc',
+ env.get('SRC_DIR') + '/service/easy-setup/enrollee/arduino/wifi',
+ env.get('SRC_DIR') + '/service/easy-setup/enrollee/inc',
+ env.get('SRC_DIR') + '/service/easy-setup/enrollee/src'
+])
+
+enrollee_env.AppendUnique(CPPDEFINES=['TB_LOG', 'ESWIFI'])
+
+enrollee_env.AppendUnique(LIBPATH=[env.get('BUILD_DIR')])
+
+enrollee_env.PrependUnique(LIBS=[
+ 'octbstack',
+ 'ocsrm',
+ 'connectivity_abstraction',
+ 'coap',
+ 'ESEnrolleeSDK',
+])
enrollee = enrollee_env.Program('enrollee', 'enrolleewifi.cpp')
env.CreateBin('enrollee')
Alias('enrollee', i_enrollee)
env.AppendTarget('enrollee')
-if(enrollee_env['UPLOAD'] == True):
- if sys.platform.startswith("linux"):
- enrollee_env.Upload(env.get('BUILD_DIR') + '/service/easy-setup/sampleapp/enrollee/arduino/enrollee.hex')
- else:
- print 'Please use appropriate install method for your development machine. Linux is the only supported platform right now.'
+if (enrollee_env['UPLOAD'] == True):
+ if sys.platform.startswith("linux"):
+ enrollee_env.Upload(
+ env.get('BUILD_DIR') + '/service/easy-setup/sampleapp/enrollee/arduino/enrollee.hex')
+ else:
+ print 'Please use appropriate install method for your developing machine. Linux is the only supported platform right now.'
######################################################################
# Build flags
######################################################################
-enrollee_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
-enrollee_env.AppendUnique(CXXFLAGS = ['-Wall', '-std=c++0x'])
+enrollee_env.AppendUnique(LIBPATH=[env.get('BUILD_DIR')])
+enrollee_env.AppendUnique(CXXFLAGS=['-Wall', '-std=c++0x'])
if env.get('RELEASE'):
- enrollee_env.AppendUnique(CCFLAGS = ['-Os'])
- enrollee_env.AppendUnique(CPPDEFINES = ['NDEBUG'])
+ enrollee_env.AppendUnique(CCFLAGS=['-Os'])
+ enrollee_env.AppendUnique(CPPDEFINES=['NDEBUG'])
else:
- enrollee_env.AppendUnique(CCFLAGS = ['-g'])
+ enrollee_env.AppendUnique(CCFLAGS=['-g'])
if env.get('LOGGING'):
- env.AppendUnique(CPPDEFINES = ['TB_LOG'])
+ env.AppendUnique(CPPDEFINES=['TB_LOG'])
-enrollee_env.PrependUnique(CPPPATH = [
- env.get('SRC_DIR') + '/resource/include',
- env.get('SRC_DIR') + '/resource/oc_logger/include',
- env.get('SRC_DIR') + '/resource/csdk/logger/include',
- env.get('SRC_DIR') + '/resource/csdk/include',
- env.get('SRC_DIR') + '/resource/csdk/security/include',
- env.get('SRC_DIR') + '/resource/csdk/stack/include',
- env.get('SRC_DIR') + '/extlibs/cjson',
- env.get('SRC_DIR') + '/service/easy-setup/inc',
- env.get('SRC_DIR') + '/service/easy-setup/enrollee/linux/wifi',
- env.get('SRC_DIR') + '/service/easy-setup/enrollee/inc',
- env.get('SRC_DIR') + '/service/easy-setup/enrollee/src'])
+enrollee_env.PrependUnique(CPPPATH=[
+ env.get('SRC_DIR') + '/resource/include',
+ env.get('SRC_DIR') + '/resource/oc_logger/include',
+ env.get('SRC_DIR') + '/resource/csdk/logger/include',
+ env.get('SRC_DIR') + '/resource/csdk/include',
+ env.get('SRC_DIR') + '/resource/csdk/security/include',
+ env.get('SRC_DIR') + '/resource/csdk/stack/include',
+ env.get('SRC_DIR') + '/extlibs/cjson',
+ env.get('SRC_DIR') + '/service/easy-setup/inc',
+ env.get('SRC_DIR') + '/service/easy-setup/enrollee/linux/wifi',
+ env.get('SRC_DIR') + '/service/easy-setup/enrollee/inc',
+ env.get('SRC_DIR') + '/service/easy-setup/enrollee/src'
+])
-enrollee_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'ocsrm', 'pthread', 'connectivity_abstraction','coap', 'ESEnrolleeSDK'])
+enrollee_env.PrependUnique(LIBS=[
+ 'oc',
+ 'octbstack',
+ 'oc_logger',
+ 'ocsrm',
+ 'pthread',
+ 'connectivity_abstraction',
+ 'coap',
+ 'ESEnrolleeSDK',
+])
if enrollee_env.get('SECURED') == '1':
- enrollee_env.PrependUnique(LIBS = ['ocpmapi', 'ocprovision'])
- enrollee_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+ enrollee_env.PrependUnique(LIBS=['ocpmapi', 'ocprovision'])
+ enrollee_env.AppendUnique(LIBS=['mbedtls', 'mbedx509', 'mbedcrypto'])
-enrollee = enrollee_env.Program('enrollee', ['enrolleewifi.c', 'easysetup_x.c'])
+enrollee = enrollee_env.Program('enrollee',
+ ['enrolleewifi.c', 'easysetup_x.c'])
i_enrollee = enrollee_env.Install(env.get('BUILD_DIR'), enrollee)
-justworksdat = enrollee_env.Install(env.get('BUILD_DIR') + '/service/easy-setup/sampleapp/enrollee/linux/',
- env.get('SRC_DIR') + '/service/easy-setup/sampleapp/enrollee/linux/oic_svr_db_server.dat')
-
-MOTdat = enrollee_env.Install(env.get('BUILD_DIR') + '/service/easy-setup/sampleapp/enrollee/linux/',
- env.get('SRC_DIR') + '/service/easy-setup/sampleapp/enrollee/linux/oic_svr_db_server_MOT.dat')
+justworksdat = enrollee_env.Install(
+ env.get('BUILD_DIR') + '/service/easy-setup/sampleapp/enrollee/linux/',
+ env.get('SRC_DIR') +
+ '/service/easy-setup/sampleapp/enrollee/linux/oic_svr_db_server.dat')
+MOTdat = enrollee_env.Install(
+ env.get('BUILD_DIR') + '/service/easy-setup/sampleapp/enrollee/linux/',
+ env.get('SRC_DIR') +
+ '/service/easy-setup/sampleapp/enrollee/linux/oic_svr_db_server_MOT.dat')
Alias('enrollee', [i_enrollee, justworksdat, MOTdat])
env.AppendTarget('enrollee')
##
# This script includes generic build options:
# release/debug, target os, target arch, cross toolchain, build environment etc
+#
+# Note to maintainers: this script borrows elements from the top-level
+# build_common/SConscript. The borrowed elements should be kept in sync,
+# but there is no current way to do that automatically.
+# Since it appears in a target-themed directory (tizen-sdb), it is not
+# clear that it ought to borrow quite so much.
##
import os
import platform
'linux': ['linux', 'android', 'arduino', 'yocto', 'tizen'],
'windows': ['windows', 'android', 'arduino'],
'darwin': ['darwin', 'ios', 'android', 'arduino'],
- 'msys_nt' :['msys_nt'],
+ 'msys_nt': ['msys_nt'],
}
# Map of os and allowed archs (os: allowed archs)
os_arch_map = {
- 'linux': ['x86', 'x86_64', 'arm', 'arm-v7a', 'armeabi-v7a', 'arm64', 'mips', 'mipsel', 'mips64', 'mips64el', 'i386', 'powerpc', 'sparc', 'aarch64'],
+ 'linux': [
+ 'x86', 'x86_64', 'arm', 'arm-v7a', 'armeabi-v7a', 'arm64', 'mips',
+ 'mipsel', 'mips64', 'mips64el', 'i386', 'powerpc', 'sparc', 'aarch64'
+ ],
'tizen': ['x86', 'x86_64', 'arm', 'arm-v7a', 'armeabi-v7a', 'arm64'],
- 'android': ['x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'armeabi-v7a-hard', 'arm64-v8a'],
+ 'android': [
+ 'x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'armeabi-v7a-hard',
+ 'arm64-v8a'
+ ],
'windows': ['x86', 'amd64', 'arm'],
- 'msys_nt':['x86', 'x86_64'],
+ 'msys_nt': ['x86', 'x86_64'],
'darwin': ['i386', 'x86_64'],
'ios': ['i386', 'x86_64', 'armv7', 'armv7s', 'arm64'],
'arduino': ['avr', 'arm'],
- 'yocto': ['i586', 'i686', 'x86_64', 'arm', 'aarch64', 'powerpc', 'powerpc64', 'mips', 'mipsel'],
+ 'yocto': [
+ 'i586', 'i686', 'x86_64', 'arm', 'aarch64', 'powerpc', 'powerpc64',
+ 'mips', 'mipsel'
+ ],
}
host = platform.system().lower()
######################################################################
# Get build options (the optins from command line)
######################################################################
-target_os = ARGUMENTS.get('TARGET_OS', host).lower() # target os
+target_os = ARGUMENTS.get('TARGET_OS', host).lower() # target os
if target_os not in host_target_map[host]:
- print "\nError: Unknown target os: %s (Allow values: %s)\n" % (target_os, host_target_map[host])
+ print "\nError: Unsupported target os: %s (supported values: %s)\n" % (
+ target_os, host_target_map[host])
Exit(1)
if target_os == 'android':
if target_os == 'windows':
default_arch = default_arch.lower()
-target_arch = ARGUMENTS.get('TARGET_ARCH', default_arch) # target arch
+target_arch = ARGUMENTS.get('TARGET_ARCH', default_arch) # target arch
# True if binary needs to be installed on board. (Might need root permissions)
# set to 'no', 'false' or 0 for only compilation
logging_default = False
else:
release_mode = False
- if ARGUMENTS.get('RELEASE', True) in ['y', 'yes', 'true', 't', '1', 'on', 'all', True]:
+ if ARGUMENTS.get('RELEASE', True) in [
+ 'y', 'yes', 'true', 't', '1', 'on', 'all', True
+ ]:
release_mode = True
logging_default = (release_mode == False)
# targets that do not support the DTLS build (SECURED=1 build option)
-targets_without_dtls_support = ['arduino'];
-if ARGUMENTS.get('SECURED') == '1' and target_os in targets_without_dtls_support:
- print "\nError: DTLS not supported on target os: %s MUST build with SECURED=0\n" % (target_os)
- Exit(1)
+targets_without_dtls_support = ['arduino']
+if ARGUMENTS.get(
+ 'SECURED') == '1' and target_os in targets_without_dtls_support:
+ print "\nError: DTLS not supported on target os: %s MUST build with SECURED=0\n" % (
+ target_os)
+ Exit(1)
######################################################################
# Common build options (release, target os, target arch)
help_vars.Add('PROJECT_VERSION', 'The version of IoTivity', project_version)
help_vars.Add(BoolVariable('VERBOSE', 'Show compilation', False))
-help_vars.Add(BoolVariable('RELEASE', 'Build for release?', True)) # set to 'no', 'false' or 0 for debug
-help_vars.Add(EnumVariable('TARGET_OS', 'Target platform', host, host_target_map[host]))
+help_vars.Add(BoolVariable('RELEASE', 'Build for release?',
+ True)) # set to 'no', 'false' or 0 for debug
+help_vars.Add(
+ EnumVariable('TARGET_OS', 'Target platform', host, host_target_map[host]))
-
-help_vars.Add(BoolVariable('WITH_RA', 'Build with Remote Access module', False))
+help_vars.Add(
+ BoolVariable('WITH_RA', 'Build with Remote Access module', False))
help_vars.Add(BoolVariable('WITH_TCP', 'Build with TCP adapter', False))
help_vars.Add(BoolVariable('WITH_PROXY', 'Build with CoAP-HTTP Proxy', False))
-help_vars.Add(ListVariable('WITH_MQ', 'Build with MQ publisher/broker', 'OFF', ['OFF', 'SUB', 'PUB', 'BROKER']))
-help_vars.Add(BoolVariable('WITH_CLOUD', 'Build including AccountManager class and Cloud Client sample', False))
-help_vars.Add(ListVariable('RD_MODE', 'Resource Directory build mode', 'CLIENT', ['CLIENT', 'SERVER']))
+help_vars.Add(
+ ListVariable('WITH_MQ', 'Build with MQ publisher/broker', 'OFF',
+ ['OFF', 'SUB', 'PUB', 'BROKER']))
+help_vars.Add(
+ BoolVariable(
+ 'WITH_CLOUD',
+ 'Build including AccountManager class and Cloud Client sample', False))
+help_vars.Add(
+ ListVariable('RD_MODE', 'Resource Directory build mode', 'CLIENT',
+ ['CLIENT', 'SERVER']))
help_vars.Add(BoolVariable('SIMULATOR', 'Build with simulator module', False))
-help_vars.Add(BoolVariable('WITH_RA_IBB', 'Build with Remote Access module(workssys)', False))
-
+help_vars.Add(
+ BoolVariable('WITH_RA_IBB', 'Build with Remote Access module(workssys)',
+ False))
if target_os in targets_disallow_multitransport:
- help_vars.Add(ListVariable('TARGET_TRANSPORT', 'Target transport', 'IP', ['BT', 'BLE', 'IP', 'NFC']))
+ help_vars.Add(
+ ListVariable('TARGET_TRANSPORT', 'Target transport', 'IP',
+ ['BT', 'BLE', 'IP', 'NFC']))
else:
- help_vars.Add(ListVariable('TARGET_TRANSPORT', 'Target transport', 'ALL', ['ALL', 'BT', 'BLE', 'IP', 'NFC']))
+ help_vars.Add(
+ ListVariable('TARGET_TRANSPORT', 'Target transport', 'ALL',
+ ['ALL', 'BT', 'BLE', 'IP', 'NFC']))
-help_vars.Add(EnumVariable('TARGET_ARCH', 'Target architecture', default_arch, os_arch_map[target_os]))
+help_vars.Add(
+ EnumVariable('TARGET_ARCH', 'Target architecture', default_arch,
+ os_arch_map[target_os]))
if target_os in targets_without_dtls_support:
- help_vars.Add(EnumVariable('SECURED', 'Build with DTLS', '0', allowed_values=('0', '1')))
+ help_vars.Add(
+ EnumVariable(
+ 'SECURED', 'Build with DTLS', '0', allowed_values=('0', '1')))
else:
- help_vars.Add(EnumVariable('SECURED', 'Build with DTLS', '1', allowed_values=('0', '1')))
-help_vars.Add(EnumVariable('MULTIPLE_OWNER', 'Enable multiple owner', '0', allowed_values=('0', '1')))
-help_vars.Add(EnumVariable('EXC_PROV_SUPPORT', 'Except OCPMAPI library(libocpmapi.so)', '0', allowed_values=('0', '1')))
-help_vars.Add(EnumVariable('TEST', 'Run unit tests', '0', allowed_values=('0', '1')))
+ help_vars.Add(
+ EnumVariable(
+ 'SECURED', 'Build with DTLS', '1', allowed_values=('0', '1')))
+help_vars.Add(
+ EnumVariable(
+ 'MULTIPLE_OWNER',
+ 'Enable multiple owner',
+ '0',
+ allowed_values=('0', '1')))
+help_vars.Add(
+ EnumVariable(
+ 'EXC_PROV_SUPPORT',
+ 'Except OCPMAPI library(libocpmapi.so)',
+ '0',
+ allowed_values=('0', '1')))
+help_vars.Add(
+ EnumVariable('TEST', 'Run unit tests', '0', allowed_values=('0', '1')))
help_vars.Add(BoolVariable('LOGGING', 'Enable stack logging', logging_default))
-help_vars.Add(EnumVariable('LOG_LEVEL', 'Enable stack logging level', 'DEBUG', allowed_values=('DEBUG', 'INFO', 'ERROR', 'WARNING', 'FATAL')))
-help_vars.Add(BoolVariable('UPLOAD', 'Upload binary ? (For Arduino)', require_upload))
-help_vars.Add(EnumVariable('ROUTING', 'Enable routing', 'EP', allowed_values=('GW', 'EP')))
-help_vars.Add(EnumVariable('BUILD_SAMPLE', 'Build with sample', 'ON', allowed_values=('ON', 'OFF')))
-help_vars.AddVariables(('DEVICE_NAME', 'Network display name for device (For Arduino)', device_name, None, None),)
-help_vars.Add(PathVariable('ANDROID_NDK', 'Android NDK path', None, PathVariable.PathAccept))
-help_vars.Add(PathVariable('ANDROID_HOME', 'Android SDK path', None, PathVariable.PathAccept))
-help_vars.Add(PathVariable('ANDROID_GRADLE', 'Gradle binary file', None, PathVariable.PathIsFile))
-help_vars.Add(EnumVariable('WITH_UPSTREAM_LIBCOAP', 'Use latest stable version of LibCoAP downloaded from github', default_with_upstream_libcoap, allowed_values=('0','1')))
-help_vars.Add(BoolVariable('WITH_ENV', 'Use compiler options from environment', False))
+help_vars.Add(
+ EnumVariable(
+ 'LOG_LEVEL',
+ 'Enable stack logging level',
+ 'DEBUG',
+ allowed_values=('DEBUG', 'INFO', 'ERROR', 'WARNING', 'FATAL')))
+help_vars.Add(
+ BoolVariable('UPLOAD', 'Upload binary ? (For Arduino)', require_upload))
+help_vars.Add(
+ EnumVariable(
+ 'ROUTING', 'Enable routing', 'EP', allowed_values=('GW', 'EP')))
+help_vars.Add(
+ EnumVariable(
+ 'BUILD_SAMPLE',
+ 'Build with sample',
+ 'ON',
+ allowed_values=('ON', 'OFF')))
+help_vars.AddVariables(
+ ('DEVICE_NAME', 'Network display name for device (For Arduino)',
+ device_name, None, None), )
+help_vars.Add(
+ PathVariable('ANDROID_NDK', 'Android NDK path', None,
+ PathVariable.PathAccept))
+help_vars.Add(
+ PathVariable('ANDROID_HOME', 'Android SDK path', None,
+ PathVariable.PathAccept))
+help_vars.Add(
+ PathVariable('ANDROID_GRADLE', 'Gradle binary file', None,
+ PathVariable.PathIsFile))
+help_vars.Add(
+ EnumVariable(
+ 'WITH_UPSTREAM_LIBCOAP',
+ 'Use latest stable version of LibCoAP downloaded from github',
+ default_with_upstream_libcoap,
+ allowed_values=('0', '1')))
+help_vars.Add(
+ BoolVariable('WITH_ENV', 'Use compiler options from environment', False))
if target_os == 'windows':
- # For VS2013, MSVC_VERSION is '12.0'. For VS2015, MSVC_VERSION is '14.0'.
- # Default value is None, meaning that SCons has to choose automatically a VS version.
- help_vars.Add(EnumVariable('MSVC_VERSION', 'MSVC compiler version - Windows', None, allowed_values=('12.0', '14.0')))
+ # For VS2013, MSVC_VERSION is '12.0'. For VS2015, MSVC_VERSION is '14.0'.
+ # Default value is None, meaning that SCons has to choose automatically a VS version.
+ help_vars.Add(
+ EnumVariable(
+ 'MSVC_VERSION',
+ 'MSVC compiler version - Windows',
+ None,
+ allowed_values=('12.0', '14.0')))
help_vars.Add(BoolVariable('BUILD_JAVA', 'Build Java bindings', False))
-help_vars.Add(PathVariable('JAVA_HOME', 'JDK directory', os.environ.get('JAVA_HOME'), PathVariable.PathAccept))
-help_vars.Add(EnumVariable('OIC_SUPPORT_TIZEN_TRACE', 'Tizen Trace(T-trace) api availability', 'False', allowed_values=('True', 'False')))
-
-AddOption('--prefix',
- dest='prefix',
- type='string',
- nargs=1,
- action='store',
- metavar='DIR',
- help='installation prefix')
+help_vars.Add(
+ PathVariable('JAVA_HOME', 'JDK directory',
+ os.environ.get('JAVA_HOME'), PathVariable.PathAccept))
+help_vars.Add(
+ EnumVariable(
+ 'OIC_SUPPORT_TIZEN_TRACE',
+ 'Tizen Trace(T-trace) api availability',
+ 'False',
+ allowed_values=('True', 'False')))
+
+AddOption(
+ '--prefix',
+ dest='prefix',
+ type='string',
+ nargs=1,
+ action='store',
+ metavar='DIR',
+ help='installation prefix')
######################################################################
# Platform(build target) specific options: SDK/NDK & toolchain
if target_os in targets_support_cc:
# Set cross compile toolchain
- help_vars.Add('TC_PREFIX', "Toolchain prefix (Generally only be required for cross-compiling)", os.environ.get('TC_PREFIX'))
- help_vars.Add(PathVariable('TC_PATH',
+ help_vars.Add(
+ 'TC_PREFIX',
+ "Toolchain prefix (Generally only be required for cross-compiling)",
+ os.environ.get('TC_PREFIX'))
+ help_vars.Add(
+ PathVariable(
+ 'TC_PATH',
'Toolchain path (Generally only be required for cross-compiling)',
os.environ.get('TC_PATH')))
-if target_os in ['android', 'arduino']: # Android/Arduino always uses GNU compiler regardless of the host
- env = Environment(variables = help_vars,
- tools = ['gnulink', 'gcc', 'g++', 'ar', 'as', 'textfile']
- )
+if target_os in [
+ 'android', 'arduino'
+]: # Android/Arduino always uses GNU compiler regardless of the host
+ env = Environment(
+ variables=help_vars,
+ tools=['gnulink', 'gcc', 'g++', 'ar', 'as', 'textfile'])
else:
- env = Environment(variables = help_vars, tools = ['default', 'textfile'],
- TARGET_ARCH = target_arch, TARGET_OS = target_os,
- PREFIX = GetOption('prefix'),
- LIB_INSTALL_DIR = ARGUMENTS.get('LIB_INSTALL_DIR') #for 64bit build
- )
+ env = Environment(
+ variables=help_vars,
+ tools=['default', 'textfile'],
+ TARGET_ARCH=target_arch,
+ TARGET_OS=target_os,
+ PREFIX=GetOption('prefix'),
+ LIB_INSTALL_DIR=ARGUMENTS.get('LIB_INSTALL_DIR') #for 64bit build
+ )
Help(help_vars.GenerateHelpText(env))
if env.get('WITH_ENV'):
prefix = env.get('TC_PREFIX')
tc_path = env.get('TC_PATH')
if prefix:
- env.Replace(CC = prefix + env.get('CC', 'gcc'))
- env.Replace(CXX = prefix + env.get('CXX', 'g++'))
- env.Replace(AR = prefix + env.get('AR', 'ar'))
- env.Replace(AS = prefix + env.get('AS', 'as'))
- env.Replace(RANLIB = prefix + env.get('RANLIB', 'ranlib'))
+ env.Replace(CC=prefix + env.get('CC', 'gcc'))
+ env.Replace(CXX=prefix + env.get('CXX', 'g++'))
+ env.Replace(AR=prefix + env.get('AR', 'ar'))
+ env.Replace(AS=prefix + env.get('AS', 'as'))
+ env.Replace(RANLIB=prefix + env.get('RANLIB', 'ranlib'))
if tc_path:
env.PrependENVPath('PATH', tc_path)
sys_root = os.path.abspath(tc_path + '/../')
- env.AppendUnique(CCFLAGS = ['--sysroot=' + sys_root])
- env.AppendUnique(LINKFLAGS = ['--sysroot=' + sys_root])
+ env.AppendUnique(CCFLAGS=['--sysroot=' + sys_root])
+ env.AppendUnique(LINKFLAGS=['--sysroot=' + sys_root])
if prefix or tc_path:
print tc_set_msg
if env['CONFIG_ENVIRONMENT_IMPORT'] == True:
print "warning: importing some environment variables for OS: %s" % target_os
- for ev in ['PATH', 'PKG_CONFIG', 'PKG_CONFIG_PATH', 'PKG_CONFIG_SYSROOT_DIR']:
+ for ev in [
+ 'PATH', 'PKG_CONFIG', 'PKG_CONFIG_PATH', 'PKG_CONFIG_SYSROOT_DIR'
+ ]:
if os.environ.get(ev) != None:
env['ENV'][ev] = os.environ.get(ev)
if os.environ['LDFLAGS'] != None:
- env.AppendUnique(LINKFLAGS = Split(os.environ['LDFLAGS']))
+ env.AppendUnique(LINKFLAGS=Split(os.environ['LDFLAGS']))
# Ensure scons be able to change its working directory
env.SConscriptChdir(1)
# env.get('SRC_DIR')
# env.get('BUILD_DIR')
+
def __set_dir(env, dir):
if not os.path.exists(dir + '/SConstruct'):
print '''
build_dir = dir + '/out/' + target_os + '/' + target_arch + '/debug/'
env.VariantDir(build_dir, dir, duplicate=0)
- env.Replace(BUILD_DIR = build_dir)
- env.Replace(SRC_DIR = dir)
+ env.Replace(BUILD_DIR=build_dir)
+ env.Replace(SRC_DIR=dir)
-def __src_to_obj(env, src, home = ''):
+
+def __src_to_obj(env, src, home=''):
obj = env.get('BUILD_DIR') + src.replace(home, '')
if env.get('OBJSUFFIX'):
obj += env.get('OBJSUFFIX')
return env.Object(obj, src)
+
def __install(ienv, targets, name):
i_n = ienv.Install(env.get('BUILD_DIR'), targets)
Alias(name, i_n)
- env.AppendUnique(TS = [name])
+ env.AppendUnique(TS=[name])
+
def __installlib(ienv, targets, name):
user_prefix = env.get('PREFIX')
i_n = ienv.Install(env.get('BUILD_DIR'), targets)
ienv.Alias("install", i_n)
+
def __installbin(ienv, targets, name):
user_prefix = env.get('PREFIX')
if user_prefix:
i_n = ienv.Install(user_prefix + '/bin', targets)
ienv.Alias("install", i_n)
+
def __installheader(ienv, targets, dir, name):
user_prefix = env.get('PREFIX')
if user_prefix:
- i_n = ienv.Install(user_prefix + '/include/' + dir ,targets)
+ i_n = ienv.Install(user_prefix + '/include/' + dir, targets)
else:
- i_n = ienv.Install(os.path.join(env.get('BUILD_DIR'), 'include', dir), targets)
+ i_n = ienv.Install(
+ os.path.join(env.get('BUILD_DIR'), 'include', dir), targets)
ienv.Alias("install", i_n)
+
def __installpcfile(ienv, targets, name):
user_prefix = env.get('PREFIX')
if user_prefix:
i_n = ienv.Install(env.get('BUILD_DIR') + 'lib/pkgconfig', targets)
ienv.Alias("install", i_n)
-def __append_target(ienv, name, targets = None):
+
+def __append_target(ienv, name, targets=None):
if targets:
env.Alias(name, targets)
- env.AppendUnique(TS = [name])
+ env.AppendUnique(TS=[name])
+
def __print_targets(env):
Help('''
===============================================================================
''')
+
env.AddMethod(__set_dir, 'SetDir')
env.AddMethod(__print_targets, 'PrintTargets')
env.AddMethod(__src_to_obj, 'SrcToObj')
env.AddMethod(__installheader, 'UserInstallTargetHeader')
env.AddMethod(__installpcfile, 'UserInstallTargetPCFile')
env.SetDir(env.GetLaunchDir())
-env['ROOT_DIR']=env.GetLaunchDir()+'/..'
+env['ROOT_DIR'] = env.GetLaunchDir() + '/..'
Export('env')
'\@LIBS\@': " ".join(libs)
}
-env.Substfile(pc_file, SUBST_DICT = pc_vars)
+env.Substfile(pc_file, SUBST_DICT=pc_vars)
######################################################################
# Setting global compiler flags
rd_mode = env.get('RD_MODE')
with_ra_ibb = env.get('WITH_RA_IBB')
-env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
+env.AppendUnique(LIBPATH=[env.get('BUILD_DIR')])
if (env.get('WITH_UPSTREAM_LIBCOAP') == '1'):
- env.AppendUnique(CPPDEFINES = ['WITH_UPSTREAM_LIBCOAP'])
+ env.AppendUnique(CPPDEFINES=['WITH_UPSTREAM_LIBCOAP'])
if (target_os not in ['arduino', 'windows']):
- env.AppendUnique(CPPDEFINES = ['WITH_POSIX'])
+ env.AppendUnique(CPPDEFINES=['WITH_POSIX'])
-if (target_os in ['darwin','ios']):
- env.AppendUnique(CPPDEFINES = ['_DARWIN_C_SOURCE'])
+if (target_os in ['darwin', 'ios']):
+ env.AppendUnique(CPPDEFINES=['_DARWIN_C_SOURCE'])
if (env.get('SECURED') == '1'):
- env.AppendUnique(CPPDEFINES = ['__WITH_DTLS__'])
+ env.AppendUnique(CPPDEFINES=['__WITH_DTLS__'])
if ((env.get('SECURED') == '1') and with_tcp):
- env.AppendUnique(CPPDEFINES = ['__WITH_TLS__'])
+ env.AppendUnique(CPPDEFINES=['__WITH_TLS__'])
if (env.get('MULTIPLE_OWNER') == '1'):
env.AppendUnique(CPPDEFINES=['MULTIPLE_OWNER'])
if (env.get('ROUTING') == 'GW'):
- env.AppendUnique(CPPDEFINES = ['ROUTING_GATEWAY'])
+ env.AppendUnique(CPPDEFINES=['ROUTING_GATEWAY'])
elif (env.get('ROUTING') == 'EP'):
- env.AppendUnique(CPPDEFINES = ['ROUTING_EP'])
+ env.AppendUnique(CPPDEFINES=['ROUTING_EP'])
if (target_os == 'arduino'):
- env.AppendUnique(CPPDEFINES = ['SINGLE_THREAD'])
- env.AppendUnique(CPPDEFINES = ['WITH_ARDUINO'])
+ env.AppendUnique(CPPDEFINES=['SINGLE_THREAD'])
+ env.AppendUnique(CPPDEFINES=['WITH_ARDUINO'])
elif (('IP' in target_transport) or ('ALL' in target_transport)):
- env.AppendUnique(CPPDEFINES = ['WITH_BWT'])
+ env.AppendUnique(CPPDEFINES=['WITH_BWT'])
if (target_os in ['linux', 'tizen', 'android'] and with_tcp):
- env.AppendUnique(CPPDEFINES = ['WITH_TCP'])
+ env.AppendUnique(CPPDEFINES=['WITH_TCP'])
if (target_os in ['linux', 'tizen', 'android', 'arduino', 'ios']):
- if (('BLE' in target_transport) or ('BT' in target_transport) or ('ALL' in target_transport)):
- env.AppendUnique(CPPDEFINES = ['WITH_TCP'])
+ if (('BLE' in target_transport) or ('BT' in target_transport) or
+ ('ALL' in target_transport)):
+ env.AppendUnique(CPPDEFINES=['WITH_TCP'])
if 'ALL' in target_transport:
if with_ra:
- env.AppendUnique(CPPDEFINES = ['RA_ADAPTER'])
+ env.AppendUnique(CPPDEFINES=['RA_ADAPTER'])
if with_tcp:
- env.AppendUnique(CPPDEFINES = ['TCP_ADAPTER'])
+ env.AppendUnique(CPPDEFINES=['TCP_ADAPTER'])
if (target_os in ['linux', 'yocto']):
- env.AppendUnique(CPPDEFINES = ['IP_ADAPTER', 'NO_EDR_ADAPTER', 'LE_ADAPTER'])
+ env.AppendUnique(
+ CPPDEFINES=['IP_ADAPTER', 'NO_EDR_ADAPTER', 'LE_ADAPTER'])
elif (target_os == 'android'):
- env.AppendUnique(CPPDEFINES = ['IP_ADAPTER', 'EDR_ADAPTER', 'LE_ADAPTER', 'NFC_ADAPTER'])
- elif (target_os in['darwin', 'ios', 'msys_nt', 'windows']):
- env.AppendUnique(CPPDEFINES = ['IP_ADAPTER', 'NO_EDR_ADAPTER', 'NO_LE_ADAPTER'])
+ env.AppendUnique(CPPDEFINES=[
+ 'IP_ADAPTER', 'EDR_ADAPTER', 'LE_ADAPTER', 'NFC_ADAPTER'
+ ])
+ elif (target_os in ['darwin', 'ios', 'msys_nt', 'windows']):
+ env.AppendUnique(
+ CPPDEFINES=['IP_ADAPTER', 'NO_EDR_ADAPTER', 'NO_LE_ADAPTER'])
else:
- env.AppendUnique(CPPDEFINES = ['IP_ADAPTER', 'EDR_ADAPTER', 'LE_ADAPTER'])
+ env.AppendUnique(
+ CPPDEFINES=['IP_ADAPTER', 'EDR_ADAPTER', 'LE_ADAPTER'])
else:
if ('BT' in target_transport):
if (target_os == 'linux'):
print "CA Transport BT is not supported "
Exit(1)
else:
- env.AppendUnique(CPPDEFINES = ['EDR_ADAPTER'])
+ env.AppendUnique(CPPDEFINES=['EDR_ADAPTER'])
else:
- env.AppendUnique(CPPDEFINES = ['NO_EDR_ADAPTER'])
+ env.AppendUnique(CPPDEFINES=['NO_EDR_ADAPTER'])
if ('BLE' in target_transport):
- env.AppendUnique(CPPDEFINES = ['LE_ADAPTER'])
+ env.AppendUnique(CPPDEFINES=['LE_ADAPTER'])
else:
- env.AppendUnique(CPPDEFINES = ['NO_LE_ADAPTER'])
+ env.AppendUnique(CPPDEFINES=['NO_LE_ADAPTER'])
if ('IP' in target_transport):
- env.AppendUnique(CPPDEFINES = ['IP_ADAPTER'])
+ env.AppendUnique(CPPDEFINES=['IP_ADAPTER'])
else:
- env.AppendUnique(CPPDEFINES = ['NO_IP_ADAPTER'])
+ env.AppendUnique(CPPDEFINES=['NO_IP_ADAPTER'])
if with_tcp:
- if (target_os in ['linux', 'tizen', 'android', 'arduino', 'ios', 'windows']):
- env.AppendUnique(CPPDEFINES = ['TCP_ADAPTER', 'WITH_TCP'])
+ if (target_os in [
+ 'linux', 'tizen', 'android', 'arduino', 'ios', 'windows'
+ ]):
+ env.AppendUnique(CPPDEFINES=['TCP_ADAPTER', 'WITH_TCP'])
else:
print "CA Transport TCP is not supported "
Exit(1)
else:
- env.AppendUnique(CPPDEFINES = ['NO_TCP_ADAPTER'])
+ env.AppendUnique(CPPDEFINES=['NO_TCP_ADAPTER'])
if ('NFC' in target_transport):
if (target_os == 'android'):
- env.AppendUnique(CPPDEFINES = ['NFC_ADAPTER'])
+ env.AppendUnique(CPPDEFINES=['NFC_ADAPTER'])
else:
print "CA Transport NFC is not supported "
Exit(1)
else:
- env.AppendUnique(CPPDEFINES = ['NO_NFC_ADAPTER'])
+ env.AppendUnique(CPPDEFINES=['NO_NFC_ADAPTER'])
if ('SUB' in with_mq):
- env.AppendUnique(CPPDEFINES = ['MQ_SUBSCRIBER', 'WITH_MQ'])
+ env.AppendUnique(CPPDEFINES=['MQ_SUBSCRIBER', 'WITH_MQ'])
if ('PUB' in with_mq):
- env.AppendUnique(CPPDEFINES = ['MQ_PUBLISHER', 'WITH_MQ'])
+ env.AppendUnique(CPPDEFINES=['MQ_PUBLISHER', 'WITH_MQ'])
if ('BROKER' in with_mq):
- env.AppendUnique(CPPDEFINES = ['MQ_BROKER', 'WITH_MQ'])
+ env.AppendUnique(CPPDEFINES=['MQ_BROKER', 'WITH_MQ'])
if env.get('LOGGING'):
- env.AppendUnique(CPPDEFINES = ['TB_LOG'])
+ env.AppendUnique(CPPDEFINES=['TB_LOG'])
if env.get('WITH_CLOUD') and with_tcp:
- env.AppendUnique(CPPDEFINES = ['WITH_CLOUD'])
+ env.AppendUnique(CPPDEFINES=['WITH_CLOUD'])
if 'CLIENT' in rd_mode:
- env.AppendUnique(CPPDEFINES = ['RD_CLIENT'])
+ env.AppendUnique(CPPDEFINES=['RD_CLIENT'])
if 'SERVER' in rd_mode:
- env.AppendUnique(CPPDEFINES = ['RD_SERVER'])
+ env.AppendUnique(CPPDEFINES=['RD_SERVER'])
if with_ra_ibb:
- env.AppendUnique(CPPDEFINES = ['RA_ADAPTER_IBB'])
+ env.AppendUnique(CPPDEFINES=['RA_ADAPTER_IBB'])
######################################################################
# Link scons to Yocto cross-toolchain ONLY when target_os is yocto
######################################################################
try:
CC = os.environ['CC']
target_prefix = CC.split()[0]
- target_prefix = target_prefix[:len(target_prefix)-3]
- tools = {"CC" : target_prefix+"gcc",
- "CXX" : target_prefix+"g++",
- "AS" : target_prefix+"as",
- "LD" : target_prefix+"ld",
- "GDB" : target_prefix+"gdb",
- "STRIP" : target_prefix+"strip",
- "RANLIB" : target_prefix+"ranlib",
- "OBJCOPY" : target_prefix+"objcopy",
- "OBJDUMP" : target_prefix+"objdump",
- "AR" : target_prefix+"ar",
- "NM" : target_prefix+"nm",
- "M4" : "m4",
- "STRINGS": target_prefix+"strings"}
+ target_prefix = target_prefix[:len(target_prefix) - 3]
+ tools = {
+ "CC": target_prefix + "gcc",
+ "CXX": target_prefix + "g++",
+ "AS": target_prefix + "as",
+ "LD": target_prefix + "ld",
+ "GDB": target_prefix + "gdb",
+ "STRIP": target_prefix + "strip",
+ "RANLIB": target_prefix + "ranlib",
+ "OBJCOPY": target_prefix + "objcopy",
+ "OBJDUMP": target_prefix + "objdump",
+ "AR": target_prefix + "ar",
+ "NM": target_prefix + "nm",
+ "M4": "m4",
+ "STRINGS": target_prefix + "strings"
+ }
PATH = os.environ['PATH'].split(os.pathsep)
for tool in tools:
if tool in os.environ:
We want to preserve debug symbols to allow BitBake to generate both DEBUG and
RELEASE packages for OIC.
'''
- env.AppendUnique(CCFLAGS = ['-g'])
+ env.AppendUnique(CCFLAGS=['-g'])
'''
Additional flags to pass to the Yocto toolchain.
'''
if env.get('RELEASE'):
- env.AppendUnique(CPPDEFINES = ['NDEBUG'])
- env.AppendUnique(CPPDEFINES = ['__linux__', '_GNU_SOURCE'])
- env.AppendUnique(CFLAGS = ['-std=gnu99'])
- env.AppendUnique(CCFLAGS = ['-Wall', '-Wextra', '-fPIC'])
- env.AppendUnique(LIBS = ['dl', 'pthread', 'uuid'])
+ env.AppendUnique(CPPDEFINES=['NDEBUG'])
+ env.AppendUnique(CPPDEFINES=['__linux__', '_GNU_SOURCE'])
+ env.AppendUnique(CFLAGS=['-std=gnu99'])
+ env.AppendUnique(CCFLAGS=['-Wall', '-Wextra', '-fPIC'])
+ env.AppendUnique(LIBS=[
+ 'dl',
+ 'pthread',
+ 'uuid'
+ ])
Export('env')
else:
'''
import iotivityconfig
from iotivityconfig import *
-conf = Configure(env,
- custom_tests =
- {
- 'CheckPThreadsSupport' : iotivityconfig.check_pthreads
- } )
+conf = Configure(
+ env, custom_tests={'CheckPThreadsSupport': iotivityconfig.check_pthreads})
# Identify whether we have pthreads support, which is necessary for
# threading and mutexes. This will set the environment variable
##
# This script includes generic build options:
# release/debug, target os, target arch, cross toolchain, build environment etc
+#
+# Note to maintainers: this script borrows elements from the top-level
+# build_common/SConscript. The borrowed elements should be kept in sync,
+# but there is no current way to do that automatically.
+# Since it appears in a target-themed directory (tizen-sdb), it is not
+# clear that it ought to borrow quite so much.
##
import os
import platform
# Map of host os and allowed target os (host: allowed target os)
host_target_map = {
- 'linux': ['linux', 'android', 'arduino', 'yocto', 'tizen'],
- 'windows': ['windows', 'android', 'arduino'],
- 'darwin': ['darwin', 'ios', 'android', 'arduino'],
- }
+ 'linux': ['linux', 'android', 'arduino', 'yocto', 'tizen'],
+ 'windows': ['windows', 'android', 'arduino'],
+ 'darwin': ['darwin', 'ios', 'android', 'arduino'],
+}
# Map of os and allowed archs (os: allowed archs)
os_arch_map = {
- 'linux': ['x86', 'x86_64', 'arm', 'arm64'],
- 'tizen': ['x86', 'x86_64', 'arm', 'arm64'],
- 'android': ['x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'armeabi-v7a-hard', 'arm64-v8a'],
- 'windows': ['x86', 'amd64', 'arm'],
- 'darwin': ['i386', 'x86_64'],
- 'ios': ['i386', 'x86_64', 'armv7', 'armv7s', 'arm64'],
- 'arduino': ['avr', 'arm'],
- 'yocto': ['i586', 'x86_64', 'arm', 'powerpc', 'powerpc64', 'mips', 'mipsel'],
- }
-
-es_target_enrollee_map = {
- 'arduino', 'tizen', 'linux'
- }
+ 'linux': ['x86', 'x86_64', 'arm', 'arm64'],
+ 'tizen': ['x86', 'x86_64', 'arm', 'arm64'],
+ 'android': [
+ 'x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'armeabi-v7a-hard',
+ 'arm64-v8a'
+ ],
+ 'windows': ['x86', 'amd64', 'arm'],
+ 'darwin': ['i386', 'x86_64'],
+ 'ios': ['i386', 'x86_64', 'armv7', 'armv7s', 'arm64'],
+ 'arduino': ['avr', 'arm'],
+ 'yocto':
+ ['i586', 'x86_64', 'arm', 'powerpc', 'powerpc64', 'mips', 'mipsel'],
+}
+
+es_target_enrollee_map = {'arduino', 'tizen', 'linux'}
host = platform.system().lower()
if host not in host_target_map:
- print "\nError: Current system (%s) isn't supported\n" % host
- Exit(1)
+ print "\nError: Current system (%s) isn't supported\n" % host
+ Exit(1)
######################################################################
# Get build options (the optins from command line)
######################################################################
-target_os = ARGUMENTS.get('TARGET_OS', host).lower() # target os
+target_os = ARGUMENTS.get('TARGET_OS', host).lower() # target os
if target_os not in host_target_map[host]:
- print "\nError: Unknown target os: %s (Allow values: %s)\n" % (target_os, host_target_map[host])
- Exit(1)
+ print "\nError: Unsupported target os: %s (supported values: %s)\n" % (
+ target_os, host_target_map[host])
+ Exit(1)
default_arch = platform.machine()
if default_arch not in os_arch_map[target_os]:
- default_arch = os_arch_map[target_os][0].lower()
+ default_arch = os_arch_map[target_os][0].lower()
-target_arch = ARGUMENTS.get('TARGET_ARCH', default_arch) # target arch
+target_arch = ARGUMENTS.get('TARGET_ARCH', default_arch) # target arch
# True if binary needs to be installed on board. (Might need root permissions)
# set to 'no', 'false' or 0 for only compilation
es_target_enrollee = ARGUMENTS.get('ES_TARGET_ENROLLEE')
if es_target_enrollee not in es_target_enrollee_map:
- print "\nError: Unknown ES_TARGET_ENROLLEE: %s (Allow values: %s)\n" % (es_target_enrollee, es_target_enrollee_map)
- Exit(1)
-
+ print "\nError: Unknown ES_TARGET_ENROLLEE: %s (Allow values: %s)\n" % (
+ es_target_enrollee, es_target_enrollee_map)
+ Exit(1)
######################################################################
# Common build options (release, target os, target arch)
######################################################################
help_vars = Variables()
-help_vars.Add(BoolVariable('RELEASE', 'Build for release?', True)) # set to 'no', 'false' or 0 for debug
+help_vars.Add(BoolVariable('RELEASE', 'Build for release?',
+ True)) # set to 'no', 'false' or 0 for debug
help_vars.Add(BoolVariable('LOGGING', 'Enable stack logging', False))
-help_vars.Add(EnumVariable('TARGET_OS', 'Target platform', host, host_target_map[host]))
-help_vars.Add(ListVariable('TARGET_TRANSPORT', 'Target transport', 'ALL', ['ALL', 'BT', 'BLE', 'IP', 'TCP']))
-help_vars.Add(EnumVariable('TARGET_ARCH', 'Target architecture', default_arch, os_arch_map[target_os]))
-help_vars.Add(EnumVariable('SECURED', 'Build with DTLS', '1', allowed_values=('0', '1')))
-help_vars.Add(BoolVariable('UPLOAD', 'Upload binary ? (For Arduino)', require_upload))
-help_vars.Add(EnumVariable('ROUTING', 'Enable routing', 'EP', allowed_values=('GW', 'EP')))
-help_vars.Add(EnumVariable('BUILD_SAMPLE', 'Build with sample', 'ON', allowed_values=('ON', 'OFF')))
+help_vars.Add(
+ EnumVariable('TARGET_OS', 'Target platform', host, host_target_map[host]))
+help_vars.Add(
+ ListVariable('TARGET_TRANSPORT', 'Target transport', 'ALL',
+ ['ALL', 'BT', 'BLE', 'IP', 'TCP']))
+help_vars.Add(
+ EnumVariable('TARGET_ARCH', 'Target architecture', default_arch,
+ os_arch_map[target_os]))
+help_vars.Add(
+ EnumVariable('SECURED', 'Build with DTLS', '1', allowed_values=('0', '1')))
+help_vars.Add(
+ BoolVariable('UPLOAD', 'Upload binary ? (For Arduino)', require_upload))
+help_vars.Add(
+ EnumVariable(
+ 'ROUTING', 'Enable routing', 'EP', allowed_values=('GW', 'EP')))
+help_vars.Add(
+ EnumVariable(
+ 'BUILD_SAMPLE',
+ 'Build with sample',
+ 'ON',
+ allowed_values=('ON', 'OFF')))
help_vars.Add(BoolVariable('WITH_TCP', 'Build with TCP adapter', False))
-help_vars.Add(BoolVariable('WITH_CLOUD', 'Build including AccountManager class and Cloud Client sample', False))
-help_vars.AddVariables(('DEVICE_NAME', 'Network display name for device', 'OIC-DEVICE', None, None),)
+help_vars.Add(
+ BoolVariable(
+ 'WITH_CLOUD',
+ 'Build including AccountManager class and Cloud Client sample', False))
+help_vars.AddVariables(
+ ('DEVICE_NAME', 'Network display name for device', 'OIC-DEVICE', None,
+ None), )
#ES_TARGET_ENROLLEE is for specifying what is our target enrollee (Arduino or rest of platforms which support Multicast)
-help_vars.Add(EnumVariable('ES_TARGET_ENROLLEE', 'Target Enrollee', 'arduino', allowed_values=('arduino', 'tizen', 'linux')))
-
-AddOption('--prefix',
- dest='prefix',
- type='string',
- nargs=1,
- action='store',
- metavar='DIR',
- help='installation prefix')
+help_vars.Add(
+ EnumVariable(
+ 'ES_TARGET_ENROLLEE',
+ 'Target Enrollee',
+ 'arduino',
+ allowed_values=('arduino', 'tizen', 'linux')))
+
+AddOption(
+ '--prefix',
+ dest='prefix',
+ type='string',
+ nargs=1,
+ action='store',
+ metavar='DIR',
+ help='installation prefix')
######################################################################
# Platform(build target) specific options: SDK/NDK & toolchain
targets_support_cc = ['linux', 'arduino', 'tizen']
if target_os in targets_support_cc:
- # Set cross compile toolchain
- help_vars.Add('TC_PREFIX', "Toolchain prefix (Generally only be required for cross-compiling)", os.environ.get('TC_PREFIX'))
- help_vars.Add(PathVariable('TC_PATH',
- 'Toolchain path (Generally only be required for cross-compiling)',
- os.environ.get('TC_PATH')))
-
-if target_os in ['android', 'arduino']: # Android/Arduino always uses GNU compiler regardless of the host
- env = Environment(variables = help_vars,
- tools = ['gnulink', 'gcc', 'g++', 'ar', 'as']
- )
+ # Set cross compile toolchain
+ help_vars.Add(
+ 'TC_PREFIX',
+ "Toolchain prefix (Generally only be required for cross-compiling)",
+ os.environ.get('TC_PREFIX'))
+ help_vars.Add(
+ PathVariable(
+ 'TC_PATH',
+ 'Toolchain path (Generally only be required for cross-compiling)',
+ os.environ.get('TC_PATH')))
+
+if target_os in [
+ 'android', 'arduino'
+]: # Android/Arduino always uses GNU compiler regardless of the host
+ env = Environment(
+ variables=help_vars, tools=['gnulink', 'gcc', 'g++', 'ar', 'as'])
else:
- env = Environment(variables = help_vars, TARGET_ARCH = target_arch, TARGET_OS = target_os, ES_TARGET_ENROLLEE = es_target_enrollee, ESPREFIX = GetOption('prefix'))
+ env = Environment(
+ variables=help_vars,
+ TARGET_ARCH=target_arch,
+ TARGET_OS=target_os,
+ ES_TARGET_ENROLLEE=es_target_enrollee,
+ ESPREFIX=GetOption('prefix'))
Help(help_vars.GenerateHelpText(env))
# Set device name to __OIC_DEVICE_NAME__
-env.AppendUnique(CPPDEFINES = ['-D__OIC_DEVICE_NAME__=' + "\'\"" + device_name + "\"\'"])
+env.AppendUnique(
+ CPPDEFINES=['-D__OIC_DEVICE_NAME__=' + "\'\"" + device_name + "\"\'"])
tc_set_msg = '''
************************************ Warning **********************************
'''
if target_os in targets_support_cc:
- prefix = env.get('TC_PREFIX')
- tc_path = env.get('TC_PATH')
- if prefix:
- env.Replace(CC = prefix + 'gcc')
- env.Replace(CXX = prefix + 'g++')
- env.Replace(AR = prefix + 'ar')
- env.Replace(AS = prefix + 'as')
- env.Replace(LINK = prefix + 'ld')
- env.Replace(RANLIB = prefix + 'ranlib')
-
- if tc_path:
- env.PrependENVPath('PATH', tc_path)
- sys_root = os.path.abspath(tc_path + '/../')
- env.AppendUnique(CCFLAGS = ['--sysroot=' + sys_root])
- env.AppendUnique(LINKFLAGS = ['--sysroot=' + sys_root])
-
- if prefix or tc_path:
- print tc_set_msg
+ prefix = env.get('TC_PREFIX')
+ tc_path = env.get('TC_PATH')
+ if prefix:
+ env.Replace(CC=prefix + 'gcc')
+ env.Replace(CXX=prefix + 'g++')
+ env.Replace(AR=prefix + 'ar')
+ env.Replace(AS=prefix + 'as')
+ env.Replace(LINK=prefix + 'ld')
+ env.Replace(RANLIB=prefix + 'ranlib')
+
+ if tc_path:
+ env.PrependENVPath('PATH', tc_path)
+ sys_root = os.path.abspath(tc_path + '/../')
+ env.AppendUnique(CCFLAGS=['--sysroot=' + sys_root])
+ env.AppendUnique(LINKFLAGS=['--sysroot=' + sys_root])
+
+ if prefix or tc_path:
+ print tc_set_msg
# Ensure scons be able to change its working directory
env.SConscriptChdir(1)
# env.get('SRC_DIR')
# env.get('BUILD_DIR')
+
def __set_dir(env, dir):
- if not os.path.exists(dir + '/SConstruct'):
- print '''
+ if not os.path.exists(dir + '/SConstruct'):
+ print '''
*************************************** Error *********************************
* The directory(%s) seems isn't a source code directory, no SConstruct file is
* found. *
*******************************************************************************
''' % dir
- Exit(1)
+ Exit(1)
+
+ if env.get('RELEASE'):
+ build_dir = dir + '/out/' + target_os + '/' + target_arch + '/release/'
+ else:
+ build_dir = dir + '/out/' + target_os + '/' + target_arch + '/debug/'
+ env.VariantDir(build_dir, dir, duplicate=0)
+
+ env.Replace(BUILD_DIR=build_dir)
+ env.Replace(SRC_DIR=dir)
- if env.get('RELEASE'):
- build_dir = dir + '/out/' + target_os + '/' + target_arch + '/release/'
- else:
- build_dir = dir + '/out/' + target_os + '/' + target_arch + '/debug/'
- env.VariantDir(build_dir, dir, duplicate=0)
- env.Replace(BUILD_DIR = build_dir)
- env.Replace(SRC_DIR = dir)
+def __src_to_obj(env, src, home=''):
+ obj = env.get('BUILD_DIR') + src.replace(home, '')
+ if env.get('OBJSUFFIX'):
+ obj += env.get('OBJSUFFIX')
+ return env.Object(obj, src)
-def __src_to_obj(env, src, home = ''):
- obj = env.get('BUILD_DIR') + src.replace(home, '')
- if env.get('OBJSUFFIX'):
- obj += env.get('OBJSUFFIX')
- return env.Object(obj, src)
def __install(ienv, targets, name):
- i_n = ienv.Install(env.get('BUILD_DIR'), targets)
- Alias(name, i_n)
- env.AppendUnique(TS = [name])
+ i_n = ienv.Install(env.get('BUILD_DIR'), targets)
+ Alias(name, i_n)
+ env.AppendUnique(TS=[name])
+
def __installlib(ienv, targets, name):
- user_prefix = env.get('PREFIX')
- if user_prefix:
- i_n = ienv.Install(user_prefix + '/lib', targets)
- else:
- i_n = ienv.Install(env.get('BUILD_DIR'), targets)
- ienv.Alias("install", i_n)
+ user_prefix = env.get('PREFIX')
+ if user_prefix:
+ i_n = ienv.Install(user_prefix + '/lib', targets)
+ else:
+ i_n = ienv.Install(env.get('BUILD_DIR'), targets)
+ ienv.Alias("install", i_n)
+
def __installbin(ienv, targets, name):
- user_prefix = env.get('PREFIX')
- if user_prefix:
- i_n = ienv.Install(user_prefix + '/bin', targets)
- else:
- i_n = ienv.Install(env.get('BUILD_DIR'), targets)
- ienv.Alias("install", i_n)
+ user_prefix = env.get('PREFIX')
+ if user_prefix:
+ i_n = ienv.Install(user_prefix + '/bin', targets)
+ else:
+ i_n = ienv.Install(env.get('BUILD_DIR'), targets)
+ ienv.Alias("install", i_n)
+
def __append_target(ienv, target):
- env.AppendUnique(TS = [target])
+ env.AppendUnique(TS=[target])
+
def __print_targets(env):
- Help('''
+ Help('''
===============================================================================
Targets:\n ''')
- for t in env.get('TS'):
- Help(t + ' ')
- Help('''
+ for t in env.get('TS'):
+ Help(t + ' ')
+ Help('''
\nDefault all targets will be built. You can specify the target to build:
$ scons [options] [target]
===============================================================================
''')
+
env.AddMethod(__set_dir, 'SetDir')
env.AddMethod(__print_targets, 'PrintTargets')
env.AddMethod(__src_to_obj, 'SrcToObj')
env.AddMethod(__installlib, 'UserInstallTargetLib')
env.AddMethod(__installbin, 'UserInstallTargetBin')
env.SetDir(env.GetLaunchDir())
-env['ROOT_DIR']=env.GetLaunchDir()+'/..'
+env['ROOT_DIR'] = env.GetLaunchDir() + '/..'
Export('env')
# Delete the temp files of configuration
if env.GetOption('clean'):
- dir = env.get('SRC_DIR')
+ dir = env.get('SRC_DIR')
- if os.path.exists(dir + '/config.log'):
- Execute(Delete(dir + '/config.log'))
- Execute(Delete(dir + '/.sconsign.dblite'))
- Execute(Delete(dir + '/.sconf_temp'))
+ if os.path.exists(dir + '/config.log'):
+ Execute(Delete(dir + '/config.log'))
+ Execute(Delete(dir + '/.sconsign.dblite'))
+ Execute(Delete(dir + '/.sconf_temp'))
Return('env')
# Enrollee sample build script
##
-SConscript('./service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample/build/SConscript')
+SConscript(
+ './service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample/build/SConscript'
+)
Import('env')
print "Given OS is %s" % target_os
print "Given es_target_enrollee is %s" % es_target_enrollee
print "Given tcp option is %s" % with_tcp
-print "Given cloud option is %s" %with_cloud
+print "Given cloud option is %s" % with_cloud
if target_os == 'tizen':
- command = "sh service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample/build/tizen/gbsbuild.sh %s %s %s %s %s %s %s %s" % (transport, secured, routing, release_mode, logging, es_target_enrollee, with_tcp, with_cloud)
- print "Created Command is %s" % command
- gbs_script = env.Command('gbs_build', None, command)
- AlwaysBuild ('gbs_script')
\ No newline at end of file
+ command = "sh service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample/build/tizen/gbsbuild.sh %s %s %s %s %s %s %s %s" % (
+ transport, secured, routing, release_mode, logging, es_target_enrollee,
+ with_tcp, with_cloud)
+ print "Created Command is %s" % command
+ gbs_script = env.Command('gbs_build', None, command)
+ AlwaysBuild('gbs_script')
build_dir = env.get('BUILD_DIR')
sample_dir = build_dir
-env.ParseConfig("pkg-config --cflags --libs capi-network-wifi dlog gobject-2.0 gio-2.0 gthread-2.0 glib-2.0 iotivity")
-env.AppendUnique(CPPFLAGS = ['-fPIC', '-D__TIZEN__','-DWITH_POSIX', '-Wall', '-DSLP_SDK_LOG', '-g','-D_GNU_SOURCE','-DTIZEN_DEBUG_ENABLE', '-DTB_LOG','`pkg-config', '--cflags', '--libs', 'iotivity', 'dlog','capi-network-wifi',
- 'gobject-2.0', 'gio-2.0', 'gthread-2.0', 'glib-2.0`'])
+env.ParseConfig(
+ "pkg-config --cflags --libs capi-network-wifi dlog gobject-2.0 gio-2.0 gthread-2.0 glib-2.0 iotivity"
+)
+env.AppendUnique(CPPFLAGS=[
+ '-fPIC', '-D__TIZEN__', '-DWITH_POSIX', '-Wall', '-DSLP_SDK_LOG', '-g',
+ '-D_GNU_SOURCE', '-DTIZEN_DEBUG_ENABLE', '-DTB_LOG', '`pkg-config',
+ '--cflags', '--libs', 'iotivity', 'dlog', 'capi-network-wifi',
+ 'gobject-2.0', 'gio-2.0', 'gthread-2.0', 'glib-2.0`'
+])
-env.AppendUnique(CPPDEFINES = ['TB_LOG'])
+env.AppendUnique(CPPDEFINES=['TB_LOG'])
-env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
+env.AppendUnique(LIBPATH=[env.get('BUILD_DIR')])
if routing == 'GW':
- env.AppendUnique(CPPDEFINES = ['ROUTING_GATEWAY'])
+ env.AppendUnique(CPPDEFINES=['ROUTING_GATEWAY'])
elif routing == 'EP':
- env.AppendUnique(CPPDEFINES = ['ROUTING_EP'])
+ env.AppendUnique(CPPDEFINES=['ROUTING_EP'])
-env.Append(LIBS=['-lgobject-2.0', '-lglib-2.0', '-lgio-2.0', '-lgthread-2.0'])
-env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'connectivity_abstraction','coap','rt','libESEnrolleeSDK','pthread'])
+env.Append(LIBS=[
+ 'gobject-2.0',
+ 'glib-2.0',
+ 'gio-2.0',
+ 'gthread-2.0'
+])
+env.PrependUnique(LIBS=[
+ 'oc',
+ 'octbstack',
+ 'oc_logger',
+ 'connectivity_abstraction',
+ 'coap',
+ 'rt',
+ 'libESEnrolleeSDK',
+ 'pthread',
+])
if secured == '1':
- env.PrependUnique(CPPPATH = [root_dir + '/external/inc/'])
- env.AppendUnique(CPPDEFINES = ['__WITH_DTLS__'])
+ env.PrependUnique(CPPPATH=[root_dir + '/external/inc/'])
+ env.AppendUnique(CPPDEFINES=['__WITH_DTLS__'])
-env.Program('enrollee_wifi', [sample_dir + 'enrolleewifi.cpp', sample_dir + 'easysetup_wifi_conn.c'])
\ No newline at end of file
+env.Program('enrollee_wifi', [
+ sample_dir + 'enrolleewifi.cpp', sample_dir + 'easysetup_wifi_conn.c'
+])
ANDROID_TARGET_ARCH = env.get('TARGET_ARCH')
if env.get('RELEASE'):
- ANDROID_RELEASE="release"
+ ANDROID_RELEASE = "release"
else:
- ANDROID_RELEASE="debug"
+ ANDROID_RELEASE = "debug"
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'):
+if not os.path.exists(android_home +
+ '/platforms/android-21') or not os.path.exists(
+ android_home + '/build-tools/20.0.0'):
print '''
***************************************** Info ********************************
* Either 'Android API 21' is not installed or 'Android SDK Build Tools *
#SConscript("../../../../../../android/android_api/SConscript")
+
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'
+ ]
+
jdk_env = Environment(ENV=os.environ)
-jdk_env['BUILDERS']['Gradle'] = Builder(action = env.get('ANDROID_GRADLE') +
- ' build -bservice/easy-setup/sampleapp/mediator/android/EasySetup/build.gradle -PTARGET_ARCH=%s -PRELEASE=%s --stacktrace' %(ANDROID_TARGET_ARCH, ANDROID_RELEASE),
- emitter = ensure_libs)
+jdk_env['BUILDERS']['Gradle'] = Builder(
+ action=env.get('ANDROID_GRADLE') +
+ ' build -bservice/easy-setup/sampleapp/mediator/android/EasySetup/build.gradle -PTARGET_ARCH=%s -PRELEASE=%s --stacktrace'
+ % (ANDROID_TARGET_ARCH, ANDROID_RELEASE),
+ emitter=ensure_libs)
jdk_env['BUILD_DIR'] = env.get('BUILD_DIR')
-cmdBuildEasysetupApp=jdk_env.Gradle(target="EasySetup/app/apk",
- source="EasySetup/app/src/main/java/org/iotivity/service/easysetup/EasysetupActivity.java")
-jdk_env.Clean(cmdBuildEasysetupApp, '#/service/easy-setup/sampleapp/mediator/android/EasySetup/build')
-jdk_env.Clean(cmdBuildEasysetupApp, '#/service/easy-setup/sampleapp/mediator/android/EasySetup/app/build')
-Depends(cmdBuildEasysetupApp, env.get('easysetupAAR'))
\ No newline at end of file
+cmdBuildEasysetupApp = jdk_env.Gradle(
+ target="EasySetup/app/apk",
+ source=
+ "EasySetup/app/src/main/java/org/iotivity/service/easysetup/EasysetupActivity.java"
+)
+jdk_env.Clean(
+ cmdBuildEasysetupApp,
+ '#/service/easy-setup/sampleapp/mediator/android/EasySetup/build')
+jdk_env.Clean(
+ cmdBuildEasysetupApp,
+ '#/service/easy-setup/sampleapp/mediator/android/EasySetup/app/build')
+Depends(cmdBuildEasysetupApp, env.get('easysetupAAR'))
######################################################################
# Build flags
######################################################################
-mediator_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
+mediator_env.AppendUnique(LIBPATH=[env.get('BUILD_DIR')])
if env.get('RELEASE'):
- mediator_env.AppendUnique(CCFLAGS = ['-Os'])
- mediator_env.AppendUnique(CPPDEFINES = ['NDEBUG'])
+ mediator_env.AppendUnique(CCFLAGS=['-Os'])
+ mediator_env.AppendUnique(CPPDEFINES=['NDEBUG'])
else:
- mediator_env.AppendUnique(CCFLAGS = ['-g'])
+ mediator_env.AppendUnique(CCFLAGS=['-g'])
if env.get('LOGGING'):
- env.AppendUnique(CPPDEFINES = ['TB_LOG'])
+ env.AppendUnique(CPPDEFINES=['TB_LOG'])
-env.AppendUnique(CPPDEFINES = ['CPP_MEDIATOR'])
+env.AppendUnique(CPPDEFINES=['CPP_MEDIATOR'])
if target_os not in ['windows']:
- mediator_env.AppendUnique(CXXFLAGS = ['-Wall', '-std=c++0x'])
-
-mediator_env.PrependUnique(CPPPATH = [
- env.get('SRC_DIR') + '/resource/include',
- env.get('SRC_DIR') + '/resource/oc_logger/include',
- env.get('SRC_DIR') + '/resource/c_common/oic_malloc/include',
- env.get('SRC_DIR') + '/resource/csdk/include',
- env.get('SRC_DIR') + '/resource/csdk/stack/include',
- env.get('SRC_DIR') + '/resource/csdk/security/provisioning/include',
- env.get('SRC_DIR') + '/resource/csdk/security/provisioning/include/internal',
- env.get('SRC_DIR') + '/resource/csdk/logger/include',
- env.get('SRC_DIR') + '/resource/csdk/security/include',
- env.get('SRC_DIR') + '/resource/csdk/connectivity/api',
- env.get('SRC_DIR') + '/extlibs/cjson',
- env.get('SRC_DIR') + '/service/easy-setup/mediator/richsdk/inc',
- env.get('SRC_DIR') + '/service/easy-setup/mediator/richsdk/src',
- env.get('SRC_DIR') + '/service/easy-setup/inc'])
+ mediator_env.AppendUnique(CXXFLAGS=['-Wall', '-std=c++0x'])
+
+mediator_env.PrependUnique(CPPPATH=[
+ env.get('SRC_DIR') + '/resource/include',
+ env.get('SRC_DIR') + '/resource/oc_logger/include',
+ env.get('SRC_DIR') + '/resource/c_common/oic_malloc/include',
+ env.get('SRC_DIR') + '/resource/csdk/include',
+ env.get('SRC_DIR') + '/resource/csdk/stack/include',
+ env.get('SRC_DIR') + '/resource/csdk/security/provisioning/include',
+ env.get('SRC_DIR') +
+ '/resource/csdk/security/provisioning/include/internal',
+ env.get('SRC_DIR') + '/resource/csdk/logger/include',
+ env.get('SRC_DIR') + '/resource/csdk/security/include',
+ env.get('SRC_DIR') + '/resource/csdk/connectivity/api',
+ env.get('SRC_DIR') + '/extlibs/cjson',
+ env.get('SRC_DIR') + '/service/easy-setup/mediator/richsdk/inc',
+ env.get('SRC_DIR') + '/service/easy-setup/mediator/richsdk/src',
+ env.get('SRC_DIR') + '/service/easy-setup/inc'
+])
if env.get('SECURED') == '1':
- mediator_env.PrependUnique(LIBS = ['mbedtls', 'mbedx509','mbedcrypto'])
+ mediator_env.PrependUnique(LIBS=['mbedtls', 'mbedx509', 'mbedcrypto'])
-mediator_env.PrependUnique(LIBS = ['ESMediatorRich', 'oc', 'octbstack', 'oc_logger', 'connectivity_abstraction'])
+mediator_env.PrependUnique(LIBS=[
+ 'ESMediatorRich',
+ 'oc',
+ 'octbstack',
+ 'oc_logger',
+ 'connectivity_abstraction',
+])
if env.get('SECURED') == '1':
- mediator_env.PrependUnique(LIBS = ['ocpmapi', 'ocprovision'])
+ mediator_env.PrependUnique(LIBS=['ocpmapi', 'ocprovision'])
mediator = mediator_env.Program('mediator', 'mediator.cpp')
submediator = mediator_env.Program('submediator', 'submediator.cpp')
-i_mediator = mediator_env.Install(env.get('BUILD_DIR'), [mediator, submediator])
-
-clientdat = mediator_env.Install(env.get('BUILD_DIR') + '/service/easy-setup/sampleapp/mediator/linux/richsdk_sample',
- env.get('SRC_DIR') + '/service/easy-setup/sampleapp/mediator/linux/richsdk_sample/oic_svr_db_client.dat')
-
-subclientdat = mediator_env.Install(env.get('BUILD_DIR') + '/service/easy-setup/sampleapp/mediator/linux/richsdk_sample',
- env.get('SRC_DIR') + '/service/easy-setup/sampleapp/mediator/linux/richsdk_sample/oic_svr_db_subclient.dat')
-
+i_mediator = mediator_env.Install(
+ env.get('BUILD_DIR'), [mediator, submediator])
+
+clientdat = mediator_env.Install(
+ env.get('BUILD_DIR') +
+ '/service/easy-setup/sampleapp/mediator/linux/richsdk_sample',
+ env.get('SRC_DIR') +
+ '/service/easy-setup/sampleapp/mediator/linux/richsdk_sample/oic_svr_db_client.dat'
+)
+
+subclientdat = mediator_env.Install(
+ env.get('BUILD_DIR') +
+ '/service/easy-setup/sampleapp/mediator/linux/richsdk_sample',
+ env.get('SRC_DIR') +
+ '/service/easy-setup/sampleapp/mediator/linux/richsdk_sample/oic_svr_db_subclient.dat'
+)
Alias('mediator_rich', [i_mediator, clientdat, subclientdat])
env.AppendTarget('mediator_rich')
Import('env')
if env.get('RELEASE'):
- env.AppendUnique(CCFLAGS = ['-Os'])
- env.AppendUnique(CPPDEFINES = ['NDEBUG'])
+ env.AppendUnique(CCFLAGS=['-Os'])
+ env.AppendUnique(CPPDEFINES=['NDEBUG'])
else:
- env.AppendUnique(CCFLAGS = ['-g'])
+ env.AppendUnique(CCFLAGS=['-g'])
if env.get('LOGGING'):
- env.AppendUnique(CPPDEFINES = ['TB_LOG'])
+ env.AppendUnique(CPPDEFINES=['TB_LOG'])
lib_env = env.Clone()
SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
notification_env = lib_env.Clone()
target_os = env.get('TARGET_OS')
+
######################################################################
# Build flags
######################################################################
-notification_env.AppendUnique(CPPPATH = ['include'])
-notification_env.AppendUnique(CPPPATH = ['src/common'])
-notification_env.AppendUnique(CPPPATH = ['src/provider'])
-notification_env.AppendUnique(CPPPATH = ['src/consumer'])
-notification_env.AppendUnique(CPPPATH = ['#/resource/csdk/include'])
-notification_env.AppendUnique(CPPPATH = ['#/resource/csdk/security/include'])
-notification_env.AppendUnique(CPPPATH = ['#/resource/csdk/stack/include'])
-notification_env.AppendUnique(CPPPATH = ['#/resource/csdk/resource-directory/include'])
-notification_env.AppendUnique(CPPPATH = ['#/resource/csdk/connectivity/api'])
-
-notification_env.PrependUnique(LIBS = [
- 'octbstack',
- 'oc_logger',
- 'connectivity_abstraction',
- 'libcoap',
- 'resource_directory'
- ])
+
+notification_env.AppendUnique(CPPPATH=[
+ 'include',
+ 'src/common',
+ 'src/provider',
+ 'src/consumer',
+ '#/resource/csdk/include',
+ '#/resource/csdk/security/include',
+ '#/resource/csdk/stack/include',
+ '#/resource/csdk/resource-directory/include',
+ '#/resource/csdk/connectivity/api',
+])
+
+notification_env.PrependUnique(LIBS=[
+ 'octbstack',
+ 'oc_logger',
+ 'connectivity_abstraction',
+ 'libcoap',
+ 'resource_directory'
+])
if target_os not in ['windows', 'winrt']:
- notification_env.AppendUnique(CCFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0'])
+ notification_env.AppendUnique(
+ CCFLAGS=['-O2', '-g', '-Wall', '-fmessage-length=0'])
if target_os not in ['darwin', 'ios', 'windows', 'winrt']:
- notification_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
+ notification_env.AppendUnique(LINKFLAGS=['-Wl,--no-undefined'])
if target_os == 'linux':
- notification_env.AppendUnique(LIBS = ['pthread'])
- if not env.get('RELEASE'):
- notification_env.PrependUnique(LIBS = ['gcov'])
- notification_env.AppendUnique(CCFLAGS = ['--coverage'])
+ notification_env.AppendUnique(LIBS=['pthread'])
+ if not env.get('RELEASE'):
+ notification_env.PrependUnique(LIBS=['gcov'])
+ notification_env.AppendUnique(CCFLAGS=['--coverage'])
if target_os == 'android':
- notification_env.AppendUnique(CCFLAGS = ['-frtti', '-fexceptions'])
- notification_env.AppendUnique(LIBS = ['gnustl_shared','log'])
+ notification_env.AppendUnique(CCFLAGS=['-frtti', '-fexceptions'])
+ notification_env.AppendUnique(LIBS=['gnustl_shared', 'log'])
- if not env.get('RELEASE'):
- notification_env.AppendUnique(LIBS = ['log'])
+ if not env.get('RELEASE'):
+ notification_env.AppendUnique(LIBS=['log'])
if target_os == 'tizen':
- notification_env.AppendUnique(CPPDEFINES = ['__TIZEN__'])
- # notification_env.ParseConfig('pkg-config --cflags --libs sqlite3')
+ notification_env.AppendUnique(CPPDEFINES=['__TIZEN__'])
+ # notification_env.ParseConfig('pkg-config --cflags --libs sqlite3')
if env.get('WITH_CLOUD') == True:
- notification_env.AppendUnique(CPPDEFINES = ['WITH_CLOUD'])
+ notification_env.AppendUnique(CPPDEFINES=['WITH_CLOUD'])
if env.get('SECURED') == '1':
- notification_env.AppendUnique(CPPDEFINES = ['SECURED'])
-
+ notification_env.AppendUnique(CPPDEFINES=['SECURED'])
+
with_mq = env.get('WITH_MQ')
if 'SUB' in with_mq:
- notification_env.AppendUnique(CPPDEFINES = ['MQ_SUBSCRIBER', 'WITH_MQ'])
+ notification_env.AppendUnique(CPPDEFINES=['MQ_SUBSCRIBER', 'WITH_MQ'])
print "MQ SUB support"
if 'PUB' in with_mq:
- notification_env.AppendUnique(CPPDEFINES = ['MQ_PUBLISHER', 'WITH_MQ'])
+ notification_env.AppendUnique(CPPDEFINES=['MQ_PUBLISHER', 'WITH_MQ'])
print "MQ PUB support"
if 'BROKER' in with_mq:
- notification_env.AppendUnique(CPPDEFINES = ['MQ_BROKER', 'WITH_MQ'])
+ notification_env.AppendUnique(CPPDEFINES=['MQ_BROKER', 'WITH_MQ'])
print "MQ Broker support"
-
######################################################################
# Source files and Targets
######################################################################
+
notification_provider_env = notification_env.Clone()
notification_consumer_env = notification_env.Clone()
if target_os == 'android':
- notification_provider_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libnotification_provider.so'])
+ notification_provider_env.AppendUnique(
+ LINKFLAGS=['-Wl,-soname,libnotification_provider.so'])
if target_os == 'android':
- notification_consumer_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libnotification_consumer.so'])
+ notification_consumer_env.AppendUnique(
+ LINKFLAGS=['-Wl,-soname,libnotification_consumer.so'])
-notification_common_obj = notification_provider_env.SharedObject(env.Glob('src/common/*.c'))
+notification_common_obj = notification_provider_env.SharedObject(
+ env.Glob('src/common/*.c'))
notification_provider_src = [
- env.Glob('src/provider/*.c'), notification_common_obj]
+ env.Glob('src/provider/*.c'),
+ notification_common_obj
+]
notification_consumer_src = [
- env.Glob('src/consumer/*.c'), notification_common_obj]
+ env.Glob('src/consumer/*.c'),
+ notification_common_obj
+]
if target_os not in ['ios']:
- providersdk = notification_provider_env.SharedLibrary('notification_provider', notification_provider_src)
- notification_provider_env.InstallTarget(providersdk, 'libnotification_provider')
- notification_provider_env.UserInstallTargetLib(providersdk, 'libnotification_provider')
- consumersdk = notification_consumer_env.SharedLibrary('notification_consumer', notification_consumer_src)
- notification_consumer_env.InstallTarget(consumersdk, 'libnotification_consumer')
- notification_consumer_env.UserInstallTargetLib(consumersdk, 'libnotification_consumer')
-
-providersdk = notification_provider_env.StaticLibrary('notification_provider', notification_provider_src)
-notification_provider_env.InstallTarget(providersdk, 'libnotification_provider')
-notification_provider_env.UserInstallTargetLib(providersdk, 'libnotification_provider')
-
-consumersdk = notification_consumer_env.StaticLibrary('notification_consumer', notification_consumer_src)
-notification_consumer_env.InstallTarget(consumersdk, 'libnotification_consumer')
-notification_consumer_env.UserInstallTargetLib(consumersdk, 'libnotification_consumer')
-
-notification_provider_env.UserInstallTargetHeader('include/NSProviderInterface.h',\
- 'service/notification', 'NSProviderInterface.h')
-notification_consumer_env.UserInstallTargetHeader('include/NSConsumerInterface.h',\
- 'service/notification', 'NSConsumerInterface.h')
-notification_consumer_env.UserInstallTargetHeader('include/NSCommon.h',\
- 'service/notification', 'NSCommon.h')
-
+ providersdk = notification_provider_env.SharedLibrary(
+ 'notification_provider', notification_provider_src)
+ notification_provider_env.InstallTarget(
+ providersdk, 'libnotification_provider')
+ notification_provider_env.UserInstallTargetLib(
+ providersdk, 'libnotification_provider')
+ consumersdk = notification_consumer_env.SharedLibrary(
+ 'notification_consumer', notification_consumer_src)
+ notification_consumer_env.InstallTarget(
+ consumersdk, 'libnotification_consumer')
+ notification_consumer_env.UserInstallTargetLib(
+ consumersdk, 'libnotification_consumer')
+
+providersdk = notification_provider_env.StaticLibrary(
+ 'notification_provider', notification_provider_src)
+notification_provider_env.InstallTarget(
+ providersdk, 'libnotification_provider')
+notification_provider_env.UserInstallTargetLib(
+ providersdk, 'libnotification_provider')
+
+consumersdk = notification_consumer_env.StaticLibrary(
+ 'notification_consumer', notification_consumer_src)
+notification_consumer_env.InstallTarget(
+ consumersdk, 'libnotification_consumer')
+notification_consumer_env.UserInstallTargetLib(
+ consumersdk, 'libnotification_consumer')
+
+notification_provider_env.UserInstallTargetHeader(
+ 'include/NSProviderInterface.h', 'service/notification', 'NSProviderInterface.h')
+notification_consumer_env.UserInstallTargetHeader(
+ 'include/NSConsumerInterface.h', 'service/notification', 'NSConsumerInterface.h')
+notification_consumer_env.UserInstallTargetHeader(
+ 'include/NSCommon.h', 'service/notification', 'NSCommon.h')
# Go to build Unit test
if target_os in ['linux']:
ANDROID_TARGET_ARCH = env.get('TARGET_ARCH')
if env.get('RELEASE'):
- ANDROID_RELEASE="release"
+ ANDROID_RELEASE = "release"
else:
- ANDROID_RELEASE="debug"
+ ANDROID_RELEASE = "debug"
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'):
+if not os.path.exists(android_home +
+ '/platforms/android-21') or not os.path.exists(
+ android_home + '/build-tools/20.0.0'):
print '''
***************************************** Info ********************************
* Either 'Android API 21' is not installed or 'Android SDK Build Tools *
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_wrapper.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['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')
-cmdBuildNotification = jdk_env.Gradle(target="notification-service/objs",
- source="notification-service/src/main/java/org/iotivity/service/ns/consumer/ConsumerService.java")
+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, '#/service/notification/android/build')
-jdk_env.Clean(cmdBuildNotification, '#/service/notification/android/notification-service/build')
+jdk_env.Clean(cmdBuildNotification,
+ '#/service/notification/android/notification-service/build')
Depends(cmdBuildNotification, env.get('baseAAR'))
-env.AppendUnique(notificationAAR = cmdBuildNotification)
+env.AppendUnique(notificationAAR=cmdBuildNotification)
Import('env')
target_os = env.get('TARGET_OS')
-SConscript('common/SConscript')
-
-# build producer notification wrapper
-SConscript('provider/SConscript')
-
-# build producer notification wrapper
-SConscript('consumer/SConscript')
+SConscript(dirs=[
+ 'common',
+ 'provider', # build producer notification wrapper
+ 'consumer', # build producer notification wrapper
+])
# Go to build sample apps using wrapper
if target_os == 'linux':
SConscript('#service/third_party_libs.scons', 'lib_env')
notification_env = lib_env.Clone()
-list = [ "NSMessage.h", "NSSyncInfo.h", "NSTopicsList.h", "NSUtils.h"]
+list = [
+ "NSMessage.h",
+ "NSSyncInfo.h",
+ "NSTopicsList.h",
+ "NSUtils.h"
+]
for filename in list:
- notification_env.UserInstallTargetHeader(filename , 'service/notification', filename)
+ notification_env.UserInstallTargetHeader(
+ filename, 'service/notification', filename)
Import('env')
if env.get('RELEASE'):
- env.AppendUnique(CCFLAGS = ['-Os'])
- env.AppendUnique(CPPDEFINES = ['NDEBUG'])
+ env.AppendUnique(CCFLAGS=['-Os'])
+ env.AppendUnique(CPPDEFINES=['NDEBUG'])
else:
- env.AppendUnique(CCFLAGS = ['-g'])
+ env.AppendUnique(CCFLAGS=['-g'])
if env.get('LOGGING'):
- env.AppendUnique(CPPDEFINES = ['TB_LOG'])
+ env.AppendUnique(CPPDEFINES=['TB_LOG'])
lib_env = env.Clone()
SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
######################################################################
# Build flags
######################################################################
-notification_env.AppendUnique(CPPPATH = [
+notification_env.AppendUnique(CPPPATH=[
'../../include',
'inc',
'../common',
'#/resource/oc_logger/include'
])
-notification_env.PrependUnique(LIBS = [
- 'oc_logger',
- 'oc',
- 'notification_consumer'
- ])
+notification_env.PrependUnique(LIBS=[
+ 'oc_logger',
+ 'oc',
+ 'notification_consumer',
+])
-notification_env.AppendUnique(CXXFLAGS = ['-std=c++0x','-frtti'])
+notification_env.AppendUnique(CXXFLAGS=['-std=c++0x', '-frtti'])
if target_os not in ['windows', 'winrt']:
- notification_env.AppendUnique(CCFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0'])
+ notification_env.AppendUnique(
+ CCFLAGS=['-O2', '-g', '-Wall', '-fmessage-length=0'])
if target_os not in ['darwin', 'ios', 'windows', 'winrt']:
- notification_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
+ notification_env.AppendUnique(LINKFLAGS=['-Wl,--no-undefined'])
if target_os == 'linux':
- notification_env.AppendUnique(LIBS = ['pthread'])
-
+ notification_env.AppendUnique(LIBS=['pthread'])
+
if target_os == 'android':
- notification_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
- notification_env.PrependUnique(LIBS = ['gnustl_shared', 'log'])
- notification_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libnotification_consumer_wrapper.so'])
+ notification_env.AppendUnique(CXXFLAGS=['-frtti', '-fexceptions'])
+ notification_env.PrependUnique(LIBS=['gnustl_shared', 'log'])
+ notification_env.AppendUnique(
+ LINKFLAGS=['-Wl,-soname,libnotification_consumer_wrapper.so'])
if not env.get('RELEASE') and target_os not in ['ios']:
- notification_env.PrependUnique(LIBS = ['gcov'])
- notification_env.AppendUnique(CCFLAGS = ['--coverage'])
+ notification_env.PrependUnique(LIBS=['gcov'])
+ notification_env.AppendUnique(CCFLAGS=['--coverage'])
if env.get('WITH_CLOUD') == True:
- notification_env.AppendUnique(CPPDEFINES = ['WITH_CLOUD'])
+ notification_env.AppendUnique(CPPDEFINES=['WITH_CLOUD'])
with_mq = env.get('WITH_MQ')
if 'SUB' in with_mq:
- notification_env.AppendUnique(CPPDEFINES = ['MQ_SUBSCRIBER', 'WITH_MQ'])
+ notification_env.AppendUnique(CPPDEFINES=['MQ_SUBSCRIBER', 'WITH_MQ'])
print "MQ SUB support"
if 'PUB' in with_mq:
- notification_env.AppendUnique(CPPDEFINES = ['MQ_PUBLISHER', 'WITH_MQ'])
+ notification_env.AppendUnique(CPPDEFINES=['MQ_PUBLISHER', 'WITH_MQ'])
print "MQ PUB support"
if 'BROKER' in with_mq:
- notification_env.AppendUnique(CPPDEFINES = ['MQ_BROKER', 'WITH_MQ'])
+ notification_env.AppendUnique(CPPDEFINES=['MQ_BROKER', 'WITH_MQ'])
print "MQ Broker support"
######################################################################
# Source files and Targets for Consumer
Import('notificationCommonSharedObjs')
notification_consumer_src = [
- env.Glob('src/*.cpp'),notificationCommonSharedObjs]
+ env.Glob('src/*.cpp'), notificationCommonSharedObjs
+]
if target_os in ['android']:
- notification_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libnotification_consumer_wrapper.so'])
+ notification_env.AppendUnique(
+ LINKFLAGS=['-Wl,-soname,libnotification_consumer_wrapper.so'])
if target_os not in ['ios']:
- consumersdk = notification_env.SharedLibrary('notification_consumer_wrapper', notification_consumer_src)
- notification_env.InstallTarget(consumersdk, 'libnotification_consumer_wrapper')
- notification_env.UserInstallTargetLib(consumersdk, 'libnotification_consumer_wrapper')
+ consumersdk = notification_env.SharedLibrary(
+ 'notification_consumer_wrapper', notification_consumer_src)
+ notification_env.InstallTarget(consumersdk,
+ 'libnotification_consumer_wrapper')
+ notification_env.UserInstallTargetLib(consumersdk,
+ 'libnotification_consumer_wrapper')
notification_consumer_src = [
- env.Glob('src/*.cpp'),notificationCommonStaticObjs]
+ env.Glob('src/*.cpp'), notificationCommonStaticObjs
+]
-consumersdk = notification_env.StaticLibrary('notification_consumer_wrapper', notification_consumer_src)
+consumersdk = notification_env.StaticLibrary(
+ 'notification_consumer_wrapper', notification_consumer_src)
notification_env.InstallTarget(consumersdk, 'libnotification_consumer_wrapper')
-notification_env.UserInstallTargetLib(consumersdk, 'libnotification_consumer_wrapper')
+notification_env.UserInstallTargetLib(
+ consumersdk, 'libnotification_consumer_wrapper')
-notification_env.UserInstallTargetHeader("inc/NSProvider.h", 'service/notification', 'NSProvider.h')
-notification_env.UserInstallTargetHeader("inc/NSConsumerService.h", 'service/notification', 'NSConsumerService.h')
+notification_env.UserInstallTargetHeader(
+ "inc/NSProvider.h", 'service/notification', 'NSProvider.h')
+notification_env.UserInstallTargetHeader(
+ "inc/NSConsumerService.h", 'service/notification', 'NSConsumerService.h')
######################################################################
# Source files and Targets for Consumer Jni
######################################################################
if target_os == 'android':
- Import('notificationJniCommonSharedObjs')
-
- notification_jni_consumer_env.AppendUnique(CPPPATH = ['../../../../extlibs/boost/boost_1_58_0'])
- notification_jni_consumer_env.AppendUnique(CPPPATH = ['../../../../java/jni'])
- notification_jni_consumer_env.AppendUnique(CPPPATH = ['../../android/notification-service/src/main/jni/common'])
- notification_jni_consumer_env.AppendUnique(CPPPATH = ['../../android/notification-service/src/main/jni/consumer'])
-
- notification_jni_consumer_env.PrependUnique(LIBS = [
- 'notification_consumer_wrapper'
- ])
-
- notification_consumer_jni_src = [
- env.Glob('../../android/notification-service/src/main/jni/consumer/*.cpp'),
- notificationJniCommonSharedObjs]
-
- consumerJni = notification_jni_consumer_env.SharedLibrary('notification_consumer_jni', notification_consumer_jni_src)
- notification_jni_consumer_env.InstallTarget(consumerJni, 'libnotification_consumer_jni')
- notification_jni_consumer_env.UserInstallTargetLib(consumerJni, 'libnotification_consumer_jni')
+ Import('notificationJniCommonSharedObjs')
+
+ notification_jni_consumer_env.AppendUnique(CPPPATH=[
+ '../../../../extlibs/boost/boost_1_58_0',
+ '../../../../java/jni',
+ '../../android/notification-service/src/main/jni/common',
+ '../../android/notification-service/src/main/jni/consumer'
+ ])
+
+ notification_jni_consumer_env.PrependUnique(
+ LIBS=['notification_consumer_wrapper'])
+
+ notification_consumer_jni_src = [
+ env.Glob(
+ '../../android/notification-service/src/main/jni/consumer/*.cpp'),
+ notificationJniCommonSharedObjs
+ ]
+
+ consumerJni = notification_jni_consumer_env.SharedLibrary(
+ 'notification_consumer_jni', notification_consumer_jni_src)
+ notification_jni_consumer_env.InstallTarget(consumerJni,
+ 'libnotification_consumer_jni')
+ notification_jni_consumer_env.UserInstallTargetLib(
+ consumerJni, 'libnotification_consumer_jni')
######################################################################
# Build flags
######################################################################
-notification_sample_env.AppendUnique(CPPPATH = [
+notification_sample_env.AppendUnique(CPPPATH=[
'../../../include',
'../../provider/inc',
'../../consumer/inc',
'#/resource/include',
'#/resource/oc_logger/include'
'../../../src/common'
- ])
+])
-notification_sample_env.PrependUnique(LIBS = [
+notification_sample_env.PrependUnique(LIBS=[
'resource_directory',
'oc',
'liboctbstack',
'oc_logger',
'connectivity_abstraction',
'libcoap',
- ])
+])
-notification_sample_env.AppendUnique(CXXFLAGS = ['-std=c++0x','-frtti'])
+notification_sample_env.AppendUnique(CXXFLAGS=['-std=c++0x', '-frtti'])
if target_os not in ['windows', 'winrt']:
- notification_sample_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0'])
+ notification_sample_env.AppendUnique(
+ CXXFLAGS=['-O2', '-g', '-Wall', '-fmessage-length=0'])
if target_os not in ['darwin', 'ios', 'windows', 'winrt']:
- notification_sample_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
+ notification_sample_env.AppendUnique(LINKFLAGS=['-Wl,--no-undefined'])
if target_os == 'linux':
- notification_sample_env.AppendUnique(LIBS = ['pthread'])
+ 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'])
+ notification_sample_env.AppendUnique(CXXFLAGS=['-frtti', '-fexceptions'])
+ notification_sample_env.AppendUnique(LIBS=['gnustl_shared', 'log'])
if not env.get('RELEASE'):
- notification_sample_env.PrependUnique(LIBS = ['gcov'])
- notification_sample_env.AppendUnique(CCFLAGS = ['--coverage'])
+ notification_sample_env.PrependUnique(LIBS=['gcov'])
+ notification_sample_env.AppendUnique(CCFLAGS=['--coverage'])
if env.get('WITH_CLOUD') == True:
- notification_sample_env.AppendUnique(CPPDEFINES = ['WITH_CLOUD'])
+ notification_sample_env.AppendUnique(CPPDEFINES=['WITH_CLOUD'])
with_mq = env.get('WITH_MQ')
if 'SUB' in with_mq:
- notification_sample_env.AppendUnique(CPPDEFINES = ['MQ_SUBSCRIBER', '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'])
+ 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'])
+ notification_sample_env.AppendUnique(CPPDEFINES=['MQ_BROKER', 'WITH_MQ'])
print "MQ Broker support"
if env.get('WITH_TCP') == True:
- notification_sample_env.AppendUnique(CPPDEFINES = ['WITH_TCP'])
+ notification_sample_env.AppendUnique(CPPDEFINES=['WITH_TCP'])
if env.get('SECURED') == '1':
- notification_sample_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+ notification_sample_env.AppendUnique(
+ LIBS=['mbedtls', 'mbedx509', 'mbedcrypto'])
####################################################################
# Source files and Targets
######################################################################
notification_sample_provider_env = notification_sample_env.Clone()
-notification_sample_provider_env.AppendUnique(LIBS = 'libnotification_provider_wrapper')
-notification_sample_provider_env.AppendUnique(LIBS = 'libnotification_provider')
-notificationproviderwrapper = notification_sample_provider_env.Program('notificationproviderwrapper', 'notificationserviceprovider.cpp')
-i_notificationprovider = notification_sample_provider_env.Install(env.get('BUILD_DIR'), notificationproviderwrapper)
+notification_sample_provider_env.AppendUnique(
+ LIBS='libnotification_provider_wrapper')
+notification_sample_provider_env.AppendUnique(LIBS='libnotification_provider')
+notificationproviderwrapper = notification_sample_provider_env.Program(
+ 'notificationproviderwrapper', 'notificationserviceprovider.cpp')
+i_notificationprovider = notification_sample_provider_env.Install(
+ env.get('BUILD_DIR'), notificationproviderwrapper)
notification_sample_consumer_env = notification_sample_env.Clone()
-notification_sample_consumer_env.AppendUnique(LIBS = 'libnotification_consumer_wrapper')
-notification_sample_consumer_env.AppendUnique(LIBS = 'libnotification_consumer')
-notificationconsumerwrapper = notification_sample_consumer_env.Program('notificationconsumerwrapper', 'notificationserviceconsumer.cpp')
-i_notificationconsumer = notification_sample_consumer_env.Install(env.get('BUILD_DIR'), notificationconsumerwrapper)
+notification_sample_consumer_env.AppendUnique(
+ LIBS='libnotification_consumer_wrapper')
+notification_sample_consumer_env.AppendUnique(LIBS='libnotification_consumer')
+notificationconsumerwrapper = notification_sample_consumer_env.Program(
+ 'notificationconsumerwrapper', 'notificationserviceconsumer.cpp')
+i_notificationconsumer = notification_sample_consumer_env.Install(
+ env.get('BUILD_DIR'), notificationconsumerwrapper)
Import('env')
if env.get('RELEASE'):
- env.AppendUnique(CCFLAGS = ['-Os'])
- env.AppendUnique(CPPDEFINES = ['NDEBUG'])
+ env.AppendUnique(CCFLAGS=['-Os'])
+ env.AppendUnique(CPPDEFINES=['NDEBUG'])
else:
- env.AppendUnique(CCFLAGS = ['-g'])
+ env.AppendUnique(CCFLAGS=['-g'])
if env.get('LOGGING'):
- env.AppendUnique(CPPDEFINES = ['TB_LOG'])
+ env.AppendUnique(CPPDEFINES=['TB_LOG'])
lib_env = env.Clone()
SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
######################################################################
# Build flags
######################################################################
-notification_env.AppendUnique(CPPPATH = [
+notification_env.AppendUnique(CPPPATH=[
'../../include',
'inc',
'../common',
'#/resource/oc_logger/include'
])
-notification_env.PrependUnique(LIBS = [
+notification_env.PrependUnique(LIBS=[
'oc_logger',
'oc',
'octbstack',
'notification_provider',
'resource_directory'
- ])
-notification_env.AppendUnique(CXXFLAGS = ['-std=c++0x','-frtti'])
+])
+notification_env.AppendUnique(CXXFLAGS=['-std=c++0x', '-frtti'])
if target_os not in ['windows', 'winrt']:
- notification_env.AppendUnique(CCFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0'])
+ notification_env.AppendUnique(
+ CCFLAGS=['-O2', '-g', '-Wall', '-fmessage-length=0'])
if target_os not in ['darwin', 'ios', 'windows', 'winrt']:
- notification_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
+ notification_env.AppendUnique(LINKFLAGS=['-Wl,--no-undefined'])
if target_os == 'linux':
- notification_env.AppendUnique(LIBS = ['pthread'])
-
+ notification_env.AppendUnique(LIBS=['pthread'])
+
if target_os == 'android':
- notification_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
- notification_env.PrependUnique(LIBS = ['gnustl_shared', 'log'])
- notification_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libnotification_provider_wrapper.so'])
+ notification_env.AppendUnique(CXXFLAGS=['-frtti', '-fexceptions'])
+ notification_env.PrependUnique(LIBS=['gnustl_shared', 'log'])
+ notification_env.AppendUnique(
+ LINKFLAGS=['-Wl,-soname,libnotification_provider_wrapper.so'])
if not env.get('RELEASE') and target_os not in ['ios']:
- notification_env.PrependUnique(LIBS = ['gcov'])
- notification_env.AppendUnique(CCFLAGS = ['--coverage'])
+ notification_env.PrependUnique(LIBS=['gcov'])
+ notification_env.AppendUnique(CCFLAGS=['--coverage'])
if env.get('WITH_CLOUD') == True:
- notification_env.AppendUnique(CPPDEFINES = ['WITH_CLOUD'])
+ notification_env.AppendUnique(CPPDEFINES=['WITH_CLOUD'])
with_mq = env.get('WITH_MQ')
if 'SUB' in with_mq:
- notification_env.AppendUnique(CPPDEFINES = ['MQ_SUBSCRIBER', 'WITH_MQ'])
+ notification_env.AppendUnique(CPPDEFINES=['MQ_SUBSCRIBER', 'WITH_MQ'])
print "MQ SUB support"
if 'PUB' in with_mq:
- notification_env.AppendUnique(CPPDEFINES = ['MQ_PUBLISHER', 'WITH_MQ'])
+ notification_env.AppendUnique(CPPDEFINES=['MQ_PUBLISHER', 'WITH_MQ'])
print "MQ PUB support"
if 'BROKER' in with_mq:
- notification_env.AppendUnique(CPPDEFINES = ['MQ_BROKER', 'WITH_MQ'])
+ notification_env.AppendUnique(CPPDEFINES=['MQ_BROKER', 'WITH_MQ'])
print "MQ Broker support"
######################################################################
# Source files and Targets for Provider
notification_env.Object('../common/NSMessage.cpp'),
notification_env.Object('../common/NSSyncInfo.cpp'),
notification_env.Object('../common/NSTopic.cpp'),
- notification_env.Object('../common/NSTopicsList.cpp')]
+ notification_env.Object('../common/NSTopicsList.cpp')
+]
notificationCommonSharedObjs = [
notification_env.SharedObject('../common/NSMediaContents.cpp'),
notification_env.SharedObject('../common/NSMessage.cpp'),
notification_env.SharedObject('../common/NSSyncInfo.cpp'),
notification_env.SharedObject('../common/NSTopic.cpp'),
- notification_env.SharedObject('../common/NSTopicsList.cpp')]
+ notification_env.SharedObject('../common/NSTopicsList.cpp')
+]
notification_provider_src = [
- env.Glob('src/*.cpp'),notificationCommonSharedObjs]
+ env.Glob('src/*.cpp'), notificationCommonSharedObjs
+]
if target_os in ['android']:
- notification_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libnotification_provider_wrapper.so'])
+ notification_env.AppendUnique(
+ LINKFLAGS=['-Wl,-soname,libnotification_provider_wrapper.so'])
if target_os not in ['ios']:
- providersdk = notification_env.SharedLibrary('notification_provider_wrapper', notification_provider_src)
- notification_env.InstallTarget(providersdk, 'libnotification_provider_wrapper')
- notification_env.UserInstallTargetLib(providersdk, 'libnotification_provider_wrapper')
+ providersdk = notification_env.SharedLibrary(
+ 'notification_provider_wrapper', notification_provider_src)
+ notification_env.InstallTarget(providersdk,
+ 'libnotification_provider_wrapper')
+ notification_env.UserInstallTargetLib(providersdk,
+ 'libnotification_provider_wrapper')
notification_provider_src = [
- env.Glob('src/*.cpp'),notificationCommonStaticObjs]
+ env.Glob('src/*.cpp'), notificationCommonStaticObjs
+]
-providersdk = notification_env.StaticLibrary('notification_provider_wrapper', notification_provider_src)
+providersdk = notification_env.StaticLibrary('notification_provider_wrapper',
+ notification_provider_src)
notification_env.InstallTarget(providersdk, 'libnotification_provider_wrapper')
-notification_env.UserInstallTargetLib(providersdk, 'libnotification_provider_wrapper')
-notification_env.UserInstallTargetHeader('inc/NSConsumer.h', 'service/notification', 'NSConsumer.h')
-notification_env.UserInstallTargetHeader('inc/NSProviderService.h', 'service/notification', 'NSProviderService.h')
+notification_env.UserInstallTargetLib(providersdk,
+ 'libnotification_provider_wrapper')
+notification_env.UserInstallTargetHeader(
+ 'inc/NSConsumer.h', 'service/notification', 'NSConsumer.h')
+notification_env.UserInstallTargetHeader(
+ 'inc/NSProviderService.h', 'service/notification', 'NSProviderService.h')
Export('notificationCommonStaticObjs')
Export('notificationCommonSharedObjs')
# Source files and Targets for Provider Jni
######################################################################
if target_os == 'android':
- notification_jni_provider_env.AppendUnique(CPPPATH = ['../../../../extlibs/boost/boost_1_58_0'])
- notification_jni_provider_env.AppendUnique(CPPPATH = ['../../../../java/jni'])
- notification_jni_provider_env.AppendUnique(CPPPATH = ['../../android/notification-service/src/main/jni/common'])
- notification_jni_provider_env.AppendUnique(CPPPATH = ['../../android/notification-service/src/main/jni/provider'])
+ notification_jni_provider_env.AppendUnique(CPPPATH=[
+ '../../../../extlibs/boost/boost_1_58_0',
+ '../../../../java/jni',
+ '../../android/notification-service/src/main/jni/common',
+ '../../android/notification-service/src/main/jni/provider',
+ ])
- notification_jni_provider_env.PrependUnique(LIBS = [
- 'notification_provider_wrapper'
- ])
+ notification_jni_provider_env.PrependUnique(
+ LIBS=['notification_provider_wrapper'])
notificationJniCommonSharedObjs = [
- notification_jni_provider_env.SharedObject('../../android/notification-service/src/main/jni/common/JniNotificationCommon.cpp')]
+ notification_jni_provider_env.SharedObject(
+ '../../android/notification-service/src/main/jni/common/JniNotificationCommon.cpp'
+ )
+ ]
notification_provider_jni_src = [
- env.Glob('../../android/notification-service/src/main/jni/provider/*.cpp'),
- notificationJniCommonSharedObjs]
-
- providerJni = notification_jni_provider_env.SharedLibrary('notification_provider_jni', notification_provider_jni_src)
- notification_jni_provider_env.InstallTarget(providerJni, 'libnotification_provider_jni')
- notification_jni_provider_env.UserInstallTargetLib(providerJni, 'libnotification_provider_jni')
+ env.Glob(
+ '../../android/notification-service/src/main/jni/provider/*.cpp'),
+ notificationJniCommonSharedObjs
+ ]
+
+ providerJni = notification_jni_provider_env.SharedLibrary(
+ 'notification_provider_jni', notification_provider_jni_src)
+ notification_jni_provider_env.InstallTarget(
+ providerJni, 'libnotification_provider_jni')
+ notification_jni_provider_env.UserInstallTargetLib(
+ providerJni, 'libnotification_provider_jni')
Export('notificationJniCommonSharedObjs')
# Notification Unit Test build script
##
+from tools.scons.RunTest import run_test
+
Import('env')
if env.get('RELEASE'):
- env.AppendUnique(CCFLAGS = ['-Os'])
- env.AppendUnique(CPPDEFINES = ['NDEBUG'])
+ env.AppendUnique(CCFLAGS=['-Os'])
+ env.AppendUnique(CPPDEFINES=['NDEBUG'])
else:
- env.AppendUnique(CCFLAGS = ['-g'])
+ env.AppendUnique(CCFLAGS=['-g'])
if env.get('LOGGING'):
- env.AppendUnique(CPPDEFINES = ['TB_LOG'])
+ env.AppendUnique(CPPDEFINES=['TB_LOG'])
gtest_env = SConscript('#extlibs/gtest/SConscript')
lib_env = gtest_env.Clone()
# Build flags
######################################################################
-notification_wrapper_test_env.AppendUnique(LIBPATH = [lib_env.get('BUILD_DIR')])
-notification_wrapper_test_env.AppendUnique(LIBS = [
- 'connectivity_abstraction', 'oc', 'octbstack', 'oc_logger', 'coap', 'resource_directory'
+notification_wrapper_test_env.AppendUnique(LIBPATH=[lib_env.get('BUILD_DIR')])
+notification_wrapper_test_env.AppendUnique(LIBS=[
+ 'connectivity_abstraction',
+ 'oc',
+ 'octbstack',
+ 'oc_logger',
+ 'coap',
+ 'resource_directory',
+
])
if env.get('WITH_TCP') == True:
- notification_wrapper_test_env.AppendUnique(CPPDEFINES = ['WITH_TCP'])
+ notification_wrapper_test_env.AppendUnique(CPPDEFINES=['WITH_TCP'])
if env.get('SECURED') == '1':
- notification_wrapper_test_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+ notification_wrapper_test_env.AppendUnique(
+ LIBS=['mbedtls', 'mbedx509', 'mbedcrypto'])
if target_os not in ['windows', 'winrt']:
- notification_wrapper_test_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
+ notification_wrapper_test_env.AppendUnique(
+ CXXFLAGS=['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
-notification_wrapper_test_env.AppendUnique(LINKFLAGS = ['-Wl,--no-as-needed'])
+notification_wrapper_test_env.AppendUnique(LINKFLAGS=['-Wl,--no-as-needed'])
-notification_wrapper_test_env.AppendUnique(CXXFLAGS = ['-pthread'])
-notification_wrapper_test_env.AppendUnique(LIBS = ['pthread'])
+notification_wrapper_test_env.AppendUnique(CXXFLAGS=['-pthread'])
+notification_wrapper_test_env.AppendUnique(LIBS=['pthread'])
-notification_wrapper_test_env.PrependUnique(CPPPATH = [
+notification_wrapper_test_env.PrependUnique(CPPPATH=[
'#/extlibs/hippomocks/hippomocks',
'../provider/inc',
'../consumer/inc',
######################################################################
notification_consumer_wrapper_test_env = notification_wrapper_test_env.Clone()
-notification_consumer_wrapper_test_env.AppendUnique(LIBS = ['notification_consumer_wrapper','notification_consumer'])
+notification_consumer_wrapper_test_env.AppendUnique(
+ LIBS=['notification_consumer_wrapper', 'notification_consumer'])
notification_provider_wrapper_test_env = notification_wrapper_test_env.Clone()
-notification_provider_wrapper_test_env.AppendUnique(LIBS = ['notification_provider_wrapper','notification_provider'])
-
-notification_consumer_wrapper_test_src = env.Glob('./NSConsumerServiceTest2.cpp')
-notification_consumer_wrapper_test = notification_consumer_wrapper_test_env.Program('notification_consumer_wrapper_test', notification_consumer_wrapper_test_src)
+notification_provider_wrapper_test_env.AppendUnique(
+ LIBS=['notification_provider_wrapper', 'notification_provider'])
+
+notification_consumer_wrapper_test_src = env.Glob(
+ './NSConsumerServiceTest2.cpp')
+notification_consumer_wrapper_test = notification_consumer_wrapper_test_env.Program(
+ 'notification_consumer_wrapper_test',
+ notification_consumer_wrapper_test_src)
Alias("notification_consumer_wrapper_test", notification_consumer_wrapper_test)
env.AppendTarget('notification_consumer_wrapper_test')
-notification_consumer_wrapper_test_src = env.Glob('./NSConsumerServiceTest.cpp')
-notification_consumer_wrapper_internaltest = notification_consumer_wrapper_test_env.Program('notification_consumer_wrapper_internaltest', notification_consumer_wrapper_test_src)
-Alias("notification_consumer_wrapper_internaltest", notification_consumer_wrapper_internaltest)
+notification_consumer_wrapper_test_src = env.Glob(
+ './NSConsumerServiceTest.cpp')
+notification_consumer_wrapper_internaltest = notification_consumer_wrapper_test_env.Program(
+ 'notification_consumer_wrapper_internaltest',
+ notification_consumer_wrapper_test_src)
+Alias("notification_consumer_wrapper_internaltest",
+ notification_consumer_wrapper_internaltest)
env.AppendTarget('notification_consumer_wrapper_test')
-notification_provider_wrapper_test_src = env.Glob('./NSProviderServiceTest2.cpp')
-notification_provider_wrapper_test = notification_provider_wrapper_test_env.Program('notification_provider_wrapper_test', notification_provider_wrapper_test_src)
+notification_provider_wrapper_test_src = env.Glob(
+ './NSProviderServiceTest2.cpp')
+notification_provider_wrapper_test = notification_provider_wrapper_test_env.Program(
+ 'notification_provider_wrapper_test',
+ notification_provider_wrapper_test_src)
Alias("notification_provider_wrapper_test", notification_provider_wrapper_test)
env.AppendTarget('notification_provider_wrapper_test')
-notification_provider_wrapper_test_src = env.Glob('./NSProviderServiceTest.cpp')
-notification_provider_wrapper_internaltest = notification_provider_wrapper_test_env.Program('notification_provider_wrapper_internaltest', notification_provider_wrapper_test_src)
-Alias("notification_provider_wrapper_internaltest", notification_provider_wrapper_internaltest)
+notification_provider_wrapper_test_src = env.Glob(
+ './NSProviderServiceTest.cpp')
+notification_provider_wrapper_internaltest = notification_provider_wrapper_test_env.Program(
+ 'notification_provider_wrapper_internaltest',
+ notification_provider_wrapper_test_src)
+Alias("notification_provider_wrapper_internaltest",
+ notification_provider_wrapper_internaltest)
env.AppendTarget('notification_provider_wrapper_test')
# TODO: Fix this test for more configs and remove this commented line
if env.get('TEST') == '1':
if env.get('SECURED') != '1':
if target_os in ['linux']:
- from tools.scons.RunTest import *
- run_test(notification_consumer_wrapper_test_env,
- 'service_notification_cpp-wrapper_unittest_notification_consumer_wrapper_test.memcheck',
- 'service/notification/cpp-wrapper/unittest/notification_consumer_wrapper_test',
- notification_consumer_wrapper_test)
- run_test(notification_provider_wrapper_test_env,
- 'service_notification_cpp-wrapper_unittest_notification_provider_wrapper_test.memcheck',
- 'service/notification/cpp-wrapper/unittest/notification_provider_wrapper_test',
- notification_provider_wrapper_test)
+ run_test(
+ notification_consumer_wrapper_test_env,
+ 'service_notification_cpp-wrapper_unittest_notification_consumer_wrapper_test.memcheck',
+ 'service/notification/cpp-wrapper/unittest/notification_consumer_wrapper_test',
+ notification_consumer_wrapper_test)
+ run_test(
+ notification_provider_wrapper_test_env,
+ 'service_notification_cpp-wrapper_unittest_notification_provider_wrapper_test.memcheck',
+ 'service/notification/cpp-wrapper/unittest/notification_provider_wrapper_test',
+ notification_provider_wrapper_test)
target_os = env.get('TARGET_OS')
if target_os == 'linux':
- SConscript('linux/SConscript')
+ SConscript('linux/SConscript')
elif target_os == 'android':
- SConscript('android/SConscript')
\ No newline at end of file
+ SConscript('android/SConscript')
ANDROID_TARGET_ARCH = env.get('TARGET_ARCH')
if env.get('RELEASE'):
- ANDROID_RELEASE="release"
+ ANDROID_RELEASE = "release"
else:
- ANDROID_RELEASE="debug"
+ ANDROID_RELEASE = "debug"
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'):
+if not os.path.exists(android_home +
+ '/platforms/android-21') or not os.path.exists(
+ android_home + '/build-tools/20.0.0'):
print '''
***************************************** Info ********************************
* Either 'Android API 21' is not installed or 'Android SDK Build Tools *
'''
os.system(android_home + '/tools/android')
+
def ensure_libs(target, source, env):
- return target, [source,
- env.get('BUILD_DIR') + 'libnotification_provider_jni.so',
- env.get('BUILD_DIR') + 'libnotification_provider_wrapper.so',
- env.get('BUILD_DIR') + 'libnotification_provider.so',
- env.get('BUILD_DIR') + 'libnotification_consumer_jni.so',
- env.get('BUILD_DIR') + 'libnotification_consumer_wrapper.so',
- env.get('BUILD_DIR') + 'libnotification_consumer.so']
+ return target, [
+ source,
+ env.get('BUILD_DIR') + 'libnotification_provider_jni.so',
+ env.get('BUILD_DIR') + 'libnotification_provider_wrapper.so',
+ env.get('BUILD_DIR') + 'libnotification_provider.so',
+ env.get('BUILD_DIR') + 'libnotification_consumer_jni.so',
+ env.get('BUILD_DIR') + 'libnotification_consumer_wrapper.so',
+ env.get('BUILD_DIR') + 'libnotification_consumer.so'
+ ]
+
jdk_env = Environment(ENV=os.environ)
-jdk_env['BUILDERS']['Gradle'] = Builder(action = env.get('ANDROID_GRADLE') +
- ' build -bservice/notification/examples/android/NotiConsumerExample/build.gradle -PTARGET_ARCH=%s -PRELEASE=%s --stacktrace' %(ANDROID_TARGET_ARCH, ANDROID_RELEASE),
- emitter = ensure_libs)
+jdk_env['BUILDERS']['Gradle'] = Builder(
+ action=env.get('ANDROID_GRADLE') +
+ ' build -bservice/notification/examples/android/NotiConsumerExample/build.gradle -PTARGET_ARCH=%s -PRELEASE=%s --stacktrace'
+ % (ANDROID_TARGET_ARCH, ANDROID_RELEASE),
+ emitter=ensure_libs)
jdk_env['BUILD_DIR'] = env.get('BUILD_DIR')
-cmdBuildNotificationConsumerApp=jdk_env.Gradle(target="app/apk",
- source=["app/src/main/java/org/iotivity/service/ns/sample/consumer/MainActivity.java",
- "app/src/main/java/org/iotivity/service/ns/sample/consumer/ConsumerSample.java"])
-jdk_env.Clean(cmdBuildNotificationConsumerApp, '#/service/notification/examples/android/NotiConsumerExample/build')
-jdk_env.Clean(cmdBuildNotificationConsumerApp, '#/service/notification/examples/android/NotiConsumerExample/app/build')
+cmdBuildNotificationConsumerApp = jdk_env.Gradle(
+ target="app/apk",
+ source=[
+ "app/src/main/java/org/iotivity/service/ns/sample/consumer/MainActivity.java",
+ "app/src/main/java/org/iotivity/service/ns/sample/consumer/ConsumerSample.java"
+ ])
+jdk_env.Clean(
+ cmdBuildNotificationConsumerApp,
+ '#/service/notification/examples/android/NotiConsumerExample/build')
+jdk_env.Clean(
+ cmdBuildNotificationConsumerApp,
+ '#/service/notification/examples/android/NotiConsumerExample/app/build')
Depends(cmdBuildNotificationConsumerApp, env.get('notificationAAR'))
ANDROID_TARGET_ARCH = env.get('TARGET_ARCH')
if env.get('RELEASE'):
- ANDROID_RELEASE="release"
+ ANDROID_RELEASE = "release"
else:
- ANDROID_RELEASE="debug"
+ ANDROID_RELEASE = "debug"
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'):
+if not os.path.exists(android_home +
+ '/platforms/android-21') or not os.path.exists(
+ android_home + '/build-tools/20.0.0'):
print '''
***************************************** Info ********************************
* Either 'Android API 21' is not installed or 'Android SDK Build Tools *
'''
os.system(android_home + '/tools/android')
+
def ensure_libs(target, source, env):
- return target, [source,
- env.get('BUILD_DIR') + 'libnotification_provider_jni.so',
- env.get('BUILD_DIR') + 'libnotification_provider_wrapper.so',
- env.get('BUILD_DIR') + 'libnotification_provider.so',
- env.get('BUILD_DIR') + 'libnotification_consumer_jni.so',
- env.get('BUILD_DIR') + 'libnotification_consumer_wrapper.so',
- env.get('BUILD_DIR') + 'libnotification_consumer.so']
+ return target, [
+ source,
+ env.get('BUILD_DIR') + 'libnotification_provider_jni.so',
+ env.get('BUILD_DIR') + 'libnotification_provider_wrapper.so',
+ env.get('BUILD_DIR') + 'libnotification_provider.so',
+ env.get('BUILD_DIR') + 'libnotification_consumer_jni.so',
+ env.get('BUILD_DIR') + 'libnotification_consumer_wrapper.so',
+ env.get('BUILD_DIR') + 'libnotification_consumer.so'
+ ]
+
jdk_env = Environment(ENV=os.environ)
-jdk_env['BUILDERS']['Gradle'] = Builder(action = env.get('ANDROID_GRADLE') +
- ' build -bservice/notification/examples/android/NotiProviderExample/build.gradle -PTARGET_ARCH=%s -PRELEASE=%s --stacktrace' %(ANDROID_TARGET_ARCH, ANDROID_RELEASE),
- emitter = ensure_libs)
+jdk_env['BUILDERS']['Gradle'] = Builder(
+ action=env.get('ANDROID_GRADLE') +
+ ' build -bservice/notification/examples/android/NotiProviderExample/build.gradle -PTARGET_ARCH=%s -PRELEASE=%s --stacktrace'
+ % (ANDROID_TARGET_ARCH, ANDROID_RELEASE),
+ emitter=ensure_libs)
jdk_env['BUILD_DIR'] = env.get('BUILD_DIR')
-cmdBuildNotificationProviderApp=jdk_env.Gradle(target="app/apk",
- source=["app/src/main/java/org/iotivity/service/ns/sample/provider/MainActivity.java",
- "app/src/main/java/org/iotivity/service/ns/sample/provider/NotiListener.java",
- "app/src/main/java/org/iotivity/service/ns/sample/provider/ProviderSample.java"])
-jdk_env.Clean(cmdBuildNotificationProviderApp, '#/service/notification/examples/android/NotiProviderExample/build')
-jdk_env.Clean(cmdBuildNotificationProviderApp, '#/service/notification/examples/android/NotiProviderExample/app/build')
+cmdBuildNotificationProviderApp = jdk_env.Gradle(
+ target="app/apk",
+ source=[
+ "app/src/main/java/org/iotivity/service/ns/sample/provider/MainActivity.java",
+ "app/src/main/java/org/iotivity/service/ns/sample/provider/NotiListener.java",
+ "app/src/main/java/org/iotivity/service/ns/sample/provider/ProviderSample.java"
+ ])
+jdk_env.Clean(
+ cmdBuildNotificationProviderApp,
+ '#/service/notification/examples/android/NotiProviderExample/build')
+jdk_env.Clean(
+ cmdBuildNotificationProviderApp,
+ '#/service/notification/examples/android/NotiProviderExample/app/build')
Depends(cmdBuildNotificationProviderApp, env.get('notificationAAR'))
######################################################################
# 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/include'])
-notification_sample_env.AppendUnique(CPPPATH = ['#/resource/csdk/stack/include'])
-notification_sample_env.AppendUnique(CPPPATH = ['#/resource/csdk/security/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 = [
- 'resource_directory',
- 'octbstack',
- 'connectivity_abstraction',
- 'oc_logger',
- 'libcoap',
- ])
+notification_sample_env.AppendUnique(CPPPATH=[
+ '../../include',
+ '../../src/common',
+ '../../src/provider',
+ '#/resource/csdk/include',
+ '#/resource/csdk/stack/include',
+ '#/resource/csdk/security/include',
+ '#/resource/csdk/resource-directory/include',
+ '#/resource/csdk/connectivity/api',
+])
+
+notification_sample_env.PrependUnique(LIBS=[
+ 'resource_directory',
+ 'octbstack',
+ 'connectivity_abstraction',
+ 'oc_logger',
+ 'libcoap',
+])
if target_os not in ['windows', 'winrt']:
- notification_sample_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
+ 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'])
+ notification_sample_env.AppendUnique(LINKFLAGS=['-Wl,--no-undefined'])
if target_os == 'linux':
- notification_sample_env.AppendUnique(LIBS = ['pthread'])
+ 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'])
+ 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 not env.get('RELEASE'):
+ notification_sample_env.AppendUnique(LIBS=['log'])
notification_sample_consumer_src = 'notificationconsumer.c'
notification_sample_provider_src = 'notificationprovider.c'
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'])
-
- providerCloudConnectorObj = notification_sample_env.Object('cloud_connector.c')
- consumerCloudConnectorObj = notification_sample_env.Object('cloud_connector.c')
-
- #PROVIDER_CLOUD = File('cloud_connector.c')
- #notification_sample_provider_src = ['notificationprovider.c', PROVIDER_CLOUD]
- notification_sample_provider_src = ['notificationprovider.c', providerCloudConnectorObj]
- #CONSUMER_CLOUD = File('cloud_connector.c')
- #notification_sample_consumer_src = ['notificationconsumer.c', CONSUMER_CLOUD]
- notification_sample_consumer_src = ['notificationconsumer.c', consumerCloudConnectorObj]
+ notification_sample_env.AppendUnique(CPPPATH=['../../src/consumer'])
+ notification_sample_env.AppendUnique(CPPPATH=['../../src/provider'])
+ notification_sample_env.AppendUnique(CPPDEFINES=['WITH_CLOUD'])
+
+ providerCloudConnectorObj = notification_sample_env.Object('cloud_connector.c')
+ consumerCloudConnectorObj = notification_sample_env.Object('cloud_connector.c')
+
+ #PROVIDER_CLOUD = File('cloud_connector.c')
+ #notification_sample_provider_src = ['notificationprovider.c', PROVIDER_CLOUD]
+ notification_sample_provider_src = [
+ 'notificationprovider.c',
+ providerCloudConnectorObj,
+ ]
+ #CONSUMER_CLOUD = File('cloud_connector.c')
+ #notification_sample_consumer_src = ['notificationconsumer.c', CONSUMER_CLOUD]
+ notification_sample_consumer_src = [
+ 'notificationconsumer.c',
+ consumerCloudConnectorObj,
+ ]
if env.get('WITH_TCP') == True:
- notification_sample_env.AppendUnique(CPPDEFINES = ['WITH_TCP'])
+ notification_sample_env.AppendUnique(CPPDEFINES=['WITH_TCP'])
if env.get('SECURED') == '1':
- notification_sample_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+ 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'])
+ 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'])
+ 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'])
+ 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 = 'libnotification_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_provider_env.AppendUnique(LIBS='libnotification_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 = 'libnotification_consumer')
-notificationconsumer = notification_sample_consumer_env.Program('notificationconsumer', notification_sample_consumer_src)
-i_notificationprovider = notification_sample_consumer_env.Install(env.get('BUILD_DIR'), notificationconsumer)
+notification_sample_consumer_env.AppendUnique(LIBS='libnotification_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('providerCloudConnectorObj')
- Export('consumerCloudConnectorObj')
+ Export('providerCloudConnectorObj')
+ Export('consumerCloudConnectorObj')
##
# Notification Unit Test build script
##
-from tools.scons.RunTest import run_test
-Import('env')
import os
+from tools.scons.RunTest import run_test
+
+Import('env')
if env.get('RELEASE'):
- env.AppendUnique(CCFLAGS = ['-Os'])
- env.AppendUnique(CPPDEFINES = ['NDEBUG'])
+ env.AppendUnique(CCFLAGS=['-Os'])
+ env.AppendUnique(CPPDEFINES=['NDEBUG'])
else:
- env.AppendUnique(CCFLAGS = ['-g'])
+ env.AppendUnique(CCFLAGS=['-g'])
if env.get('LOGGING'):
- env.AppendUnique(CPPDEFINES = ['TB_LOG'])
+ env.AppendUnique(CPPDEFINES=['TB_LOG'])
gtest_env = SConscript('#extlibs/gtest/SConscript')
lib_env = gtest_env.Clone()
######################################################################
# Build flags
######################################################################
-notification_test_env.AppendUnique(LIBPATH = [lib_env.get('BUILD_DIR')])
-notification_test_env.AppendUnique(LIBS = [
- 'resource_directory', 'oc',
- 'octbstack', 'connectivity_abstraction', 'oc_logger',
- 'coap'
+notification_test_env.AppendUnique(LIBPATH=[lib_env.get('BUILD_DIR')])
+notification_test_env.AppendUnique(LIBS=[
+ 'resource_directory',
+ 'oc',
+ 'octbstack',
+ 'connectivity_abstraction',
+ 'oc_logger',
+ 'coap',
])
if target_os not in ['windows', 'winrt']:
- notification_test_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
+ notification_test_env.AppendUnique(
+ CXXFLAGS=['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
+
+notification_test_env.AppendUnique(LINKFLAGS=['-Wl,--no-as-needed'])
-notification_test_env.AppendUnique(LINKFLAGS = ['-Wl,--no-as-needed'])
-notification_test_env.AppendUnique(CXXFLAGS = ['-pthread'])
-notification_test_env.AppendUnique(LIBS = ['pthread'])
-notification_test_env.AppendUnique(CPPPATH = ['../include'])
-notification_test_env.AppendUnique(CPPPATH = ['../src/consumer'])
-notification_test_env.AppendUnique(CPPPATH = ['../src/provider'])
-notification_test_env.AppendUnique(CPPPATH = ['../src/common'])
-notification_test_env.AppendUnique(CPPPATH = [src_dir + '/resource/csdk/connectivity/api'])
+notification_test_env.AppendUnique(CXXFLAGS=['-pthread'])
+notification_test_env.AppendUnique(LIBS=['pthread'])
+
+notification_test_env.PrependUnique(CPPPATH=[
+ '../include',
+ '../src/consumer',
+ '../src/provider',
+ '../src/common',
+ src_dir + '/resource/csdk/connectivity/api',
+])
if env.get('WITH_TCP') == True:
- notification_test_env.AppendUnique(CPPDEFINES = ['WITH_TCP'])
+ notification_test_env.AppendUnique(CPPDEFINES=['WITH_TCP'])
if env.get('SECURED') == '1':
- notification_test_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
- notification_test_env.AppendUnique(CPPPATH = ['#/resource/csdk/security/include'])
+ notification_test_env.AppendUnique(
+ LIBS=['mbedtls', 'mbedx509', 'mbedcrypto'])
+ notification_test_env.AppendUnique(
+ CPPPATH=['#/resource/csdk/security/include'])
######################################################################
# Build Test
######################################################################
notification_consumer_test_env = notification_test_env.Clone()
-notification_consumer_test_env.AppendUnique(LIBS = ['notification_consumer'])
+notification_consumer_test_env.AppendUnique(LIBS=['notification_consumer'])
notification_provider_test_env = notification_test_env.Clone()
-notification_provider_test_env.AppendUnique(LIBS = ['notification_provider'])
+notification_provider_test_env.AppendUnique(LIBS=['notification_provider'])
notification_consumer_test_src = env.Glob('./NSConsumerTest2.cpp')
-notification_consumer_test = notification_consumer_test_env.Program('notification_consumer_test', notification_consumer_test_src)
+notification_consumer_test = notification_consumer_test_env.Program(
+ 'notification_consumer_test', notification_consumer_test_src)
Alias("notification_consumer_test", notification_consumer_test)
env.AppendTarget('notification_consumer_test')
notification_consumer_test_src = env.Glob('./NSConsumerTest.cpp')
-notification_consumer_internaltest = notification_consumer_test_env.Program('notification_consumer_internaltest', notification_consumer_test_src)
+notification_consumer_internaltest = notification_consumer_test_env.Program(
+ 'notification_consumer_internaltest', notification_consumer_test_src)
Alias("notification_consumer_internaltest", notification_consumer_internaltest)
notification_provider_test_src = env.Glob('./NSProviderTest2.cpp')
notification_provider_test = notification_provider_test_env.Program(
- 'notification_provider_test', notification_provider_test_src)
+ 'notification_provider_test', notification_provider_test_src)
Alias("notification_provider_test", notification_provider_test)
env.AppendTarget('notification_provider_test')
notification_provider_test_src = env.Glob('./NSProviderTest.cpp')
notification_provider_internaltest = notification_provider_test_env.Program(
- 'notification_provider_internaltest', notification_provider_test_src)
+ 'notification_provider_internaltest', notification_provider_test_src)
Alias("notification_provider_internaltest", notification_provider_internaltest)
-# TODO: Fix this test for MLK and remove commented lines
if env.get('TEST') == '1':
if target_os in ['linux'] and env.get('SECURED') != '1':
- run_test(notification_consumer_test_env,
-# 'service_notification_unittest_notification_consumer_test.memcheck',
- '',
- 'service/notification/unittest/notification_consumer_test')
- run_test(notification_provider_test_env,
-# 'service_notification_unittest_notification_provider_test.memcheck',
- '',
- 'service/notification/unittest/notification_provider_test')
+ run_test(
+ notification_consumer_test_env,
+ #'service_notification_unittest_notification_consumer_test.memcheck',
+ '', # TODO: Fix this test for MLK and enable previous line
+ 'service/notification/unittest/notification_consumer_test')
+ run_test(
+ notification_provider_test_env,
+ #'service_notification_unittest_notification_provider_test.memcheck',
+ '', # TODO: Fix this test for MLK and enable previous line
+ 'service/notification/unittest/notification_provider_test')
else:
- notification_consumer_test_env.AppendUnique(CPPDEFINES = ['LOCAL_RUNNING'])
- notification_provider_test_env.AppendUnique(CPPDEFINES = ['LOCAL_RUNNING'])
+ notification_consumer_test_env.AppendUnique(CPPDEFINES=['LOCAL_RUNNING'])
+ notification_provider_test_env.AppendUnique(CPPDEFINES=['LOCAL_RUNNING'])
src_dir = notification_consumer_test_env.get('SRC_DIR')
svr_db_src_dir = os.path.join(src_dir, 'service/notification/unittest/')
- svr_db_build_dir = os.path.join(notification_consumer_test_env.get('BUILD_DIR'),
- 'service', 'notification', 'unittest') + os.sep
- notification_consumer_test_env.Alias("install",
- notification_consumer_test_env.Install(svr_db_build_dir,
- os.path.join(svr_db_src_dir,
- 'oic_svr_db_ns.dat')))
+ svr_db_build_dir = os.path.join(
+ notification_consumer_test_env.get('BUILD_DIR'), 'service',
+ 'notification', 'unittest') + os.sep
+ notification_consumer_test_env.Alias(
+ "install",
+ notification_consumer_test_env.Install(
+ svr_db_build_dir, os.path.join(svr_db_src_dir, 'oic_svr_db_ns.dat')))
Import('env')
import os.path
-containerJavaSupport = ARGUMENTS.get('containerJavaSupport',0)
+containerJavaSupport = ARGUMENTS.get('containerJavaSupport', 0)
-def filtered_glob(env, pattern, omit=[],
- ondisk=True, source=False, strings=False):
- return filter(
- lambda f: os.path.basename(f.path) not in omit,
- env.Glob(pattern))
-env.AddMethod(filtered_glob, "FilteredGlob");
+def filtered_glob(env,
+ pattern,
+ omit=[],
+ ondisk=True,
+ source=False,
+ strings=False):
+ return filter(lambda f: os.path.basename(f.path) not in omit,
+ env.Glob(pattern))
+
+
+env.AddMethod(filtered_glob, "FilteredGlob")
# Add third party libraries
lib_env = env.Clone()
-SConscript('#service/third_party_libs.scons', exports = 'lib_env')
+SConscript('#service/third_party_libs.scons', exports='lib_env')
resource_container_env = lib_env.Clone()
target_os = env.get('TARGET_OS')
try:
print 'Java Home: ', os.environ['JAVA_HOME']
print 'Java Lib: ', os.environ['JAVA_LIB']
- resource_container_env.Append(CPPDEFINES={'JAVA_SUPPORT':1})
+ resource_container_env.Append(CPPDEFINES={'JAVA_SUPPORT': 1})
except KeyError:
print '''
- *********************************** Error *************************************
- * Building resource container without Java support. JAVA_HOME or JAVA_LIB are not set properly
- * Please configure JAVA_HOME to point to your Java 7 JDK and
- * JAVA_LIB to your folder containing libjvm
- * Example: export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386
- * export JAVA_LIB=/usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386/server
- *******************************************************************************
- '''
- resource_container_env.Append(CPPDEFINES={'JAVA_SUPPORT':0})
-
-
-resource_container_env.AppendUnique(
- CPPPATH = [
- '#/extlibs',
- '#/resource/csdk/include',
- '#/resource/csdk/stack/include',
- '#/resource/include',
- '#/resource/oc_logger/include',
- '#/service/resource-encapsulation/include',
- 'include',
- 'bundle-api/include',
- 'src'
- ])
+*********************************** Error *************************************
+* Building resource container without Java support. JAVA_HOME or JAVA_LIB are not set properly
+* Please configure JAVA_HOME to point to your Java 7 JDK and
+* JAVA_LIB to your folder containing libjvm
+* Example: export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386
+* export JAVA_LIB=/usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386/server
+*******************************************************************************
+'''
+ resource_container_env.Append(CPPDEFINES={'JAVA_SUPPORT': 0})
+
+resource_container_env.AppendUnique(CPPPATH=[
+ '#/extlibs',
+ '#/resource/csdk/include',
+ '#/resource/csdk/stack/include',
+ '#/resource/include',
+ '#/resource/oc_logger/include',
+ '#/service/resource-encapsulation/include',
+ 'include',
+ 'bundle-api/include',
+ 'src',
+])
if int(containerJavaSupport):
try:
- resource_container_env.AppendUnique(
- CPPPATH = [
- os.environ['JAVA_HOME']+'/include',
- os.environ['JAVA_HOME']+'/include/linux'
+ resource_container_env.AppendUnique(CPPPATH=[
+ os.environ['JAVA_HOME'] + '/include',
+ os.environ['JAVA_HOME'] + '/include/linux'
])
except KeyError:
print ''
-
if target_os not in ['windows']:
- resource_container_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall'])
+ resource_container_env.AppendUnique(CXXFLAGS=['-std=c++0x', '-Wall'])
if target_os != 'android':
- resource_container_env.AppendUnique(CXXFLAGS = ['-pthread'])
+ resource_container_env.AppendUnique(CXXFLAGS=['-pthread'])
if target_os not in ['darwin', 'ios', 'windows']:
- resource_container_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
+ resource_container_env.AppendUnique(LINKFLAGS=['-Wl,--no-undefined'])
if target_os == 'android':
- resource_container_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
- resource_container_env.PrependUnique(LIBS = ['gnustl_shared', 'log'])
+ resource_container_env.AppendUnique(CXXFLAGS=['-frtti', '-fexceptions'])
+ resource_container_env.PrependUnique(LIBS=['gnustl_shared', 'log'])
try:
- resource_container_env.AppendUnique(LIBPATH = [os.environ['JAVA_LIB']])
+ resource_container_env.AppendUnique(LIBPATH=[os.environ['JAVA_LIB']])
except KeyError:
print ''
-resource_container_env.PrependUnique(LIBS = ['coap'])
-resource_container_env.AppendUnique(LIBS = ['connectivity_abstraction'])
-resource_container_env.AppendUnique(LIBS = ['oc_logger'])
-resource_container_env.AppendUnique(LIBS = ['octbstack'])
-resource_container_env.AppendUnique(LIBS = ['oc'])
-resource_container_env.AppendUnique(LIBS = ['rcs_client'])
-resource_container_env.AppendUnique(LIBS = ['rcs_server'])
-resource_container_env.AppendUnique(LIBS = ['rcs_common'])
-resource_container_env.AppendUnique(LIBS = ['dl'])
-resource_container_env.AppendUnique(LIBS = ['boost_system'])
-resource_container_env.AppendUnique(LIBS = ['boost_date_time'])
-resource_container_env.AppendUnique(LIBS = ['boost_thread'])
+resource_container_env.PrependUnique(LIBS=[
+ 'coap',
+ 'connectivity_abstraction',
+ 'oc_logger',
+ 'octbstack',
+ 'oc',
+ 'rcs_client',
+ 'rcs_server',
+ 'rcs_common',
+ 'dl',
+ 'boost_system',
+ 'boost_date_time',
+ 'boost_thread',
+])
if resource_container_env.get('SECURED') == '1':
- resource_container_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+ resource_container_env.AppendUnique(
+ LIBS=['mbedtls', 'mbedx509', 'mbedcrypto'])
if int(containerJavaSupport):
try:
print 'Java Lib: ', os.environ['JAVA_LIB']
- resource_container_env.AppendUnique(LIBS = ['jvm'])
+ resource_container_env.AppendUnique(LIBS=['jvm'])
except KeyError:
print ''
######################################################################
# Source files and Targets
######################################################################
-res_container_src = [ Glob('src/*.cpp') ]
+res_container_src = [Glob('src/*.cpp')]
-res_container_static = resource_container_env.StaticLibrary('rcs_container', res_container_src)
+res_container_static = resource_container_env.StaticLibrary(
+ 'rcs_container', res_container_src)
if target_os not in ['ios']:
- res_container_shared = resource_container_env.SharedLibrary('rcs_container', res_container_src)
- resource_container_env.InstallTarget([res_container_static,res_container_shared], 'libResContainer')
- resource_container_env.UserInstallTargetLib([res_container_static,res_container_shared], 'libResContainer')
+ res_container_shared = resource_container_env.SharedLibrary(
+ 'rcs_container', res_container_src)
+ resource_container_env.InstallTarget(
+ [res_container_static, res_container_shared], 'libResContainer')
+ resource_container_env.UserInstallTargetLib(
+ [res_container_static, res_container_shared], 'libResContainer')
else:
- resource_container_env.InstallTarget([res_container_static], 'libResContainer')
- resource_container_env.UserInstallTargetLib([res_container_static], 'libResContainer')
+ resource_container_env.InstallTarget([res_container_static],
+ 'libResContainer')
+ resource_container_env.UserInstallTargetLib([res_container_static],
+ 'libResContainer')
-resource_container_env.UserInstallTargetHeader('include/RCSBundleInfo.h', 'service/resource-container', 'RCSBundleInfo.h')
-resource_container_env.UserInstallTargetHeader('include/RCSResourceContainer.h', 'service/resource-container', 'RCSResourceContainer.h')
+resource_container_env.UserInstallTargetHeader(
+ 'include/RCSBundleInfo.h', 'service/resource-container', 'RCSBundleInfo.h')
+resource_container_env.UserInstallTargetHeader(
+ 'include/RCSResourceContainer.h', 'service/resource-container',
+ 'RCSResourceContainer.h')
if target_os in ['android']:
- resource_container_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,librcs_container.so'])
+ resource_container_env.AppendUnique(
+ LINKFLAGS=['-Wl,-soname,librcs_container.so'])
######################################################################
# build discomfort index sensor sample bundle
######################################################################
if target_os in ['linux', 'tizen', 'android']:
DI_sensor_bundle_env = resource_container_env.Clone()
- DI_sensor_bundle_env.AppendUnique(CCFLAGS = ['-fPIC'])
+ DI_sensor_bundle_env.AppendUnique(CCFLAGS=['-fPIC'])
DI_SENSOR_BUNDLE_DIR = 'examples/DiscomfortIndexSensorBundle/'
- DI_sensor_bundle_env.AppendUnique(CPPPATH = [ DI_SENSOR_BUNDLE_DIR + 'include' ])
+ DI_sensor_bundle_env.AppendUnique(
+ CPPPATH=[DI_SENSOR_BUNDLE_DIR + 'include'])
- DI_sensor_bundle_env.PrependUnique(LIBS = ['rcs_container'])
+ DI_sensor_bundle_env.PrependUnique(LIBS=['rcs_container'])
- DI_sensor_bundle_src = [ Glob(DI_SENSOR_BUNDLE_DIR + 'src/*.cpp')]
+ DI_sensor_bundle_src = [Glob(DI_SENSOR_BUNDLE_DIR + 'src/*.cpp')]
- DISensorBundle = DI_sensor_bundle_env.SharedLibrary('DISensorBundle', DI_sensor_bundle_src)
+ DISensorBundle = DI_sensor_bundle_env.SharedLibrary(
+ 'DISensorBundle', DI_sensor_bundle_src)
DI_sensor_bundle_env.InstallTarget(DISensorBundle, 'libDISensorBundle')
- DI_sensor_bundle_env.UserInstallTargetLib(DISensorBundle, 'libDISensorBundle')
+ DI_sensor_bundle_env.UserInstallTargetLib(DISensorBundle,
+ 'libDISensorBundle')
if target_os in ['linux']:
SConscript(DI_SENSOR_BUNDLE_DIR + 'src/inputSensors/SConscript')
- Command("THSensorApp", DI_SENSOR_BUNDLE_DIR + "src/inputSensors/THSensorApp/THSensorApp", Copy("$TARGET", "$SOURCE"))
- Command("THSensorApp1", DI_SENSOR_BUNDLE_DIR + "src/inputSensors/THSensorApp1/THSensorApp1", Copy("$TARGET", "$SOURCE"))
+ Command(
+ "THSensorApp",
+ DI_SENSOR_BUNDLE_DIR + "src/inputSensors/THSensorApp/THSensorApp",
+ Copy("$TARGET", "$SOURCE"))
+ Command("THSensorApp1", DI_SENSOR_BUNDLE_DIR +
+ "src/inputSensors/THSensorApp1/THSensorApp1",
+ Copy("$TARGET", "$SOURCE"))
if target_os in ['android']:
- resource_container_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libDISensorBundle.so'])
+ resource_container_env.AppendUnique(
+ LINKFLAGS=['-Wl,-soname,libDISensorBundle.so'])
######################################################################
# build BMI sensor sample bundle
######################################################################
if target_os in ['linux', 'tizen', 'android']:
BMI_sensor_bundle_env = resource_container_env.Clone()
- BMI_sensor_bundle_env.AppendUnique(CCFLAGS = ['-fPIC'])
+ BMI_sensor_bundle_env.AppendUnique(CCFLAGS=['-fPIC'])
BMI_SENSOR_BUNDLE_DIR = 'examples/BMISensorBundle/'
- BMI_sensor_bundle_env.AppendUnique(CPPPATH = [ BMI_SENSOR_BUNDLE_DIR + 'include' ])
+ BMI_sensor_bundle_env.AppendUnique(
+ CPPPATH=[BMI_SENSOR_BUNDLE_DIR + 'include'])
- BMI_sensor_bundle_env.PrependUnique(LIBS = ['rcs_container'])
+ BMI_sensor_bundle_env.PrependUnique(LIBS=['rcs_container'])
- BMI_sensor_bundle_src = [ Glob(BMI_SENSOR_BUNDLE_DIR + 'src/*.cpp')]
+ BMI_sensor_bundle_src = [Glob(BMI_SENSOR_BUNDLE_DIR + 'src/*.cpp')]
- BMISensorBundle = BMI_sensor_bundle_env.SharedLibrary('BMISensorBundle', BMI_sensor_bundle_src)
+ BMISensorBundle = BMI_sensor_bundle_env.SharedLibrary(
+ 'BMISensorBundle', BMI_sensor_bundle_src)
BMI_sensor_bundle_env.InstallTarget(BMISensorBundle, 'libBMISensorBundle')
- BMI_sensor_bundle_env.UserInstallTargetLib(BMISensorBundle, 'libBMISensorBundle')
+ BMI_sensor_bundle_env.UserInstallTargetLib(BMISensorBundle,
+ 'libBMISensorBundle')
if target_os in ['linux']:
SConscript(BMI_SENSOR_BUNDLE_DIR + 'src/inputSensors/SConscript')
- Command("HeightSensorApp", BMI_SENSOR_BUNDLE_DIR + "src/inputSensors/HeightSensorApp/HeightSensorApp", Copy("$TARGET", "$SOURCE"))
- Command("WeightSensorApp", BMI_SENSOR_BUNDLE_DIR + "src/inputSensors/WeightSensorApp/WeightSensorApp", Copy("$TARGET", "$SOURCE"))
+ Command("HeightSensorApp", BMI_SENSOR_BUNDLE_DIR +
+ "src/inputSensors/HeightSensorApp/HeightSensorApp",
+ Copy("$TARGET", "$SOURCE"))
+ Command("WeightSensorApp", BMI_SENSOR_BUNDLE_DIR +
+ "src/inputSensors/WeightSensorApp/WeightSensorApp",
+ Copy("$TARGET", "$SOURCE"))
if target_os in ['android']:
- resource_container_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libBMISensorBundle.so'])
+ resource_container_env.AppendUnique(
+ LINKFLAGS=['-Wl,-soname,libBMISensorBundle.so'])
######################################################################
# build hue sample bundle
conf2 = Configure(lib_env)
if not conf2.CheckLib('curl'):
- print '''X
+ print '''
*********************************** Error *************************************
* Cannot build hue sample. Please install libcurl.
* Example (Ubuntu):
'''
else:
hue_resource_bundle_env = resource_container_env.Clone()
- hue_resource_bundle_env.AppendUnique(CCFLAGS = ['-fPIC'])
+ hue_resource_bundle_env.AppendUnique(CCFLAGS=['-fPIC'])
HUE_RESOURCE_BUNDLE_DIR = 'examples/HueSampleBundle/'
- hue_resource_bundle_env.AppendUnique(CPPPATH = [
- HUE_RESOURCE_BUNDLE_DIR + 'include',
- 'include/'
- ])
+ hue_resource_bundle_env.AppendUnique(
+ CPPPATH=[HUE_RESOURCE_BUNDLE_DIR + 'include', 'include/'])
- hue_resource_bundle_env.PrependUnique(LIBS = ['curl', 'rcs_container'])
+ hue_resource_bundle_env.PrependUnique(LIBS=['curl', 'rcs_container'])
- hue_resource_bundle_src = [ Glob(HUE_RESOURCE_BUNDLE_DIR + 'src/*.cpp')]
+ hue_resource_bundle_src = [Glob(HUE_RESOURCE_BUNDLE_DIR + 'src/*.cpp')]
- HueBundle = hue_resource_bundle_env.SharedLibrary('HueBundle', hue_resource_bundle_src)
+ HueBundle = hue_resource_bundle_env.SharedLibrary('HueBundle',
+ hue_resource_bundle_src)
hue_resource_bundle_env.InstallTarget(HueBundle, 'libHueBundle')
hue_resource_bundle_env.UserInstallTargetLib(HueBundle, 'libHueBundle')
lib_env = conf2.Finish()
# Build Container Sample
######################################################################
if target_os not in ['ios']:
- containersample_env = resource_container_env.Clone();
+ containersample_env = resource_container_env.Clone()
containersample_env.AppendUnique(LINKFLAGS=["-rdynamic"])
# Copy test configuration
- Command("examples/ResourceContainerConfig.xml","examples/ResourceContainerConfig.xml", Copy("$TARGET", "$SOURCE"))
- Ignore("examples/ResourceContainerConfig.xml", "examples/ResourceContainerConfig.xml")
+ Command("examples/ResourceContainerConfig.xml",
+ "examples/ResourceContainerConfig.xml", Copy("$TARGET", "$SOURCE"))
+ Ignore("examples/ResourceContainerConfig.xml",
+ "examples/ResourceContainerConfig.xml")
- containersample_env.AppendUnique(LIBS = ['rcs_container','resource_directory'])
+ containersample_env.AppendUnique(
+ LIBS=['rcs_container', 'resource_directory'])
- containersampleapp_src = ['examples/ContainerSample.cpp']
- containersampleapp = containersample_env.Program('ContainerSample',containersampleapp_src)
+ containersampleapp_src = ['examples/ContainerSample.cpp']
+ containersampleapp = containersample_env.Program('ContainerSample',
+ containersampleapp_src)
Alias("containersample", containersampleapp)
env.AppendTarget('containersample')
-######################################################################
-# Build Container Sample Client
-######################################################################
- containersampleclient_env = resource_container_env.Clone();
+ ######################################################################
+ # Build Container Sample Client
+ ######################################################################
+ containersampleclient_env = resource_container_env.Clone()
- containersample_env.AppendUnique(LIBS = ['rcs_container'])
- containersampleclient_src = ['examples/ContainerSampleClient.cpp']
- containersampleclientapp = containersample_env.Program('ContainerSampleClient',containersampleclient_src)
+ # this looks like a duplicate, needed?
+ containersample_env.AppendUnique(LIBS=['rcs_container'])
+ containersampleclient_src = ['examples/ContainerSampleClient.cpp']
+ containersampleclientapp = containersample_env.Program(
+ 'ContainerSampleClient', containersampleclient_src)
Alias("containersampleclient", containersampleclientapp)
env.AppendTarget('containersampleclient')
ANDROID_TARGET_ARCH = env.get('TARGET_ARCH')
if env.get('RELEASE'):
- ANDROID_RELEASE="release"
+ ANDROID_RELEASE = "release"
else:
- ANDROID_RELEASE="debug"
+ ANDROID_RELEASE = "debug"
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'):
+if not os.path.exists(android_home +
+ '/platforms/android-21') or not os.path.exists(
+ android_home + '/build-tools/20.0.0'):
print '''
***************************************** Info ********************************
* Either 'Android API 21' is not installed or 'Android SDK Build Tools *
...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') + 'librcs_container.so']
+
jdk_env = Environment(ENV=os.environ)
-jdk_env['BUILDERS']['Gradle'] = Builder(action = env.get('ANDROID_GRADLE') +
- ' build -bservice/resource-container/android/build.gradle -PTARGET_ARCH=%s -PRELEASE=%s --stacktrace' %(ANDROID_TARGET_ARCH, ANDROID_RELEASE),
- emitter = ensure_libs)
+jdk_env['BUILDERS']['Gradle'] = Builder(
+ action=env.get('ANDROID_GRADLE') +
+ ' build -bservice/resource-container/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')
-cmdResourceContainerApp = jdk_env.Gradle(target="resource-container/objs",
- source="resource-container/src/main/java/org/iotivity/service/resourcecontainer/RcsBundleInfo.java")
-jdk_env.Clean(cmdResourceContainerApp, '#/service/resource-container/android/build')
-jdk_env.Clean(cmdResourceContainerApp, '#/service/resource-container/android/resource-container/build')
+cmdResourceContainerApp = jdk_env.Gradle(
+ target="resource-container/objs",
+ source=
+ "resource-container/src/main/java/org/iotivity/service/resourcecontainer/RcsBundleInfo.java"
+)
+jdk_env.Clean(cmdResourceContainerApp,
+ '#/service/resource-container/android/build')
+jdk_env.Clean(cmdResourceContainerApp,
+ '#/service/resource-container/android/resource-container/build')
Import('env linux_sample_env')
# Add third party libraries
-SConscript('#service/third_party_libs.scons', exports = { 'lib_env' : linux_sample_env })
+SConscript('#service/third_party_libs.scons',
+ exports={'lib_env': linux_sample_env})
######################################################################
# Build flags
######################################################################
-linux_sample_env.AppendUnique(CPPPATH = ['include'])
-linux_sample_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread'])
-linux_sample_env.AppendUnique(CPPDEFINES = ['LINUX'])
-linux_sample_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
-linux_sample_env.AppendUnique(LIBS = ['coap'])
-linux_sample_env.AppendUnique(LIBS = ['connectivity_abstraction'])
-linux_sample_env.AppendUnique(LIBS = ['oc_logger'])
-linux_sample_env.AppendUnique(LIBS = ['octbstack'])
-linux_sample_env.AppendUnique(LIBS = ['oc'])
-linux_sample_env.AppendUnique(LIBS = ['pthread'])
+linux_sample_env.AppendUnique(CPPPATH=['include'])
+linux_sample_env.AppendUnique(CXXFLAGS=['-std=c++0x', '-Wall', '-pthread'])
+linux_sample_env.AppendUnique(CPPDEFINES=['LINUX'])
+linux_sample_env.AppendUnique(LIBPATH=[env.get('BUILD_DIR')])
+linux_sample_env.AppendUnique(LIBS=[
+ 'coap',
+ 'connectivity_abstraction',
+ 'oc_logger',
+ 'octbstack',
+ 'oc',
+ 'pthread',
+])
if env.get('SECURED') == '1':
- linux_sample_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+ linux_sample_env.AppendUnique(LIBS=['mbedtls', 'mbedx509', 'mbedcrypto'])
# On some platforms link order can miss functions so librt needs to be
# re-scanned at the end if present. gcc 4.6 is one with this issue.
if 'rt' in linux_sample_env.get('LIBS'):
- linux_sample_env.Append(LIBS = ['rt'])
+ linux_sample_env.Append(LIBS=['rt'])
######################################################################
#build sampleapp
######################################################################
-heightsensorapp = linux_sample_env.Program('HeightSensorApp', 'src/HeightSensorApp.cpp')
+heightsensorapp = linux_sample_env.Program('HeightSensorApp',
+ 'src/HeightSensorApp.cpp')
Alias("heightsensorapp_sample", heightsensorapp)
env.AppendTarget('heightsensorapp')
linux_sample_env = env.Clone()
-linux_sample_env.AppendUnique(CPPPATH = [
+linux_sample_env.AppendUnique(CPPPATH=[
'#/resource/csdk/include',
'#/resource/csdk/stack/include',
'#/resource/include',
- '#/resource/oc_logger/include'
+ '#/resource/oc_logger/include',
])
if target_os in ['linux']:
- SConscript('HeightSensorApp/SConscript', 'linux_sample_env')
- SConscript('WeightSensorApp/SConscript', 'linux_sample_env')
\ No newline at end of file
+ SConscript('HeightSensorApp/SConscript', 'linux_sample_env')
+ SConscript('WeightSensorApp/SConscript', 'linux_sample_env')
Import('env linux_sample_env')
# Add third party libraries
-SConscript('#service/third_party_libs.scons', exports = { 'lib_env' : linux_sample_env })
+SConscript(
+ '#service/third_party_libs.scons', exports={'lib_env': linux_sample_env})
######################################################################
# Build flags
######################################################################
-linux_sample_env.AppendUnique(CPPPATH = ['include'])
-linux_sample_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread'])
-linux_sample_env.AppendUnique(CPPDEFINES = ['LINUX'])
-linux_sample_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
-linux_sample_env.AppendUnique(LIBS = ['coap'])
-linux_sample_env.AppendUnique(LIBS = ['connectivity_abstraction'])
-linux_sample_env.AppendUnique(LIBS = ['oc_logger'])
-linux_sample_env.AppendUnique(LIBS = ['octbstack'])
-linux_sample_env.AppendUnique(LIBS = ['oc'])
-linux_sample_env.AppendUnique(LIBS = ['pthread'])
+linux_sample_env.AppendUnique(CPPPATH=['include'])
+linux_sample_env.AppendUnique(CXXFLAGS=['-std=c++0x', '-Wall', '-pthread'])
+linux_sample_env.AppendUnique(CPPDEFINES=['LINUX'])
+linux_sample_env.AppendUnique(LIBPATH=[env.get('BUILD_DIR')])
+linux_sample_env.AppendUnique(LIBS=[
+ 'coap',
+ 'connectivity_abstraction',
+ 'oc_logger',
+ 'octbstack',
+ 'oc',
+ 'pthread',
+])
if env.get('SECURED') == '1':
- linux_sample_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+ linux_sample_env.AppendUnique(LIBS=['mbedtls', 'mbedx509', 'mbedcrypto'])
# On some platforms link order can miss functions so librt needs to be
# re-scanned at the end if present. gcc 4.6 is one with this issue.
if 'rt' in linux_sample_env.get('LIBS'):
- linux_sample_env.Append(LIBS = ['rt'])
+ linux_sample_env.Append(LIBS=['rt'])
######################################################################
#build sampleapp
######################################################################
-weightsensorapp = linux_sample_env.Program('WeightSensorApp', 'src/WeightSensorApp.cpp')
+weightsensorapp = linux_sample_env.Program('WeightSensorApp',
+ 'src/WeightSensorApp.cpp')
Alias("weightsensorapp_sample", weightsensorapp)
env.AppendTarget('weightsensorapp')
linux_sample_env = env.Clone()
-linux_sample_env.AppendUnique(CPPPATH = [
+linux_sample_env.AppendUnique(CPPPATH=[
'#/resource/csdk/include',
'#/resource/csdk/stack/include',
'#/resource/include',
'#/resource/oc_logger/include'
])
-if target_os in ['linux'] :
+if target_os in ['linux']:
SConscript('THSensorApp/SConscript', 'linux_sample_env')
SConscript('THSensorApp1/SConscript', 'linux_sample_env')
Import('env linux_sample_env')
# Add third party libraries
-SConscript('#service/third_party_libs.scons', exports = { 'lib_env' : linux_sample_env })
+SConscript('#service/third_party_libs.scons',
+ exports={'lib_env': linux_sample_env})
######################################################################
# Build flags
######################################################################
-linux_sample_env.AppendUnique(CPPPATH = ['include'])
-linux_sample_env.AppendUnique(CXXFLAGS = ['-Wall', '-pthread','-std=c++0x'])
-linux_sample_env.AppendUnique(CPPDEFINES = ['LINUX'])
-linux_sample_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
-linux_sample_env.AppendUnique(LIBS = ['coap'])
-linux_sample_env.AppendUnique(LIBS = ['connectivity_abstraction'])
-linux_sample_env.AppendUnique(LIBS = ['oc_logger'])
-linux_sample_env.AppendUnique(LIBS = ['octbstack'])
-linux_sample_env.AppendUnique(LIBS = ['oc'])
-linux_sample_env.AppendUnique(LIBS = ['pthread'])
+linux_sample_env.AppendUnique(CPPPATH=['include'])
+linux_sample_env.AppendUnique(CXXFLAGS=['-Wall', '-pthread', '-std=c++0x'])
+linux_sample_env.AppendUnique(CPPDEFINES=['LINUX'])
+linux_sample_env.AppendUnique(LIBPATH=[env.get('BUILD_DIR')])
+linux_sample_env.AppendUnique(LIBS=[
+ 'coap',
+ 'connectivity_abstraction',
+ 'oc_logger',
+ 'octbstack',
+ 'oc',
+ 'pthread',
+])
if env.get('SECURED') == '1':
- linux_sample_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+ linux_sample_env.AppendUnique(LIBS=['mbedtls', 'mbedx509', 'mbedcrypto'])
#
# On some platforms link order can miss functions so librt needs to be
# re-scanned at the end if present. gcc 4.6 is one with this issue.
if 'rt' in linux_sample_env.get('LIBS'):
- linux_sample_env.Append(LIBS = ['rt'])
+ linux_sample_env.Append(LIBS=['rt'])
######################################################################
#build sampleapp
######################################################################
-thsensorapp = linux_sample_env.Program('THSensorApp', 'src/ThingResourceServer.cpp')
+thsensorapp = linux_sample_env.Program('THSensorApp',
+ 'src/ThingResourceServer.cpp')
Alias("thsensorapp_sample", thsensorapp)
env.AppendTarget('thsensorapp_sample')
Import('env linux_sample_env')
# Add third party libraries
-SConscript('#service/third_party_libs.scons', exports = { 'lib_env' : linux_sample_env })
+SConscript('#service/third_party_libs.scons',
+ exports={'lib_env': linux_sample_env})
######################################################################
# Build flags
######################################################################
-linux_sample_env.AppendUnique(CPPPATH = ['include'])
-linux_sample_env.AppendUnique(CXXFLAGS = ['-Wall', '-pthread','-std=c++0x'])
-linux_sample_env.AppendUnique(CPPDEFINES = ['LINUX'])
-linux_sample_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
-linux_sample_env.AppendUnique(LIBS = ['coap'])
-linux_sample_env.AppendUnique(LIBS = ['connectivity_abstraction'])
-linux_sample_env.AppendUnique(LIBS = ['oc_logger'])
-linux_sample_env.AppendUnique(LIBS = ['octbstack'])
-linux_sample_env.AppendUnique(LIBS = ['oc'])
-linux_sample_env.AppendUnique(LIBS = ['pthread'])
+linux_sample_env.AppendUnique(CPPPATH=['include'])
+linux_sample_env.AppendUnique(CXXFLAGS=['-Wall', '-pthread', '-std=c++0x'])
+linux_sample_env.AppendUnique(CPPDEFINES=['LINUX'])
+linux_sample_env.AppendUnique(LIBPATH=[env.get('BUILD_DIR')])
+linux_sample_env.AppendUnique(LIBS=[
+ 'coap',
+ 'connectivity_abstraction',
+ 'oc_logger',
+ 'octbstack',
+ 'oc',
+ 'pthread',
+])
if env.get('SECURED') == '1':
- linux_sample_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+ linux_sample_env.AppendUnique(LIBS=['mbedtls', 'mbedx509', 'mbedcrypto'])
# On some platforms link order can miss functions so librt needs to be
# re-scanned at the end if present. gcc 4.6 is one with this issue.
if 'rt' in linux_sample_env.get('LIBS'):
- linux_sample_env.Append(LIBS = ['rt'])
+ linux_sample_env.Append(LIBS=['rt'])
######################################################################
#build sampleapp
######################################################################
-thsensorapp1 = linux_sample_env.Program('THSensorApp1', 'src/ThingResourceServer1.cpp')
+thsensorapp1 = linux_sample_env.Program('THSensorApp1',
+ 'src/ThingResourceServer1.cpp')
Alias("thsensorapp1_sample", thsensorapp1)
env.AppendTarget('thsensorapp1_sample')
##
import os
import os.path
+from tools.scons.RunTest import run_test
# SConscript file for Local PKI google tests
gtest_env = SConscript('#extlibs/gtest/SConscript')
src_dir = lib_env.get('SRC_DIR')
rd_mode = lib_env.get('RD_MODE')
-containerJavaSupport = ARGUMENTS.get('containerJavaSupport',0)
+containerJavaSupport = ARGUMENTS.get('containerJavaSupport', 0)
-def filtered_glob(env, pattern, omit=[],
- ondisk=True, source=False, strings=False):
- return filter(
- lambda f: os.path.basename(f.path) not in omit,
- lib_env.Glob(pattern))
-lib_env.AddMethod(filtered_glob, "FilteredGlob");
+def filtered_glob(env,
+ pattern,
+ omit=[],
+ ondisk=True,
+ source=False,
+ strings=False):
+ return filter(lambda f: os.path.basename(f.path) not in omit,
+ lib_env.Glob(pattern))
+
+
+lib_env.AddMethod(filtered_glob, "FilteredGlob")
if lib_env.get('RELEASE'):
- lib_env.AppendUnique(CCFLAGS = ['-Os'])
- lib_env.AppendUnique(CPPDEFINES = ['NDEBUG'])
+ lib_env.AppendUnique(CCFLAGS=['-Os'])
+ lib_env.AppendUnique(CPPDEFINES=['NDEBUG'])
else:
- lib_env.AppendUnique(CCFLAGS = ['-g'])
+ lib_env.AppendUnique(CCFLAGS=['-g'])
if lib_env.get('LOGGING'):
- lib_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
+ lib_env.AppendUnique(CPPDEFINES=['TB_LOG'])
# Add third party libraries
SConscript(src_dir + '/service/third_party_libs.scons', 'lib_env')
try:
print 'Java Home: ', os.environ['JAVA_HOME']
print 'Java Lib: ', os.environ['JAVA_LIB']
- container_gtest_env.Append(CPPDEFINES={'JAVA_SUPPORT_TEST':1})
+ container_gtest_env.Append(CPPDEFINES={'JAVA_SUPPORT_TEST': 1})
except KeyError:
print '''
- *********************************** Error *************************************
- * Building resource container without Java support. JAVA_HOME or JAVA_LIB are not set properly
- * Please configure JAVA_HOME to point to your Java 7 JDK and
- * JAVA_LIB to your folder containing libjvm
- * Example: export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386
- * export JAVA_LIB=/usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386/server/
- *******************************************************************************
- '''
- container_gtest_env.Append(CPPDEFINES={'JAVA_SUPPORT_TEST':0})
-
-
+*********************************** Error *************************************
+* Building resource container without Java support. JAVA_HOME or JAVA_LIB are not set properly
+* Please configure JAVA_HOME to point to your Java 7 JDK and
+* JAVA_LIB to your folder containing libjvm
+* Example: export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386
+* export JAVA_LIB=/usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386/server/
+*******************************************************************************
+'''
+ container_gtest_env.Append(CPPDEFINES={'JAVA_SUPPORT_TEST': 0})
######################### unit test setting ##########################
######################################################################
-
######################################################################
# Build flags
######################################################################
-container_gtest_env.AppendUnique(
- CPPPATH = [
- '#/extlibs',
- '../include',
- '../../resource-encapsulation/include',
- '../../resource-encapsulation/src/common/utils/include',
- '../bundle-api/include',
- '../src',
- '#/resource/include',
- '#/resource/csdk/include',
- '#/resource/csdk/stack/include',
- '#/resource/oc_logger/include'
- ])
+container_gtest_env.AppendUnique(CPPPATH=[
+ '#/extlibs',
+ '../include',
+ '../../resource-encapsulation/include',
+ '../../resource-encapsulation/src/common/utils/include',
+ '../bundle-api/include',
+ '../src',
+ '#/resource/include',
+ '#/resource/csdk/include',
+ '#/resource/csdk/stack/include',
+ '#/resource/oc_logger/include'
+])
if int(containerJavaSupport):
try:
- container_gtest_env.AppendUnique(
- CPPPATH = [
- os.environ['JAVA_HOME']+'/include',
- os.environ['JAVA_HOME']+'/include/linux'
+ container_gtest_env.AppendUnique(CPPPATH=[
+ os.environ['JAVA_HOME'] + '/include',
+ os.environ['JAVA_HOME'] + '/include/linux'
])
except KeyError:
print ''
if target_os not in ['windows']:
- container_gtest_env.AppendUnique(LIBS = ['dl'])
- container_gtest_env.AppendUnique(CCFLAGS = ['-Wnoexcept'])
+ container_gtest_env.AppendUnique(LIBS=['dl'])
+ container_gtest_env.AppendUnique(CCFLAGS=['-Wnoexcept'])
-container_gtest_env.PrependUnique(LIBS = ['rcs_container', 'rcs_client', 'rcs_server', 'rcs_common',
- 'oc','octbstack', 'oc_logger', 'oc_logger_core',
- 'connectivity_abstraction'])
+container_gtest_env.PrependUnique(LIBS=[
+ 'rcs_container',
+ 'rcs_client',
+ 'rcs_server',
+ 'rcs_common',
+ 'oc',
+ 'octbstack',
+ 'oc_logger',
+ 'oc_logger_core',
+ 'connectivity_abstraction',
+])
if target_os in ['android']:
- container_gtest_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
- container_gtest_env.PrependUnique(LIBS = ['gnustl_shared', 'compatibility', 'log'])
+ container_gtest_env.AppendUnique(CXXFLAGS=['-frtti', '-fexceptions'])
+ container_gtest_env.PrependUnique(
+ LIBS=['gnustl_shared', 'compatibility', 'log'])
-container_gtest_env.PrependUnique(CPPPATH = ['#/extlibs/hippomocks/hippomocks'])
+container_gtest_env.PrependUnique(CPPPATH=['#/extlibs/hippomocks/hippomocks'])
if int(containerJavaSupport):
try:
- container_gtest_env.AppendUnique(LIBPATH = [os.environ['JAVA_LIB']])
+ container_gtest_env.AppendUnique(LIBPATH=[os.environ['JAVA_LIB']])
except KeyError:
print ''
-container_gtest_env.PrependUnique(LIBS = [
+container_gtest_env.PrependUnique(LIBS=[
'rcs_container',
'rcs_client',
'rcs_server',
'oc_logger',
'oc_logger_core',
'connectivity_abstraction',
- 'gtest',
- 'gtest_main',
- 'boost_system'])
+ 'boost_system'
+])
if int(containerJavaSupport):
try:
print 'Java Lib: ', os.environ['JAVA_LIB']
- container_gtest_env.AppendUnique(LIBS = ['jvm'])
+ container_gtest_env.AppendUnique(LIBS=['jvm'])
except KeyError:
print ''
if container_gtest_env.get('SECURED') == '1':
- container_gtest_env.AppendUnique(CPPDEFINES = ['SECURED'])
- container_gtest_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+ container_gtest_env.AppendUnique(CPPDEFINES=['SECURED'])
+ container_gtest_env.AppendUnique(
+ LIBS=['mbedtls', 'mbedx509', 'mbedcrypto'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
- container_gtest_env.AppendUnique(LIBS = ['resource_directory'])
+ container_gtest_env.AppendUnique(LIBS=['resource_directory'])
######################################################################
# build test bundle
######################################################################
test_bundle_env = container_gtest_env.Clone()
-test_bundle_env.AppendUnique(CCFLAGS = ['-fPIC'])
+test_bundle_env.AppendUnique(CCFLAGS=['-fPIC'])
if target_os not in ['darwin', 'ios', 'windows']:
- test_bundle_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
+ test_bundle_env.AppendUnique(LINKFLAGS=['-Wl,--no-undefined'])
TEST_BUNDLE_DIR = 'TestBundle/'
-test_bundle_env.AppendUnique(CPPPATH = [
- TEST_BUNDLE_DIR + 'include'
- ])
+test_bundle_env.AppendUnique(CPPPATH=[TEST_BUNDLE_DIR + 'include'])
-test_bundle_src = [ Glob(TEST_BUNDLE_DIR + 'src/*.cpp'), Glob('src/*.cpp')]
+test_bundle_src = [Glob(TEST_BUNDLE_DIR + 'src/*.cpp'), Glob('src/*.cpp')]
TestBundle = test_bundle_env.SharedLibrary('TestBundle', test_bundle_src)
test_bundle_env.InstallTarget(TestBundle, 'libTestBundle')
-
######################################################################
# Build Test
######################################################################
if 'g++' in container_gtest_env.get('CXX'):
- container_gtest_env.AppendUnique(CXXFLAGS = ['-std=c++0x'])
+ container_gtest_env.AppendUnique(CXXFLAGS=['-std=c++0x'])
container_gtest_src = container_gtest_env.Glob('./ResourceContainerTest.cpp')
-container_test = container_gtest_env.Program('container_test', container_gtest_src)
+container_test = container_gtest_env.Program('container_test',
+ container_gtest_src)
Alias("container_test", container_test)
container_gtest_env.AppendTarget('container_test')
# Copy test configuration
-Command("./ResourceContainerTestConfig.xml","./ResourceContainerTestConfig.xml", Copy("$TARGET", "$SOURCE"))
-Ignore("./ResourceContainerTestConfig.xml", "./ResourceContainerTestConfig.xml")
-Command("./ResourceContainerInvalidConfig.xml","./ResourceContainerInvalidConfig.xml", Copy("$TARGET", "$SOURCE"))
-Ignore("./ResourceContainerInvalidConfig.xml", "./ResourceContainerInvalidConfig.xml")
-Command("./TestBundleJava/hue-0.1-jar-with-dependencies.jar","./TestBundleJava/hue-0.1-jar-with-dependencies.jar", Copy("$TARGET", "$SOURCE"))
-Ignore("./TestBundleJava/hue-0.1-jar-with-dependencies.jar", "./TestBundleJava/hue-0.1-jar-with-dependencies.jar")
-
-# TODO: fix this test and edit commented lines
+Command("./ResourceContainerTestConfig.xml",
+ "./ResourceContainerTestConfig.xml", Copy("$TARGET", "$SOURCE"))
+Ignore("./ResourceContainerTestConfig.xml",
+ "./ResourceContainerTestConfig.xml")
+Command("./ResourceContainerInvalidConfig.xml",
+ "./ResourceContainerInvalidConfig.xml", Copy("$TARGET", "$SOURCE"))
+Ignore("./ResourceContainerInvalidConfig.xml",
+ "./ResourceContainerInvalidConfig.xml")
+Command("./TestBundleJava/hue-0.1-jar-with-dependencies.jar",
+ "./TestBundleJava/hue-0.1-jar-with-dependencies.jar",
+ Copy("$TARGET", "$SOURCE"))
+Ignore("./TestBundleJava/hue-0.1-jar-with-dependencies.jar",
+ "./TestBundleJava/hue-0.1-jar-with-dependencies.jar")
+
+# TODO: fix this test and edit commented lines and target_os
if container_gtest_env.get('TEST') == '1':
- if target_os in ['TODO/linux'] and container_gtest_env.get('SECURED') != '1':
- from tools.scons.RunTest import run_test
- run_test(container_gtest_env,
-# 'service_resource-container_unittests_container_test.memcheck',
- '',
- 'service/resource-container/unittests/container_test',
- container_test)
+ if target_os in ['TODO/linux'
+ ] and container_gtest_env.get('SECURED') != '1':
+ run_test(
+ container_gtest_env,
+ #'service_resource-container_unittests_container_test.memcheck',
+ '',
+ 'service/resource-container/unittests/container_test',
+ container_test)
######################################################################
if env.get('RELEASE'):
- env.AppendUnique(CCFLAGS = ['-Os'])
- env.AppendUnique(CPPDEFINES = ['NDEBUG'])
+ env.AppendUnique(CCFLAGS=['-Os'])
+ env.AppendUnique(CPPDEFINES=['NDEBUG'])
else:
- env.AppendUnique(CCFLAGS = ['-g'])
+ env.AppendUnique(CCFLAGS=['-g'])
if env.get('LOGGING'):
- env.AppendUnique(CPPDEFINES = ['TB_LOG'])
+ env.AppendUnique(CPPDEFINES=['TB_LOG'])
target_os = env.get('TARGET_OS')
if target_os in ['ios']:
- env.AppendUnique(CPPDEFINES = ['TARGET_OS_IPHONE'])
+ env.AppendUnique(CPPDEFINES=['TARGET_OS_IPHONE'])
# Add third party libraries
lib_env = env.Clone()
######################################################################
# Build flags
######################################################################
-resourceClient_env.AppendUnique(CPPPATH = [
+resourceClient_env.AppendUnique(CPPPATH=[
'include',
'#/resource/include',
'#/resource/csdk/include',
'src/resourceCache/include'
])
-resourceClient_env.PrependUnique(LIBS = ['oc', 'rcs_common', 'octbstack','oc_logger'])
+resourceClient_env.PrependUnique(
+ LIBS=['oc', 'rcs_common', 'octbstack', 'oc_logger'])
if target_os not in ['windows']:
- resourceClient_env.AppendUnique(CXXFLAGS = ['-Wall', '-std=c++0x'])
- resourceClient_env.AppendUnique(LIBS = ['dl'])
+ resourceClient_env.AppendUnique(CXXFLAGS=['-Wall', '-std=c++0x'])
+ resourceClient_env.AppendUnique(LIBS=['dl'])
if target_os in ['linux']:
- resourceClient_env.AppendUnique(LIBS = ['pthread'])
+ resourceClient_env.AppendUnique(LIBS=['pthread'])
if target_os in ['android']:
- resourceClient_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
- resourceClient_env.PrependUnique(LIBS = ['gnustl_shared', 'log'])
- resourceClient_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,librcs_client.so'])
+ resourceClient_env.AppendUnique(CXXFLAGS=['-frtti', '-fexceptions'])
+ resourceClient_env.PrependUnique(LIBS=['gnustl_shared', 'log'])
+ resourceClient_env.AppendUnique(LINKFLAGS=['-Wl,-soname,librcs_client.so'])
if target_os in ['linux']:
if not env.get('RELEASE'):
- resourceClient_env.PrependUnique(LIBS = ['gcov'])
- resourceClient_env.AppendUnique(CXXFLAGS = ['--coverage'])
+ resourceClient_env.PrependUnique(LIBS=['gcov'])
+ resourceClient_env.AppendUnique(CXXFLAGS=['--coverage'])
######################################################################
# Source files and Targets
RESOURCECLIENT_DIR = 'src/resourceClient/'
client_src = [
- BROKER_SRC_DIR + 'DeviceAssociation.cpp',
- BROKER_SRC_DIR + 'DevicePresence.cpp',
- BROKER_SRC_DIR + 'ResourcePresence.cpp',
- BROKER_SRC_DIR + 'ResourceBroker.cpp',
- CACHE_SRC_DIR + 'DataCache.cpp',
- CACHE_SRC_DIR + 'ResourceCacheManager.cpp',
- CACHE_SRC_DIR + 'ObserveCache.cpp',
- RESOURCECLIENT_DIR + 'RCSDiscoveryManager.cpp',
- RESOURCECLIENT_DIR + 'RCSDiscoveryManagerImpl.cpp',
- RESOURCECLIENT_DIR + 'RCSRemoteResourceObject.cpp'
- ]
-ResourceClientsdk_static = resourceClient_env.StaticLibrary('rcs_client', client_src)
+ BROKER_SRC_DIR + 'DeviceAssociation.cpp',
+ BROKER_SRC_DIR + 'DevicePresence.cpp',
+ BROKER_SRC_DIR + 'ResourcePresence.cpp',
+ BROKER_SRC_DIR + 'ResourceBroker.cpp', CACHE_SRC_DIR + 'DataCache.cpp',
+ CACHE_SRC_DIR + 'ResourceCacheManager.cpp',
+ CACHE_SRC_DIR + 'ObserveCache.cpp',
+ RESOURCECLIENT_DIR + 'RCSDiscoveryManager.cpp',
+ RESOURCECLIENT_DIR + 'RCSDiscoveryManagerImpl.cpp',
+ RESOURCECLIENT_DIR + 'RCSRemoteResourceObject.cpp'
+]
+ResourceClientsdk_static = resourceClient_env.StaticLibrary(
+ 'rcs_client', client_src)
if target_os not in ['ios']:
- ResourceClientsdk_shared = resourceClient_env.SharedLibrary('rcs_client', client_src)
- resourceClient_env.InstallTarget([ResourceClientsdk_static,ResourceClientsdk_shared], 'rcs_client')
- resourceClient_env.UserInstallTargetLib([ResourceClientsdk_static,ResourceClientsdk_shared], 'rcs_client')
+ ResourceClientsdk_shared = resourceClient_env.SharedLibrary(
+ 'rcs_client', client_src)
+ resourceClient_env.InstallTarget(
+ [ResourceClientsdk_static, ResourceClientsdk_shared], 'rcs_client')
+ resourceClient_env.UserInstallTargetLib(
+ [ResourceClientsdk_static, ResourceClientsdk_shared], 'rcs_client')
else:
resourceClient_env.InstallTarget([ResourceClientsdk_static], 'rcs_client')
- resourceClient_env.UserInstallTargetLib([ResourceClientsdk_static], 'rcs_client')
-resourceClient_env.UserInstallTargetHeader('include/RCSAddress.h', 'service/resource-encapsulation', 'RCSAddress.h')
-resourceClient_env.UserInstallTargetHeader('include/RCSDiscoveryManager.h', 'service/resource-encapsulation', 'RCSDiscoveryManager.h')
-resourceClient_env.UserInstallTargetHeader('include/RCSRemoteResourceObject.h', 'service/resource-encapsulation', 'RCSRemoteResourceObject.h')
-resourceClient_env.UserInstallTargetHeader('include/RCSResourceAttributes.h', 'service/resource-encapsulation', 'RCSResourceAttributes.h')
-resourceClient_env.UserInstallTargetHeader('include/RCSResourceObject.h', 'service/resource-encapsulation', 'RCSResourceObject.h')
-resourceClient_env.UserInstallTargetHeader('include/RCSException.h', 'service/resource-encapsulation', 'RCSException.h')
-resourceClient_env.UserInstallTargetHeader('include/RCSRequest.h', 'service/resource-encapsulation', 'RCSRequest.h')
-resourceClient_env.UserInstallTargetHeader('include/RCSResponse.h', 'service/resource-encapsulation', 'RCSResponse.h')
-resourceClient_env.UserInstallTargetHeader('include/RCSRepresentation.h', 'service/resource-encapsulation', 'RCSRepresentation.h')
-resourceClient_env.UserInstallTargetHeader('include/RCSSeparateResponse.h', 'service/resource-encapsulation', 'RCSSeparateResponse.h')
+ resourceClient_env.UserInstallTargetLib([ResourceClientsdk_static],
+ 'rcs_client')
+resourceClient_env.UserInstallTargetHeader(
+ 'include/RCSAddress.h', 'service/resource-encapsulation', 'RCSAddress.h')
+resourceClient_env.UserInstallTargetHeader('include/RCSDiscoveryManager.h',
+ 'service/resource-encapsulation',
+ 'RCSDiscoveryManager.h')
+resourceClient_env.UserInstallTargetHeader('include/RCSRemoteResourceObject.h',
+ 'service/resource-encapsulation',
+ 'RCSRemoteResourceObject.h')
+resourceClient_env.UserInstallTargetHeader('include/RCSResourceAttributes.h',
+ 'service/resource-encapsulation',
+ 'RCSResourceAttributes.h')
+resourceClient_env.UserInstallTargetHeader('include/RCSResourceObject.h',
+ 'service/resource-encapsulation',
+ 'RCSResourceObject.h')
+resourceClient_env.UserInstallTargetHeader('include/RCSException.h',
+ 'service/resource-encapsulation',
+ 'RCSException.h')
+resourceClient_env.UserInstallTargetHeader(
+ 'include/RCSRequest.h', 'service/resource-encapsulation', 'RCSRequest.h')
+resourceClient_env.UserInstallTargetHeader(
+ 'include/RCSResponse.h', 'service/resource-encapsulation', 'RCSResponse.h')
+resourceClient_env.UserInstallTargetHeader('include/RCSRepresentation.h',
+ 'service/resource-encapsulation',
+ 'RCSRepresentation.h')
+resourceClient_env.UserInstallTargetHeader('include/RCSSeparateResponse.h',
+ 'service/resource-encapsulation',
+ 'RCSSeparateResponse.h')
######################################################################
# Build Sample App: SampleResourceClient & SampleResourceServer
SConscript('examples/SConscript')
######################################################################
-# Build UnitTests Resource Client , resourceCache and resourceBroker and
+# Build UnitTests Resource Client , resourceCache and resourceBroker and
# DiscoveryManager
################################################ ######################
if target_os in ['linux']:
ANDROID_TARGET_ARCH = env.get('TARGET_ARCH')
if env.get('RELEASE'):
- ANDROID_RELEASE="release"
+ ANDROID_RELEASE = "release"
else:
- ANDROID_RELEASE="debug"
+ ANDROID_RELEASE = "debug"
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'):
+if not os.path.exists(android_home +
+ '/platforms/android-21') or not os.path.exists(
+ android_home + '/build-tools/20.0.0'):
print '''
***************************************** Info ********************************
* Either 'Android API 21' is not installed or 'Android SDK Build Tools *
def ensure_libs(target, source, env):
- return target, [source, env.get('BUILD_DIR') + 'librcs_server.so',
- env.get('BUILD_DIR') + 'librcs_client.so']
+ return target, [
+ source,
+ env.get('BUILD_DIR') + 'librcs_server.so',
+ env.get('BUILD_DIR') + 'librcs_client.so'
+ ]
+
jdk_env = Environment(ENV=os.environ)
-jdk_env['BUILDERS']['Gradle'] = Builder(action = env.get('ANDROID_GRADLE') +
- ' build -bservice/resource-encapsulation/android/build.gradle -PTARGET_ARCH=%s -PRELEASE=%s --stacktrace' %(ANDROID_TARGET_ARCH, ANDROID_RELEASE),
- emitter = ensure_libs)
+jdk_env['BUILDERS']['Gradle'] = Builder(
+ action=env.get('ANDROID_GRADLE') +
+ ' build -bservice/resource-encapsulation/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')
-cmdBuildRE = jdk_env.Gradle(target="service/objs",
- source="service/src/main/java/org/iotivity/service/RcsResourceAttributes.java")
+cmdBuildRE = jdk_env.Gradle(
+ target="service/objs",
+ source=
+ "service/src/main/java/org/iotivity/service/RcsResourceAttributes.java")
jdk_env.Clean(cmdBuildRE, '#/service/resource-encapsulation/android/build')
-jdk_env.Clean(cmdBuildRE, '#/service/resource-encapsulation/android/service/build')
-env.AppendUnique(resourceencapsulationAAR = cmdBuildRE)
+jdk_env.Clean(cmdBuildRE,
+ '#/service/resource-encapsulation/android/service/build')
+env.AppendUnique(resourceencapsulationAAR=cmdBuildRE)
Depends(cmdBuildRE, env.get('baseAAR'))
# Build RE Android Samples
re_sample_server_env = Environment(ENV=os.environ)
-re_sample_server_env['BUILDERS']['Gradle'] = Builder(action = env.get('ANDROID_GRADLE') +
- ' build -bservice/resource-encapsulation/examples/android/RESampleServerApp/build.gradle -PTARGET_ARCH=%s -PRELEASE=%s --stacktrace' %(ANDROID_TARGET_ARCH, ANDROID_RELEASE),
- emitter = ensure_libs)
+re_sample_server_env['BUILDERS']['Gradle'] = Builder(
+ action=env.get('ANDROID_GRADLE') +
+ ' build -bservice/resource-encapsulation/examples/android/RESampleServerApp/build.gradle -PTARGET_ARCH=%s -PRELEASE=%s --stacktrace'
+ % (ANDROID_TARGET_ARCH, ANDROID_RELEASE),
+ emitter=ensure_libs)
re_sample_server_env['BUILD_DIR'] = env.get('BUILD_DIR')
-cmdBuildREServerApp=re_sample_server_env.Gradle(target="../examples/android/RESampleServerApp/app/apk",
- source=["../examples/android/RESampleServerApp/app/src/main/java/org/iotivity/service/sample/server/MainActivity.java",
- "../examples/android/RESampleServerApp/app/src/main/java/org/iotivity/service/sample/server/CustomServerActivity.java",
- "../examples/android/RESampleServerApp/app/src/main/java/org/iotivity/service/sample/server/ResourceProperties.java",
- "../examples/android/RESampleServerApp/app/src/main/java/org/iotivity/service/sample/server/SimpleServerActivity.java"])
-jdk_env.Clean(cmdBuildREServerApp, '#/service/resource-encapsulation/examples/android/RESampleServerApp/build')
-jdk_env.Clean(cmdBuildREServerApp, '#/service/resource-encapsulation/examples/android/RESampleServerApp/app/build')
+cmdBuildREServerApp = re_sample_server_env.Gradle(
+ target="../examples/android/RESampleServerApp/app/apk",
+ source=[
+ "../examples/android/RESampleServerApp/app/src/main/java/org/iotivity/service/sample/server/MainActivity.java",
+ "../examples/android/RESampleServerApp/app/src/main/java/org/iotivity/service/sample/server/CustomServerActivity.java",
+ "../examples/android/RESampleServerApp/app/src/main/java/org/iotivity/service/sample/server/ResourceProperties.java",
+ "../examples/android/RESampleServerApp/app/src/main/java/org/iotivity/service/sample/server/SimpleServerActivity.java"
+ ])
+jdk_env.Clean(
+ cmdBuildREServerApp,
+ '#/service/resource-encapsulation/examples/android/RESampleServerApp/build'
+)
+jdk_env.Clean(
+ cmdBuildREServerApp,
+ '#/service/resource-encapsulation/examples/android/RESampleServerApp/app/build'
+)
Depends(cmdBuildREServerApp, cmdBuildRE)
re_sample_client_env = Environment(ENV=os.environ)
-re_sample_client_env['BUILDERS']['Gradle'] = Builder(action = env.get('ANDROID_GRADLE') +
- ' build -bservice/resource-encapsulation/examples/android/RESampleClientApp/build.gradle -PTARGET_ARCH=%s -PRELEASE=%s --stacktrace' %(ANDROID_TARGET_ARCH, ANDROID_RELEASE),
- emitter = ensure_libs)
+re_sample_client_env['BUILDERS']['Gradle'] = Builder(
+ action=env.get('ANDROID_GRADLE') +
+ ' build -bservice/resource-encapsulation/examples/android/RESampleClientApp/build.gradle -PTARGET_ARCH=%s -PRELEASE=%s --stacktrace'
+ % (ANDROID_TARGET_ARCH, ANDROID_RELEASE),
+ emitter=ensure_libs)
re_sample_client_env['BUILD_DIR'] = env.get('BUILD_DIR')
-cmdBuildREClientApp=re_sample_client_env.Gradle(target="../examples/android/RESampleClientApp/app/apk",
- source=["../examples/android/RESampleClientApp/app/src/main/java/org/iotivity/service/sample/client/MainActivity.java",
- "../examples/android/RESampleClientApp/app/src/main/java/org/iotivity/service/sample/client/ResourceClientActivity.java"])
-jdk_env.Clean(cmdBuildREClientApp, '#/service/resource-encapsulation/examples/android/RESampleClientApp/build')
-jdk_env.Clean(cmdBuildREClientApp, '#/service/resource-encapsulation/examples/android/RESampleClientApp/app/build')
+cmdBuildREClientApp = re_sample_client_env.Gradle(
+ target="../examples/android/RESampleClientApp/app/apk",
+ source=[
+ "../examples/android/RESampleClientApp/app/src/main/java/org/iotivity/service/sample/client/MainActivity.java",
+ "../examples/android/RESampleClientApp/app/src/main/java/org/iotivity/service/sample/client/ResourceClientActivity.java"
+ ])
+jdk_env.Clean(
+ cmdBuildREClientApp,
+ '#/service/resource-encapsulation/examples/android/RESampleClientApp/build'
+)
+jdk_env.Clean(
+ cmdBuildREClientApp,
+ '#/service/resource-encapsulation/examples/android/RESampleClientApp/app/build'
+)
Depends(cmdBuildREClientApp, cmdBuildRE)
sample_env = lib_env.Clone()
-sample_env.AppendUnique(CXXFLAGS = ['-Wall', '-std=c++0x'])
-sample_env.AppendUnique(LIBS = [
- 'coap',
- 'connectivity_abstraction',
- 'oc_logger',
- 'octbstack',
- 'oc',
- 'rcs_common',
- 'pthread'
- ])
-sample_env.AppendUnique(CPPPATH = [
+sample_env.AppendUnique(CXXFLAGS=['-Wall', '-std=c++0x'])
+sample_env.AppendUnique(LIBS=[
+ 'coap', 'connectivity_abstraction', 'oc_logger', 'octbstack', 'oc',
+ 'rcs_common', 'pthread'
+])
+sample_env.AppendUnique(CPPPATH=[
'../../include',
'#/resource/csdk/include',
'#/resource/csdk/stack/include',
])
if env.get('SECURED') == '1':
- sample_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+ sample_env.AppendUnique(LIBS=['mbedtls', 'mbedx509', 'mbedcrypto'])
if 'rt' in sample_env.get('LIBS'):
- sample_env.Append(LIBS = ['rt'])
+ sample_env.Append(LIBS=['rt'])
######################################################################
# ##### Client #####
######################################################################
client_env = sample_env.Clone()
-client_env.AppendUnique(LIBS = 'rcs_client')
+client_env.AppendUnique(LIBS='rcs_client')
-sampleResourceClient = client_env.Program('sampleResourceClient', 'SampleResourceClient.cpp')
-nestedAttributesClient = client_env.Program('nestedAttributesClient', 'NestedAttributesClient.cpp')
+sampleResourceClient = client_env.Program('sampleResourceClient',
+ 'SampleResourceClient.cpp')
+nestedAttributesClient = client_env.Program('nestedAttributesClient',
+ 'NestedAttributesClient.cpp')
######################################################################
# ##### Server #####
######################################################################
server_env = sample_env.Clone()
-server_env.AppendUnique(LIBS = 'rcs_server')
+server_env.AppendUnique(LIBS='rcs_server')
-sampleResourceServer = server_env.Program('sampleResourceServer', 'SampleResourceServer.cpp')
-separateResponseServer = server_env.Program('separateResponseServer', 'SeparateResponseServer.cpp')
-nestedAttributesServer = server_env.Program('nestedAttributesServer', 'NestedAttributesServer.cpp')
+sampleResourceServer = server_env.Program('sampleResourceServer',
+ 'SampleResourceServer.cpp')
+separateResponseServer = server_env.Program('separateResponseServer',
+ 'SeparateResponseServer.cpp')
+nestedAttributesServer = server_env.Program('nestedAttributesServer',
+ 'NestedAttributesServer.cpp')
##
# rcs_common (primitiveResource and expiryTimer) build script
##
+
import os
Import('env')
######################################################################
# Build flags
######################################################################
-rcs_common_env.AppendUnique(CPPPATH = [
+rcs_common_env.AppendUnique(CPPPATH=[
'#/extlibs',
'#/resource/include',
'#/resource/csdk/include',
'#/resource/csdk/stack/include',
'#/resource/oc_logger/include',
'../../include',
- 'primitiveResource/include'])
+ 'primitiveResource/include'
+])
-rcs_common_env.AppendUnique(CPPPATH = [
- 'expiryTimer/include',
- 'expiryTimer/src'])
+rcs_common_env.AppendUnique(CPPPATH=['expiryTimer/include', 'expiryTimer/src'])
-rcs_common_env.AppendUnique(LIBPATH = [rcs_common_env.get('BUILD_DIR')])
+rcs_common_env.AppendUnique(LIBPATH=[rcs_common_env.get('BUILD_DIR')])
if target_os not in ['windows']:
- rcs_common_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall'])
+ rcs_common_env.AppendUnique(CXXFLAGS=['-std=c++0x', '-Wall'])
if target_os not in ['darwin', 'ios', 'windows']:
- rcs_common_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
- rcs_common_env.AppendUnique(LIBS = ['dl'])
+ rcs_common_env.AppendUnique(LINKFLAGS=['-Wl,--no-undefined'])
+ rcs_common_env.AppendUnique(LIBS=['dl'])
if target_os == 'android':
- rcs_common_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
- rcs_common_env.PrependUnique(LIBS = ['gnustl_shared', 'log'])
- rcs_common_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,librcs_common.so'])
+ rcs_common_env.AppendUnique(CXXFLAGS=['-frtti', '-fexceptions'])
+ rcs_common_env.PrependUnique(LIBS=['gnustl_shared', 'log'])
+ rcs_common_env.AppendUnique(LINKFLAGS=['-Wl,-soname,librcs_common.so'])
-rcs_common_env.AppendUnique(LIBS = ['oc'])
+rcs_common_env.AppendUnique(LIBS=['oc'])
if not release:
- rcs_common_env.AppendUnique(CXXFLAGS = ['--coverage'])
- rcs_common_env.PrependUnique(LIBS = ['gcov'])
+ rcs_common_env.AppendUnique(CXXFLAGS=['--coverage'])
+ rcs_common_env.PrependUnique(LIBS=['gcov'])
if rcs_common_env.get('SECURED') == '1':
- if rcs_common_env.get('WITH_TCP') == True:
- rcs_common_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+ if rcs_common_env.get('WITH_TCP') == True:
+ rcs_common_env.AppendUnique(LIBS=['mbedtls', 'mbedx509', 'mbedcrypto'])
######################################################################
# Source files and Targets
TIMER_SRC_DIR = 'expiryTimer/src/'
RESOURCE_SRC = 'primitiveResource/src/'
rcs_common_src = [
- TIMER_SRC_DIR + 'ExpiryTimerImpl.cpp',
- TIMER_SRC_DIR + 'ExpiryTimer.cpp',
- RESOURCE_SRC + 'PresenceSubscriber.cpp',
- RESOURCE_SRC + 'PrimitiveResource.cpp',
- RESOURCE_SRC + 'RCSException.cpp',
- RESOURCE_SRC + 'RCSAddress.cpp',
- RESOURCE_SRC + 'RCSResourceAttributes.cpp',
- RESOURCE_SRC + 'RCSRepresentation.cpp'
- ]
+ TIMER_SRC_DIR + 'ExpiryTimerImpl.cpp', TIMER_SRC_DIR + 'ExpiryTimer.cpp',
+ RESOURCE_SRC + 'PresenceSubscriber.cpp',
+ RESOURCE_SRC + 'PrimitiveResource.cpp', RESOURCE_SRC + 'RCSException.cpp',
+ RESOURCE_SRC + 'RCSAddress.cpp',
+ RESOURCE_SRC + 'RCSResourceAttributes.cpp',
+ RESOURCE_SRC + 'RCSRepresentation.cpp'
+]
rcs_common_static = rcs_common_env.StaticLibrary('rcs_common', rcs_common_src)
if target_os not in ['ios']:
- rcs_common_shared = rcs_common_env.SharedLibrary('rcs_common', rcs_common_src)
- rcs_common_env.InstallTarget([rcs_common_static,rcs_common_shared], 'rcs_common')
- rcs_common_env.UserInstallTargetLib([rcs_common_static,rcs_common_shared], 'rcs_common')
+ rcs_common_shared = rcs_common_env.SharedLibrary('rcs_common',
+ rcs_common_src)
+ rcs_common_env.InstallTarget([rcs_common_static, rcs_common_shared],
+ 'rcs_common')
+ rcs_common_env.UserInstallTargetLib([rcs_common_static, rcs_common_shared],
+ 'rcs_common')
else:
rcs_common_env.InstallTarget([rcs_common_static], 'rcs_common')
rcs_common_env.UserInstallTargetLib([rcs_common_static], 'rcs_common')
######################################################################
if target_os in ['linux']:
SConscript('primitiveResource/unittests/SConscript')
+
# ResourceBroker Unit Test build script
##
# SConscript file for Local PKI google tests
+
+from tools.scons.RunTest import run_test
+
gtest_env = SConscript('#extlibs/gtest/SConscript')
lib_env = gtest_env.Clone()
if lib_env.get('RELEASE'):
- lib_env.AppendUnique(CCFLAGS = ['-Os'])
- lib_env.AppendUnique(CPPDEFINES = ['NDEBUG'])
+ lib_env.AppendUnique(CCFLAGS=['-Os'])
+ lib_env.AppendUnique(CPPDEFINES=['NDEBUG'])
else:
- lib_env.AppendUnique(CCFLAGS = ['-g'])
+ lib_env.AppendUnique(CCFLAGS=['-g'])
if lib_env.get('LOGGING'):
- lib_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
+ lib_env.AppendUnique(CPPDEFINES=['TB_LOG'])
SConscript('#service/third_party_libs.scons', 'lib_env')
# Build flags
######################################################################
-broker_test_env.AppendUnique(CPPPATH = [
+broker_test_env.AppendUnique(CPPPATH=[
'../include',
'../../../include',
'../../common/primitiveResource/include',
'#/resource/oc_logger/include'
])
-broker_test_env.PrependUnique(CPPPATH = ['#/extlibs/hippomocks/hippomocks'])
-broker_test_env.AppendUnique(LIBPATH = [broker_test_env.get('BUILD_DIR')])
+broker_test_env.PrependUnique(CPPPATH=['#/extlibs/hippomocks/hippomocks'])
+broker_test_env.AppendUnique(LIBPATH=[broker_test_env.get('BUILD_DIR')])
-broker_test_env.PrependUnique(LIBS = ['coap'])
-broker_test_env.AppendUnique(LIBS = ['connectivity_abstraction'])
-broker_test_env.AppendUnique(LIBS = ['oc_logger'])
-broker_test_env.AppendUnique(LIBS = ['octbstack'])
-broker_test_env.AppendUnique(LIBS = ['oc'])
-broker_test_env.AppendUnique(LIBS = ['rcs_client'])
-broker_test_env.AppendUnique(LIBS = ['rcs_common'])
+broker_test_env.PrependUnique(LIBS=['coap'])
+broker_test_env.AppendUnique(LIBS=[
+'connectivity_abstraction',
+'oc_logger',
+'octbstack',
+'oc',
+'rcs_client',
+'rcs_common',
+])
compiler = broker_test_env.get('CXX')
if 'g++' in compiler:
- broker_test_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
+ broker_test_env.AppendUnique(
+ CXXFLAGS=['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
if broker_test_env.get('SECURED') == '1':
- broker_test_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+ broker_test_env.AppendUnique(LIBS=['mbedtls', 'mbedx509', 'mbedcrypto'])
######################################################################
# Build Test
if broker_test_env.get('TEST') == '1':
if target_os in ['linux']:
- from tools.scons.RunTest import run_test
- run_test(broker_test_env,
-# TODO: fix this test on linux and remove commented lines
-# 'service_resource-encapsulation_src_resourceBroker_unittest_broker_test.memcheck',
- '',
- 'service/resource-encapsulation/src/resourceBroker/unittest/broker_test',
- broker_test)
+ run_test(
+ broker_test_env,
+ #'service_resource-encapsulation_src_resourceBroker_unittest_broker_test.memcheck',
+ '', # TODO: fix this test on linux and enable previous line
+ 'service/resource-encapsulation/src/resourceBroker/unittest/broker_test',
+ broker_test)
# ResourceCache Unit Test build script
##
# SConscript file for Local PKI google tests
+
+from tools.scons.RunTest import run_test
+
gtest_env = SConscript('#extlibs/gtest/SConscript')
lib_env = gtest_env.Clone()
if lib_env.get('RELEASE'):
- lib_env.AppendUnique(CCFLAGS = ['-Os'])
- lib_env.AppendUnique(CPPDEFINES = ['NDEBUG'])
+ lib_env.AppendUnique(CCFLAGS=['-Os'])
+ lib_env.AppendUnique(CPPDEFINES=['NDEBUG'])
else:
- lib_env.AppendUnique(CCFLAGS = ['-g'])
+ lib_env.AppendUnique(CCFLAGS=['-g'])
if lib_env.get('LOGGING'):
- lib_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
+ lib_env.AppendUnique(CPPDEFINES=['TB_LOG'])
SConscript('#service/third_party_libs.scons', 'lib_env')
# Build flags
######################################################################
-cache_test_env.AppendUnique(CPPPATH = [
+cache_test_env.AppendUnique(CPPPATH=[
'../include',
'../../../include',
'../../common/primitiveResource/include',
'#/resource/include',
'#/resource/oc_logger/include'
])
-cache_test_env.PrependUnique(CPPPATH = ['#/extlibs/hippomocks/hippomocks'])
-cache_test_env.AppendUnique(LIBPATH = [cache_test_env.get('BUILD_DIR')])
-cache_test_env.PrependUnique(LIBS = ['rcs_client', 'rcs_common',
- 'oc', 'octbstack', 'oc_logger',
- 'connectivity_abstraction', 'coap'])
+cache_test_env.PrependUnique(CPPPATH=['#/extlibs/hippomocks/hippomocks'])
+cache_test_env.AppendUnique(LIBPATH=[cache_test_env.get('BUILD_DIR')])
+cache_test_env.PrependUnique(LIBS=[
+ 'rcs_client',
+ 'rcs_common',
+ 'oc',
+ 'octbstack',
+ 'oc_logger',
+ 'connectivity_abstraction',
+ 'coap',
+])
compiler = cache_test_env.get('CXX')
if 'g++' in compiler:
- cache_test_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
+ cache_test_env.AppendUnique(
+ CXXFLAGS=['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
if cache_test_env.get('SECURED') == '1':
- cache_test_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+ cache_test_env.AppendUnique(LIBS=['mbedtls', 'mbedx509', 'mbedcrypto'])
######################################################################
# Build Test
if cache_test_env.get('TEST') == '1':
if target_os in ['linux']:
- from tools.scons.RunTest import run_test
- run_test(cache_test_env,
- 'service_resource-encapsulation_src_resourceCache_unittests_cache_test.memtest',
- 'service/resource-encapsulation/src/resourceCache/unittests/cache_test',
- cache_test)
+ run_test(
+ cache_test_env,
+ 'service_resource-encapsulation_src_resourceCache_unittests_cache_test.memtest',
+ 'service/resource-encapsulation/src/resourceCache/unittests/cache_test',
+ cache_test)
# rcs_server (Server Builder) project build script
##
# SConscript file for Local PKI google tests
+
gtest_env = SConscript('#extlibs/gtest/SConscript')
lib_env = gtest_env.Clone()
rd_mode = lib_env.get('RD_MODE')
# Add third party libraries
-SConscript('#service/third_party_libs.scons', exports = 'lib_env')
+SConscript('#service/third_party_libs.scons', exports='lib_env')
server_builder_env = lib_env.Clone()
release = server_builder_env.get('RELEASE')
src_dir = server_builder_env.get('SRC_DIR')
######################################################################
# Build flags
######################################################################
-server_builder_env.AppendUnique(CPPPATH = [
+server_builder_env.AppendUnique(CPPPATH=[
'../common/primitiveResource/include',
'../common/utils/include',
'../../include',
'#/resource/csdk/include',
'#/resource/csdk/stack/include',
'#/resource/oc_logger/include',
- ])
-
-server_builder_env.AppendUnique(CPPPATH = [server_builder_env.get('SRC_DIR')+'/extlibs', 'include'])
-server_builder_env.AppendUnique(LIBPATH = [server_builder_env.get('BUILD_DIR')])
-server_builder_env.AppendUnique(LIBS = ['oc', 'rcs_common'])
-
+])
+server_builder_env.AppendUnique(
+ CPPPATH=[server_builder_env.get('SRC_DIR') + '/extlibs', 'include'])
+server_builder_env.AppendUnique(LIBPATH=[server_builder_env.get('BUILD_DIR')])
+server_builder_env.AppendUnique(LIBS=['oc', 'rcs_common'])
if server_builder_env.get('LOGGING'):
- server_builder_env.AppendUnique(LIBS = ['octbstack'])
+ server_builder_env.AppendUnique(LIBS=['octbstack'])
if not release:
- server_builder_env.AppendUnique(CXXFLAGS = ['--coverage'])
- server_builder_env.PrependUnique(LIBS = ['gcov'])
+ server_builder_env.AppendUnique(CXXFLAGS=['--coverage'])
+ server_builder_env.PrependUnique(LIBS=['gcov'])
if target_os not in ['windows']:
- server_builder_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall'])
+ server_builder_env.AppendUnique(CXXFLAGS=['-std=c++0x', '-Wall'])
if target_os not in ['darwin', 'ios', 'windows']:
- server_builder_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
+ server_builder_env.AppendUnique(LINKFLAGS=['-Wl,--no-undefined'])
if target_os in ['android']:
- server_builder_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
- server_builder_env.PrependUnique(LIBS = ['gnustl_shared', 'log'])
- server_builder_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,librcs_server.so'])
+ server_builder_env.AppendUnique(CXXFLAGS=['-frtti', '-fexceptions'])
+ server_builder_env.PrependUnique(LIBS=['gnustl_shared', 'log'])
+ server_builder_env.AppendUnique(LINKFLAGS=['-Wl,-soname,librcs_server.so'])
if server_builder_env.get('SECURED') == '1':
- if server_builder_env.get('WITH_TCP') == True:
- server_builder_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+ if server_builder_env.get('WITH_TCP') == True:
+ server_builder_env.AppendUnique(
+ LIBS=['mbedtls', 'mbedx509', 'mbedcrypto'])
######################################################################
# Source files and Targets
######################################################################
server_builder_src = server_builder_env.Glob('src/*.cpp')
-server_builder_static = server_builder_env.StaticLibrary('rcs_server', server_builder_src)
+server_builder_static = server_builder_env.StaticLibrary(
+ 'rcs_server', server_builder_src)
if target_os not in ['ios']:
- server_builder_shared = server_builder_env.SharedLibrary('rcs_server', server_builder_src)
- server_builder_env.InstallTarget([server_builder_static, server_builder_shared], 'rcs_server')
- server_builder_env.UserInstallTargetLib([server_builder_static, server_builder_shared], 'rcs_server')
+ server_builder_shared = server_builder_env.SharedLibrary(
+ 'rcs_server', server_builder_src)
+ server_builder_env.InstallTarget(
+ [server_builder_static, server_builder_shared], 'rcs_server')
+ server_builder_env.UserInstallTargetLib(
+ [server_builder_static, server_builder_shared], 'rcs_server')
else:
server_builder_env.InstallTarget([server_builder_static], 'rcs_server')
- server_builder_env.UserInstallTargetLib([server_builder_static], 'rcs_server')
+ server_builder_env.UserInstallTargetLib([server_builder_static],
+ 'rcs_server')
######################################################################
# Build Test
######################################################################
if target_os in ['linux']:
- server_builder_test_env = server_builder_env.Clone();
-
- server_builder_test_env.AppendUnique(CPPPATH = [
- '#/extlibs/hippomocks/hippomocks',
- '../common/utils/include'
- ])
-
- server_builder_test_env.PrependUnique(LIBS = [
- 'rcs_server',
- 'octbstack',
- 'oc_logger',
- 'connectivity_abstraction',
- 'coap'])
-
- server_builder_test_src = server_builder_test_env.Glob('unittests/*.cpp')
-
- server_builder_test = server_builder_test_env.Program('rcs_server_test', server_builder_test_src)
- Alias("rcs_server_test", server_builder_test)
- server_builder_test_env.AppendTarget('rcs_server_test')
-
- if server_builder_test_env.get('TEST') == '1':
- from tools.scons.RunTest import *
- run_test(server_builder_test_env,
-# TODO: fix this test on linux and remove commented lines
- '',
-# 'service_resource-encapsulation_src_serverBuilder_rcs_server_test.memcheck',
- 'service/resource-encapsulation/src/serverBuilder/rcs_server_test',
- server_builder_test)
+ server_builder_test_env = server_builder_env.Clone()
+ server_builder_test_env.AppendUnique(CPPPATH=[
+ '#/extlibs/hippomocks/hippomocks',
+ '../common/utils/include'
+])
+
+ if server_builder_test_env.get('SECURED') == '1':
+ server_builder_test_env.AppendUnique(
+ CPPPATH=['#/resource/csdk/security/include'])
+
+ server_builder_test_env.PrependUnique(LIBS=[
+ 'rcs_server',
+ 'octbstack',
+ 'oc_logger',
+ 'connectivity_abstraction',
+ 'coap',
+ ])
+
+ server_builder_test_src = [
+ server_builder_test_env.Glob('unittests/*.cpp'),
+ ]
+
+ server_builder_test = server_builder_test_env.Program(
+ 'rcs_server_test', server_builder_test_src)
+ Alias("rcs_server_test", server_builder_test)
+ server_builder_test_env.AppendTarget('rcs_server_test')
+
+ if server_builder_test_env.get('TEST') == '1':
+ from tools.scons.RunTest import run_test
+ run_test(
+ server_builder_test_env,
+# 'service_resource-encapsulation_src_serverBuilder_rcs_server_test.memcheck',
+ '', # TODO: fix this test on linux and remove commented lines
+ 'service/resource-encapsulation/src/serverBuilder/rcs_server_test',
+ server_builder_test)
# ResourceClient Unit Test build script
##
# SConscript file for Local PKI google tests
+
import os
+from tools.scons.RunTest import run_test
gtest_env = SConscript('#extlibs/gtest/SConscript')
lib_env = gtest_env.Clone()
target_os = lib_env.get('TARGET_OS')
if lib_env.get('RELEASE'):
- lib_env.AppendUnique(CCFLAGS = ['-Os'])
- lib_env.AppendUnique(CPPDEFINES = ['NDEBUG'])
+ lib_env.AppendUnique(CCFLAGS=['-Os'])
+ lib_env.AppendUnique(CPPDEFINES=['NDEBUG'])
else:
- lib_env.AppendUnique(CCFLAGS = ['-g'])
+ lib_env.AppendUnique(CCFLAGS=['-g'])
if lib_env.get('LOGGING'):
- lib_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
+ lib_env.AppendUnique(CPPDEFINES=['TB_LOG'])
# Add third party libraries
SConscript('#service/third_party_libs.scons', 'lib_env')
######################################################################
# Build flags
######################################################################
-rcs_test_env.AppendUnique(
- CPPPATH = [
- '#/extlibs/hippomocks/hippomocks',
- '../include',
- '../src/common/utils/include',
- '#/resource/csdk/include',
- '#/resource/csdk/stack/include',
- '#/resource/include',
- '#/resource/oc_logger/include'
- ])
-
-rcs_test_env.PrependUnique(LIBS = [
+
+rcs_test_env.AppendUnique(CPPPATH=[
+ '#/extlibs/hippomocks/hippomocks',
+ '../include',
+ '../src/common/utils/include',
+ '#/resource/csdk/include',
+ '#/resource/csdk/stack/include',
+ '#/resource/include',
+ '#/resource/oc_logger/include',
+ '#/resource/csdk/connectivity/api'
+])
+
+rcs_test_env.PrependUnique(LIBS=[
'connectivity_abstraction',
'oc_logger',
'oc_logger_core',
'oc',
'rcs_client',
'rcs_server',
- 'rcs_common'])
+ 'rcs_common',
+])
if lib_env.get('SECURED') == '1':
- rcs_test_env.AppendUnique(CPPDEFINES = ['SECURED'])
- rcs_test_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+ rcs_test_env.AppendUnique(CPPDEFINES=['SECURED'])
+ rcs_test_env.AppendUnique(LIBS=['mbedtls', 'mbedx509', 'mbedcrypto'])
if 'g++' in rcs_test_env.get('CXX'):
- rcs_test_env.AppendUnique(CXXFLAGS = ['-std=c++0x'])
+ rcs_test_env.AppendUnique(CXXFLAGS=['-std=c++0x'])
######################################################################
# Build Test
# TODO: fix this test on linux and remove commented lines
if rcs_test_env.get('TEST') == '1':
if target_os in ['linux']:
- from tools.scons.RunTest import run_test
- run_test(rcs_test_env,
-# 'service_resource-encapsulation_unittests_rcs_client_test.memcheck',
- '',
- 'service/resource-encapsulation/unittests/rcs_client_test')
+ run_test(
+ rcs_test_env,
+# 'service_resource-encapsulation_unittests_rcs_client_test.memcheck',
+ '',
+ 'service/resource-encapsulation/unittests/rcs_client_test')
else:
- rcs_test_env.AppendUnique(CPPDEFINES = ['LOCAL_RUNNING'])
+ rcs_test_env.AppendUnique(CPPDEFINES=['LOCAL_RUNNING'])
if lib_env.get('SECURED') == '1':
src_dir = rcs_test_env.get('SRC_DIR')
- svr_db_src_dir = os.path.join(src_dir, 'service/resource-encapsulation/unittests/')
- svr_db_build_dir = os.path.join(rcs_test_env.get('BUILD_DIR'), 'service', 'resource-encapsulation', 'unittests') + os.sep
+ svr_db_src_dir = os.path.join(src_dir,
+ 'service/resource-encapsulation/unittests/')
+ svr_db_build_dir = os.path.join(
+ rcs_test_env.get('BUILD_DIR'), 'service', 'resource-encapsulation',
+ 'unittests') + os.sep
rcs_test_env.Alias("install",
- rcs_test_env.Install(svr_db_build_dir,
- os.path.join(svr_db_src_dir,
- 'oic_svr_db_re_client.dat')))
\ No newline at end of file
+ rcs_test_env.Install(svr_db_build_dir,
+ os.path.join(
+ svr_db_src_dir,
+ 'oic_svr_db_re_client.dat')))
Import('env')
if env.get('RELEASE'):
- env.AppendUnique(CCFLAGS = ['-Os'])
- env.AppendUnique(CPPDEFINES = ['NDEBUG'])
+ env.AppendUnique(CCFLAGS=['-Os'])
+ env.AppendUnique(CPPDEFINES=['NDEBUG'])
else:
- env.AppendUnique(CCFLAGS = ['-g'])
+ env.AppendUnique(CCFLAGS=['-g'])
if env.get('LOGGING'):
- env.AppendUnique(CPPDEFINES = ['TB_LOG'])
+ env.AppendUnique(CPPDEFINES=['TB_LOG'])
lib_env = env.Clone()
SConscript('#service/third_party_libs.scons', 'lib_env')
######################################################################
# Build flags
######################################################################
-scenemanager_env.AppendUnique(CPPPATH = [
+scenemanager_env.AppendUnique(CPPPATH=[
'./include',
'./src',
'#/resource/csdk/connectivity/api',
'#/resource/oc_logger/include'
])
-scenemanager_env.PrependUnique(LIBS = [
+scenemanager_env.PrependUnique(LIBS=[
'coap',
'connectivity_abstraction',
'oc_logger',
'oc',
'rcs_client',
'rcs_server',
- 'rcs_common'
- ])
+ 'rcs_common',
+])
if target_os not in ['windows']:
- scenemanager_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
+ scenemanager_env.AppendUnique(
+ CXXFLAGS=['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
if target_os not in ['darwin', 'ios', 'windows']:
- scenemanager_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
+ scenemanager_env.AppendUnique(LINKFLAGS=['-Wl,--no-undefined'])
if target_os in ['linux']:
- scenemanager_env.AppendUnique(LIBS = ['pthread'])
-
+ scenemanager_env.AppendUnique(LIBS=['pthread'])
if target_os == 'android':
- scenemanager_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
- scenemanager_env.AppendUnique(LIBS = ['gnustl_shared','log'])
+ scenemanager_env.AppendUnique(CXXFLAGS=['-frtti', '-fexceptions'])
+ scenemanager_env.AppendUnique(LIBS=['gnustl_shared', 'log'])
if not env.get('RELEASE') and target_os not in ['ios']:
- scenemanager_env.PrependUnique(LIBS = ['gcov'])
- scenemanager_env.AppendUnique(CXXFLAGS = ['--coverage'])
+ scenemanager_env.PrependUnique(LIBS=['gcov'])
+ scenemanager_env.AppendUnique(CXXFLAGS=['--coverage'])
######################################################################
# Source files and Targets
######################################################################
-SCENE_SRC_DIR = './src/'
+SCENE_SRC_DIR = './src/'
scenemanager_src = Glob(SCENE_SRC_DIR + '*.cpp')
-if target_os in ['tizen','android'] :
- scenemanagersdk = scenemanager_env.SharedLibrary('scene_manager', scenemanager_src)
-else :
- scenemanagersdk = scenemanager_env.StaticLibrary('scene_manager', scenemanager_src)
+if target_os in ['tizen', 'android']:
+ scenemanagersdk = scenemanager_env.SharedLibrary('scene_manager',
+ scenemanager_src)
+else:
+ scenemanagersdk = scenemanager_env.StaticLibrary('scene_manager',
+ scenemanager_src)
scenemanager_env.InstallTarget(scenemanagersdk, 'libscene_manager')
scenemanager_env.UserInstallTargetLib(scenemanagersdk, 'libscene_manager')
-scenemanager_env.UserInstallTargetHeader('include/SceneList.h', 'service/scene-manager', 'SceneList.h')
-scenemanager_env.UserInstallTargetHeader('include/SceneCollection.h', 'service/scene-manager', 'SceneCollection.h')
-scenemanager_env.UserInstallTargetHeader('include/Scene.h', 'service/scene-manager', 'Scene.h')
-scenemanager_env.UserInstallTargetHeader('include/SceneAction.h', 'service/scene-manager', 'SceneAction.h')
-scenemanager_env.UserInstallTargetHeader('include/RemoteSceneList.h', 'service/scene-manager', 'RemoteSceneList.h')
-scenemanager_env.UserInstallTargetHeader('include/RemoteSceneCollection.h', 'service/scene-manager', 'RemoteSceneCollection.h')
-scenemanager_env.UserInstallTargetHeader('include/RemoteScene.h', 'service/scene-manager', 'RemoteScene.h')
-scenemanager_env.UserInstallTargetHeader('include/RemoteSceneAction.h', 'service/scene-manager', 'RemoteSceneAction.h')
+scenemanager_env.UserInstallTargetHeader(
+ 'include/SceneList.h', 'service/scene-manager', 'SceneList.h')
+scenemanager_env.UserInstallTargetHeader(
+ 'include/SceneCollection.h', 'service/scene-manager', 'SceneCollection.h')
+scenemanager_env.UserInstallTargetHeader('include/Scene.h',
+ 'service/scene-manager', 'Scene.h')
+scenemanager_env.UserInstallTargetHeader(
+ 'include/SceneAction.h', 'service/scene-manager', 'SceneAction.h')
+scenemanager_env.UserInstallTargetHeader(
+ 'include/RemoteSceneList.h', 'service/scene-manager', 'RemoteSceneList.h')
+scenemanager_env.UserInstallTargetHeader('include/RemoteSceneCollection.h',
+ 'service/scene-manager',
+ 'RemoteSceneCollection.h')
+scenemanager_env.UserInstallTargetHeader(
+ 'include/RemoteScene.h', 'service/scene-manager', 'RemoteScene.h')
+scenemanager_env.UserInstallTargetHeader('include/RemoteSceneAction.h',
+ 'service/scene-manager',
+ 'RemoteSceneAction.h')
# Go to build Unit test
if target_os in ['linux']:
target_os = env.get('TARGET_OS')
if target_os in ['linux']:
- SConscript('linux/SConscript')
+ SConscript('linux/SConscript')
elif target_os == 'arduino':
- SConscript('arduino/SConscript')
\ No newline at end of file
+ SConscript('arduino/SConscript')
######################################################################
# Build flags
######################################################################
-scenemanager_sample_env.AppendUnique(CPPPATH = [
+scenemanager_sample_env.AppendUnique(CPPPATH=[
'../../include',
'../../src',
'#/service/resource-encapsulation/include',
'#/resource/include',
'#/resource/oc_logger/include'
])
-scenemanager_sample_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
+scenemanager_sample_env.AppendUnique(
+ CXXFLAGS=['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
-scenemanager_sample_env.PrependUnique(LIBS = ['scene_manager'])
-scenemanager_sample_env.AppendUnique(LIBS = ['rcs_client'])
-scenemanager_sample_env.AppendUnique(LIBS = ['rcs_server'])
-scenemanager_sample_env.AppendUnique(LIBS = ['rcs_common'])
-scenemanager_sample_env.AppendUnique(LIBS = ['oc'])
-scenemanager_sample_env.AppendUnique(LIBS = ['octbstack'])
-scenemanager_sample_env.AppendUnique(LIBS = ['oc_logger'])
-scenemanager_sample_env.AppendUnique(LIBS = ['connectivity_abstraction'])
-scenemanager_sample_env.AppendUnique(LIBS = ['coap'])
+scenemanager_sample_env.PrependUnique(LIBS=['scene_manager'])
+scenemanager_sample_env.AppendUnique(LIBS=[
+ 'rcs_client',
+ 'rcs_server',
+ 'rcs_common',
+ 'oc',
+ 'octbstack',
+ 'oc_logger',
+ 'connectivity_abstraction',
+ 'coap',
+])
if env.get('SECURED') == '1':
- scenemanager_sample_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+ scenemanager_sample_env.AppendUnique(
+ LIBS=['mbedtls', 'mbedx509', 'mbedcrypto'])
if 'rt' in scenemanager_sample_env.get('LIBS'):
- scenemanager_sample_env.Append(LIBS = ['rt'])
+ scenemanager_sample_env.Append(LIBS=['rt'])
if not env.get('RELEASE'):
- scenemanager_sample_env.PrependUnique(LIBS = ['gcov'])
- scenemanager_sample_env.AppendUnique(CXXFLAGS = ['--coverage'])
+ scenemanager_sample_env.PrependUnique(LIBS=['gcov'])
+ scenemanager_sample_env.AppendUnique(CXXFLAGS=['--coverage'])
####################################################################
# Source files and Targets
######################################################################
# SConscript file for Local PKI google tests
from tools.scons.RunTest import run_test
+
Import('env')
gtest_env = SConscript('#extlibs/gtest/SConscript')
lib_env = gtest_env.Clone()
if lib_env.get('RELEASE'):
- lib_env.AppendUnique(CCFLAGS = ['-Os'])
- lib_env.AppendUnique(CPPDEFINES = ['NDEBUG'])
+ lib_env.AppendUnique(CCFLAGS=['-Os'])
+ lib_env.AppendUnique(CPPDEFINES=['NDEBUG'])
else:
- lib_env.AppendUnique(CCFLAGS = ['-g'])
+ lib_env.AppendUnique(CCFLAGS=['-g'])
if lib_env.get('LOGGING'):
- lib_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
+ lib_env.AppendUnique(CPPDEFINES=['TB_LOG'])
SConscript('#service/third_party_libs.scons', 'lib_env')
# Build flags
######################################################################
-scene_test_env.AppendUnique(LIBPATH = [lib_env.get('BUILD_DIR')])
-scene_test_env.AppendUnique(LIBS = [
- 'scene_manager', 'rcs_server', 'rcs_client','rcs_common',
- 'oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'coap'])
+scene_test_env.AppendUnique(LIBPATH=[lib_env.get('BUILD_DIR')])
+scene_test_env.AppendUnique(LIBS=[
+ 'scene_manager',
+ 'rcs_server',
+ 'rcs_client',
+ 'rcs_common',
+ 'oc',
+ 'octbstack',
+ 'oc_logger',
+ 'connectivity_abstraction',
+ 'coap',
+])
if target_os not in ['windows']:
- scene_test_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0'])
+ scene_test_env.AppendUnique(
+ CXXFLAGS=['-O2', '-g', '-Wall', '-fmessage-length=0'])
if not scene_test_env.get('RELEASE'):
- scene_test_env.PrependUnique(LIBS = ['gcov'])
- scene_test_env.AppendUnique(CXXFLAGS = ['--coverage'])
+ scene_test_env.PrependUnique(LIBS=['gcov'])
+ scene_test_env.AppendUnique(CXXFLAGS=['--coverage'])
-scene_test_env.PrependUnique(CPPPATH = [
+scene_test_env.PrependUnique(CPPPATH=[
'#/extlibs/hippomocks/hippomocks',
'../include',
'../src',
if scene_test_env.get('SECURED') == '1':
if scene_test_env.get('WITH_TCP') == True:
- scene_test_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+ scene_test_env.AppendUnique(LIBS=['mbedtls', 'mbedx509', 'mbedcrypto'])
######################################################################
# Build Test
######################################################################
scene_list_test_src = scene_test_env.Glob('./SceneListTest.cpp')
-scene_list_test = scene_test_env.Program('scene_list_test', scene_list_test_src)
+scene_list_test = scene_test_env.Program('scene_list_test',
+ scene_list_test_src)
Alias("scene_list_test", scene_list_test)
scene_test_env.AppendTarget('scene_list_test')
scene_collection_test_src = scene_test_env.Glob('./SceneCollectionTest.cpp')
-scene_collection_test = scene_test_env.Program('scene_collection_test', scene_collection_test_src)
+scene_collection_test = scene_test_env.Program('scene_collection_test',
+ scene_collection_test_src)
Alias("scene_collection_test", scene_collection_test)
scene_test_env.AppendTarget('scene_collection_test')
scene_test_env.AppendTarget('scene_test')
scene_action_test_src = scene_test_env.Glob('./SceneActionTest.cpp')
-scene_action_test = scene_test_env.Program('scene_action_test', scene_action_test_src)
+scene_action_test = scene_test_env.Program('scene_action_test',
+ scene_action_test_src)
Alias("scene_action_test", scene_action_test)
scene_test_env.AppendTarget('scene_action_test')
remote_scene_list_test_src = scene_test_env.Glob('./RemoteSceneListTest.cpp')
-remote_scene_list_test = scene_test_env.Program('remote_scene_list_test', remote_scene_list_test_src)
+remote_scene_list_test = scene_test_env.Program('remote_scene_list_test',
+ remote_scene_list_test_src)
Alias("remote_scene_list_test", remote_scene_list_test)
scene_test_env.AppendTarget('remote_scene_list_test')
-remote_scene_col_test_src = scene_test_env.Glob('./RemoteSceneCollectionTest.cpp')
-remote_scene_col_test = scene_test_env.Program('remote_scene_col_test', remote_scene_col_test_src)
+remote_scene_col_test_src = scene_test_env.Glob(
+ './RemoteSceneCollectionTest.cpp')
+remote_scene_col_test = scene_test_env.Program('remote_scene_col_test',
+ remote_scene_col_test_src)
Alias("remote_scene_col_test", remote_scene_col_test)
scene_test_env.AppendTarget('remote_scene_col_test')
remote_scene_test_src = scene_test_env.Glob('./RemoteSceneTest.cpp')
-remote_scene_test = scene_test_env.Program('remote_scene_test', remote_scene_test_src)
+remote_scene_test = scene_test_env.Program('remote_scene_test',
+ remote_scene_test_src)
Alias("remote_scene_test", remote_scene_test)
scene_test_env.AppendTarget('remote_scene_test')
-remote_scene_action_test_src = scene_test_env.Glob('./RemoteSceneActionTest.cpp')
-remote_scene_action_test = scene_test_env.Program('remote_scene_action_test', remote_scene_action_test_src)
+remote_scene_action_test_src = scene_test_env.Glob(
+ './RemoteSceneActionTest.cpp')
+remote_scene_action_test = scene_test_env.Program('remote_scene_action_test',
+ remote_scene_action_test_src)
Alias("remote_scene_action_test", remote_scene_action_test)
scene_test_env.AppendTarget('remote_scene_action_test')
if env.get('TEST') == '1':
if env.get('SECURED') != '1':
- run_test(scene_test_env,
- '',
- 'service/scene-manager/unittests/scene_list_test')
- run_test(scene_test_env,
- '',
- 'service/scene-manager/unittests/scene_collection_test')
- run_test(scene_test_env,
- '',
- 'service/scene-manager/unittests/scene_test')
- run_test(scene_test_env,
- '',
- 'service/scene-manager/unittests/scene_action_test')
- run_test(scene_test_env,
- '',
- 'service/scene-manager/unittests/remote_scene_list_test')
- run_test(scene_test_env,
- '',
- 'service/scene-manager/unittests/remote_scene_col_test')
- run_test(scene_test_env,
- '',
- 'service/scene-manager/unittests/remote_scene_test')
- run_test(scene_test_env,
- '',
- 'service/scene-manager/unittests/remote_scene_action_test')
+ run_test(scene_test_env, '',
+ 'service/scene-manager/unittests/scene_list_test')
+ run_test(scene_test_env, '',
+ 'service/scene-manager/unittests/scene_collection_test')
+ run_test(scene_test_env, '',
+ 'service/scene-manager/unittests/scene_test')
+ run_test(scene_test_env, '',
+ 'service/scene-manager/unittests/scene_action_test')
+ run_test(scene_test_env, '',
+ 'service/scene-manager/unittests/remote_scene_list_test')
+ run_test(scene_test_env, '',
+ 'service/scene-manager/unittests/remote_scene_col_test')
+ run_test(scene_test_env, '',
+ 'service/scene-manager/unittests/remote_scene_test')
+ run_test(scene_test_env, '',
+ 'service/scene-manager/unittests/remote_scene_action_test')
######################################################################
# Build flags
######################################################################
-simulator_env.AppendUnique(CPPPATH = ['inc', 'src/client', 'src/server', 'src/common'])
-simulator_env.AppendUnique(CPPPATH = [
- '../../resource/include/',
- '../../resource/csdk/include',
- '../../resource/csdk/stack/include',
- '../../resource/c_common/ocrandom/include',
- '../../resource/csdk/logger/include',
- '../../resource/oc_logger/include',
- './ramlparser/raml',
- './ramlparser/raml/model',
- './ramlparser/raml/jsonSchemaParser',
- '../../extlibs/yaml/yaml/include'
- ])
+simulator_env.AppendUnique(CPPPATH=[
+ 'inc',
+ 'src/client',
+ 'src/server',
+ 'src/common',
+ '../../resource/include/',
+ '../../resource/csdk/include',
+ '../../resource/csdk/stack/include',
+ '../../resource/c_common/ocrandom/include',
+ '../../resource/csdk/logger/include',
+ '../../resource/oc_logger/include',
+ './ramlparser/raml',
+ './ramlparser/raml/model',
+ './ramlparser/raml/jsonSchemaParser',
+ '../../extlibs/yaml/yaml/include',
+])
# Including Java path for building JNI files
try:
- os.environ['JAVA_HOME']
+ os.environ['JAVA_HOME']
except KeyError:
- print '''
+ print '''
*************************************** Error *********************************
* JAVA_HOME environment variable not set
* Simulator has dependency on java, Please set environment variable JAVA_HOME
*******************************************************************************
'''
- sys.exit(1)
-
+ sys.exit(1)
+
java_headers = [os.path.join(os.environ['JAVA_HOME'], 'include')]
java_headers.append(os.path.join(java_headers[0], 'win32'))
java_headers.append(os.path.join(java_headers[0], 'linux'))
java_headers.append(os.path.join(java_headers[0], 'solaris'))
-simulator_env.AppendUnique(CPPPATH = java_headers)
+simulator_env.AppendUnique(CPPPATH=java_headers)
-simulator_env.Append( RPATH = env.Literal('\\$$ORIGIN'))
+simulator_env.Append(RPATH=env.Literal('\\$$ORIGIN'))
-simulator_env.AppendUnique(CPPPATH = ['../../extlibs/cjson'])
-simulator_env.PrependUnique(LIBS = ['oc', 'octbstack', 'RamlParser'])
-simulator_env.AppendUnique(LIBS = ['pthread'])
+simulator_env.AppendUnique(CPPPATH=['../../extlibs/cjson'])
+simulator_env.PrependUnique(LIBS=['oc', 'octbstack', 'RamlParser'])
+simulator_env.AppendUnique(LIBS=['pthread'])
-simulator_env.AppendUnique(CXXFLAGS = ['-O2', '-Wall', '-fmessage-length=0', '-std=c++0x'])
+simulator_env.AppendUnique(
+ CXXFLAGS=['-O2', '-Wall', '-fmessage-length=0', '-std=c++0x'])
######################################################################
# Source files and Targets
######################################################################
-simulator_src = [env.Glob('src/*.cpp')
- ,env.Glob('src/*/*.cpp')
- ,env.Glob('java/jni/*.cpp')
- ]
+simulator_src = [
+ env.Glob('src/*.cpp'),
+ env.Glob('src/*/*.cpp'),
+ env.Glob('java/jni/*.cpp')
+]
simulatorsdk = simulator_env.SharedLibrary('SimulatorManager', simulator_src)
simulator_env.InstallTarget(simulatorsdk, 'libSimulatorManager')
######################################################################
# Build flags
######################################################################
-sim_env.AppendUnique(CPPPATH = [
+sim_env.AppendUnique(CPPPATH=[
'../../inc',
'#/resource/csdk/include',
'#/resource/csdk/stack/include',
'#/resource/include',
'#/resource/oc_logger/include'
])
-sim_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread'])
-sim_env.AppendUnique(CPPDEFINES = ['LINUX'])
-sim_env.AppendUnique(LIBS = ['SimulatorManager'])
+sim_env.AppendUnique(CXXFLAGS=['-std=c++0x', '-Wall', '-pthread'])
+sim_env.AppendUnique(CPPDEFINES=['LINUX'])
+sim_env.AppendUnique(LIBS=['SimulatorManager'])
-sim_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
-sim_env.AppendUnique(RPATH = [env.get('BUILD_DIR')])
-sim_env.PrependUnique(LIBS = ['SimulatorManager'])
+sim_env.AppendUnique(LIBPATH=[env.get('BUILD_DIR')])
+sim_env.AppendUnique(RPATH=[env.get('BUILD_DIR')])
+sim_env.PrependUnique(LIBS=['SimulatorManager'])
if sim_env.get('SECURED') == '1':
- sim_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+ sim_env.AppendUnique(LIBS=['mbedtls', 'mbedx509', 'mbedcrypto'])
######################################################################
# Source files and Targets
######################################################################
# Build flags
######################################################################
-sim_env.AppendUnique(CPPPATH = [
+sim_env.AppendUnique(CPPPATH=[
'#/resource/c_common/octimer/include',
'../../inc',
'#/resource/csdk/include',
'#/resource/include',
'#/resource/oc_logger/include'
])
-sim_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread'])
-sim_env.AppendUnique(CPPDEFINES = ['LINUX'])
-sim_env.AppendUnique(LIBS = ['SimulatorManager'])
+sim_env.AppendUnique(CXXFLAGS=['-std=c++0x', '-Wall', '-pthread'])
+sim_env.AppendUnique(CPPDEFINES=['LINUX'])
+sim_env.AppendUnique(LIBS=['SimulatorManager'])
-sim_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
-sim_env.AppendUnique(RPATH = [env.get('BUILD_DIR')])
-sim_env.PrependUnique(LIBS = ['SimulatorManager'])
+sim_env.AppendUnique(LIBPATH=[env.get('BUILD_DIR')])
+sim_env.AppendUnique(RPATH=[env.get('BUILD_DIR')])
+sim_env.PrependUnique(LIBS=['SimulatorManager'])
if sim_env.get('SECURED') == '1':
- sim_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+ sim_env.AppendUnique(LIBS=['mbedtls', 'mbedx509', 'mbedcrypto'])
######################################################################
# Source files and Targets
######################################################################
# Build flags
######################################################################
-raml_env.AppendUnique(CPPPATH = ['#/resource/c_common/octimer/include',
- '#/extlibs/cjson',
- '#/extlibs/yaml/yaml/src' ,
- '#/extlibs/yaml/yaml/include',
- 'raml/model',
- 'raml/jsonSchemaParser',
- 'raml'])
-raml_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread', '-O2', '-g', '-Wall', '-fmessage-length=0'])
-raml_env.AppendUnique(CPPDEFINES = ['LINUX'])
-raml_env.Append( RPATH = env.Literal('\\$$ORIGIN'))
+raml_env.AppendUnique(CPPPATH=[
+ '#/resource/c_common/octimer/include',
+ '#/extlibs/cjson',
+ '#/extlibs/yaml/yaml/src',
+ '#/extlibs/yaml/yaml/include',
+ 'raml/model',
+ 'raml/jsonSchemaParser',
+ 'raml'
+])
+raml_env.AppendUnique(CXXFLAGS=[
+ '-std=c++0x', '-Wall', '-pthread', '-O2', '-g', '-Wall',
+ '-fmessage-length=0'
+])
+raml_env.AppendUnique(CPPDEFINES=['LINUX'])
+raml_env.Append(RPATH=env.Literal('\\$$ORIGIN'))
-raml_env.PrependUnique(LIBS = ['octbstack', 'YamlParser'])
-raml_env.AppendUnique(LIBS = ['pthread', 'm', 'cjson'])
+raml_env.PrependUnique(LIBS=['octbstack', 'YamlParser'])
+raml_env.AppendUnique(LIBS=['pthread', 'm', 'cjson'])
######################################################################
# Source files and Targets
######################################################################
-raml_src = [env.Glob('raml/model/*.cpp'), env.Glob('raml/jsonSchemaParser/*.cpp'), env.Glob('raml/*.cpp')]
+raml_src = [
+ env.Glob('raml/model/*.cpp'),
+ env.Glob('raml/jsonSchemaParser/*.cpp'),
+ env.Glob('raml/*.cpp')
+]
ramlsdk = raml_env.SharedLibrary('RamlParser', raml_src)
conf = Configure(lib_env.Clone(LIBS=[]))
- if target_os not in ['tizen'] and not conf.CheckLib('boost_thread', language='C++'):
- print 'Did not find boost_thread, exiting!'
- Exit(1)
+ if target_os not in ['tizen']:
+ if not conf.CheckLib('boost_thread', language='C++'):
+ print 'Did not find boost_thread, exiting!'
+ Exit(1)
- if target_os not in ['tizen'] and not conf.CheckLib('boost_system', language='C++'):
- print 'Did not find boost_system, exiting!'
- Exit(1)
+ if not conf.CheckLib('boost_system', language='C++'):
+ print 'Did not find boost_system, exiting!'
+ Exit(1)
conf.Finish()
lib_env.AppendUnique(CCFLAGS=['-w'])
elif target_os == 'ios':
- lib_env.AppendUnique(FRAMEWORKPATH=[src_dir + '/extlibs/boost/ios/framework'])
+ lib_env.AppendUnique(
+ FRAMEWORKPATH=[src_dir + '/extlibs/boost/ios/framework'])
lib_env.AppendUnique(FRAMEWORKS=['boost'])
elif target_os == 'darwin':
lib_env.AppendUnique(CPPPATH=['/usr/local/include'])