Skip to content

Commit ea23db9

Browse files
committed
Add automatic build
1 parent 3e9604b commit ea23db9

File tree

3 files changed

+50
-9
lines changed

3 files changed

+50
-9
lines changed

README.md

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,42 +16,62 @@ The output consists of these parts:
1616

1717
0. Clone/download this repo to your computer.
1818
1. Install [Docker](https://docs.docker.com/engine/installation/) for your operating system.
19-
2. Build the jdk cross-compilation environment:
19+
2. Build the jdk cross-compilation OS:
2020
```sh
2121
sudo docker build -t ev3dev-lang-java:jdk-stretch -f system/Dockerfile system
22+
```
23+
24+
### Semi-manual build
25+
3. Build the jdk cross-compilation environment:
26+
```sh
2227
sudo docker build -t ev3dev-lang-java:jdk-build -f scripts/Dockerfile scripts
2328
```
24-
3. Run the newly prepared container. You have to mount a host directory to the the `/build` directory in the container,
29+
4. Run the newly prepared container. You have to mount a host directory to the the `/build` directory in the container,
2530
otherwise the build would get discarded. The final build needs at least 6.5 GB of free space (in the build directory).
2631
```
27-
sudo docker run --rm -it -v <path on host, where the sources should be stored>:/build ev3dev-lang-java:jdk-build
32+
sudo docker run --rm -it -v $BUILD_DIRECTORY:/build ev3dev-lang-java:jdk-build
2833
```
29-
4. Select the OpenJDK version you want to cross-compile (select only one):
34+
Please change the `$BUILD_DIRECTORY` to a valid path.
35+
5. Select the OpenJDK version you want to cross-compile (select only one):
3036
```
3137
export JDKVER=9 # OpenJDK 9 with ARM32 JIT
3238
export JDKVER=9zero # OpenJDK 9 with Zero interpreter
3339
export JDKVER=10 # OpenJDK 10 with ARM32 JIT
3440
export JDKVER=10zero # OpenJDK 10 with Zero interpreter
3541
```
36-
5. Before we can start the build process, Boot JDK must be downloaded:
42+
6. Before we can start the build process, Boot JDK must be downloaded:
3743
```
3844
./prepare.sh
3945
```
40-
6. Now we can download the OpenJDK sources:
46+
7. Now we can download the OpenJDK sources:
4147
```
4248
./fetch.sh
4349
```
44-
7. The OpenJDK source tree should be ready. Now you can start the cross-build itself:
50+
8. The OpenJDK source tree should be ready. Now you can start the cross-build itself:
4551
```
4652
./build.sh
4753
```
48-
8. Create the zipped images:
54+
9. Create the zipped images:
4955
```
5056
./zip.sh
5157
```
52-
9. If the build was successful, JDK packages were created in `/build/jri-ev3.tar.gz`, `/build/jdk-ev3.tar.gz` and `/build/jmods.tar.gz`.
58+
10. If the build was successful, JDK packages were created in `/build/jri-ev3.tar.gz`, `/build/jdk-ev3.tar.gz` and `/build/jmods.tar.gz`.
5359
If you have mounted `/build`, you can access the files from the host.
5460

61+
### Automatic build
62+
3. Build the jdk cross-compilation environment:
63+
```sh
64+
sudo docker build -t ev3dev-lang-java:jdk-autobuild -f scripts/Dockerfile.autorun scripts
65+
```
66+
4. Run the newly prepared container. You have to mount a host directory to the the `/build` directory in the container,
67+
otherwise the build would get discarded. The final build needs at least 6.5 GB of free space (in the build directory).
68+
```
69+
sudo docker run --rm -it -v $BUILD_DIRECTORY:/build -e JDKVER='X' ev3dev-lang-java:jdk-autobuild
70+
```
71+
`X` can be one of `9`, `9zero`, `10` and `10zero`. Please change the `$BUILD_DIRECTORY` to a valid path.
72+
5. If the build was successful, JDK packages were created in `$BUILD_DIRECTORY/jri-ev3.tar.gz`, `$BUILD_DIRECTORY/jdk-ev3.tar.gz` and `$BUILD_DIRECTORY/jmods.tar.gz`.
73+
74+
5575
## ~~JShell on the EV3~~
5676

5777
No longer supported. JShell backend on the EV3 is a huge overkill.

scripts/Dockerfile.autorun

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM ev3dev-lang-java:jdk-stretch
2+
3+
# copy build patches & scripts
4+
COPY *.patch *.sh /opt/jdkcross/
5+
RUN chmod +x /opt/jdkcross/*.sh
6+
7+
# this directory should be mounted
8+
VOLUME /build
9+
10+
USER compiler
11+
WORKDIR /opt/jdkcross
12+
CMD ["/opt/jdkcross/autorun.sh"]

scripts/autorun.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
set -e
3+
4+
cd "$(dirname ${BASH_SOURCE[0]})"
5+
6+
./prepare.sh
7+
./fetch.sh
8+
./build.sh
9+
./zip.sh

0 commit comments

Comments
 (0)