From: Mats Wichmann Date: Fri, 2 Jun 2017 13:12:54 +0000 (-0600) Subject: Reformat all of the cloud SConscripts to be more Pythonic X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c33194eae964d15b436b3d0d93c7b7b409c10ac4;p=platform%2Fupstream%2Fiotivity.git Reformat all of the cloud SConscripts to be more Pythonic There are not intended to be any functional changes, and this set of changes turned out to be relatively minor. Change-Id: I738b2f2f43d3edd069426daa06ba29f7aaa33bef Signed-off-by: Mats Wichmann Reviewed-on: https://gerrit.iotivity.org/gerrit/20535 Tested-by: jenkins-iotivity Reviewed-by: George Nash Reviewed-by: Phil Coval (cherry picked from commit b3aa625df006bb6c0a5d6269e6a82219d0bffefc) Reviewed-on: https://gerrit.iotivity.org/gerrit/20575 Reviewed-by: Pawel Winogrodzki Reviewed-by: Ziran Sun --- diff --git a/cloud/SConscript b/cloud/SConscript index a3a01af..9e5a1b6 100644 --- a/cloud/SConscript +++ b/cloud/SConscript @@ -29,4 +29,4 @@ target_os = env.get('TARGET_OS') if target_os in ['linux']: # Build sample cloud client project if env.get('WITH_CLOUD') == True: - SConscript('samples/client/SConscript') \ No newline at end of file + SConscript('samples/client/SConscript') diff --git a/cloud/samples/client/SConscript b/cloud/samples/client/SConscript index bcb099b..c3434fd 100644 --- a/cloud/samples/client/SConscript +++ b/cloud/samples/client/SConscript @@ -33,74 +33,79 @@ cc_sample_app_env = lib_env.Clone() ###################################################################### with_upstream_libcoap = cc_sample_app_env.get('WITH_UPSTREAM_LIBCOAP') if with_upstream_libcoap == '1': - cc_sample_app_env.AppendUnique(CPPPATH = ['#extlibs/libcoap/libcoap/include']) + cc_sample_app_env.AppendUnique( + CPPPATH=['#/extlibs/libcoap/libcoap/include']) else: - cc_sample_app_env.AppendUnique(CPPPATH = [ - '#resource/csdk/connectivity/lib/libcoap-4.1.1/include' - ]) - -cc_sample_app_env.AppendUnique(CPPPATH = [ - '#/resource/include/', - '#/resource/csdk/resource-directory/include', - '#/resource/csdk/include', - '#/resource/csdk/stack/include', - '#/resource/c_common/ocrandom/include', - '#/resource/csdk/logger/include', - '#/resource/oc_logger/include', - '#/resource/csdk/connectivity/inc', - '#/resource/csdk/connectivity/api', - '#/resource/csdk/connectivity/common/inc', - '#/resource/csdk/security/include', - '#/resource/csdk/security/provisioning/include', - '#/resource/csdk/security/provisioning/include/internal', - '#/extlibs/mbedtls/mbedtls/include' - ]) - -cc_sample_app_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-Wextra', '-std=c++0x', '-pthread']) -cc_sample_app_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')]) -cc_sample_app_env.AppendUnique(RPATH = [env.get('BUILD_DIR')]) - -cc_sample_app_env.PrependUnique(LIBS = ['oc', 'octbstack','connectivity_abstraction','pthread', 'resource_directory']) - -cc_sample_app_env.AppendUnique(CPPDEFINES = ['WITH_CLOUD', 'RD_CLIENT']) + cc_sample_app_env.AppendUnique( + CPPPATH=['#/resource/csdk/connectivity/lib/libcoap-4.1.1/include']) + +cc_sample_app_env.AppendUnique(CPPPATH=[ + '#/resource/include/', + '#/resource/csdk/resource-directory/include', + '#/resource/csdk/include', + '#/resource/csdk/stack/include', + '#/resource/c_common/ocrandom/include', + '#/resource/csdk/logger/include', + '#/resource/oc_logger/include', + '#/resource/csdk/connectivity/inc', + '#/resource/csdk/connectivity/api', + '#/resource/csdk/connectivity/common/inc', + '#/resource/csdk/security/include', + '#/resource/csdk/security/provisioning/include', + '#/resource/csdk/security/provisioning/include/internal', + '#/extlibs/mbedtls/mbedtls/include' +]) + +cc_sample_app_env.AppendUnique( + CXXFLAGS=['-O2', '-g', '-Wall', '-Wextra', '-std=c++0x', '-pthread']) +cc_sample_app_env.AppendUnique(LIBPATH=[env.get('BUILD_DIR')]) +cc_sample_app_env.AppendUnique(RPATH=[env.get('BUILD_DIR')]) + +cc_sample_app_env.PrependUnique(LIBS=[ + 'oc', 'octbstack', 'connectivity_abstraction', 'pthread', + 'resource_directory' +]) + +cc_sample_app_env.AppendUnique(CPPDEFINES=['WITH_CLOUD', 'RD_CLIENT']) ###################################################################### -# Install for rootca certificate +# Install for rootca certificate ###################################################################### src_dir = cc_sample_app_env.get('SRC_DIR') cc_cloud_src_dir = src_dir + '/cloud/samples/client/' tlsOption = env.get('SECURED') if tlsOption is '1': - cc_sample_app_env.PrependUnique(LIBS = ['ocpmapi']) - Command("rootca.crt", cc_cloud_src_dir + "rootca.crt", Copy("$TARGET", "$SOURCE")) - Command("aircon_controlee.dat", cc_cloud_src_dir + "aircon_controlee.dat", Copy("$TARGET", "$SOURCE")) - Command("aircon_controller.dat", cc_cloud_src_dir + "aircon_controller.dat", Copy("$TARGET", "$SOURCE")) - Command("group_invite.dat", cc_cloud_src_dir + "group_invite.dat", Copy("$TARGET", "$SOURCE")) - Command("mq_publisher.dat", cc_cloud_src_dir + "mq_publisher.dat", Copy("$TARGET", "$SOURCE")) - Command("mq_subscriber.dat", cc_cloud_src_dir + "mq_subscriber.dat", Copy("$TARGET", "$SOURCE")) - Command("thin_room_light.dat", cc_cloud_src_dir + "thin_room_light.dat", Copy("$TARGET", "$SOURCE")) - + cc_sample_app_env.PrependUnique(LIBS=['ocpmapi']) + Command("rootca.crt", cc_cloud_src_dir + "rootca.crt", + Copy("$TARGET", "$SOURCE")) + Command("aircon_controlee.dat", cc_cloud_src_dir + "aircon_controlee.dat", + Copy("$TARGET", "$SOURCE")) + Command("aircon_controller.dat", + cc_cloud_src_dir + "aircon_controller.dat", + Copy("$TARGET", "$SOURCE")) + Command("group_invite.dat", cc_cloud_src_dir + "group_invite.dat", + Copy("$TARGET", "$SOURCE")) + Command("mq_publisher.dat", cc_cloud_src_dir + "mq_publisher.dat", + Copy("$TARGET", "$SOURCE")) + Command("mq_subscriber.dat", cc_cloud_src_dir + "mq_subscriber.dat", + Copy("$TARGET", "$SOURCE")) + Command("thin_room_light.dat", cc_cloud_src_dir + "thin_room_light.dat", + Copy("$TARGET", "$SOURCE")) ###################################################################### # Sample for the thin cloud device ###################################################################### -thin_room_light_src = [ - 'thin_light/thin_room_light.cpp' - ] +thin_room_light_src = ['thin_light/thin_room_light.cpp'] cc_sample_app_env.Program('thin_room_light', thin_room_light_src) ###################################################################### # Samples for the air conditioner ###################################################################### -aircon_controlee_src = [ - 'airconditioner/aircon_controlee.cpp' - ] +aircon_controlee_src = ['airconditioner/aircon_controlee.cpp'] cc_sample_app_env.Program('aircon_controlee', aircon_controlee_src) -aircon_controller_src = [ - 'airconditioner/aircon_controller.cpp' - ] +aircon_controller_src = ['airconditioner/aircon_controller.cpp'] cc_sample_app_env.Program('aircon_controller', aircon_controller_src) ###################################################################### @@ -108,27 +113,25 @@ cc_sample_app_env.Program('aircon_controller', aircon_controller_src) ###################################################################### mqOption = env.get('WITH_MQ') if mqOption[0] is not 'OFF': - cc_sample_app_env.AppendUnique(CPPDEFINES = ['WITH_MQ']) - if set(['PUB']) == set(mqOption): - cc_sample_app_env.AppendUnique(CPPDEFINES = ['MQ_PUBLISHER']) - mq_publisher_src = ['messagequeue/mq_publisher.cpp'] - cc_sample_app_env.Program('mq_publisher', mq_publisher_src) - elif set(['SUB']) == set(mqOption): - cc_sample_app_env.AppendUnique(CPPDEFINES = ['MQ_SUBSCRIBER']) - mq_subscriber_src = ['messagequeue/mq_subscriber.cpp'] - cc_sample_app_env.Program('mq_subscriber', mq_subscriber_src) - else: - cc_sample_app_env.AppendUnique(CPPDEFINES = ['MQ_PUBLISHER']) - mq_publisher_src = ['messagequeue/mq_publisher.cpp'] - cc_sample_app_env.Program('mq_publisher', mq_publisher_src) - cc_sample_app_env.AppendUnique(CPPDEFINES = ['MQ_SUBSCRIBER']) - mq_subscriber_src = ['messagequeue/mq_subscriber.cpp'] - cc_sample_app_env.Program('mq_subscriber', mq_subscriber_src) + cc_sample_app_env.AppendUnique(CPPDEFINES=['WITH_MQ']) + if set(['PUB']) == set(mqOption): + cc_sample_app_env.AppendUnique(CPPDEFINES=['MQ_PUBLISHER']) + mq_publisher_src = ['messagequeue/mq_publisher.cpp'] + cc_sample_app_env.Program('mq_publisher', mq_publisher_src) + elif set(['SUB']) == set(mqOption): + cc_sample_app_env.AppendUnique(CPPDEFINES=['MQ_SUBSCRIBER']) + mq_subscriber_src = ['messagequeue/mq_subscriber.cpp'] + cc_sample_app_env.Program('mq_subscriber', mq_subscriber_src) + else: + cc_sample_app_env.AppendUnique(CPPDEFINES=['MQ_PUBLISHER']) + mq_publisher_src = ['messagequeue/mq_publisher.cpp'] + cc_sample_app_env.Program('mq_publisher', mq_publisher_src) + cc_sample_app_env.AppendUnique(CPPDEFINES=['MQ_SUBSCRIBER']) + mq_subscriber_src = ['messagequeue/mq_subscriber.cpp'] + cc_sample_app_env.Program('mq_subscriber', mq_subscriber_src) ###################################################################### # Samples for group and invite ###################################################################### -group_invite_src = [ - 'group_invite/group_invite.cpp' - ] +group_invite_src = ['group_invite/group_invite.cpp'] cc_sample_app_env.Program('group_invite_sample', group_invite_src)