Raphael Moll | 5abe8b2 | 2012-03-30 15:50:45 -0700 | [diff] [blame] | 1 | # Copyright 2012 The Android Open Source Project |
| 2 | |
Raphael Moll | 7778fe8 | 2012-04-25 15:40:45 -0700 | [diff] [blame] | 3 | # Expose the Monitor RCP only for the SDK builds. |
Raphael Moll | c53593b | 2012-05-07 12:51:29 -0700 | [diff] [blame] | 4 | ifneq (,$(is_sdk_build)$(filter sdk sdk_x86,$(TARGET_PRODUCT))) |
Raphael Moll | 7778fe8 | 2012-04-25 15:40:45 -0700 | [diff] [blame] | 5 | |
Raphael Moll | 5abe8b2 | 2012-03-30 15:50:45 -0700 | [diff] [blame] | 6 | LOCAL_PATH := $(call my-dir) |
| 7 | include $(CLEAR_VARS) |
| 8 | |
| 9 | LOCAL_MODULE := monitor |
| 10 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 11 | LOCAL_MODULE_TAGS := optional |
| 12 | LOCAL_IS_HOST_MODULE := true |
| 13 | include $(BUILD_SYSTEM)/base_rules.mk |
| 14 | |
Raphael Moll | d4cab2b | 2012-04-25 21:50:54 -0700 | [diff] [blame] | 15 | RCP_LOG_FILE := out/host/eclipse/rcp/build/monitor.log |
Raphael Moll | 5abe8b2 | 2012-03-30 15:50:45 -0700 | [diff] [blame] | 16 | RCP_MONITOR_DIR := $(TOPDIR)out/host/eclipse/rcp/build/I.RcpBuild |
| 17 | |
| 18 | define mk-rcp-monitor-atree-file |
| 19 | srczip=$(RCP_MONITOR_DIR)/RcpBuild-$(1).$(2).zip && \ |
| 20 | dstdir=$(HOST_OUT)/eclipse/monitor-$(1).$(2) && \ |
| 21 | rm -rf $(V) $$dstdir && \ |
| 22 | mkdir -p $$dstdir && \ |
| 23 | unzip -q $$srczip -d $$dstdir |
| 24 | endef |
| 25 | |
Siva Velusamy | 50f6b12 | 2012-05-29 12:15:41 -0700 | [diff] [blame] | 26 | MONITOR_DEP_LIBRARIES := $(shell $(TOPDIR)sdk/eclipse/scripts/create_all_symlinks.sh -d) |
| 27 | MONITOR_DEPS := $(foreach m,$(MONITOR_DEP_LIBRARIES),$(HOST_OUT_JAVA_LIBRARIES)/$(m).jar) |
| 28 | |
Raphael Moll | 5abe8b2 | 2012-03-30 15:50:45 -0700 | [diff] [blame] | 29 | # The RCP monitor. It is referenced by build/target/products/sdk.mk |
| 30 | $(LOCAL_BUILT_MODULE) : $(TOPDIR)sdk/monitor/monitor \ |
| 31 | $(TOPDIR)sdk/monitor/build.xml \ |
| 32 | $(TOPDIR)sdk/monitor/build.properties \ |
Siva Velusamy | 50f6b12 | 2012-05-29 12:15:41 -0700 | [diff] [blame] | 33 | $(MONITOR_DEPS) |
Raphael Moll | 5abe8b2 | 2012-03-30 15:50:45 -0700 | [diff] [blame] | 34 | @mkdir -p $(dir $@) |
| 35 | $(hide)$(TOPDIR)sdk/eclipse/scripts/create_all_symlinks.sh -c |
| 36 | $(hide)cd $(TOPDIR)sdk/monitor && \ |
Raphael Moll | d4cab2b | 2012-04-25 21:50:54 -0700 | [diff] [blame] | 37 | rm -f ../../$(RCP_LOG_FILE) && mkdir -p ../../$(dir $(RCP_LOG_FILE)) && \ |
| 38 | ( java -jar ../../external/eclipse-basebuilder/basebuilder-3.6.2/org.eclipse.releng.basebuilder/plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar \ |
Raphael Moll | 5abe8b2 | 2012-03-30 15:50:45 -0700 | [diff] [blame] | 39 | org.eclipse.equinox.launcher.Main \ |
| 40 | -application org.eclipse.ant.core.antRunner \ |
| 41 | -configuration ../../out/host/eclipse/rcp/build/configuration \ |
Raphael Moll | d4cab2b | 2012-04-25 21:50:54 -0700 | [diff] [blame] | 42 | -DbuildFor=$(HOST_OS) 2>&1 && \ |
| 43 | mv -f ../../$(RCP_LOG_FILE) ../../$(RCP_LOG_FILE).1 ) \ |
| 44 | | tee ../../$(RCP_LOG_FILE) \ |
| 45 | | sed '/SUCCESSFUL/d ; /\[java\]/!b label; s/\s\+\[java\]//; /^\s*$$/d; /Compiling/!d; :label /^\s*$$/d; s/^/monitor: /'; \ |
| 46 | if [[ -f ../../$(RCP_LOG_FILE) ]]; then \ |
| 47 | echo "Monitor failed. Full log:" ; \ |
| 48 | cat ../../$(RCP_LOG_FILE) ; \ |
| 49 | exit 1 ; \ |
| 50 | fi |
Raphael Moll | 5abe8b2 | 2012-03-30 15:50:45 -0700 | [diff] [blame] | 51 | $(hide)if [[ $(HOST_OS) == "linux" ]]; then \ |
| 52 | $(call mk-rcp-monitor-atree-file,linux.gtk,x86) ; \ |
| 53 | $(call mk-rcp-monitor-atree-file,linux.gtk,x86_64) ; \ |
Raphael Moll | d4cab2b | 2012-04-25 21:50:54 -0700 | [diff] [blame] | 54 | elif [[ $(HOST_OS) == "darwin" ]]; then \ |
Raphael Moll | 5abe8b2 | 2012-03-30 15:50:45 -0700 | [diff] [blame] | 55 | $(call mk-rcp-monitor-atree-file,macosx.cocoa,x86_64) ; \ |
Raphael Moll | d4cab2b | 2012-04-25 21:50:54 -0700 | [diff] [blame] | 56 | elif [[ $(HOST_OS) == "windows" ]]; then \ |
Raphael Moll | 5abe8b2 | 2012-03-30 15:50:45 -0700 | [diff] [blame] | 57 | $(call mk-rcp-monitor-atree-file,win32.win32,x86) ; \ |
| 58 | $(call mk-rcp-monitor-atree-file,win32.win32,x86_64) ; \ |
| 59 | fi |
Siva Velusamy | 50f6b12 | 2012-05-29 12:15:41 -0700 | [diff] [blame] | 60 | $(hide)$(ACP) -fp $(V) $(TOPDIR)sdk/monitor/monitor $@ |
Raphael Moll | 7778fe8 | 2012-04-25 15:40:45 -0700 | [diff] [blame] | 61 | |
| 62 | endif |