X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=android%2Fandroid_api%2FSConscript;h=7e7914481a5ead521fb3756a1257c81bac42e1ec;hb=c315c87e07c4080ecd0ef488e7a1047bc3c509b2;hp=895ebb631fdc89fe3c3e505b9190b9789bf261e8;hpb=edcfc3d2329da7b914771c0dcff5f42c9b74fd93;p=platform%2Fupstream%2Fiotivity.git diff --git a/android/android_api/SConscript b/android/android_api/SConscript index 895ebb6..7e79144 100644 --- a/android/android_api/SConscript +++ b/android/android_api/SConscript @@ -54,14 +54,21 @@ else: 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 ('ALL' in ANDROID_TRANSPORT) or ('BLE' in ANDROID_TRANSPORT): + ANDROID_API_LEVEL = '22' + ANDROID_VER = '5.1' +else: + ANDROID_API_LEVEL = '21' + ANDROID_VER = '5.0.1' + +if not os.path.exists(android_home + '/platforms/android-' + ANDROID_API_LEVEL) 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 * +* Either 'Android API %s' is not installed or 'Android SDK Build Tools * * 20.0.0' is not installed. The Android SDK Manager will now open. Please * * be sure to deselect all options, then select the following 2 packages: * * 1. Under "Tools" select "Android SDK Build-tools" Revision 20. * -* 2. Under "Android 5.0.1 (API 21)" select "SDK Platform" * +* 2. Under "Android %s (API %s)" select "SDK Platform" * * 3. Continue by selecting "Install 2 Packages" * * * * NOTE: If you have an http proxy, please press ctrl+c now and edit/create * @@ -80,7 +87,7 @@ if not os.path.exists(android_home + '/platforms/android-21') or not os.path.exi ******************************************************************************* ...Opening Android SDK Manager now. Once you are finished, the build will continue. -''' +''' % (ANDROID_API_LEVEL, ANDROID_VER, ANDROID_API_LEVEL) os.system(android_home + '/tools/android') def ensure_libs(target, source, env): @@ -92,10 +99,10 @@ jdk_env['BUILDERS']['Gradle'] = Builder(action = env.get('ANDROID_GRADLE') + ' b jdk_env['BUILD_DIR'] = env.get('BUILD_DIR') cmdBuildApi=jdk_env.Gradle(target="base/objs", source="base/src/main/java/org/iotivity/base/OcResource.java") -jdk_env['BUILDERS']['Gradle'] = Builder(action = env.get('ANDROID_GRADLE') + ' build -b' + 'android/examples/build.gradle -DWITH_TRANSPORT_EDR=%s -DWITH_TRANSPORT_BLE=%s -DWITH_TRANSPORT_NFC=%s -PTARGET_ARCH=%s -PRELEASE=%s -PSECURED=%s -DSECURE=%s -PWITH_CLOUD=%s -PRD_MODE=%s -PWITH_MQ_PUB=%s -PWITH_MQ_SUB=%s -PWITH_MQ_BROKER=%s -PWITH_TCP=%s --stacktrace' %(ANDROID_TRANSPORT_EDR, ANDROID_TRANSPORT_BLE, ANDROID_TRANSPORT_NFC, ANDROID_TARGET_ARCH, ANDROID_RELEASE, ANDROID_SECURED, ANDROID_SECURED, ANDROID_CLOUD, ANDROID_RD_MODE, ANDROID_MQ_PUB, ANDROID_MQ_SUB, ANDROID_MQ_BROKER, ANDROID_TCP)) -cmdBuildExamples=jdk_env.Gradle(target="../examples/devicediscoveryclient/apk", source="../examples/devicediscoveryclient/src/main/java/org/iotivity/base/examples/DeviceDiscoveryClient.java") +#jdk_env['BUILDERS']['Gradle'] = Builder(action = env.get('ANDROID_GRADLE') + ' build -b' + 'android/examples/build.gradle -DWITH_TRANSPORT_EDR=%s -DWITH_TRANSPORT_BLE=%s -DWITH_TRANSPORT_NFC=%s -PTARGET_ARCH=%s -PRELEASE=%s -PSECURED=%s -DSECURE=%s -PWITH_CLOUD=%s -PRD_MODE=%s -PWITH_MQ_PUB=%s -PWITH_MQ_SUB=%s -PWITH_MQ_BROKER=%s -PWITH_TCP=%s --stacktrace' %(ANDROID_TRANSPORT_EDR, ANDROID_TRANSPORT_BLE, ANDROID_TRANSPORT_NFC, ANDROID_TARGET_ARCH, ANDROID_RELEASE, ANDROID_SECURED, ANDROID_SECURED, ANDROID_CLOUD, ANDROID_RD_MODE, ANDROID_MQ_PUB, ANDROID_MQ_SUB, ANDROID_MQ_BROKER, ANDROID_TCP)) +#cmdBuildExamples=jdk_env.Gradle(target="../examples/devicediscoveryclient/apk", source="../examples/devicediscoveryclient/src/main/java/org/iotivity/base/examples/DeviceDiscoveryClient.java") # android examples require android api to be built before being invoked -Depends(cmdBuildExamples, cmdBuildApi) +#Depends(cmdBuildExamples, cmdBuildApi) env.AppendUnique(baseAAR = cmdBuildApi)