Skip to content

Commit

Permalink
Revert "Bug 906316 - Don't download the xulrunner SDK each time we ch…
Browse files Browse the repository at this point in the history
…ange a branch if their configuration are different r=yurenju,asuth,ochameau"

This reverts commit 106001c.
  • Loading branch information
lightsofapollo committed Sep 27, 2013
1 parent 49e118a commit 739347e
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 76 deletions.
71 changes: 15 additions & 56 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,6 @@
# JSHINTRC=<path> will use this config file when running jshint #
# #
###############################################################################
# #
# XULrunner download and location configuration #
# #
# USE_LOCAL_XULRUNNER_SDK : if you have a local XULrunner installation and #
# wants to use it #
# #
# XULRUNNER_DIRECTORY : if you use USE_LOCAL_XULRUNNER_SDK, this is #
# where your local XULrunner installation is #
# #
# XULRUNNER_BASE_DIRECTORY : if you don't use USE_LOCAL_XULRUNNER_SDK, this #
# is where you want the automatic XULrunner #
# download to uncompress. #
# #
# Submakes will get XULRUNNER_DIRECTORY, XULRUNNERSDK and XPCSHELLSDK as #
# absolute paths. #
# #
###############################################################################

-include local.mk

# .b2g.mk recorded the make flags from Android.mk
Expand Down Expand Up @@ -94,9 +76,6 @@ endif

PROFILE_FOLDER?=profile

STAGE_FOLDER?=build_stage
export STAGE_FOLDER

LOCAL_DOMAINS?=1

ADB?=adb
Expand Down Expand Up @@ -403,14 +382,13 @@ ifneq ($(DEBUG),1)
endif
endif

.PHONY: app-makefiles
app-makefiles:
@for d in ${GAIA_APPDIRS}; \
do \
if [[ ("$$d" =~ "${BUILD_APP_NAME}") || (${BUILD_APP_NAME} == "*") ]]; then \
for mfile in `find $$d -mindepth 1 -maxdepth 1 -name "Makefile"` ;\
do \
make -C `dirname $$mfile` || exit 1 ;\
make -C `dirname $$mfile`; \
done; \
fi; \
done;
Expand Down Expand Up @@ -499,12 +477,7 @@ reference-workload-x-heavy:

# The install-xulrunner target arranges to get xulrunner downloaded and sets up
# some commands for invoking it. But it is platform dependent
# IMPORTANT: you should generally change the directory name when you change the
# URL unless you know what you're doing
XULRUNNER_SDK_URL=http://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/2013/08/2013-08-07-03-02-16-mozilla-central/xulrunner-26.0a1.en-US.
XULRUNNER_BASE_DIRECTORY?=xulrunner-sdk-26
XULRUNNER_DIRECTORY?=$(XULRUNNER_BASE_DIRECTORY)/xulrunner-sdk
XULRUNNER_URL_FILE=$(XULRUNNER_BASE_DIRECTORY)/.url

ifeq ($(SYS),Darwin)
# For mac we have the xulrunner-sdk so check for this directory
Expand All @@ -517,14 +490,14 @@ else
# 64-bit
XULRUNNER_SDK_DOWNLOAD=$(XULRUNNER_MAC_SDK_URL)x86_64.sdk.tar.bz2
endif
XULRUNNERSDK=$(abspath $(XULRUNNER_DIRECTORY)/bin/XUL.framework/Versions/Current/run-mozilla.sh)
XPCSHELLSDK=$(abspath $(XULRUNNER_DIRECTORY)/bin/XUL.framework/Versions/Current/xpcshell)
XULRUNNERSDK=./xulrunner-sdk/bin/XUL.framework/Versions/Current/run-mozilla.sh
XPCSHELLSDK=./xulrunner-sdk/bin/XUL.framework/Versions/Current/xpcshell

else ifeq ($(findstring MINGW32,$(SYS)), MINGW32)
# For windows we only have one binary
XULRUNNER_SDK_DOWNLOAD=$(XULRUNNER_SDK_URL)win32.sdk.zip
XULRUNNERSDK=
XPCSHELLSDK=$(abspath $(XULRUNNER_DIRECTORY)/bin/xpcshell)
XPCSHELLSDK=./xulrunner-sdk/bin/xpcshell

else
# Otherwise, assume linux
Expand All @@ -536,37 +509,23 @@ XULRUNNER_SDK_DOWNLOAD=$(XULRUNNER_LINUX_SDK_URL)x86_64.sdk.tar.bz2
else
XULRUNNER_SDK_DOWNLOAD=$(XULRUNNER_LINUX_SDK_URL)i686.sdk.tar.bz2
endif
XULRUNNERSDK=$(abspath $(XULRUNNER_DIRECTORY)/bin/run-mozilla.sh)
XPCSHELLSDK=$(abspath $(XULRUNNER_DIRECTORY)/bin/xpcshell)
XULRUNNERSDK=./xulrunner-sdk/bin/run-mozilla.sh
XPCSHELLSDK=./xulrunner-sdk/bin/xpcshell
endif

# It's difficult to figure out XULRUNNERSDK in subprocesses; it's complex and
# some builders may want to override our find logic (ex: TBPL).
# So let's export these variables to external processes.
export XULRUNNER_DIRECTORY XULRUNNERSDK XPCSHELLSDK

.PHONY: install-xulrunner-sdk
install-xulrunner-sdk:
@echo "XULrunner directory: $(XULRUNNER_DIRECTORY)"
ifndef USE_LOCAL_XULRUNNER_SDK
ifneq ($(XULRUNNER_SDK_DOWNLOAD),$(shell test -d $(XULRUNNER_DIRECTORY) && cat $(XULRUNNER_URL_FILE) 2> /dev/null))
# must download the xulrunner sdk
rm -rf $(XULRUNNER_BASE_DIRECTORY)
@echo "Downloading XULRunner..."
ifneq ($(XULRUNNER_SDK_DOWNLOAD),$(shell cat .xulrunner-url 2> /dev/null))
rm -rf xulrunner-sdk
$(DOWNLOAD_CMD) $(XULRUNNER_SDK_DOWNLOAD)
ifeq ($(findstring MINGW32,$(SYS)), MINGW32)
mkdir "$(XULRUNNER_BASE_DIRECTORY)"
@echo "Unzipping XULRunner..."
unzip -q xulrunner*.zip -d "$(XULRUNNER_BASE_DIRECTORY)" && rm -f xulrunner*.zip
unzip xulrunner*.zip && rm xulrunner*.zip
else
mkdir $(XULRUNNER_BASE_DIRECTORY)
tar xjf xulrunner*.tar.bz2 -C $(XULRUNNER_BASE_DIRECTORY) && rm -f xulrunner*.tar.bz2 || \
( echo; \
echo "We failed extracting the XULRunner SDK archive which may be corrupted."; \
echo "You should run 'make really-clean' and try again." ; false )
endif # MINGW32
@echo $(XULRUNNER_SDK_DOWNLOAD) > $(XULRUNNER_URL_FILE)
endif # XULRUNNER_SDK_DOWNLOAD
tar xjf xulrunner*.tar.bz2 && rm xulrunner*.tar.bz2
endif
@echo $(XULRUNNER_SDK_DOWNLOAD) > .xulrunner-url
endif
endif # USE_LOCAL_XULRUNNER_SDK

define run-js-command
Expand Down Expand Up @@ -992,11 +951,11 @@ endif

# clean out build products
clean:
rm -rf profile profile-debug profile-test $(PROFILE_FOLDER) $(STAGE_FOLDER)
rm -rf profile profile-debug profile-test $(PROFILE_FOLDER)

# clean out build products and tools
really-clean: clean
rm -rf xulrunner-* .xulrunner-* node_modules
rm -rf xulrunner-sdk .xulrunner-url node_modules

.git/hooks/pre-commit: tools/pre-commit
test -d .git && cp tools/pre-commit .git/hooks/pre-commit || true
19 changes: 13 additions & 6 deletions apps/email/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# We can't figure out XULRUNNERSDK on our own; it's complex and some builders
# # may want to override our find logic (ex: TBPL), so let's just leave it up to
# # the root Makefile. If you know what you're doing, you can manually define
# # XULRUNNERSDK and XPCSHELLSDK on the command line.
ifndef XPCSHELLSDK
$(error This Makefile needs to be run by the root gaia makefile. Use `make APP=email` from the root gaia directory.)
SYS=$(shell uname -s)

ifeq ($(SYS),Darwin)
XULRUNNERSDK=../../xulrunner-sdk/bin/XUL.framework/Versions/Current/run-mozilla.sh
XPCSHELLSDK=../../xulrunner-sdk/bin/XUL.framework/Versions/Current/xpcshell
else ifeq ($(findstring MINGW32,$(SYS)), MINGW32)
# For windows we only have one binary
XULRUNNERSDK=
XPCSHELLSDK=../../xulrunner-sdk/bin/xpcshell
else
# Otherwise, assume linux
XULRUNNERSDK=../../xulrunner-sdk/bin/run-mozilla.sh
XPCSHELLSDK=../../xulrunner-sdk/bin/xpcshell
endif

rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
Expand Down
14 changes: 3 additions & 11 deletions bin/gaia-marionette
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,10 @@ if [ ! -d $DIR/../profile-test ]; then
PROFILE_FOLDER=profile-test make -C $DIR/../
fi

if [ -z "$XULRUNNER_DIRECTORY" ] ; then
# the xulrunner directory isn't in the environment
XULRUNNER_DIRECTORY=`ls -d "$DIR/../xulrunner-sdk"* | sort -nr | head -n1 2> /dev/null`
fi

if [ -z "$XULRUNNER_DIRECTORY" ] ; then
echo "Couldn't find XULrunner. Please execute this file from 'make' or install XULrunner yourself."
exit 1
fi

# find the xulrunner
XULRUNNER=`cd $DIR/../xulrunner-sdk* && pwd`
# find xpcshell and put it in the path
XPCSHELL_DIR=$(dirname $(find "$XULRUNNER_DIRECTORY" -type f -name "xpcshell" | head -n 1));
XPCSHELL_DIR=$(dirname $(find $XULRUNNER/bin -type f -name "xpcshell" | head -n 1));

# wrap marionette-mocha with gaia's defaults. We also need to alter the paths to
# xpcshell in available for email fake servers.
Expand Down
5 changes: 2 additions & 3 deletions tests/js/bin/runner
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ XPCSHELL=`which xpcshell`

if [ ! -x "$XPCSHELL" ]
then
PATH=$XULRUNNER_DIRECTORY/bin/:$PATH;
PATH=$GAIA_DIR/xulrunner-sdk/bin/:$PATH;
if [ -n "${VERBOSE}" ]
then
echo "xpcshell is not found in the PATH"
echo "Using $XULRUNNER_DIRECTORY/bin/xpcshell."
echo "xpcshell is not found adding xulrunner-sdk using $GAIA_DIR/xulrunner-sdk/bin/xpcshell."
fi
fi

Expand Down

0 comments on commit 739347e

Please sign in to comment.