From 5abe8b2ee87ecfeb7618f18b8ec0883237824e62 Mon Sep 17 00:00:00 2001 From: Raphael Moll Date: Fri, 30 Mar 2012 15:50:45 -0700 Subject: SDK: build 'monitor' tool and package it in the SDK. Fixed with Siva to use the 'ant' builder from Eclipse's baseBuilder jars. Changed to use: - the new external/eclipse-basebuilder for the basebuilder jars. - the rcp deltapack, located prebuilts/eclipse. - monitor scripts are now in sdk/monitor. - configuration is now in out/host/eclipse/rcp/build/configuration and doesn't change any existing repos. Requires change I7ab027ff6 from build.git Change-Id: I72fff09231fc9b3031c10eb42ff821c55af9b5d5 --- build/product_sdk.mk | 1 + build/sdk_only_whitelist.mk | 1 + build/tools.darwin.atree | 5 +- build/tools.linux.atree | 7 +-- build/tools.windows.atree | 13 +++-- build/windows_sdk_tools.mk | 5 +- eclipse/scripts/rcp/Android.mk | 41 -------------- eclipse/scripts/rcp/HOWTO-BUILD | 15 ----- eclipse/scripts/rcp/build.properties | 48 ---------------- eclipse/scripts/rcp/build.xml | 102 ---------------------------------- eclipse/scripts/rcp/monitor | 38 ------------- eclipse/scripts/rcp/monitor.bat | 27 --------- monitor/Android.mk | 46 ++++++++++++++++ monitor/HOWTO-BUILD | 15 +++++ monitor/build.properties | 48 ++++++++++++++++ monitor/build.xml | 104 +++++++++++++++++++++++++++++++++++ monitor/monitor | 44 +++++++++++++++ monitor/monitor.bat | 32 +++++++++++ 18 files changed, 306 insertions(+), 286 deletions(-) delete mode 100644 eclipse/scripts/rcp/Android.mk delete mode 100644 eclipse/scripts/rcp/HOWTO-BUILD delete mode 100644 eclipse/scripts/rcp/build.properties delete mode 100644 eclipse/scripts/rcp/build.xml delete mode 100755 eclipse/scripts/rcp/monitor delete mode 100755 eclipse/scripts/rcp/monitor.bat create mode 100644 monitor/Android.mk create mode 100644 monitor/HOWTO-BUILD create mode 100644 monitor/build.properties create mode 100644 monitor/build.xml create mode 100755 monitor/monitor create mode 100755 monitor/monitor.bat diff --git a/build/product_sdk.mk b/build/product_sdk.mk index d54710f..7802211 100644 --- a/build/product_sdk.mk +++ b/build/product_sdk.mk @@ -35,6 +35,7 @@ PRODUCT_PACKAGES += \ lint \ mksdcard \ monkeyrunner \ + monitor \ traceview # Native host Java libraries that are parts of the SDK. diff --git a/build/sdk_only_whitelist.mk b/build/sdk_only_whitelist.mk index 7a07297..3a7d9a3 100644 --- a/build/sdk_only_whitelist.mk +++ b/build/sdk_only_whitelist.mk @@ -54,6 +54,7 @@ subdirs += \ sdk/jarutils \ sdk/layoutlib_api \ sdk/manifmerger \ + sdk/monitor \ sdk/ninepatch \ sdk/rule_api \ sdk/lint \ diff --git a/build/tools.darwin.atree b/build/tools.darwin.atree index b5e852f..d584231 100644 --- a/build/tools.darwin.atree +++ b/build/tools.darwin.atree @@ -23,9 +23,8 @@ ############################################################################## # RCP Monitor. -# Not ready yet, fails due to missing "ant" on build servers -# bin/monitor tools/monitor -# eclipse/monitor-macosx.cocoa.x86_64/monitor tools/lib/monitor-x86_64 +bin/monitor tools/monitor +eclipse/monitor-macosx.cocoa.x86_64/monitor tools/lib/monitor-x86_64 # swt prebuilts/tools/darwin-x86/swt/swt.jar tools/lib/x86/swt.jar diff --git a/build/tools.linux.atree b/build/tools.linux.atree index e9f6b2c..cdba1f2 100644 --- a/build/tools.linux.atree +++ b/build/tools.linux.atree @@ -23,10 +23,9 @@ ############################################################################## # RCP Monitor. -# Not ready yet, fails due to missing "ant" on build servers -# bin/monitor tools/monitor -# eclipse/monitor-linux.gtk.x86/monitor tools/lib/monitor-x86 -# eclipse/monitor-linux.gtk.x86_64/monitor tools/lib/monitor-x86_64 +bin/monitor tools/monitor +eclipse/monitor-linux.gtk.x86/monitor tools/lib/monitor-x86 +eclipse/monitor-linux.gtk.x86_64/monitor tools/lib/monitor-x86_64 # swt diff --git a/build/tools.windows.atree b/build/tools.windows.atree index bb5befa..66f375a 100755 --- a/build/tools.windows.atree +++ b/build/tools.windows.atree @@ -86,12 +86,13 @@ sdk/traceview/etc/traceview.bat tools/traceview.bat rm tools/zipalign bin/zipalign.exe strip tools/zipalign.exe -# RCP Monitor. -# Not ready yet, fails due to missing "ant" on build servers -# rm tools/monitor -# sdk/eclipse/scripts/rcp/monitor.bat tools/monitor.bat -# eclipse/monitor-win32.win32.x86/monitor tools/lib/monitor-x86 -# eclipse/monitor-win32.win32.x86_64/monitor tools/lib/monitor-x86_64 +# RCP Monitor. Remove linux stuff and replace by Windows files. +rm tools/monitor +rm tools/lib/monitor-x86 +rm tools/lib/monitor-x86_64 +sdk/monitor/monitor.bat tools/monitor.bat +eclipse/monitor-win32.win32.x86/monitor tools/lib/monitor-x86 +eclipse/monitor-win32.win32.x86_64/monitor tools/lib/monitor-x86_64 # Copy the AVD & SDK Manager (aka avd/sdklauncher) to the root of the SDK as diff --git a/build/windows_sdk_tools.mk b/build/windows_sdk_tools.mk index 5ddca7d..37a125c 100644 --- a/build/windows_sdk_tools.mk +++ b/build/windows_sdk_tools.mk @@ -13,9 +13,9 @@ WIN_SDK_TARGETS := \ find_java \ find_lock \ mksdcard \ + monitor \ sdklauncher -# monitor -- disabled due to build break # Add OpenGLES emulation host libraries if needed. ifeq (true,$(BUILD_EMULATOR_OPENGL)) @@ -28,5 +28,6 @@ endif # Define the list of tool-dependent modules requisites needed # for the Windows SDK. These will be built using HOST_OS=linux. -WIN_SDK_BUILD_PREREQ := +WIN_SDK_BUILD_PREREQ := \ + monitor diff --git a/eclipse/scripts/rcp/Android.mk b/eclipse/scripts/rcp/Android.mk deleted file mode 100644 index 0fab0ed..0000000 --- a/eclipse/scripts/rcp/Android.mk +++ /dev/null @@ -1,41 +0,0 @@ -# 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/HOWTO-BUILD b/eclipse/scripts/rcp/HOWTO-BUILD deleted file mode 100644 index 3eb695f..0000000 --- a/eclipse/scripts/rcp/HOWTO-BUILD +++ /dev/null @@ -1,15 +0,0 @@ -To build the Monitor RCP based application, do: - -$ lunch sdk-eng -$ ./sdk/eclipse/scripts/create_all_symlinks.sh -$ cd sdk/eclipse/scripts/rcp -$ ant - -This will build the RCP for all the platforms in the folder: -$ANDROID_SRC/out/host/eclipse/rcp/build/I.RcpBuild/ - -To build only a subset of platforms, use: - -ant -DbuildFor= - -where platform is one of linux, darwin or windows. diff --git a/eclipse/scripts/rcp/build.properties b/eclipse/scripts/rcp/build.properties deleted file mode 100644 index b104b77..0000000 --- a/eclipse/scripts/rcp/build.properties +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (C) 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. - -############# PRODUCT/PACKAGING CONTROL ############# -product=/com.android.ide.eclipse.monitor/monitor.product -runPackager=true -archivePrefix=monitor -collectingFolder=${archivePrefix} -allowBinaryCycles = true -buildType=I -buildId=RcpBuild -buildLabel=${buildType}.${buildId} -timestamp=007 -launcherName=monitor - -############# BASE CONTROL ############# -baseos=linux -basews=gtk -basearch=x86_64 -filteredDependencyCheck=false -resolution.devMode=false -skipBase=true - -############# MAP FILE CONTROL ################ -skipMaps=true - -############ REPOSITORY CONTROL ############### -skipFetch=true - -############# JAVA COMPILER OPTIONS ############## -compilerArg=-warn:none -logExtension=.log -javacDebugInfo=false -javacFailOnError=true -javacVerbose=true -javacSource=1.6 -javacTarget=1.6 diff --git a/eclipse/scripts/rcp/build.xml b/eclipse/scripts/rcp/build.xml deleted file mode 100644 index 90ca80d..0000000 --- a/eclipse/scripts/rcp/build.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/eclipse/scripts/rcp/monitor b/eclipse/scripts/rcp/monitor deleted file mode 100755 index be4a1cd..0000000 --- a/eclipse/scripts/rcp/monitor +++ /dev/null @@ -1,38 +0,0 @@ -#!/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 deleted file mode 100755 index bc69849..0000000 --- a/eclipse/scripts/rcp/monitor.bat +++ /dev/null @@ -1,27 +0,0 @@ -@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 - diff --git a/monitor/Android.mk b/monitor/Android.mk new file mode 100644 index 0000000..040ff44 --- /dev/null +++ b/monitor/Android.mk @@ -0,0 +1,46 @@ +# 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/monitor/monitor \ + $(TOPDIR)sdk/monitor/build.xml \ + $(TOPDIR)sdk/monitor/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/monitor && \ + java -jar ../../external/eclipse-basebuilder/basebuilder-3.6.2/org.eclipse.releng.basebuilder/plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar \ + org.eclipse.equinox.launcher.Main \ + -application org.eclipse.ant.core.antRunner \ + -configuration ../../out/host/eclipse/rcp/build/configuration \ + -DbuildFor=$(HOST_OS) + $(hide)$(ACP) -fpt $(V) $(TOPDIR)sdk/monitor/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/monitor/HOWTO-BUILD b/monitor/HOWTO-BUILD new file mode 100644 index 0000000..38d1c23 --- /dev/null +++ b/monitor/HOWTO-BUILD @@ -0,0 +1,15 @@ +To build the Monitor RCP based application, do: + +$ lunch sdk-eng +$ ./sdk/eclipse/scripts/create_all_symlinks.sh +$ cd sdk/monitor +$ ant + +This will build the RCP for all the platforms in the folder: +$ANDROID_SRC/out/host/eclipse/rcp/build/I.RcpBuild/ + +To build only a subset of platforms, use: + +ant -DbuildFor= + +where platform is one of linux, darwin or windows. diff --git a/monitor/build.properties b/monitor/build.properties new file mode 100644 index 0000000..b104b77 --- /dev/null +++ b/monitor/build.properties @@ -0,0 +1,48 @@ +# Copyright (C) 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. + +############# PRODUCT/PACKAGING CONTROL ############# +product=/com.android.ide.eclipse.monitor/monitor.product +runPackager=true +archivePrefix=monitor +collectingFolder=${archivePrefix} +allowBinaryCycles = true +buildType=I +buildId=RcpBuild +buildLabel=${buildType}.${buildId} +timestamp=007 +launcherName=monitor + +############# BASE CONTROL ############# +baseos=linux +basews=gtk +basearch=x86_64 +filteredDependencyCheck=false +resolution.devMode=false +skipBase=true + +############# MAP FILE CONTROL ################ +skipMaps=true + +############ REPOSITORY CONTROL ############### +skipFetch=true + +############# JAVA COMPILER OPTIONS ############## +compilerArg=-warn:none +logExtension=.log +javacDebugInfo=false +javacFailOnError=true +javacVerbose=true +javacSource=1.6 +javacTarget=1.6 diff --git a/monitor/build.xml b/monitor/build.xml new file mode 100644 index 0000000..fabd3ba --- /dev/null +++ b/monitor/build.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/monitor/monitor b/monitor/monitor new file mode 100755 index 0000000..53a2bb5 --- /dev/null +++ b/monitor/monitor @@ -0,0 +1,44 @@ +#!/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 lib/archquery.jar` + +app=lib/monitor-${vmarch}/monitor +if [[ "Darwin" == `uname` ]]; then + app=${app}.app/Contents/MacOS/monitor +fi + + +exec $app + diff --git a/monitor/monitor.bat b/monitor/monitor.bat new file mode 100755 index 0000000..9bcc4e0 --- /dev/null +++ b/monitor/monitor.bat @@ -0,0 +1,32 @@ +@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 + +rem Check we have a valid Java.exe in the path. +set java_exe= +call lib\find_java.bat +if not defined java_exe goto :EOF + +:QueryArch +for /f %%a in ('%java_exe% -jar lib\archquery.jar') do set vmarch=%%a + +start lib\monitor-%vmarch%\monitor + -- cgit v1.1