aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjrizzoli <joey@cyanogenmoditalia.it>2016-02-03 20:40:34 +0100
committerjrizzoli <joey@cyanogenmoditalia.it>2016-03-15 18:43:12 +0100
commite1fecf0f79509bedb387cb07cb10dbbf58bd95ec (patch)
tree352a142fa70a0bc9ff26b69fc317255efd04e9ac
parent5196f6627ca374dacfbdfd4f0b3915009bca2651 (diff)
downloadandroid_external_gello_build-e1fecf0f79509bedb387cb07cb10dbbf58bd95ec.tar.gz
android_external_gello_build-e1fecf0f79509bedb387cb07cb10dbbf58bd95ec.tar.bz2
android_external_gello_build-e1fecf0f79509bedb387cb07cb10dbbf58bd95ec.zip
gello-build: sourcebuild makefiles
add makefiles to support build from source Change-Id: Ie76e1a1a2397de5d8516a41b2ebd5636ee5acf74 Signed-off-by: jrizzoli <joey@cyanogenmoditalia.it>
-rw-r--r--Android.mk33
-rw-r--r--CleanSpec.mk47
-rw-r--r--README.md27
-rwxr-xr-xgello_build.sh33
4 files changed, 123 insertions, 17 deletions
diff --git a/Android.mk b/Android.mk
new file mode 100644
index 0000000..65e8e1f
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,33 @@
+#
+# Copyright (C) 2016 The CyanogenMod 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.
+#
+
+# Install the prebuilt gello apk.
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := Gello
+LOCAL_MODULE_CLASS := APPS
+LOCAL_CERTIFICATE := $(DEFAULT_SYSTEM_DEV_CERTIFICATE)
+
+ifeq ($(WITH_GELLO_SOURCE),true)
+# Build from source
+BUILD_GELLO := $(info $(shell bash $(LOCAL_PATH)/gello_build.sh 1>&2))
+LOCAL_SRC_FILES := Gello.apk
+endif
+
+include $(BUILD_PREBUILT)
diff --git a/CleanSpec.mk b/CleanSpec.mk
new file mode 100644
index 0000000..8275466
--- /dev/null
+++ b/CleanSpec.mk
@@ -0,0 +1,47 @@
+# Copyright (C) 2016 The CyanogenMod 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.
+#
+
+# If you don't need to do a full clean build but would like to touch
+# a file or delete some intermediate files, add a clean step to the end
+# of the list. These steps will only be run once, if they haven't been
+# run before.
+#
+# E.g.:
+# $(call add-clean-step, touch -c external/sqlite/sqlite3.h)
+# $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates)
+#
+# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with
+# files that are missing or have been moved.
+#
+# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory.
+# Use $(OUT_DIR) to refer to the "out" directory.
+#
+# If you need to re-do something that's already mentioned, just copy
+# the command and add it to the bottom of the list. E.g., if a change
+# that you made last week required touching a file and a change you
+# made today requires touching the same file, just copy the old
+# touch step and add it to the end of the list.
+#
+# For example:
+#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates)
+#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates)
+#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
+#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/app/Gello)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/app/Browser)
+
+# ******************************************************************
+# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST ABOVE THIS BANNER
+# ******************************************************************
diff --git a/README.md b/README.md
index 6b44e9d..77290bb 100644
--- a/README.md
+++ b/README.md
@@ -8,15 +8,28 @@ Documentation
Features
----------
-- *--clean* = Make a clean build
-- *--depot* = Install Depot Tool
-- *--fast* = Skip sync and runhooks, useful for testing changes
-- *--local* = Pick local gello from packages/apps/Gello (for testing purpose)
-- *--push* = Once everything else is done, install the given apk on a connected device
-- *--no-sync* = Skip sync
+- *--clean* = Make a clean build
+- *--depot* = Install Depot Tool
+- *--fast* = Skip sync and runhooks, useful for testing changes
+- *--local* = Pick local gello from packages/apps/Gello (for testing purpose)
+- *--push* = Once everything else is done, install the given apk on a connected device
+- *--no-sync* = Skip sync
+
+How to build
+----------
+If you're going to build from CyanogenMod build environment you will be able to choose between Sourcebuilt or Prebuilt. By default CyanogenMod uses Prebuilt to save you time, data and disk space.
+If you don't want to use/trust prebuilt apk (that comes from CyanogenMod Maven) for some reason, you're free to build it yourself on your own machine. To build from source you just need to run the following commands:
+
+ export WITH_GELLO_SOURCE=true
+ mka Gello
+To be able to build Gello you'll need to set up your machine, see [Setup](https://github.com/CyanogenMod/android_external_gello_build#setup).
Setup
----------
Read [chromium documentation](https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_instructions_prerequisites.md) for needed packages to build Gello.
-To get sources you need Depot tools that can be easily installed using _gello_build.sh --depot_
+To get sources you need Depot tools that can be easily installed by running
+
+ ./gello_build.sh --depot
+
During the first build you may be asked to accept EULA for some components needed to compile.
+__Building from source is not recommend to those who have a really limited storage and / or data plan, the Gello environment needs to download a lot of data__
diff --git a/gello_build.sh b/gello_build.sh
index c32ce22..b3c8805 100755
--- a/gello_build.sh
+++ b/gello_build.sh
@@ -17,16 +17,7 @@
# Integrated SWE Build System for Gello
#
-##
-# Variables
-#
TOP_GELLO=$(pwd)
-SRC_GELLO=$TOP_GELLO/env/src
-
-BACKUP_GELLO=$SRC_GELLO/swe/browser_orig
-BUILD_GELLO=$SRC_GELLO/swe/browser
-
-READY_APK=$TOP_GELLO/Gello.apk
##
@@ -188,6 +179,26 @@ function parseflags() {
done
}
+##
+# PathValidator
+#
+function pathvalidator() {
+ local ENV_PATH=$TOP_GELLO/external/gello-build
+
+ # Adjust path to make sure it works both from make and manual sh execution
+ if [ ! -d "$TOP_GELLO/env/src" ]; then
+ if [ -d "$ENV_PATH" ]; then
+ TOP_GELLO=$ENV_PATH
+ fi
+ fi
+
+ # Set up paths now
+ SRC_GELLO=$TOP_GELLO/env/src
+ BACKUP_GELLO=$SRC_GELLO/swe/browser_orig
+ BUILD_GELLO=$SRC_GELLO/swe/browser
+ READY_APK=$TOP_GELLO/Gello.apk
+}
+
##
# Help
@@ -218,10 +229,11 @@ function getdepot() {
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
}
-
##
# Main
#
+pathvalidator
+
if [ "$1" == "--depot" ]; then
getdepot && exit 0
elif [ "$1" == "--help" ]; then
@@ -230,6 +242,7 @@ fi
parseflags "$@"
+
sync && setup && compile
if [ "$?" == 0 ]; then