• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2012 The Android Open Source Project
2
3# Expose the Monitor RCP only for the SDK builds.
4ifneq (,$(is_sdk_build)$(filter sdk,$(TARGET_PRODUCT)))
5
6LOCAL_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
15RCP_LOG_FILE := out/host/eclipse/rcp/build/monitor.log
16RCP_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
26# The RCP monitor. It is referenced by build/target/products/sdk.mk
27$(LOCAL_BUILT_MODULE) : $(TOPDIR)sdk/monitor/monitor \
28			$(TOPDIR)sdk/monitor/build.xml \
29			$(TOPDIR)sdk/monitor/build.properties \
30			$(shell $(TOPDIR)sdk/eclipse/scripts/create_all_symlinks.sh -d)
31	@mkdir -p $(dir $@)
32	$(hide)$(TOPDIR)sdk/eclipse/scripts/create_all_symlinks.sh -c
33	$(hide)cd $(TOPDIR)sdk/monitor && \
34		rm -f ../../$(RCP_LOG_FILE) && mkdir -p ../../$(dir $(RCP_LOG_FILE)) && \
35		( java -jar ../../external/eclipse-basebuilder/basebuilder-3.6.2/org.eclipse.releng.basebuilder/plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar \
36			org.eclipse.equinox.launcher.Main \
37			-application org.eclipse.ant.core.antRunner \
38			-configuration ../../out/host/eclipse/rcp/build/configuration \
39			-DbuildFor=$(HOST_OS) 2>&1 && \
40		  mv -f ../../$(RCP_LOG_FILE) ../../$(RCP_LOG_FILE).1 ) \
41		| tee ../../$(RCP_LOG_FILE) \
42		| sed '/SUCCESSFUL/d ; /\[java\]/!b label; s/\s\+\[java\]//; /^\s*$$/d; /Compiling/!d; :label /^\s*$$/d; s/^/monitor: /'; \
43		if [[ -f ../../$(RCP_LOG_FILE) ]]; then \
44		  echo "Monitor failed. Full log:" ; \
45		  cat ../../$(RCP_LOG_FILE) ; \
46		  exit 1 ; \
47		fi
48	$(hide)if [[ $(HOST_OS) == "linux" ]]; then \
49		$(call mk-rcp-monitor-atree-file,linux.gtk,x86)    ; \
50		$(call mk-rcp-monitor-atree-file,linux.gtk,x86_64) ; \
51	elif [[ $(HOST_OS) == "darwin" ]]; then \
52		$(call mk-rcp-monitor-atree-file,macosx.cocoa,x86_64) ; \
53	elif [[ $(HOST_OS) == "windows" ]]; then \
54		$(call mk-rcp-monitor-atree-file,win32.win32,x86)    ; \
55		$(call mk-rcp-monitor-atree-file,win32.win32,x86_64) ; \
56	fi
57	$(hide)$(ACP) -fpt $(V) $(TOPDIR)sdk/monitor/monitor $@
58
59endif
60