diff --git a/ci/.gitlab-ci.yml b/ci/.gitlab-ci.yml new file mode 100644 index 0000000000..92200a8d8e --- /dev/null +++ b/ci/.gitlab-ci.yml @@ -0,0 +1,43 @@ +# gitlab CI config file + +# this image is on dockerhub. Dockerfile is here: https://gitlab.com/PrzemoF/FreeCAD/-/blob/gitlab-v1/ci/Dockerfile +image: freecadci/runner + +stages: # List of stages for jobs, and their order of execution + - build + - test + +before_script: + - apt-get update -yqq + # CCache Config + - mkdir -p ccache + - export CCACHE_BASEDIR=${PWD} + - export CCACHE_DIR=${PWD}/ccache + +cache: + paths: + - ccache/ + +build-job: # This job runs in the build stage, which runs first. + stage: build + + script: + - echo "Compiling the code..." + - mkdir build + - cd build + - ccache cmake ../ + - ccache cmake --build ./ -j$(nproc) + - echo "Compile complete." + + artifacts: + paths: + - build/ + +test-job: # This job runs in the test stage. + stage: test # It only starts when the job in the build stage completes successfully. + script: + - echo "Running unit tests... " + - cd build/bin/ + # Testing currently doesn't work due to problems with libraries ot being visible by the binary. + - ./FreeCADCmd -t 0 + diff --git a/ci/Dockerfile b/ci/Dockerfile new file mode 100644 index 0000000000..fb5196ed4d --- /dev/null +++ b/ci/Dockerfile @@ -0,0 +1,118 @@ +FROM ubuntu:20.04 +MAINTAINER Przemo Firszt +# This is the docker image definition used to build FreeCAD. It's currently accessible on: +# https://hub.docker.com/repository/docker/freecadci/runner +# on under name freecadci/runner when using docker + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update -y +RUN apt-get update -y && apt-get install -y gnupg2 +RUN echo "deb http://ppa.launchpad.net/freecad-maintainers/freecad-daily/ubuntu focal main" >> /etc/apt/sources.list.d/freecad-daily.list +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 83193AA3B52FF6FCF10A1BBF005EAE8119BB5BCA +RUN apt-get update -y + +# those 3 are for debugging purposes only. Not required to build FreeCAD +RUN apt-get install -y \ + vim \ + nano \ + bash + +# Main set of FreeCAD dependencies. To be verified. +RUN apt-get install -y \ + ccache \ + cmake \ + debhelper \ + dh-exec \ + dh-python \ + doxygen \ + git \ + graphviz \ + libboost-date-time-dev \ + libboost-dev \ + libboost-filesystem-dev \ + libboost-filesystem1.71-dev \ + libboost-graph-dev \ + libboost-iostreams-dev \ + libboost-program-options-dev \ + libboost-program-options1.71-dev \ + libboost-python1.71-dev \ + libboost-regex-dev \ + libboost-regex1.71-dev \ + libboost-serialization-dev \ + libboost-system1.71-dev \ + libboost-thread-dev \ + libboost-thread1.71-dev \ + libboost1.71-dev \ + libcoin-dev \ + libdouble-conversion-dev \ + libeigen3-dev \ + libglew-dev \ + libgts-bin \ + libgts-dev \ + libkdtree++-dev \ + liblz4-dev \ + libmedc-dev \ + libmetis-dev \ + libnglib-dev \ + libocct-data-exchange-dev \ + libocct-ocaf-dev \ + libocct-visualization-dev \ + libopencv-dev \ + libproj-dev \ + libpyside2-dev \ + libqt5opengl5 \ + libqt5opengl5-dev \ + libqt5svg5-dev \ + libqt5webkit5 \ + libqt5webkit5-dev \ + libqt5x11extras5-dev \ + libqt5xmlpatterns5-dev \ + libshiboken2-dev \ + libspnav-dev \ + libvtk7-dev \ + libvtk7.1p \ + libvtk7.1p-qt \ + libx11-dev \ + libxerces-c-dev \ + libzipios++-dev \ + lsb-release \ + nastran \ + netgen \ + netgen-headers \ + occt-draw \ + pybind11-dev \ + pyqt5-dev-tools \ + pyside2-tools \ + python3-dev \ + python3-matplotlib \ + python3-pivy \ + python3-ply \ + python3-pyqt5 \ + python3-pyside2.* \ + python3-pyside2.qtcore \ + python3-pyside2.qtgui \ + python3-pyside2.qtsvg \ + python3-pyside2.qtuitools \ + python3-pyside2.qtwidgets \ + python3-pyside2.qtxml \ + python3-requests \ + python3-yaml \ + qt5-default \ + qt5-qmake \ + qtbase5-dev \ + qttools5-dev \ + qtwebengine5-dev \ + swig + +RUN apt-get update -y --fix-missing + +# Clean +RUN apt-get clean \ + && rm /var/lib/apt/lists/* \ + /usr/share/doc/* \ + /usr/share/locale/* \ + /usr/share/man/* \ + /usr/share/info/* -fR + + diff --git a/src/Mod/AddonManager/addonmanager_utilities.py b/src/Mod/AddonManager/addonmanager_utilities.py index e86fff54c2..cfb63ccbb6 100644 --- a/src/Mod/AddonManager/addonmanager_utilities.py +++ b/src/Mod/AddonManager/addonmanager_utilities.py @@ -266,8 +266,10 @@ def get_zip_url(baseurl): def get_readme_url(url): "Returns the location of a readme file" - if "github" in url or "framagit" in url or "gitlab" in url: + if "github" in url or "framagit" in url: return url+"/raw/master/README.md" + elif "gitlab" in url: + return url+"/-/raw/master/README.md" else: print("Debug: addonmanager_utilities.get_readme_url: Unknown git host:", url) return None diff --git a/src/Mod/Path/PathTests/TestPathDeburr.py b/src/Mod/Path/PathTests/TestPathDeburr.py index 2dcf446018..6d103e7ab0 100644 --- a/src/Mod/Path/PathTests/TestPathDeburr.py +++ b/src/Mod/Path/PathTests/TestPathDeburr.py @@ -52,7 +52,7 @@ class TestPathDeburr(PathTestUtils.PathTestBase): self.assertFalse(info) def test01(self): - '''Verify chamfer depth and offset for a 90° v-bit.''' + '''Verify chamfer depth and offset for a 90 deg v-bit.''' tool = Path.Tool() tool.FlatRadius = 0 tool.CuttingEdgeAngle = 90 @@ -68,7 +68,7 @@ class TestPathDeburr(PathTestUtils.PathTestBase): self.assertFalse(info) def test02(self): - '''Verify chamfer depth and offset for a 90° v-bit with non 0 flat radius.''' + '''Verify chamfer depth and offset for a 90 deg v-bit with non 0 flat radius.''' tool = Path.Tool() tool.FlatRadius = 0.3 tool.CuttingEdgeAngle = 90 @@ -84,7 +84,7 @@ class TestPathDeburr(PathTestUtils.PathTestBase): self.assertFalse(info) def test03(self): - '''Verify chamfer depth and offset for a 60° v-bit with non 0 flat radius.''' + '''Verify chamfer depth and offset for a 60 deg v-bit with non 0 flat radius.''' tool = Path.Tool() tool.FlatRadius = 10 tool.CuttingEdgeAngle = 60 diff --git a/src/Mod/Web/Gui/AppWebGui.cpp b/src/Mod/Web/Gui/AppWebGui.cpp index c665318dff..a82508b93d 100644 --- a/src/Mod/Web/Gui/AppWebGui.cpp +++ b/src/Mod/Web/Gui/AppWebGui.cpp @@ -27,6 +27,7 @@ # include # include # include +# include #endif #include @@ -63,7 +64,7 @@ public: add_varargs_method("openBrowserWindow",&Module::openBrowserWindow ); add_varargs_method("open",&Module::openBrowser, - "open(string)\n" + "open(htmlcode,baseurl,[title,iconpath])\n" "Load a local (X)HTML file." ); add_varargs_method("insert",&Module::openBrowser, @@ -99,8 +100,9 @@ private: { const char* HtmlCode; const char* BaseUrl; + const char* IconPath; char* TabName = nullptr; - if (! PyArg_ParseTuple(args.ptr(), "ss|et", &HtmlCode, &BaseUrl, "utf-8", &TabName)) + if (! PyArg_ParseTuple(args.ptr(), "ss|ets", &HtmlCode, &BaseUrl, "utf-8", &TabName, &IconPath)) throw Py::Exception(); std::string EncodedName = "Browser"; @@ -114,6 +116,8 @@ private: pcBrowserView->resize(400, 300); pcBrowserView->setHtml(QString::fromUtf8(HtmlCode),QUrl(QString::fromLatin1(BaseUrl))); pcBrowserView->setWindowTitle(QString::fromUtf8(EncodedName.c_str())); + if (IconPath) + pcBrowserView->setWindowIcon(QIcon(QString::fromUtf8(IconPath))); Gui::getMainWindow()->addWindow(pcBrowserView); if (!Gui::getMainWindow()->activeWindow()) Gui::getMainWindow()->setActiveWindow(pcBrowserView); diff --git a/src/Mod/Web/Gui/BrowserView.h b/src/Mod/Web/Gui/BrowserView.h index 67efacdceb..b36e505b32 100644 --- a/src/Mod/Web/Gui/BrowserView.h +++ b/src/Mod/Web/Gui/BrowserView.h @@ -97,7 +97,11 @@ public: bool onMsg(const char* pMsg,const char** ppReturn); bool onHasMsg(const char* pMsg) const; - bool canClose(void); + bool canClose (void); + +#ifdef QTWEBENGINE + void setWindowIcon(const QIcon &icon); +#endif protected Q_SLOTS: void onLoadStarted(); @@ -107,7 +111,6 @@ protected Q_SLOTS: void urlFilter(const QUrl &url); #ifdef QTWEBENGINE void onDownloadRequested(QWebEngineDownloadItem *request); - void setWindowIcon(const QIcon &icon); void onLinkHovered(const QString& url); #else void onDownloadRequested(const QNetworkRequest& request); diff --git a/src/Tools/WinVersion.py b/src/Tools/WinVersion.py index eb02f62229..0e15568759 100644 --- a/src/Tools/WinVersion.py +++ b/src/Tools/WinVersion.py @@ -26,7 +26,7 @@ def main(): output = a git = SubWCRev.GitControl() - if(git.extractInfo(input)): + if(git.extractInfo(input, "")): print(git.hash) print(git.branch) print(git.rev[0:4])