aboutsummaryrefslogtreecommitdiffstats
path: root/monitor
diff options
context:
space:
mode:
authorRaphael Moll <raphael@google.com>2012-03-30 15:50:45 -0700
committerRaphael Moll <ralf@android.com>2012-04-23 14:18:37 -0700
commit5abe8b2ee87ecfeb7618f18b8ec0883237824e62 (patch)
tree50a189cc5b5a4f1a37439663c6d93116d3d446b5 /monitor
parentf11439afbb96a0c5591637d4234c4163bf4618d5 (diff)
downloadsdk-5abe8b2ee87ecfeb7618f18b8ec0883237824e62.zip
sdk-5abe8b2ee87ecfeb7618f18b8ec0883237824e62.tar.gz
sdk-5abe8b2ee87ecfeb7618f18b8ec0883237824e62.tar.bz2
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
Diffstat (limited to 'monitor')
-rw-r--r--monitor/Android.mk46
-rw-r--r--monitor/HOWTO-BUILD15
-rw-r--r--monitor/build.properties48
-rw-r--r--monitor/build.xml104
-rwxr-xr-xmonitor/monitor44
-rwxr-xr-xmonitor/monitor.bat32
6 files changed, 289 insertions, 0 deletions
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=<platform>
+
+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 @@
+<project name="com.android.eclipse.rcp.build" default="build">
+ <!-- Root of Android Source Tree -->
+ <property name="ANDROID_SRC" location="../../" />
+
+ <!-- Host Eclipse used for building the RCP -->
+ <property name="basebuilder" value="${ANDROID_SRC}/external/eclipse-basebuilder/basebuilder-3.6.2/org.eclipse.releng.basebuilder/" />
+
+ <!-- Source for target prebuilts -->
+ <property name="targetSrcDir" value="${ANDROID_SRC}/prebuilts/eclipse/" />
+
+ <!-- Location where build happens and resulting binaries are generated -->
+ <property name="outDir" value="${ANDROID_SRC}/out/host/eclipse/rcp/" />
+
+ <!-- Location where the target platform is created -->
+ <property name="targetDir" value="${outDir}/target" />
+
+ <!-- Location where the target platform is created -->
+ <property name="buildDir" value="${outDir}/build" />
+
+ <!-- Location of the sources -->
+ <property name="srcDir" value="${ANDROID_SRC}/sdk/eclipse/" />
+
+ <!-- Identify configurations to build -->
+ <condition property="buildconfigs" value="linux,gtk,x86 &amp; linux,gtk,x86_64">
+ <equals arg1="${buildFor}" arg2="linux" />
+ </condition>
+ <condition property="buildconfigs" value="macosx,cocoa,x86_64">
+ <equals arg1="${buildFor}" arg2="darwin" />
+ </condition>
+ <condition property="buildconfigs" value="win32,win32,x86 &amp; win32,win32,x86_64">
+ <equals arg1="${buildFor}" arg2="windows" />
+ </condition>
+
+ <!-- if no platforms are provided, then build for all platforms -->
+ <property name="buildconfigs" value="linux,gtk,x86 &amp; linux,gtk,x86_64 &amp; win32,win32,x86 &amp; win32,win32,x86_64 &amp; macosx,cocoa,x86_64" />
+
+ <!-- locate launcher plugin inside eclipse -->
+ <path id="equinox.launcher.path">
+ <fileset dir="${basebuilder}/plugins">
+ <include name="org.eclipse.equinox.launcher_*.jar" />
+ </fileset>
+ </path>
+ <property name="equinox.launcher" refid="equinox.launcher.path" />
+
+ <!-- locate pde build plugin inside eclipse -->
+ <path id="pde.build.dir.path">
+ <dirset dir="${basebuilder}/plugins">
+ <include name="org.eclipse.pde.build_*" />
+ </dirset>
+ </path>
+ <property name="pde.build.dir" refid="pde.build.dir.path" />
+
+ <!-- create the build directory, copy plugins and features into it -->
+ <target name="copy_srcs">
+ <mkdir dir="${buildDir}" />
+ <copy todir="${buildDir}">
+ <fileset dir="${srcDir}/">
+ <include name="plugins/**" />
+ <include name="features/**" />
+ </fileset>
+ </copy>
+ </target>
+
+ <!-- create target platform -->
+ <target name="create-target">
+ <mkdir dir="${targetDir}" />
+ <mkdir dir="${targetDir}/deltapack" />
+ <mkdir dir="${targetDir}/repos" />
+
+ <unzip src="${targetSrcDir}/deltapack/eclipse-3.7.2-delta-pack.zip" dest="${targetDir}/deltapack" overwrite="false" />
+ <unzip src="${targetSrcDir}/platform/org.eclipse.platform-3.7.2.zip" dest="${targetDir}/repos/platform" overwrite="false" />
+ </target>
+
+ <!-- Launch pde build -->
+ <target name="pde-build" depends="copy_srcs, create-target">
+ <java classname="org.eclipse.equinox.launcher.Main" fork="true" failonerror="true">
+ <arg value="-application" />
+ <arg value="org.eclipse.ant.core.antRunner" />
+ <arg value="-buildfile" />
+ <arg value="${pde.build.dir}/scripts/productBuild/productBuild.xml" />
+ <arg value="-data" />
+ <arg value="${buildDir}/workspace" />
+ <arg value="-configuration" />
+ <arg value="${buildDir}/configuration" />
+ <arg value="-Dtimestamp=${timestamp}" />
+ <arg value="-DeclipseLocation=${baseBuilder}" />
+ <arg value="-DbuildDirectory=${buildDir}" />
+ <arg value="-DbaseLocation=${targetDir}/deltapack/eclipse" />
+ <arg value="-DrepoBaseLocation=${targetDir}/repos/" />
+ <arg value="-DtransformedRepoLocation=${targetDir}/transformedRepos/" />
+ <arg value="-Dconfigs=${buildconfigs}" />
+ <classpath>
+ <pathelement location="${equinox.launcher}" />
+ </classpath>
+ </java>
+ </target>
+
+ <target name="clean">
+ <delete dir="${outDir}" />
+ <delete dir="${targetDir}" />
+ </target>
+
+ <target name="build" depends="pde-build" />
+</project>
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
+