aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse/scripts
diff options
context:
space:
mode:
authorSiva Velusamy <vsiva@google.com>2011-12-08 14:25:37 -0800
committerSiva Velusamy <vsiva@google.com>2011-12-08 14:25:37 -0800
commit6ca42e8ef3fe648b3345ea2bcb17825d224f39aa (patch)
tree41a9e9f60e8cef3c4a91f8045828bffb0b33aa42 /eclipse/scripts
parentfa11aa3cc8da59afc652f884f8d9e8ca84552704 (diff)
downloadsdk-6ca42e8ef3fe648b3345ea2bcb17825d224f39aa.zip
sdk-6ca42e8ef3fe648b3345ea2bcb17825d224f39aa.tar.gz
sdk-6ca42e8ef3fe648b3345ea2bcb17825d224f39aa.tar.bz2
rcp: create monitor plugin & build scripts
The monitor plugin defines the entry point for the monitor RCP application, and also defines the monitor.product product configuration. The build scripts in eclipse/scripts/rcp show how to build the RCP app from the command line. Currently, these are not built on the build server. That will happen once we figure out where to put the prebuilts. Change-Id: Idc96b2c011dba55c0d6792e916193017df6ce1c1
Diffstat (limited to 'eclipse/scripts')
-rwxr-xr-xeclipse/scripts/create_all_symlinks.sh48
-rw-r--r--eclipse/scripts/rcp/HOWTO-BUILD9
-rw-r--r--eclipse/scripts/rcp/build.properties49
-rw-r--r--eclipse/scripts/rcp/build.xml89
4 files changed, 180 insertions, 15 deletions
diff --git a/eclipse/scripts/create_all_symlinks.sh b/eclipse/scripts/create_all_symlinks.sh
index c6cd467..ebc3dc8 100755
--- a/eclipse/scripts/create_all_symlinks.sh
+++ b/eclipse/scripts/create_all_symlinks.sh
@@ -1,4 +1,8 @@
#!/bin/bash
+# This script copies the .jar files that each plugin depends on into the plugins libs folder.
+# By default, on Mac & Linux, this script creates symlinks from the libs folder to the jar file.
+# Since Windows does not support symlinks, the jar files are copied.
+# Use option "-f" to copy files rather than creating symlinks on the Mac/Linux platforms.
echo "## Running $0"
# CD to the top android directory
@@ -6,16 +10,34 @@ PROG_DIR=`dirname "$0"`
cd "${PROG_DIR}/../../../"
HOST=`uname`
+USE_COPY="" # force copy dependent jar files rather than creating symlinks
function die() {
echo "Error: $*"
exit 1
}
-if [ "${HOST:0:6}" == "CYGWIN" ]; then
+## parse arguments
+while [ $# -gt 0 ]; do
+ if [ "$1" == "-f" ]; then
+ USE_COPY="1"
+ fi
+ shift
+done
+
+if [ "$HOST" == "Linux" ]; then
+ PLATFORM="linux-x86"
+elif [ "$HOST" == "Darwin" ]; then
+ PLATFORM="darwin-x86"
+elif [ "${HOST:0:6}" == "CYGWIN" ]; then
+ USE_COPY="1" # We can't use symlinks under Cygwin
PLATFORM="windows-x86"
+else
+ echo "Unsupported platform ($HOST). Aborting."
+ exit 1
+fi
- # We can't use symlinks under Cygwin
+if [ "$USE_COPY" == "1" ]; then
function cpfile { # $1=source $2=dest
cp -fv $1 $2/
}
@@ -24,17 +46,6 @@ if [ "${HOST:0:6}" == "CYGWIN" ]; then
rsync -avW --delete-after $1 $2
}
else
- if [ "$HOST" == "Linux" ]; then
- PLATFORM="linux-x86"
- elif [ "$HOST" == "Darwin" ]; then
- PLATFORM="darwin-x86"
- else
- echo "Unsupported platform ($HOST). Aborting."
- exit 1
- fi
-
- # For all other systems which support symlinks
-
# computes the "reverse" path, e.g. "a/b/c" => "../../.."
function back() {
echo $1 | sed 's@[^/]*@..@g'
@@ -132,6 +143,13 @@ SDMAN_LIBS="swtmenubar"
LIBS="$LIBS $SDKMAN_LIBS"
+### MONITOR ###
+
+MONITOR_DEST="sdk/eclipse/plugins/com.android.ide.eclipse.monitor/libs"
+MONITOR_LIBS="sdklib sdkstats androidprefs"
+
+LIBS="$LIBS $MONITOR_LIBS"
+CP_FILES="$CP_FILES @:$MONITOR_DEST $MONITOR_LIBS"
### GL DEBUGGER ###
@@ -147,9 +165,9 @@ fi
# Make sure we have lunch sdk-<something>
if [[ ! "$TARGET_PRODUCT" ]]; then
- echo "## TARGET_PRODUCT is not set, running build/envsetup.sh"
+ echo "## TARGET_PRODUCT is not set, running build/envsetup.sh"
. build/envsetup.sh
- echo "## lunch sdk-eng"
+ echo "## lunch sdk-eng"
lunch sdk-eng
fi
diff --git a/eclipse/scripts/rcp/HOWTO-BUILD b/eclipse/scripts/rcp/HOWTO-BUILD
new file mode 100644
index 0000000..9278f98
--- /dev/null
+++ b/eclipse/scripts/rcp/HOWTO-BUILD
@@ -0,0 +1,9 @@
+To build the Monitor RCP based application, do:
+
+$ lunch sdk-eng
+$ ./sdk/eclipse/scripts/create_all_symlinks.sh -f
+$ cd sdk/eclipse/scripts/rcp
+$ ant
+
+This will build the RCP in the folder:
+$ANDROID_SRC/out/host/eclipse/rcp/build/I.RcpBuild/
diff --git a/eclipse/scripts/rcp/build.properties b/eclipse/scripts/rcp/build.properties
new file mode 100644
index 0000000..493665e
--- /dev/null
+++ b/eclipse/scripts/rcp/build.properties
@@ -0,0 +1,49 @@
+###############################################################################
+# Copyright (c) 2003, 2009 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+
+############# PRODUCT/PACKAGING CONTROL #############
+product=/com.android.ide.eclipse.monitor/monitor.product
+runPackager=true
+archivePrefix=monitor
+collectingFolder=${archivePrefix}
+configs=linux,gtk,x86_64 & \
+ linux,gtk,x86 & \
+ macosx,cocoa,x86_64 & \
+ win32,win32,x86_64 & \
+ win32,win32,x86
+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 ##############
+logExtension=.log
+javacDebugInfo=false
+javacFailOnError=true
+javacVerbose=true
+javacSource=1.5
+javacTarget=1.5
diff --git a/eclipse/scripts/rcp/build.xml b/eclipse/scripts/rcp/build.xml
new file mode 100644
index 0000000..0079d0b
--- /dev/null
+++ b/eclipse/scripts/rcp/build.xml
@@ -0,0 +1,89 @@
+<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}/prebuilts/tools/build/basebuilder/org.eclipse.releng.basebuilder/" />
+
+ <!-- Source for target prebuilts -->
+ <property name="targetSrcDir" value="${ANDROID_SRC}/prebuilts/tools/build/target-platform/" />
+
+ <!-- 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/" />
+
+ <!-- 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}/eclipse-3.6.2-delta-pack.zip" dest="${targetDir}/deltapack" />
+ <unzip src="${targetSrcDir}/org.eclipse.platform-3.6.2.zip" dest="${targetDir}/repos/platform" />
+ <unzip src="${targetSrcDir}/org.eclipse.jdt-3.6.2.zip" dest="${targetDir}/repos/jdt" />
+ </target>
+
+ <!-- Launch pde build -->
+ <target name="pde-build">
+ <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="-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/" />
+ <classpath>
+ <pathelement location="${equinox.launcher}" />
+ </classpath>
+ </java>
+ </target>
+
+ <target name="clean">
+ <delete dir="${outDir}" />
+ <delete dir="${targetDir}" />
+ </target>
+
+ <target name="build" depends="clean, copy_srcs, create-target, pde-build" />
+</project>
+