aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--adtproductbuild/Android.mk133
-rw-r--r--adtproductbuild/Makefile36
-rw-r--r--adtproductbuild/adt_eclipse_ide3
-rw-r--r--adtproductbuild/build.xml2
-rwxr-xr-xeclipse/scripts/build_server.sh22
5 files changed, 153 insertions, 43 deletions
diff --git a/adtproductbuild/Android.mk b/adtproductbuild/Android.mk
new file mode 100644
index 0000000..e3421d9
--- /dev/null
+++ b/adtproductbuild/Android.mk
@@ -0,0 +1,133 @@
+# Copyright 2012 The Android Open Source Project
+#
+# Makefile rules to build the ADT Eclipse IDE.
+# This is invoked from sdk/eclipse/scripts/build_server.sh using
+# something like "make PRODUCT-sdk-adt_eclipse_ide".
+#
+# Expected env vars:
+# ADT_IDE_DEST_DIR: existing directory where to copy the IDE zip files.
+# ADT_IDE_QUALIFIER: either a date or build number to incorporate in the zip names.
+
+# Expose the ADT Eclipse IDE build only for the SDK builds.
+ifneq (,$(is_sdk_build)$(filter sdk sdk_x86 sdk_mips,$(TARGET_PRODUCT)))
+
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := adt_eclipse_ide
+LOCAL_MODULE_CLASS := EXECUTABLES
+LOCAL_MODULE_TAGS := optional
+LOCAL_IS_HOST_MODULE := true
+include $(BUILD_SYSTEM)/base_rules.mk
+
+ADT_IDE_MODULE_DEPS := $(TOPDIR)sdk/adtproductbuild/$(LOCAL_MODULE)
+
+ADT_IDE_BUILD_LOG := $(TOPDIR)out/host/eclipse/adtproduct/build/adtproduct.log
+ADT_IDE_ARTIFACT_DIR := $(TOPDIR)out/host/eclipse/adtproduct/build/I.RcpBuild
+ADT_IDE_RELEASE_DIR := $(TOPDIR)out/host/eclipse/adtproduct/release
+
+ADT_IDE_JAVA_LIBS := $(shell $(TOPDIR)sdk/eclipse/scripts/create_all_symlinks.sh -d)
+ADT_IDE_JAVA_DEPS := $(foreach m,$(ADT_IDE_JAVA_LIBS),$(HOST_OUT_JAVA_LIBRARIES)/$(m).jar)
+
+ADT_IDE_JAVA_TARGET := $(ADT_IDE_RELEASE_DIR)/adt_eclipse_ide_java_build
+
+# Common not-quite-phony rule to perform the eclipse build only once
+# This invokes the java builder on eclipse. It generates multiple
+# zipped versions (one per OS, all built at the same time)
+# of the ide as specified in the build.properties file.
+$(ADT_IDE_JAVA_TARGET) : $(TOPDIR)sdk/adtproductbuild/adt_eclipse_ide \
+ $(TOPDIR)sdk/adtproductbuild/build.xml \
+ $(TOPDIR)sdk/adtproductbuild/build.properties \
+ $(ADT_IDE_JAVA_DEPS)
+ @if [[ ! -d $(TOPDIR)prebuilts/eclipse-build-deps ]]; then \
+ echo "*** [adt_eclipse_ide] ERROR: Missing prebuilts/eclipse-build-deps directory. Make sure to run 'repo init -g all;repo sync' first."; \
+ exit 1; \
+ fi
+ $(hide)rm -rf $(TOPDIR)out/host/eclipse/adtproduct/build/plugins
+ $(hide)mkdir -p $(dir $@)
+ $(hide)$(TOPDIR)sdk/eclipse/scripts/create_all_symlinks.sh -c
+ $(hide)cd $(TOPDIR)sdk/adtproductbuild && \
+ rm -f ../../$(ADT_IDE_BUILD_LOG) && mkdir -p ../../$(dir $(ADT_IDE_BUILD_LOG)) && \
+ ( 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/adtproduct/build/configuration \
+ -data ../../out/host/eclipse/adtproduct/workspace \
+ 2>&1 && \
+ mv -f ../../$(ADT_IDE_BUILD_LOG) ../../$(ADT_IDE_BUILD_LOG).1 ) \
+ | tee ../../$(ADT_IDE_BUILD_LOG) \
+ | sed 's/^/IDE: /'; \
+ if [[ -f ../../$(ADT_IDE_BUILD_LOG) ]]; then \
+ echo "ADT IDE build failed. Full log:" ; \
+ cat ../../$(ADT_IDE_BUILD_LOG) ; \
+ exit 1 ; \
+ fi
+ $(hide)$(ACP) -fp $(V) $(TOPDIR)sdk/adtproductbuild/adt_eclipse_ide $@
+
+# Defines the zip filename generated for an OS specific android IDE.
+define adt-ide-zip
+$(ADT_IDE_RELEASE_DIR)/android-ide-$(ADT_IDE_QUALIFIER)-$(1).$(2).zip
+endef
+
+# Defines the rule needed to make one of the OS specific android IDE.
+# If ADT_IDE_DEST_DIR it also defines the rule to produce the final dest zip.
+# $1 = the platform (linux|macosx|win32).(gtk|cocoa|win32)
+# $2 = the architecture (x86 or x8_64).
+# $3 = the src zip (from out/host/eclipse/artifacts/RcpBuild-...)
+# $4 = the destination directory (where the unpacked eclipse is created)
+# $5 = the destination zip with the zipped eclipse ide.
+define mk-adt-ide-2
+$(5): $(ADT_IDE_JAVA_TARGET)
+ $(hide) \
+ rm -rf $(V) $(4) && \
+ rm -f $(V) $(5) && \
+ mkdir -p $(4) && \
+ unzip -q $(3) -d $(4) && \
+ sed -i 's/org.eclipse.platform/com.android.ide.eclipse.adt.package.product/g' \
+ $(4)/eclipse/$(if $(filter macosx.cocoa,$(1)),eclipse.app/Contents/MacOS/)eclipse.ini && \
+ sed -i -e 's/org.eclipse.platform.ide/com.android.ide.eclipse.adt.package.product/g' \
+ -e 's/org.eclipse.platform/com.android.ide.eclipse.adt.package/g' \
+ $(4)/eclipse/configuration/config.ini
+ $(hide)cd $(4) && zip -9rq ../$(notdir $(5)) eclipse
+ifneq (,$(ADT_IDE_DEST_DIR))
+$(ADT_IDE_DEST_DIR)/$(notdir $(5)): $(5)
+ @mkdir -p $(ADT_IDE_DEST_DIR)
+ $(hide)cp $(V) $(5) $(ADT_IDE_DEST_DIR)/$(notdir $(5))
+ @echo "ADT IDE copied to $(ADT_IDE_DEST_DIR)/$(notdir $(5))"
+else
+ @echo "ADT IDE available at $(5)"
+endif
+endef
+
+# Defines the rule needed to make one of the OS specific android IDE.
+# This is just a convenience wrapper that calls mk-adt-ide-2 and presets
+# the source and destination zip paths.
+# It also sets the dependencies we need to produce the final dest zip.
+# $1 = the platform (linux|macosx|win32).(gtk|cocoa|win32)
+# $2 = the architecture (x86 or x8_64).
+define mk-adt-ide
+$(call mk-adt-ide-2,$(1),$(2), \
+ $(ADT_IDE_ARTIFACT_DIR)/RcpBuild-$(1).$(2).zip, \
+ $(ADT_IDE_RELEASE_DIR)/android-ide-$(1).$(2), \
+ $(call adt-ide-zip,$(1),$(2)))
+ADT_IDE_MODULE_DEPS += $(call adt-ide-zip,$(1),$(2))
+ifneq (,$(ADT_IDE_DEST_DIR))
+ADT_IDE_MODULE_DEPS += $(ADT_IDE_DEST_DIR)/$(notdir $(call adt-ide-zip,$(1),$(2)))
+endif
+endef
+
+$(eval $(call mk-adt-ide,linux.gtk,x86_64))
+$(eval $(call mk-adt-ide,macosx.cocoa,x86_64))
+$(eval $(call mk-adt-ide,win32.win32,x86_64))
+
+# This rule triggers the build of the 3 ide zip files.
+# The adt_eclipse_ide script is currently a platceholder used
+# to detect when the build was completed. We may use it later
+# as a launch script.
+$(LOCAL_BUILT_MODULE) : $(ADT_IDE_MODULE_DEPS)
+ @mkdir -p $(dir $@)
+ $(hide)$(ACP) -fp $(V) $(TOPDIR)sdk/adtproductbuild/adt_eclipse_ide $@
+ @echo "Packing of ADT IDE done"
+
+endif
+
diff --git a/adtproductbuild/Makefile b/adtproductbuild/Makefile
deleted file mode 100644
index 64d30ef..0000000
--- a/adtproductbuild/Makefile
+++ /dev/null
@@ -1,36 +0,0 @@
-ADT_IDE_BUILD_LOG := out/host/eclipse/adtproduct/build/adtproduct.log
-ADT_IDE_ARTIFACT_DIR := ../../out/host/eclipse/adtproduct/build/I.RcpBuild
-ADT_IDE_RELEASE_DIR := ../../out/host/eclipse/adtproduct/release/
-
-define release-ide
- srczip=$(ADT_IDE_ARTIFACT_DIR)/RcpBuild-$(1).$(2).zip && \
- dstdir=$(ADT_IDE_RELEASE_DIR)/android-ide-$(1).$(2) && \
- rm -rf $(V) $$dstdir && \
- mkdir -p $$dstdir && \
- unzip -q $$srczip -d $$dstdir && \
- if [[ $(1) == "macosx.cocoa" ]]; then eclipseini=eclipse.app/Contents/MacOS/eclipse.ini; else eclipseini=eclipse.ini; fi && \
- sed -i 's/org.eclipse.platform/com.android.ide.eclipse.adt.package.product/g' $$dstdir/eclipse/$$eclipseini && \
- sed -i -e 's/org.eclipse.platform.ide/com.android.ide.eclipse.adt.package.product/g' \
- -e 's/org.eclipse.platform/com.android.ide.eclipse.adt.package/g' $$dstdir/eclipse/configuration/config.ini
-endef
-
-
-all:
- rm -f ../../$(ADT_IDE_BUILD_LOG) && mkdir -p ../../$(dir $(ADT_IDE_BUILD_LOG)) && \
- ( 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/adtproduct/build/configuration \
- -data ../../out/host/eclipse/adtproduct/workspace \
- 2>&1 && \
- mv -f ../../$(ADT_IDE_BUILD_LOG) ../../$(ADT_IDE_BUILD_LOG).1 ) \
- | tee ../../$(ADT_IDE_BUILD_LOG) \
- | sed '/SUCCESSFUL/d ; /\[java\]/!b label; s/\s\+\[java\]//; /^\s*$$/d; /Compiling/!d; :label /^\s*$$/d; s/^/ADT: /'; \
- if [[ -f ../../$(ADT_IDE_BUILD_LOG) ]]; then \
- echo "ADT IDE build failed. Full log:" ; \
- cat ../../$(ADT_IDE_BUILD_LOG) ; \
- exit 1 ; \
- fi
- $(call release-ide,linux.gtk,x86_64) ; \
- $(call release-ide,macosx.cocoa,x86_64) ; \
- $(call release-ide,win32.win32,x86_64) ; \
diff --git a/adtproductbuild/adt_eclipse_ide b/adtproductbuild/adt_eclipse_ide
new file mode 100644
index 0000000..ea3355c
--- /dev/null
+++ b/adtproductbuild/adt_eclipse_ide
@@ -0,0 +1,3 @@
+#!/bin/bash
+echo "Placeholder launcher script for the ADT Eclipse IDE."
+exit 1
diff --git a/adtproductbuild/build.xml b/adtproductbuild/build.xml
index 7851625..c91bff0 100644
--- a/adtproductbuild/build.xml
+++ b/adtproductbuild/build.xml
@@ -7,7 +7,7 @@
<!-- Source for target prebuilts -->
<property name="deltaPackTargetSrcDir" value="${ANDROID_SRC}/prebuilts/eclipse/" />
- <property name="targetSrcDir" value="${ANDROID_SRC}/prebuilts/eclipse/" />
+ <property name="targetSrcDir" value="${ANDROID_SRC}/prebuilts/eclipse-build-deps/" />
<!-- Location where build happens and resulting binaries are generated -->
<property name="outDir" value="${ANDROID_SRC}/out/host/eclipse/adtproduct/" />
diff --git a/eclipse/scripts/build_server.sh b/eclipse/scripts/build_server.sh
index 4c27673..b3b86b7 100755
--- a/eclipse/scripts/build_server.sh
+++ b/eclipse/scripts/build_server.sh
@@ -6,7 +6,7 @@
# $2: Optional build number. If present, will be appended to the date qualifier.
# The build number cannot contain spaces *nor* periods (dashes are ok.)
# -z: Optional, prevents the final zip and leaves the udate-site directory intact.
-# -i: Optional, if present, the Google internal update site will be built. Otherwise,
+# -i: Optional, if present, the Google internal update site will be built. Otherwise,
# the external site will be built
# Workflow:
# - make dx, ddms, ping
@@ -57,16 +57,16 @@ function check_params() {
# Check dest dir exists
[ -n "$DEST_DIR" ] || die "Usage: $0 <destination-directory> [build-number]"
[ -d "$DEST_DIR" ] || die "Destination directory $DEST_DIR must exist."
-}
-
-function build_plugin {
- sdk/eclipse/scripts/create_all_symlinks.sh
# Qualifier is "v" followed by date/time in YYYYMMDDHHSS format and the optional
# build number.
DATE=`date +v%Y%m%d%H%M`
QUALIFIER="$DATE"
[ -n "$BUILD_NUMBER" ] && QUALIFIER="${QUALIFIER}-${BUILD_NUMBER}"
+}
+
+function build_plugin() {
+ sdk/eclipse/scripts/create_all_symlinks.sh
# Compute the final directory name and remove any leftovers from previous
# runs if any.
@@ -106,6 +106,16 @@ function build_plugin {
fi
}
+function build_adt_ide() {
+ ADT_IDE_DEST_DIR="$DEST_DIR" \
+ ADT_IDE_QUALIFIER="$QUALIFIER" \
+ make PRODUCT-sdk-adt_eclipse_ide
+}
+
get_params "$@"
check_params
-build_plugin
+( build_plugin )
+if [[ -z $INTERNAL_BUILD ]]; then
+ ( build_adt_ide )
+fi
+