Commit 3bbbdecd authored by Jay Sharma's avatar Jay Sharma Committed by Madan Lanka

[Resource-container] Updated the Java SDK

- Renamed sdk's service folder to resource-container
- restructured the .so's dependencies between RE and RC.

Change-Id: I96f6cd592e002d39655067b772d433e3eb12cc26
Signed-off-by: default avatarJay Sharma <jay.sharma@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/3723Reviewed-by: default avatarMarkus Jung <markus.jung@samsung.com>
Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: default avatarMadan Lanka <lanka.madan@samsung.com>
parent 2f762d04
......@@ -44,15 +44,15 @@ if not os.path.exists(android_home + '/platforms/android-21') or not os.path.exi
def ensure_libs(target, source, env):
return target, [source, env.get('BUILD_DIR') + 'librcs_server.so',
return target, [source, env.get('BUILD_DIR') + 'librcs_server.so',
env.get('BUILD_DIR') + 'librcs_client.so',
env.get('BUILD_DIR') + 'librcs_container.so']
jdk_env = Environment(ENV=os.environ)
jdk_env['BUILDERS']['Gradle'] = Builder(action = env.get('ANDROID_GRADLE') +
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')
jdk_env.Gradle(target="service/objs",
source="service/src/main/java/org/iotivity/service/resourcecontainer/RcsBundleInfo.java")
jdk_env.Gradle(target="service/objs",
source="resource-container/src/main/java/org/iotivity/service/resourcecontainer/RcsBundleInfo.java")
......@@ -3,27 +3,15 @@ LOCAL_PATH := $(call my-dir)
ROOT_PATH := ../../../../../../..
IOTIVITY_LIB_PATH := $(ROOT_PATH)/out/android/$(TARGET_ARCH_ABI)/$(APP_OPTIM)
include $(CLEAR_VARS)
LOCAL_MODULE := rcs_common
LOCAL_SRC_FILES := $(IOTIVITY_LIB_PATH)/librcs_common.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := rcs_client
LOCAL_SRC_FILES := $(IOTIVITY_LIB_PATH)/librcs_client.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := rcs_server
LOCAL_SRC_FILES := $(IOTIVITY_LIB_PATH)/librcs_server.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := rcs_container
LOCAL_SRC_FILES := $(IOTIVITY_LIB_PATH)/librcs_container.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_LDLIBS := -L$(LOCAL_PATH)/$(IOTIVITY_LIB_PATH)/
LOCAL_LDLIBS += -lrcs_common
OIC_SRC_DIR := ../../../../../..
LOCAL_MODULE := resource_container_jni
......@@ -40,11 +28,8 @@ LOCAL_SRC_FILES += $(patsubst $(LOCAL_PATH)/%, %, $(wildcard $(LOCAL_PATH)/*.cpp
LOCAL_CPPFLAGS := -std=c++0x -frtti -fexceptions
LOCAL_LDLIBS := -llog
LOCAL_LDLIBS += -llog
LOCAL_SHARED_LIBRARIES += rcs_common
LOCAL_SHARED_LIBRARIES += rcs_client
LOCAL_SHARED_LIBRARIES += rcs_server
LOCAL_SHARED_LIBRARIES += rcs_container
include $(BUILD_SHARED_LIBRARY)
......@@ -20,4 +20,4 @@
* //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
*/
include ':service'
include ':resource-container'
......@@ -4,7 +4,8 @@ To build the app
2. Copy aar files into app/libs folder
- {Iotivity_root}/android/android_api/base/build/outputs/aar/iotivity-{TARGET_ARCH}-base-{MODE}.aar
- {Iotivity_root}/service/resource-container/android/service/build/outputs/aar/iotivity-{TARGET_ARCH}-service-{MODE}.aar
- {Iotivity_root}/service/resource-encapsulation/android/service/build/outputs/aar/iotivity-{TARGET_ARCH}-service-{MODE}.aar
- {Iotivity_root}/service/resource-container/android/resource-container/build/outputs/aar/iotivity-{TARGET_ARCH}-resource-container-{MODE}.aar
3. Configure dependencies for libs in app/build.gradle
- default TARGET_ARCH is armeabi
......@@ -17,7 +18,8 @@ To build the app
then, dependencies should be modified like below
dependencies {
compile(name:'iotivity-x86-service-debug', ext:'aar')
compile(name:'iotivity-x86-base-debug', ext:'aar')
compile(name:'iotivity-x86-service-debug', ext:'aar')
compile(name:'iotivity-x86-resource-container-debug', ext:'aar')
}
......@@ -84,6 +84,7 @@
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="iotivity-service-release-" level="project" />
<orderEntry type="library" exported="" name="iotivity-resource-container-release-" level="project" />
<orderEntry type="library" exported="" name="iotivity-base-release-" level="project" />
</component>
</module>
......
......@@ -21,6 +21,7 @@ android {
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile(name:'iotivity-service-release', ext:'aar')
compile(name:'iotivity-base-release', ext:'aar')
compile(name:'iotivity-service-release', ext:'aar')
compile(name:'iotivity-resource-container-release', ext:'aar')
}
......@@ -189,8 +189,8 @@ public class ResourceContainer {
public void removeBMIBundle() {
List<RcsBundleInfo> bundleList = containerInstance.listBundles();
if (0 == bundleList.size()) {
logMessage = "No bundle to remove" + "\n";
if (1 == bundleList.size()) {
logMessage = "BMI Bundle not added" + "\n";
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment