-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·50 lines (42 loc) · 1.85 KB
/
run.sh
File metadata and controls
executable file
·50 lines (42 loc) · 1.85 KB
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
47
48
49
50
#!/bin/sh
rm -rf build
# define parameters
TARGET_WORKSPACE="$(pwd)/build" # 10 GB of free space should be sufficient, probably less
TARGET_DEBIAN_VERSION="stretch" # stretch or buster
TARGET_OPENJDK_VERSION="11" # 9, 10, 12, 13, 14 - retired, may not be working
# 11, 15 - most likely working
# loom or tip - experimental, may be broken
# clone repository
# git clone https://github.com/ev3dev-lang-java/openjdk-ev3.git
# cd openjdk-ev3
# prepare working directory
mkdir -p "$TARGET_WORKSPACE"
chmod -R 777 "$TARGET_WORKSPACE" # docker may not share UID with the current user
# build base system container
docker build --build-arg DEBIAN_RELEASE="$TARGET_DEBIAN_VERSION" \
--build-arg ARCH="armel" \
--tag "ev3dev-lang-java:jdk-cross-$TARGET_DEBIAN_VERSION" \
--file ./system/Dockerfile.cross \
./system
# on top of that, create a build scripts container
docker build --build-arg commit="$(git rev-parse HEAD)" \
--build-arg extra="Manual build by $(whoami)" \
--build-arg DEBIAN_RELEASE="$TARGET_DEBIAN_VERSION" \
--build-arg BUILD_TYPE="cross" \
--tag "ev3dev-lang-java:jdk-cross-build" \
./scripts
# now run the build
docker run --rm \
--interactive \
--tty \
--volume "$TARGET_WORKSPACE:/build" \
--env JDKVER="$TARGET_OPENJDK_VERSION" \
--env JDKVM="client" \
--env JDKPLATFORM="ev3" \
--env JDKDEBUG="release" \
--env AUTOBUILD="1" \
ev3dev-lang-java:jdk-cross-build
# finally, make workspace accessible for all users (i.e. current one too) and list files in its root
chmod -R 777 "$TARGET_WORKSPACE"
# and list the output directory (now it should contain three *-ev3.tar.gz files)
ls "$TARGET_WORKSPACE"