blob: 9973d642f7a4db9cf01b44bce1a0e8faa09cbba0 [file] [log] [blame]
Raphael Moll5abe8b22012-03-30 15:50:45 -07001# Copyright 2012 The Android Open Source Project
2
Raphael Moll7778fe82012-04-25 15:40:45 -07003# Expose the Monitor RCP only for the SDK builds.
Raphael Mollc53593b2012-05-07 12:51:29 -07004ifneq (,$(is_sdk_build)$(filter sdk sdk_x86,$(TARGET_PRODUCT)))
Raphael Moll7778fe82012-04-25 15:40:45 -07005
Raphael Moll5abe8b22012-03-30 15:50:45 -07006LOCAL_PATH := $(call my-dir)
7include $(CLEAR_VARS)
8
9LOCAL_MODULE := monitor
10LOCAL_MODULE_CLASS := EXECUTABLES
11LOCAL_MODULE_TAGS := optional
12LOCAL_IS_HOST_MODULE := true
13include $(BUILD_SYSTEM)/base_rules.mk
14
Raphael Molld4cab2b2012-04-25 21:50:54 -070015RCP_LOG_FILE := out/host/eclipse/rcp/build/monitor.log
Raphael Moll5abe8b22012-03-30 15:50:45 -070016RCP_MONITOR_DIR := $(TOPDIR)out/host/eclipse/rcp/build/I.RcpBuild
17
18define 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
24endef
25
Siva Velusamy50f6b122012-05-29 12:15:41 -070026MONITOR_DEP_LIBRARIES := $(shell $(TOPDIR)sdk/eclipse/scripts/create_all_symlinks.sh -d)
27MONITOR_DEPS := $(foreach m,$(MONITOR_DEP_LIBRARIES),$(HOST_OUT_JAVA_LIBRARIES)/$(m).jar)
28
Raphael Moll5abe8b22012-03-30 15:50:45 -070029# 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 Velusamy50f6b122012-05-29 12:15:41 -070033 $(MONITOR_DEPS)
Raphael Moll5abe8b22012-03-30 15:50:45 -070034 @mkdir -p $(dir $@)
35 $(hide)$(TOPDIR)sdk/eclipse/scripts/create_all_symlinks.sh -c
36 $(hide)cd $(TOPDIR)sdk/monitor && \
Raphael Molld4cab2b2012-04-25 21:50:54 -070037 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 Moll5abe8b22012-03-30 15:50:45 -070039 org.eclipse.equinox.launcher.Main \
40 -application org.eclipse.ant.core.antRunner \
41 -configuration ../../out/host/eclipse/rcp/build/configuration \
Raphael Molld4cab2b2012-04-25 21:50:54 -070042 -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 Moll5abe8b22012-03-30 15:50:45 -070051 $(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 Molld4cab2b2012-04-25 21:50:54 -070054 elif [[ $(HOST_OS) == "darwin" ]]; then \
Raphael Moll5abe8b22012-03-30 15:50:45 -070055 $(call mk-rcp-monitor-atree-file,macosx.cocoa,x86_64) ; \
Raphael Molld4cab2b2012-04-25 21:50:54 -070056 elif [[ $(HOST_OS) == "windows" ]]; then \
Raphael Moll5abe8b22012-03-30 15:50:45 -070057 $(call mk-rcp-monitor-atree-file,win32.win32,x86) ; \
58 $(call mk-rcp-monitor-atree-file,win32.win32,x86_64) ; \
59 fi
Siva Velusamy50f6b122012-05-29 12:15:41 -070060 $(hide)$(ACP) -fp $(V) $(TOPDIR)sdk/monitor/monitor $@
Raphael Moll7778fe82012-04-25 15:40:45 -070061
62endif