aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse/scripts/rcp
diff options
context:
space:
mode:
authorRaphael Moll <raphael@google.com>2012-01-25 13:33:57 -0800
committerRaphael <raphael@google.com>2012-03-21 21:32:47 -0700
commitd9b2cbd3378a671d924c5ad6c5db5ef96ea6cf3b (patch)
tree2c74ef27ea01816b773ee916d8b30807892b6680 /eclipse/scripts/rcp
parent7a795b5291224e2b85885f4d1f4d7ac097e96d3c (diff)
downloadsdk-d9b2cbd3378a671d924c5ad6c5db5ef96ea6cf3b.zip
sdk-d9b2cbd3378a671d924c5ad6c5db5ef96ea6cf3b.tar.gz
sdk-d9b2cbd3378a671d924c5ad6c5db5ef96ea6cf3b.tar.bz2
Build Monitor RCP as part of SDK (Mac, Linux and Win)
This adds a new SDK/tools/monitor[.bat] wrapper as well as SDK/tools/lib/monitor-x86[_64]/ directories that contain the actual RCP application. The monitor shell wrappers + bat have not been properly tested yet. The goal of this CL is just to build the RCP. In a following CL we'll adjust the wrapper and the actual binary location in the SDK. Cross-dependency: Requires build.git change Ifb31e2e3. Change-Id: I7afbd63badfb81fd5d3d899de672e02525a49bc2
Diffstat (limited to 'eclipse/scripts/rcp')
-rw-r--r--eclipse/scripts/rcp/Android.mk41
-rwxr-xr-xeclipse/scripts/rcp/monitor38
-rwxr-xr-xeclipse/scripts/rcp/monitor.bat27
3 files changed, 106 insertions, 0 deletions
diff --git a/eclipse/scripts/rcp/Android.mk b/eclipse/scripts/rcp/Android.mk
new file mode 100644
index 0000000..18302c2
--- /dev/null
+++ b/eclipse/scripts/rcp/Android.mk
@@ -0,0 +1,41 @@
+# Copyright 2012 The Android Open Source Project
+
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := monitor
+LOCAL_MODULE_CLASS := EXECUTABLES
+LOCAL_MODULE_TAGS := optional
+LOCAL_IS_HOST_MODULE := true
+include $(BUILD_SYSTEM)/base_rules.mk
+
+RCP_MONITOR_DIR := $(TOPDIR)out/host/eclipse/rcp/build/I.RcpBuild
+
+define mk-rcp-monitor-atree-file
+ srczip=$(RCP_MONITOR_DIR)/RcpBuild-$(1).$(2).zip && \
+ dstdir=$(HOST_OUT)/eclipse/monitor-$(1).$(2) && \
+ rm -rf $(V) $$dstdir && \
+ mkdir -p $$dstdir && \
+ unzip -q $$srczip -d $$dstdir
+endef
+
+# The RCP monitor. It is referenced by build/target/products/sdk.mk
+$(LOCAL_BUILT_MODULE) : $(TOPDIR)sdk/eclipse/scripts/rcp/monitor \
+ $(TOPDIR)sdk/eclipse/scripts/rcp/build.xml \
+ $(TOPDIR)sdk/eclipse/scripts/rcp/build.properties \
+ $(shell $(TOPDIR)sdk/eclipse/scripts/create_all_symlinks.sh -d)
+ @mkdir -p $(dir $@)
+ $(hide)$(TOPDIR)sdk/eclipse/scripts/create_all_symlinks.sh -c
+ $(hide)cd $(TOPDIR)sdk/eclipse/scripts/rcp && ant -DbuildFor=$(HOST_OS)
+ $(hide)cp $(V) $(TOPDIR)sdk/eclipse/scripts/rcp/monitor $@
+ $(hide)if [[ $(HOST_OS) == "linux" ]]; then \
+ $(call mk-rcp-monitor-atree-file,linux.gtk,x86) ; \
+ $(call mk-rcp-monitor-atree-file,linux.gtk,x86_64) ; \
+ fi
+ $(hide)if [[ $(HOST_OS) == "darwin" ]]; then \
+ $(call mk-rcp-monitor-atree-file,macosx.cocoa,x86_64) ; \
+ fi
+ $(hide)if [[ $(HOST_OS) == "windows" ]]; then \
+ $(call mk-rcp-monitor-atree-file,win32.win32,x86) ; \
+ $(call mk-rcp-monitor-atree-file,win32.win32,x86_64) ; \
+ fi
diff --git a/eclipse/scripts/rcp/monitor b/eclipse/scripts/rcp/monitor
new file mode 100755
index 0000000..be4a1cd
--- /dev/null
+++ b/eclipse/scripts/rcp/monitor
@@ -0,0 +1,38 @@
+#!/bin/bash
+# Copyright 2012, The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Set up prog to be the path of this script, including following symlinks,
+# and set up progdir to be the fully-qualified pathname of its directory.
+prog="$0"
+while [ -h "${prog}" ]; do
+ newProg=`/bin/ls -ld "${prog}"`
+ newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
+ if expr "x${newProg}" : 'x/' >/dev/null; then
+ prog="${newProg}"
+ else
+ progdir=`dirname "${prog}"`
+ prog="${progdir}/${newProg}"
+ fi
+done
+oldwd=`pwd`
+progdir=`dirname "${prog}"`
+cd "${progdir}"
+
+javaCmd="java"
+
+vmarch=`${javaCmd} -jar tools/lib/archquery.jar`
+
+exec tools/lib/monitor-${vmarch}/monitor
+
diff --git a/eclipse/scripts/rcp/monitor.bat b/eclipse/scripts/rcp/monitor.bat
new file mode 100755
index 0000000..bc69849
--- /dev/null
+++ b/eclipse/scripts/rcp/monitor.bat
@@ -0,0 +1,27 @@
+@echo off
+rem Copyright (C) 2012 The Android Open Source Project
+rem
+rem Licensed under the Apache License, Version 2.0 (the "License");
+rem you may not use this file except in compliance with the License.
+rem You may obtain a copy of the License at
+rem
+rem http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing, software
+rem distributed under the License is distributed on an "AS IS" BASIS,
+rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem See the License for the specific language governing permissions and
+rem limitations under the License.
+
+rem don't modify the caller's environment
+setlocal
+
+rem Change current directory and drive to where the script is, to avoid
+rem issues with directories containing whitespaces.
+cd /d %~dp0
+
+:QueryArch
+for /f %%a in ('%java_exe% -jar tools\lib\archquery.jar') do set vmarch=%%a
+
+call tools\lib\monitor-%vmarch%\monitor
+