diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c50f923 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +tools/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..50fa267 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,9 @@ +[submodule "dformat"] + path = dformat + url = https://github.com/dlang-community/dfmt.git +[submodule "dcd"] + path = dcd + url = https://github.com/dlang-community/DCD.git +[submodule "dscanner"] + path = dscanner + url = https://github.com/dlang-community/D-Scanner.git diff --git a/README.md b/README.md index d355037..07cd95a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ # d-setup -Setup D language development environment for linux in a janky fashion \ No newline at end of file +Setup D language development environment for linux in a janky fashion + +Will setup DMD and LDC compilers (Can be found in ~/dlang) + +Will build DCD, DFormat, DScanner tools for use in jetbrains IDE (can be found in ./tools) diff --git a/dcd b/dcd new file mode 160000 index 0000000..27b1042 --- /dev/null +++ b/dcd @@ -0,0 +1 @@ +Subproject commit 27b1042959c4d1a27787cf502da14970ab821149 diff --git a/dformat b/dformat new file mode 160000 index 0000000..0ea0572 --- /dev/null +++ b/dformat @@ -0,0 +1 @@ +Subproject commit 0ea0572e86a270bb2d146e3609fbb72c624d32d0 diff --git a/dscanner b/dscanner new file mode 160000 index 0000000..796d212 --- /dev/null +++ b/dscanner @@ -0,0 +1 @@ +Subproject commit 796d212b05b3178e4c28e68fb4942e14751613e9 diff --git a/setup.sh b/setup.sh new file mode 100755 index 0000000..699ad57 --- /dev/null +++ b/setup.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +ACCENT='\033[1;32m' +NC='\033[0m' # No Color + +# Update submodules +echo -e "${ACCENT}Updating submodules${NC}\n" +git pull --recurse-submodules +git submodule update --init --recursive + +# Setup compilers and activate DMD +echo -e "\n${ACCENT}Setting up compilers${NC}\n" + +curl -fsS https://dlang.org/install.sh | bash -s dmd +curl -fsS https://dlang.org/install.sh | bash -s ldc + +DMDDIR=$(ls -d ~/dlang/dmd-*/ | head -1) + +echo -e "\n${ACCENT}Activating DMD with ${DMDDIR}${NC}\n" +source $DMDDIR/activate +dmd --version + +# Build tools + +mkdir -p ./tools + +echo -e "\n${ACCENT}Building Tools${NC}" +echo -e "\n${ACCENT} - DFormat${NC}\n" +cd dformat +make +mv -f ./bin/dfmt ../tools/dfmt + +echo -e "\n${ACCENT} - D-Scanner${NC}\n" +cd ../dscanner +make +mv -f ./bin/dscanner ../tools/dscanner + +echo -e "\n${ACCENT} - DCD${NC}\n" +cd ../dcd +make +mv -f ./bin/dcd-client ../tools/dcd-client +mv -f ./bin/dcd-server ../tools/dcd-server + +echo -e "\n${ACCENT}Complete"