[IOT-1089] Changed BUILD_JAVA from Enum value to Boolean
authorGeorge Nash <george.nash@intel.com>
Fri, 2 Dec 2016 22:04:25 +0000 (14:04 -0800)
committerRick Bell <richard.s.bell@intel.com>
Mon, 5 Dec 2016 21:04:36 +0000 (21:04 +0000)
Change-Id: Ic8cd4d16127d67e014e0d9ec2a2bd87c251f282b
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/15079
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Larry Sachs <larry.j.sachs@intel.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
SConstruct
auto_build.py
build_common/SConscript
build_common/external_libs.scons
build_common/linux/SConscript

index e5b390e..4bfe3b0 100644 (file)
@@ -57,14 +57,14 @@ if target_os not in ['arduino','darwin','ios', 'android', 'msys_nt', 'windows']:
        SConscript(build_dir + 'examples/OICMiddle/SConscript')
 
 java_build = None
-if env.get('BUILD_JAVA') == 'ON' or target_os == 'android':
+if env.get('BUILD_JAVA') == True or target_os == 'android':
     if env.get('JAVA_HOME') != None:
         java_build = SConscript(build_dir + 'java/SConscript')
 
 # Build 'service' sub-project
 service_build = SConscript(build_dir + 'service/SConscript')
 
-if env.get('BUILD_JAVA') == 'ON' or target_os == 'android':
+if env.get('BUILD_JAVA') == True or target_os == 'android':
     if env.get('JAVA_HOME') != None:
         Depends(service_build, java_build)
 
index 83bf4ab..5864306 100644 (file)
@@ -92,7 +92,7 @@ def build_linux_unsecured_with_java(flag, extra_option_str):
     print ("*********** Build for linux with Java support ************")
     build_options = {
                         'RELEASE':flag,
-                        'BUILD_JAVA': 'ON',
+                        'BUILD_JAVA': 1,
                         'TARGET_TRANSPORT': 'IP',
                     }
     call_scons(build_options, extra_option_str)
@@ -101,7 +101,7 @@ def build_linux_secured_with_java(flag, extra_option_str):
     print ("*********** Build for linux with Java support and secured ************")
     build_options = {
                         'RELEASE':flag,
-                        'BUILD_JAVA': 'ON',
+                        'BUILD_JAVA': 1,
                         'TARGET_TRANSPORT': 'IP',
                         'SECURED': 1,
                     }
index bdecd95..633be4c 100644 (file)
@@ -129,7 +129,7 @@ if target_os == 'windows':
        # 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(EnumVariable('BUILD_JAVA', 'Build Java bindings', 'OFF', allowed_values=('ON', 'OFF')))
+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))
 
 AddOption('--prefix',
index 993a135..57f3fd0 100644 (file)
@@ -40,7 +40,7 @@ if target_os == 'darwin':
        env.AppendUnique(CPPPATH = ['/usr/local/include'])
        env.AppendUnique(LIBPATH = ['/usr/local/lib'])
 
-if env.get('BUILD_JAVA') == 'ON' and target_os != 'android':
+if env.get('BUILD_JAVA') == True and target_os != 'android':
        if env.get('JAVA_HOME') != None:
                        env.AppendUnique(CCFLAGS = ['-D__JAVA__'])
                        env.AppendUnique(CPPPATH = [
@@ -48,7 +48,7 @@ if env.get('BUILD_JAVA') == 'ON' and target_os != 'android':
                        env.get('JAVA_HOME') + '/include/' + target_os
                ])
        else:
-               raise SCons.Errors.StopError( 'BUILD_JAVA is ON, but JAVA_HOME is not set.')
+               raise SCons.Errors.StopError( 'BUILD_JAVA is specified, but JAVA_HOME is not set.')
 
 
 # External library include files are in <src_dir>/deps/<target_os>/include
index 1cc47ea..ce7c042 100644 (file)
@@ -10,7 +10,7 @@ print "Reading linux configuration script"
 
 SConscript('../external_libs.scons')
 help_vars = Variables()
-if env.get('BUILD_JAVA') == 'ON':
+if env.get('BUILD_JAVA') == True:
     if not env.get('ANDROID_GRADLE'):
         SConscript('../../extlibs/android/gradle/SConscript')
         help_vars.Add(PathVariable('ANDROID_GRADLE', 'Android Gradle directory', os.path.join(env.get('SRC_DIR'), 'extlibs', 'android', 'gradle', 'gradle-2.2.1/bin/gradle')))