Build c#, D, and Java in same docker container.
@@ -16,39 +16,31 @@ WORKDIR /tinyspline
END
)
-# Expects that the artifact is located at /tinyspline/dist/
-COPY_ARTIFACT_AND_DELETE() {
+# Expects that the artifacts are located at /tinyspline/dist/
+COPY_ARTIFACTS_AND_DELETE() {
CONTAINER_ID=$(docker ps -aqf "name=${1}")
docker cp "${CONTAINER_ID}":/tinyspline/dist/. ${DIST_DIR}
docker rm "${CONTAINER_ID}"
docker rmi "${REPOSITORY}:${1}"
}
-##################################### C# ######################################
-NAME="mono"
+################################# C#, D, Java #################################
+NAME="misc"
docker build -t "${REPOSITORY}:${NAME}" -f - ${ROOT_DIR} <<-END
- FROM gcc:7
+ FROM buildpack-deps:stretch
${STRETCH_SETUP_CMDS}
- RUN apt-get install -y --no-install-recommends mono-mcs nuget
+ RUN apt-get install -y --no-install-recommends mono-mcs nuget dub default-jdk maven
END
docker run --name "${NAME}" "${REPOSITORY}:${NAME}" \
- /bin/bash -c "cmake -DTINYSPLINE_ENABLE_CSHARP=True . && \
+ /bin/bash -c "mkdir -p dist && cmake \
+ -DTINYSPLINE_ENABLE_CSHARP=True \
+ -DTINYSPLINE_ENABLE_DLANG=True \
+ -DTINYSPLINE_ENABLE_JAVA=True . && \
cmake --build . --target tinysplinecsharp && \
- nuget pack && mkdir dist && mv ./*.nupkg dist/"
- COPY_ARTIFACT_AND_DELETE ${NAME}
-
-###################################### D ######################################
-NAME="dlang"
-docker build -t "${REPOSITORY}:${NAME}" -f - ${ROOT_DIR} <<-END
- FROM gcc:7
- ${STRETCH_SETUP_CMDS}
- RUN apt-get install -y --no-install-recommends
- END
-docker run --name "${NAME}" "${REPOSITORY}:${NAME}" \
- /bin/bash -c "cmake -DTINYSPLINE_ENABLE_DLANG=True . && \
- cmake --build . --target tinysplinedlang && \
- mkdir dist && mv ./lib/*.d dist/ && mv ./lib/*tinysplinedlang* dist/"
- COPY_ARTIFACT_AND_DELETE ${NAME}
+ nuget pack && mv ./*.nupkg dist/ && \
+ dub build && tar cJf dist/tinysplinedlang.linux-x86_64.tar.xz dub && \
+ mvn package && mv ./target/*.jar dist/"
+ COPY_ARTIFACTS_AND_DELETE ${NAME}
################################### Python ####################################
BUILD_PYTHON() {
@@ -60,7 +52,7 @@ BUILD_PYTHON() {
docker run --name "${NAME}" "${REPOSITORY}:${NAME}" \
/bin/bash -c "cmake -DTINYSPLINE_ENABLE_PYTHON=True . && \
python setup.py bdist_wheel"
- COPY_ARTIFACT_AND_DELETE ${NAME}
+ COPY_ARTIFACTS_AND_DELETE ${NAME}
}
BUILD_PYTHON 2.7
