diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..10be693d187eed44b2c816d12e486e251e5f036e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +/cmake-build-debug/ +/build/ +/build1/ +.vscode +.idea +CMakeUserPresets.json \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index fd9957b926a8c123392a74501b8176fc2f51c710..e9f50992556fb092c3fa08ef7f230e28931a05f9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,44 +1,42 @@ -FROM ubuntu:20.04 AS base +FROM ubuntu:20.04 AS base ENV TZ=Europe/Moscow RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone -RUN apt update -y -RUN apt install -y gcc -RUN apt install -y libpqxx-dev -RUN apt install -y clang-tidy -RUN apt install -y nlohmann-json3-dev -RUN apt install -y python3-pip -RUN apt install -y cppcheck -RUN apt install -y git -RUN apt-get update -y -RUN apt install -y xvfb -RUN pip install gcovr -RUN pip install cpplint +RUN apt update -y +RUN apt install -y gcc +RUN apt install -y libpqxx-dev +RUN apt install -y clang-tidy +RUN apt install -y python3-pip +RUN apt install -y cppcheck +RUN apt-get update +RUN apt install -y cmake +RUN apt-get update +RUN apt install -y libboost-all-dev +RUN apt install -y nlohmann-json3-dev +RUN apt install -y git +RUN apt install -y qt5-default +RUN apt-get update +RUN apt install -y default-jre +RUN apt -y install curl + +RUN pwd +WORKDIR /usr/local/lib +RUN curl -O https://www.antlr.org/download/antlr-4.12.0-complete.jar + +RUN apt install -y xvfb +RUN pip install gcovr +RUN pip install cpplint -RUN apt-get install wget -RUN apt-get install libssl-dev - -RUN wget https://github.com/Kitware/CMake/releases/download/v3.26.3/cmake-3.26.3.tar.gz -RUN tar -zxvf cmake-3.26.3.tar.gz -WORKDIR cmake-3.26.3 -RUN ./bootstrap -RUN make -RUN make install -RUN cd .. - -RUN wget https://boostorg.jfrog.io/artifactory/main/release/1.82.0/source/boost_1_82_0.tar.gz -RUN tar xvf boost_1_82_0.tar.gz -WORKDIR boost_1_82_0 -RUN ./bootstrap.sh --prefix=/usr/ -RUN ./b2 install RUN git clone https://github.com/google/googletest.git -b release-1.11.0 WORKDIR googletest/build -RUN cmake .. -DBUILD_GMOCK=OFF +RUN cmake .. -DBUILD_GMOCK=ON RUN make RUN make install WORKDIR /project -COPY . . \ No newline at end of file +COPY . . + +EXPOSE 8080 \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..b226212450fdf4c1bd5b97b6d5ae0fee95e16a6c --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +generate: + mkdir build + cmake -B build/ + +build-project: + cd ./build && make + +clean: + rm -rf build + +rebuild: clean generate build-project + +server-run: + ./build/server/cmd/Server + +test: + ctest --verbose --output-on-failure --test-dir build/ + +build-docker: + docker build . -f Dockerfile -t ddt-project + +dev: + docker run --rm -it \ + -v $(PWD):/project \ + --name app \ + ddt-project + +stop-docker: + docker stop app + + + diff --git a/server/cmd/main.cpp b/server/cmd/main.cpp index 938c0a187afb4bf8a911b1a1741b0c4a71b8c301..685eb7a8e7c7da901df422ac25fa976ec98eb1b5 100644 --- a/server/cmd/main.cpp +++ b/server/cmd/main.cpp @@ -4,7 +4,8 @@ int main(int argc, const char* argv[]) { // ifstream ins("/home/denis/2023_1_DDT/antlr/test.py"); - std::ifstream ins("/home/denis/2023_1_DDT/server/pkg/antlr/testprogs/python/test.py"); + std::ifstream ins( + "/home/denis/2023_1_DDT/server/pkg/antlr/testprogs/python/test.py"); PythonAntlr pA = PythonAntlr(ins); @@ -16,6 +17,7 @@ int main(int argc, const char* argv[]) { } std::cout << pA.getTreeString() << std::endl; + std::cout << "test" << std::endl; return 0; } \ No newline at end of file diff --git a/server/internal/entities/CMakeLists.txt b/server/internal/entities/CMakeLists.txt index 08858c7e652e13d26b92360cf52bc6e7511ffd54..7b6ad66178ab491134855e3b0327e11e56c73072 100644 --- a/server/internal/entities/CMakeLists.txt +++ b/server/internal/entities/CMakeLists.txt @@ -1,5 +1,3 @@ -cmake_minimum_required(VERSION 3.19) - project("EntitiesLib") set(LIB_NAME libEntities) diff --git a/server/pkg/antlr/CMakeLists.txt b/server/pkg/antlr/CMakeLists.txt index bcf317f298d02f11325809a319e4148d6e55d2a2..7c69be37d7d52cc9ecccdb2dfe49abfdb91b3b2d 100644 --- a/server/pkg/antlr/CMakeLists.txt +++ b/server/pkg/antlr/CMakeLists.txt @@ -10,6 +10,7 @@ set(THREADS_PREFER_PTHREAD_FLAG ON) include(ExternalAntlr4Cpp) include_directories(${ANTLR4_INCLUDE_DIRS}) + set(ANTLR_EXECUTABLE /usr/local/lib/antlr-4.12.0-complete.jar) find_package(ANTLR REQUIRED)