summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rw-r--r--build/core/apicheck_msg_current.txt4
-rw-r--r--build/core/config.mk3
-rw-r--r--build/core/http_prebuilt.mk89
-rwxr-xr-xbuild/tasks/http_curl_prebuilt.sh6
-rw-r--r--build/tools/extract_utils.sh31
l---------build/tools/repopick.py1
6 files changed, 129 insertions, 5 deletions
diff --git a/build/core/apicheck_msg_current.txt b/build/core/apicheck_msg_current.txt
index 05a0341..6881b3f 100644
--- a/build/core/apicheck_msg_current.txt
+++ b/build/core/apicheck_msg_current.txt
@@ -4,7 +4,7 @@ You have tried to change the API from what has been previously approved.
STOP.
Read this:
- https://github.com/CyanogenMod/cm_platform_sdk/wiki/Creating-an-API-for-the-SDK#updating--verifying-the-api
+ https://github.com/LineageOS/cm_platform_sdk/wiki/Creating-an-API-for-the-SDK#updating--verifying-the-api
To make these errors go away, you have two choices:
1) You can add "@hide" javadoc comments to the methods, etc. listed in the
@@ -142,6 +142,6 @@ To make these errors go away, you have two choices:
,;+++++++++++++++++++++++++++++++++++++++++++++++++++++++:.
..,;;+++++++++++++++++++++++++++++;:,.
- To submit the revised current.txt to the main CyanogenMod repository,
+ To submit the revised current.txt to the main LineageOS repository,
you will need approval.
******************************
diff --git a/build/core/config.mk b/build/core/config.mk
index 75bfca7..62a403a 100644
--- a/build/core/config.mk
+++ b/build/core/config.mk
@@ -1,4 +1,5 @@
# Copyright (C) 2015 The CyanogenMod Project
+# (C) 2017 The LineageOS Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -26,3 +27,5 @@ FRAMEWORK_CM_API_NEEDS_UPDATE_TEXT := $(TOPDIR)vendor/replicant/build/core/apich
BUILD_MAVEN_PREBUILT := $(TOP)/vendor/replicant/build/core/maven_artifact.mk
PUBLISH_MAVEN_PREBUILT := $(TOP)/vendor/replicant/build/core/maven_artifact_publish.mk
+
+BUILD_HTTP_PREBUILT := $(TOP)/vendor/replicant/build/core/http_prebuilt.mk
diff --git a/build/core/http_prebuilt.mk b/build/core/http_prebuilt.mk
new file mode 100644
index 0000000..4d7556a
--- /dev/null
+++ b/build/core/http_prebuilt.mk
@@ -0,0 +1,89 @@
+# Copyright (C) 2015 The CyanogenMod Project
+# (C) 2017 The LineageOS 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.
+
+ifeq ($(strip $(LOCAL_HTTP_PATH)),)
+ $(error LOCAL_HTTP_PATH not defined.)
+endif
+
+ifeq ($(strip $(LOCAL_HTTP_FILENAME)),)
+ $(error LOCAL_HTTP_FILENAME not defined.)
+endif
+
+ifeq ($(strip $(LOCAL_HTTP_MD5SUM)),)
+ $(error LOCAL_HTTP_MD5SUM not defined.)
+endif
+
+PREBUILT_MODULE_ARCHIVE := vendor/cm/prebuilt/archive/$(LOCAL_MODULE)
+
+PREBUILT_MODULE_FILE := $(PREBUILT_MODULE_ARCHIVE)/$(LOCAL_HTTP_FILENAME)
+
+PREBUILT_MODULE_MD5SUM := $(PREBUILT_MODULE_ARCHIVE)/md5sum
+
+HTTP_FILE_URL := $(LOCAL_HTTP_PATH)/$(LOCAL_HTTP_FILENAME)
+HTTP_FILE_MD5_URL := $(LOCAL_HTTP_PATH)/$(LOCAL_HTTP_MD5SUM)
+
+LOCAL_PREBUILT_MODULE_FILE := $(call intermediates-dir-for,$(LOCAL_MODULE_CLASS),$(LOCAL_MODULE),,COMMON)/$(LOCAL_HTTP_FILENAME)
+
+$(LOCAL_PREBUILT_MODULE_FILE): filename := $(LOCAL_HTTP_FILENAME)
+$(LOCAL_PREBUILT_MODULE_FILE): checksum := $(PREBUILT_MODULE_MD5SUM)
+$(LOCAL_PREBUILT_MODULE_FILE): filepath := $(PREBUILT_MODULE_FILE)
+$(LOCAL_PREBUILT_MODULE_FILE): version := $(LOCAL_HTTP_FILE_VERSION)
+
+define curl-checksum
+ @echo "Pulling comparison md5sum for $(filename)"
+ $(call download-prebuilt-module, $(HTTP_FILE_MD5_URL),$(checksum))
+endef
+
+define audit-checksum
+ $(hide) if [ ! -f $(filepath) ]; then \
+ echo "Downloading: $(filename) (version $(version)) -> $(filepath)"; \
+ $(call download-prebuilt-module, $(HTTP_FILE_URL),$(filepath)) \
+ else \
+ temp_checksum=$(shell md5sum $(filepath) | cut -d ' ' -f1); \
+ if [ "$$temp_checksum" != "$(shell cat $(checksum) | cut -d ' ' -f1)" ]; then \
+ echo "Downloading: $(filename) (version $(version)) -> $(filepath)"; \
+ rm -rf $(filepath); \
+ $(call download-prebuilt-module, $(HTTP_FILE_URL),$(filepath)) \
+ fi; \
+ fi; \
+ rm -f $(checksum);
+endef
+
+# $(1) url
+# $(2) file output
+define download-prebuilt-module
+ ./vendor/cm/build/tasks/http_curl_prebuilt.sh $(1) $(2);
+endef
+
+define cleanup
+ @echo "Copying: $(filename) -> $(dir $@)"
+ $(hide) mkdir -p $(dir $@)
+ $(hide) cp $(filepath) $(dir $@)/$(filename)
+endef
+
+$(LOCAL_PREBUILT_MODULE_FILE):
+ $(call curl-checksum)
+ $(call audit-checksum)
+ $(call cleanup)
+
+include $(BUILD_PREBUILT)
+
+# the "fetchprebuilts" target will go through and pre-download all of the maven dependencies in the tree
+fetchprebuilts: $(LOCAL_PREBUILT_MODULE_FILE)
+
+# the "nukeprebuilts" target will evict all archived artifacts
+nukeprebuilts:
+ @echo "Removing artifact for $(LOCAL_HTTP_FILENAME)"
+ $(hide) rm -rf $(PREBUILT_MODULE_ARCHIVE)
diff --git a/build/tasks/http_curl_prebuilt.sh b/build/tasks/http_curl_prebuilt.sh
new file mode 100755
index 0000000..c90c35f
--- /dev/null
+++ b/build/tasks/http_curl_prebuilt.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+url=$1
+output=$2
+
+curl -L "$url" --create-dirs -o $output --compressed -H "Accept-Encoding: gzip,deflate,sdch" && exit 0 || exit 1
diff --git a/build/tools/extract_utils.sh b/build/tools/extract_utils.sh
index 6f2ff15..fe63a12 100644
--- a/build/tools/extract_utils.sh
+++ b/build/tools/extract_utils.sh
@@ -429,12 +429,35 @@ function write_product_packages() {
# be executed first!
#
function write_header() {
+ if [ -f $1 ]; then
+ rm $1
+ fi
+
YEAR=$(date +"%Y")
[ "$COMMON" -eq 1 ] && local DEVICE="$DEVICE_COMMON"
- cat << EOF > $1
-# Copyright (C) $YEAR The CyanogenMod Project
+ NUM_REGEX='^[0-9]+$'
+ if [[ $INITIAL_COPYRIGHT_YEAR =~ $NUM_REGEX ]] && [ $INITIAL_COPYRIGHT_YEAR -le $YEAR ]; then
+ if [ $INITIAL_COPYRIGHT_YEAR -lt 2016 ]; then
+ printf "# Copyright (C) $INITIAL_COPYRIGHT_YEAR-2016 The CyanogenMod Project\n" > $1
+ elif [ $INITIAL_COPYRIGHT_YEAR -eq 2016 ]; then
+ printf "# Copyright (C) 2016 The CyanogenMod Project\n" > $1
+ fi
+ if [ $YEAR -eq 2017 ]; then
+ printf "# Copyright (C) 2017 The LineageOS Project\n" >> $1
+ elif [ $INITIAL_COPYRIGHT_YEAR -eq $YEAR ]; then
+ printf "# Copyright (C) $YEAR The LineageOS Project\n" >> $1
+ elif [ $INITIAL_COPYRIGHT_YEAR -le 2017 ]; then
+ printf "# Copyright (C) 2017-$YEAR The LineageOS Project\n" >> $1
+ else
+ printf "# Copyright (C) $INITIAL_COPYRIGHT_YEAR-$YEAR The LineageOS Project\n" >> $1
+ fi
+ else
+ printf "# Copyright (C) $YEAR The LineageOS Project\n" > $1
+ fi
+
+ cat << EOF >> $1
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -761,7 +784,9 @@ function extract() {
echo "Cleaning output directory ($OUTPUT_ROOT).."
rm -rf "${OUTPUT_TMP:?}"
mkdir -p "${OUTPUT_TMP:?}"
- mv "${OUTPUT_ROOT:?}/"* "${OUTPUT_TMP:?}/"
+ if [ -d "$OUTPUT_ROOT" ]; then
+ mv "${OUTPUT_ROOT:?}/"* "${OUTPUT_TMP:?}/"
+ fi
VENDOR_STATE=1
fi
diff --git a/build/tools/repopick.py b/build/tools/repopick.py
new file mode 120000
index 0000000..de58d7e
--- /dev/null
+++ b/build/tools/repopick.py
@@ -0,0 +1 @@
+../../../../build/tools/repopick.py \ No newline at end of file