-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
44 lines (37 loc) · 1010 Bytes
/
Dockerfile
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
FROM sparrowlang/sparrowdeps
# Copy the Sparrow source files
RUN mkdir /sparrow
RUN mkdir /sparrow/src
RUN mkdir /sparrow/externals
RUN mkdir /sparrow/unittests
RUN mkdir /sparrow/SparrowImplicitLib
COPY src /sparrow/src
COPY externals /sparrow/externals
COPY unittests /sparrow/unittests
COPY SparrowImplicitLib /sparrow/SparrowImplicitLib
COPY CMakeLists.txt /sparrow/
COPY Macros.cmake /sparrow/
COPY LICENSE /sparrow/
COPY .git /sparrow/.git
# Copy the test files
RUN mkdir /sparrow_tests
COPY tests /sparrow_tests
# Do the build
WORKDIR /sparrow
RUN mkdir /sparrow/build
WORKDIR /sparrow/build
RUN cmake ..
# Just make sure we don't copy this file
RUN rm -f ../src/SparrowFrontend/Grammar/parserIf.o
RUN cmake --build . -- -j4
RUN cmake --build . -- install
# Run the unit tests
WORKDIR /sparrow/build/bin
RUN ./SparrowUnitTests
# Ensure the newly installed libraries can be found
RUN ldconfig
# Test the build
WORKDIR /sparrow_tests
RUN python test.py
# Remove temporary files
RUN rm -rf /sparrow