[BUILD] fix build script for macos (remove Apple JDK dependency)
authorgreatim <jaewon81.lim@samsung.com>
Mon, 16 Nov 2015 10:01:54 +0000 (19:01 +0900)
committergreatim <jaewon81.lim@samsung.com>
Mon, 16 Nov 2015 10:53:51 +0000 (19:53 +0900)
Change-Id: I28ba372531b9145338b28ea96a0a57f22c4e23ba
Signed-off-by: greatim <jaewon81.lim@samsung.com>
os_stubs/macos/Info.plist [new file with mode: 0644]
os_stubs/macos/dynamic-analyzer.sh [new file with mode: 0644]
package/build.linux

diff --git a/os_stubs/macos/Info.plist b/os_stubs/macos/Info.plist
new file mode 100644 (file)
index 0000000..a73cd1a
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plist version="1.0">
+  <dict>
+    <key>CFBundleExecutable</key>
+       <string>dynamic-analyzer</string> 
+    <key>CFBundleIconFile</key>
+       <string>DA_icon.icns</string>
+    <key>CFBundleVersion</key>
+       <string>VERSION</string>
+    <key>CFBundleShortVersionString</key>
+       <string>VERSION</string>
+  </dict>
+</plist>
diff --git a/os_stubs/macos/dynamic-analyzer.sh b/os_stubs/macos/dynamic-analyzer.sh
new file mode 100644 (file)
index 0000000..7b6378d
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+# get script path
+pushd . > /dev/null
+SCRIPT_PATH="${BASH_SOURCE[0]}";
+  while([ -h "${SCRIPT_PATH}" ]) do
+    cd "`dirname "${SCRIPT_PATH}"`"
+    SCRIPT_PATH="$(readlink "`basename "${SCRIPT_PATH}"`")";
+  done
+cd "`dirname "${SCRIPT_PATH}"`" > /dev/null
+SCRIPT_PATH="`pwd`"
+popd  > /dev/null
+
+# path definition
+BIN_DIR_PATH="${SCRIPT_PATH}/../../.."
+LAUNCHER_JAR="${BIN_DIR_PATH}/plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar"
+ICON_FILE="${SCRIPT_PATH}/../Resources/DA_icon.icns"
+
+# launch dynamic analyzer by java command
+java \
+-XX:MaxPermSize=64m \
+-Xms256m \
+-Xmx512m \
+-XX:+UseParNewGC \
+-XX:+UseConcMarkSweepGC \
+-Xdock:icon=$ICON_FILE \
+-XstartOnFirstThread \
+-Dorg.eclipse.swt.internal.carbon.smallFonts \
+-Dosgi.requiredJavaVersion=1.6 \
+-jar $LAUNCHER_JAR
+
index 129c72d..71efd7f 100755 (executable)
@@ -26,23 +26,23 @@ __set_parameter()
                        os=windows
                        ;;
                ubuntu-64)
-                       archive_platform_name=linux
-                       windowing=gtk
-                       architecture=x86_64
-                       os=linux
-                       ;;
-               windows-64)
-                       archive_platform_name=win32
-                       windowing=win32
-                       architecture=x86_64
-                       os=windows
-                       ;;
-               macos-64)
-                       archive_platform_name=macosx
-                       windowing=cocoa
-                       architecture=x86_64
-                       os=macos
-                       ;;
+                       archive_platform_name=linux
+                       windowing=gtk
+                       architecture=x86_64
+                       os=linux
+                       ;;
+               windows-64)
+                       archive_platform_name=win32
+                       windowing=win32
+                       architecture=x86_64
+                       os=windows
+                       ;;
+               macos-64)
+                       archive_platform_name=macosx
+                       windowing=cocoa
+                       architecture=x86_64
+                       os=macos
+                       ;;
                *)
                        echo "${platform} is not support yet."
                        ;;
@@ -304,6 +304,7 @@ packaging_plugins() {
        cp -rf ${build_result_path}/${archive_platform_name}.${windowing}.${architecture}/${package_name}/* ${install_ide_path}/
        echo ${manifest_version} > ${install_ide_path}/version
 }
+
 packaging_test() {
        __set_install_parameter
        __clean_packaging_environment
@@ -345,6 +346,24 @@ packaging_bfiles()
 ##     cp -rf ${SRCDIR}/${blib_dir}/* ${install_lib_path}/
 }
 
+packaging_macos()
+{
+       install_ide_path=${INSTALL_DIR}/${ide_root_path_name}
+       app_path=${install_ide_path}/dynamic-analyzer.app/Contents
+
+       # copy script and plist
+       cp -f ${SRCDIR}/os_stubs/macos/dynamic-analyzer.sh ${app_path}/MacOS/dynamic-analyzer
+       cp -f ${SRCDIR}/os_stubs/macos/Info.plist ${app_path}/Info.plist
+
+       # remove ini file
+       rm -f ${app_path}/MacOS/dynamic-analyzer.ini
+
+       # update Info.plist
+       cd ${app_path}
+       sed -i.bak s/VERSION/${manifest_version}/g Info.plist
+       cd ${SRCDIR}
+}
+
 # clean
 clean()
 {
@@ -397,6 +416,11 @@ install()
                        then
                                packaging_plugins
                                packaging_bfiles
+
+                               if [ "x${platform}" = "xmacos-64" ]
+                               then
+                                       packaging_macos
+                               fi
                        elif [ "x${package_name}" = "xdynamic-analyzer-test" ]
                        then
                                packaging_test