From 22a033a4c16027b380cda2598eae27370529993f Mon Sep 17 00:00:00 2001 From: Alejandro R Mosteo Date: Fri, 14 May 2021 13:22:11 +0200 Subject: [PATCH] Add gitpod-enabling files (#735) * Files to provide GNAT on Gitpod * Add alr to path * Add VSCode task to run the testsuite * Set explicit project file in VSCode so ALS works * Add task to just compile current file --- .gitignore | 3 ++- .gitpod.Dockerfile | 30 ++++++++++++++++++++++++++++++ .gitpod.yml | 6 ++++++ .vscode/settings.json | 3 +++ .vscode/tasks.json | 18 ++++++++++++++++++ scripts/gnat_install.qs | 36 ++++++++++++++++++++++++++++++++++++ 6 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 .gitpod.Dockerfile create mode 100644 .gitpod.yml create mode 100644 .vscode/settings.json create mode 100644 scripts/gnat_install.qs diff --git a/.gitignore b/.gitignore index ecb82d05..dad9a345 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,5 @@ obj stress/*/ venv -testsuite/out +out/ +testsuite/out/ diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile new file mode 100644 index 00000000..f59a99d5 --- /dev/null +++ b/.gitpod.Dockerfile @@ -0,0 +1,30 @@ +FROM gitpod/workspace-base:latest +ENV PATH=$HOME/gnat/bin:$PATH:/workspace/alire/bin\ + GPR_PROJECT_PATH=/home/gitpod/adalib/share/gpr + +COPY scripts/gnat_install.qs /tmp/ + +RUN sudo apt-get update \ + && sudo apt-get install -y \ + libx11-xcb1 \ + python3 python3-pip \ + && curl -SL https://community.download.adacore.com/v1/a639696a9fd3bdf0be21376cc2dc3129323cbe42?filename=gnat-2020-20200818-x86_64-linux-bin \ + --output /tmp/gnat-2020-20200818-x86_64-linux-bin \ + && chmod +x /tmp/gnat-2020-20200818-x86_64-linux-bin \ + && /tmp/gnat-2020-20200818-x86_64-linux-bin \ + --platform minimal --script /tmp/gnat_install.qs InstallPrefix=$HOME/gnat \ + && gprinstall --uninstall gpr \ + && gprinstall --uninstall aunit \ + && gprinstall --uninstall aws \ + && gprinstall --uninstall gnatcoll \ + && sh -c "rm -rvf /opt/gnat/maintenancetool*" \ + && rm -rf $HOME/gnat/share/doc \ + && rm -rf $HOME/gnat/share/examples \ + && rm -rf $HOME/gnat/share/gps \ + && rm -rf $HOME/gnat/share/man \ + && find $HOME/gnat/ -type d -empty -delete \ + && rm -rf /tmp/gnat-2020-20200818-x86_64-linux-bin \ + && sudo apt-get purge -y --auto-remove libx11-xcb1 \ + && sudo apt-get clean \ + && sudo rm -rf /var/lib/apt/lists/* \ + && sudo /usr/bin/pip3 install e3-testsuite diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 00000000..e44c9a71 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,6 @@ +image: + file: .gitpod.Dockerfile + +vscode: + extensions: + - adacore.ada@22.0.5:b56gZDvQ5KBm6u34IBzm1g== diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..4ce017bc --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "ada.projectFile": "alr_env.gpr" +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json index e42e33fd..ca6cb8f5 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -13,6 +13,14 @@ "isDefault": true } }, + { + "type": "shell", + "command": "gprbuild -ws -c -f -s -u -P alr_env.gpr ${file}", + "problemMatcher": [ + "$ada" + ], + "label": "Alire: Compile current file", + }, { "type": "shell", "command": "gprclean -r -P alr_env.gpr", @@ -20,6 +28,16 @@ "$ada" ], "label": "Alire: Clean all projects", + }, + { + "type": "shell", + "command": "/usr/bin/python3 testsuite/run.py", + "problemMatcher": [], + "label": "Alire: Run testsuite", + "group": { + "kind": "test", + "isDefault": true + } } ] } \ No newline at end of file diff --git a/scripts/gnat_install.qs b/scripts/gnat_install.qs new file mode 100644 index 00000000..9d9ffaea --- /dev/null +++ b/scripts/gnat_install.qs @@ -0,0 +1,36 @@ +function Controller() { + installer.setValue("TargetDir", installer.value("InstallPrefix")); + installer.autoRejectMessageBoxes(); + installer.installationFinished.connect(function() { + gui.clickButton(buttons.NextButton); + }) +} + +Controller.prototype.ComponentSelectionPageCallback = function() +{ + var page = gui.currentPageWidget(); + + page.deselectAll(); + page.selectComponent("com.adacore.gnat"); + gui.clickButton(buttons.NextButton); +} + +Controller.prototype.LicenseAgreementPageCallback = function() +{ + var page = gui.pageById(QInstaller.LicenseCheck); + + page.AcceptLicenseRadioButton.click(); + gui.clickButton(buttons.NextButton); +} + +Controller.prototype.IntroductionPageCallback = +Controller.prototype.TargetDirectoryPageCallback = +Controller.prototype.ReadyForInstallationPageCallback = function() +{ + gui.clickButton(buttons.NextButton); +} + +Controller.prototype.FinishedPageCallback = function() +{ + gui.clickButton(buttons.FinishButton); +} -- 2.39.5