-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild
More file actions
executable file
·46 lines (37 loc) · 1000 Bytes
/
Copy pathbuild
File metadata and controls
executable file
·46 lines (37 loc) · 1000 Bytes
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
#!/usr/bin/env bash
set -eo pipefail
shopt -s expand_aliases
layers_dir=$1
plan_path=$3
# shellcheck source=/dev/null
. generate-project.sh "${layers_dir}"
# shellcheck source=/dev/null
. generate-layers.sh "${layers_dir}"
generate_deps_layer build-deps
generate_deps_layer run-deps
# 2. install go
generate_stack_layer java "${plan_path}" true
# shellcheck source=/dev/null
. init-stack
# 3. MAKE CACHE LAYER, RUN BUILD
# 1. GET ARGS
bp_dir=$(
cd "$(dirname "$0")"/..
pwd
)
build_choice="maven"
if [ -f pom.xml ] && [ -f gradlew ]; then
if [[ -f .build-choice ]]; then
build_choice=$(tr <.build-choice -d '[:space:]')
fi
elif [ -f pom.xml ] && [ ! -f gradlew ]; then
build_choice="maven"
elif [ -f gradlew ] && [ ! -f pom.xml ]; then
build_choice="gradle"
fi
if [ "${build_choice}" == "maven" ]; then
"$bp_dir/lib/maven_build" "${layers_dir}"
elif [ "${build_choice}" == "gradle" ]; then
"$bp_dir/lib/gradle_build" "${layers_dir}"
fi
generate-launch.sh "${layers_dir}"