-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.functions
46 lines (36 loc) · 2.31 KB
/
build.functions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# This file is part of shellfire build. It is subject to the licence terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/shellfire-dev/build/master/COPYRIGHT. No part of shellfire build, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
# Copyright © 2014-2015 The developers of shellfire build. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/shellfire-dev/build/master/COPYRIGHT.
core_dependency_requires '*' rm mkdir
build_prepareOutput()
{
if [ -e "$build_outputPath" ]; then
if [ ! -d "$build_outputPath" ]; then
rm -rf "$build_outputPath" 2>/dev/null || sudo -p "Please enter the password for user %p to let root rm -rf '$build_outputPath': " rm -rf "$build_outputPath"
mkdir -m 0755 -p "$build_outputPath"
fi
else
mkdir -m 0755 -p "$build_outputPath"
fi
mkdir -m 0755 -p "$build_outputPath"/fattened
mkdir -m 0755 -p "$build_outputPath"/swaddled
}
core_dependency_requires '*' rm mkdir ln
build_fattenAndSwaddle()
{
local groupName="$1"
local repositoryPath="$2"
shift 2
local swaddlingPath="$repositoryPath"/swaddling
local bodyPath="$swaddlingPath"/"$groupName"/body
local fattenedOutputPath="$build_outputPath"/fattened/"$groupName"/all
core_message NOTICE "Fattening and swaddling '$groupName' from repository '$repositoryPath'"
rm -rf "$fattenedOutputPath" 2>/dev/null || sudo -p "Please enter the password for user %p to let root rm -rf '$fattenedOutputPath': " rm -rf "$fattenedOutputPath"
mkdir -m 0755 -p "${fattenedOutputPath}${build_binPath}"
core_message INFO "Symlinking body path to fattened output (make sure 'body' is in .gitignore)!"
rm -rf "$bodyPath"
ln -s "$fattenedOutputPath"/.. "$bodyPath"
local swaddledOutputPath="$build_outputPath"/swaddled/"$groupName"
mkdir -m 0755 -p "$swaddledOutputPath"
"$build_fattenPath" --verbose $(core_init_verbosity) --force --repository-path "$repositoryPath" --output-path "$fattenedOutputPath" --bin-path "$build_binPath" --ignore-dependencies -- "$@"
"$build_swaddlePath" --verbose $(core_init_verbosity) --swaddling-path "$swaddlingPath" --output-path "$swaddledOutputPath" --publish-github on --release-github on -- "$groupName"
}