extract_files: Add initial blueprint creation
Start the copyrights for these at 2019 because the blueprints won't have existed before then. Change-Id: I5300109949785dd19555e35d17a1e80daef498b0
This commit is contained in:
parent
8aae50df3c
commit
42752d4d4e
1 changed files with 80 additions and 11 deletions
|
@ -85,6 +85,7 @@ function setup_vendor() {
|
|||
fi
|
||||
|
||||
export PRODUCTMK="$LINEAGE_ROOT"/"$OUTDIR"/"$VNDNAME"-vendor.mk
|
||||
export ANDROIDBP="$LINEAGE_ROOT"/"$OUTDIR"/Android.bp
|
||||
export ANDROIDMK="$LINEAGE_ROOT"/"$OUTDIR"/Android.mk
|
||||
export BOARDMK="$LINEAGE_ROOT"/"$OUTDIR"/BoardConfigVendor.mk
|
||||
|
||||
|
@ -456,8 +457,8 @@ function write_packages() {
|
|||
#
|
||||
# write_product_packages:
|
||||
#
|
||||
# This function will create BUILD_PREBUILT entries in the
|
||||
# Android.mk and associated PRODUCT_PACKAGES list in the
|
||||
# This function will create prebuilt entries in the
|
||||
# Android.bp and associated PRODUCT_PACKAGES list in the
|
||||
# product makefile for all files in the blob list which
|
||||
# start with a single dash (-) character.
|
||||
#
|
||||
|
@ -683,7 +684,7 @@ function write_product_packages() {
|
|||
}
|
||||
|
||||
#
|
||||
# write_header:
|
||||
# write_blueprint_header:
|
||||
#
|
||||
# $1: file which will be written to
|
||||
#
|
||||
|
@ -691,7 +692,61 @@ function write_product_packages() {
|
|||
# note that this is not an append operation, and should
|
||||
# be executed first!
|
||||
#
|
||||
function write_header() {
|
||||
function write_blueprint_header() {
|
||||
if [ -f $1 ]; then
|
||||
rm $1
|
||||
fi
|
||||
|
||||
YEAR=$(date +"%Y")
|
||||
|
||||
[ "$COMMON" -eq 1 ] && local DEVICE="$DEVICE_COMMON"
|
||||
|
||||
printf "/**\n" > $1
|
||||
NUM_REGEX='^[0-9]+$'
|
||||
if [[ ! $INITIAL_COPYRIGHT_YEAR =~ $NUM_REGEX ]] || [ $INITIAL_COPYRIGHT_YEAR -lt 2019 ]; then
|
||||
BLUEPRINT_INITIAL_COPYRIGHT_YEAR=2019
|
||||
else
|
||||
BLUEPRINT_INITIAL_COPYRIGHT_YEAR=$INITIAL_COPYRIGHT_YEAR
|
||||
fi
|
||||
|
||||
if [ $BLUEPRINT_INITIAL_COPYRIGHT_YEAR -eq $YEAR ]; then
|
||||
printf " * Copyright (C) $YEAR The LineageOS Project\n" >> $1
|
||||
elif [ $BLUEPRINT_INITIAL_COPYRIGHT_YEAR -le 2019 ]; then
|
||||
printf " * Copyright (C) 2019-$YEAR The LineageOS Project\n" >> $1
|
||||
else
|
||||
printf " * Copyright (C) $BLUEPRINT_INITIAL_COPYRIGHT_YEAR-$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.
|
||||
* 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.
|
||||
*
|
||||
* This file is generated by device/$VENDOR/$DEVICE/setup-makefiles.sh
|
||||
*/
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
#
|
||||
# write_makefile_header:
|
||||
#
|
||||
# $1: file which will be written to
|
||||
#
|
||||
# writes out the copyright header with the current year.
|
||||
# note that this is not an append operation, and should
|
||||
# be executed first!
|
||||
#
|
||||
function write_makefile_header() {
|
||||
if [ -f $1 ]; then
|
||||
rm $1
|
||||
fi
|
||||
|
@ -745,12 +800,12 @@ EOF
|
|||
# $1: devices falling under common to be added to guard - optional
|
||||
# $2: custom guard - optional
|
||||
#
|
||||
# Calls write_header for each of the makefiles and creates
|
||||
# the initial path declaration and device guard for the
|
||||
# Android.mk
|
||||
# Calls write_makefile_header for each of the makefiles and
|
||||
# write_blueprint_header for Android.bp and creates the initial
|
||||
# path declaration and device guard for the Android.mk
|
||||
#
|
||||
function write_headers() {
|
||||
write_header "$ANDROIDMK"
|
||||
write_makefile_header "$ANDROIDMK"
|
||||
|
||||
GUARD="$2"
|
||||
if [ -z "$GUARD" ]; then
|
||||
|
@ -777,8 +832,22 @@ ifneq (\$(filter $1,\$($GUARD)),)
|
|||
EOF
|
||||
fi
|
||||
|
||||
write_header "$BOARDMK"
|
||||
write_header "$PRODUCTMK"
|
||||
write_makefile_header "$BOARDMK"
|
||||
write_makefile_header "$PRODUCTMK"
|
||||
write_blueprint_header "$ANDROIDBP"
|
||||
|
||||
cat << EOF >> "$ANDROIDBP"
|
||||
soong_namespace {
|
||||
}
|
||||
|
||||
EOF
|
||||
|
||||
[ "$COMMON" -eq 1 ] && local DEVICE="$DEVICE_COMMON"
|
||||
cat << EOF >> "$PRODUCTMK"
|
||||
PRODUCT_SOONG_NAMESPACES += \\
|
||||
vendor/$VENDOR/$DEVICE
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
#
|
||||
|
@ -881,7 +950,7 @@ function parse_file_list() {
|
|||
# $2: make treble compatible makefile - optional
|
||||
#
|
||||
# Calls write_product_copy_files and write_product_packages on
|
||||
# the given file and appends to the Android.mk as well as
|
||||
# the given file and appends to the Android.bp as well as
|
||||
# the product makefile.
|
||||
#
|
||||
function write_makefiles() {
|
||||
|
|
Loading…
Reference in a new issue