aboutsummaryrefslogtreecommitdiffstats
path: root/adtproductbuild
diff options
context:
space:
mode:
authorRaphael Moll <ralf@android.com>2012-08-09 16:42:36 -0700
committerRaphael Moll <ralf@android.com>2012-10-01 16:24:15 -0700
commitb95e95f261f808d430afd0db5c3e279bfa9addfd (patch)
tree1d4fbaa94a66c2071db45298dac40f1f76622921 /adtproductbuild
parent5ef3136fe8c58cd748ad36cda8acbeaa32a1a4ed (diff)
downloadsdk-b95e95f261f808d430afd0db5c3e279bfa9addfd.zip
sdk-b95e95f261f808d430afd0db5c3e279bfa9addfd.tar.gz
sdk-b95e95f261f808d430afd0db5c3e279bfa9addfd.tar.bz2
Android makefile for ADT Eclipse IDE.
The ADT IDE is not part of a full "make sdk". Instead it is invoked as part of sdk/eclipse/build_server.sh. Change-Id: Ifdf1dfa2cd6a655b1821a0886b0c78ccf5d6854d
Diffstat (limited to 'adtproductbuild')
-rw-r--r--adtproductbuild/Android.mk135
-rw-r--r--adtproductbuild/Makefile36
-rw-r--r--adtproductbuild/adt_eclipse_ide3
-rw-r--r--adtproductbuild/build.xml2
4 files changed, 139 insertions, 37 deletions
diff --git a/adtproductbuild/Android.mk b/adtproductbuild/Android.mk
new file mode 100644
index 0000000..ef49661
--- /dev/null
+++ b/adtproductbuild/Android.mk
@@ -0,0 +1,135 @@
+# 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 on Linux
+ifneq (,$(is_sdk_build)$(filter sdk sdk_x86 sdk_mips,$(TARGET_PRODUCT)))
+ifeq (linux,$(HOST_OS))
+
+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 -e '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
+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/" />