From 89d0bc3bee4a0084ff3785d39d9a74a262a5e870 Mon Sep 17 00:00:00 2001 From: Paul Knopf Date: Thu, 11 Apr 2019 20:57:35 -0400 Subject: [PATCH] Removed the build steps that handles the Qt runtimes. They will be managed differently. --- build/appveyor.bat | 2 + build/scripts/Program.cs | 174 +---------------------------------- build/travis.linux.sh | 4 +- build/travis.osx.sh | 4 +- src/native/QmlNet/QmlNet.pro | 46 --------- src/native/build.bat | 2 +- src/native/build.sh | 2 +- 7 files changed, 11 insertions(+), 223 deletions(-) diff --git a/build/appveyor.bat b/build/appveyor.bat index 1e90bfc0..364d7877 100644 --- a/build/appveyor.bat +++ b/build/appveyor.bat @@ -3,5 +3,7 @@ set PATH=%PATH%;C:\qmlnet-qt\qt\bin set PATH=%PATH%;C:\qmlnet-qt\Tools\QtCreator\bin set PATH=%PATH%;%APPVEYOR_BUILD_FOLDER%\src\native\output +set QT_PLUGIN_PATH=C:\qmlnet-qt\qt\plugins +set QML2_IMPORT_PATH=C:\qmlnet-qt\qt\qml dotnet run -p ./build/scripts/Build.csproj -- ci \ No newline at end of file diff --git a/build/scripts/Program.cs b/build/scripts/Program.cs index bb0f4386..0b0c2f23 100644 --- a/build/scripts/Program.cs +++ b/build/scripts/Program.cs @@ -59,182 +59,10 @@ namespace Build if (IsWindows()) { RunShell($"{ExpandPath("./src/native/build.bat")}"); - - // The windows build currently brings in all the .dll's for packaging. - // However, it also brings in the *d.dll/*.pdb files. Let's remove them. - foreach(var file in GetFiles(ExpandPath("./src/native/output/"), recursive: true)) - { - if (file.EndsWith("d.dll")) - { - if(FileExists(file.Substring(0, file.Length - 5) + ".dll")) - { - // This is a debug dll. - DeleteFile(file); - } - } - else if (file.EndsWith(".pdb")) - { - DeleteFile(file); - } - else if (file.EndsWith("*.qmlc")) - { - DeleteFile(file); - } - } } else { - RunShell("src/native/build.sh"); - - if (IsOSX()) - { - // We deploy the entire Qt framework. Let's trim it down. - foreach(var directory in GetDirecories(ExpandPath("./src/native/output"), recursive:true)) - { - if (!DirectoryExists(directory)) - { - continue; - } - - var directoryName = Path.GetFileName(directory); - if (directoryName == "Headers") - { - DeleteDirectory(directory); - continue; - } - - if (directoryName.EndsWith(".dSYM")) - { - DeleteDirectory(directory); - continue; - } - - if (directory == "cmake") - { - DeleteDirectory(directory); - continue; - } - - if (directory == "pkgconfig") - { - DeleteDirectory(directory); - } - } - - foreach (var file in GetFiles(ExpandPath("./src/native/output"), recursive:true)) - { - var extension = Path.GetExtension(file); - var fileName = Path.GetFileNameWithoutExtension(file); - - if (fileName.EndsWith("_debug")) - { - DeleteFile(file); - continue; - } - - if (extension == ".prl") - { - DeleteFile(file); - continue; - } - - if (extension == ".plist") - { - DeleteFile(file); - continue; - } - - if (extension == ".qmlc") - { - DeleteFile(file); - continue; - } - - if (extension == ".cmake") - { - DeleteFile(file); - continue; - } - - if (extension == ".a") - { - DeleteFile(file); - continue; - } - - if (extension == ".la") - { - DeleteFile(file); - } - } - } - - if (IsLinux()) - { - // First get a list of all dependencies from every .so files. - var linkedFiles = new List(); - foreach(var file in GetFiles(ExpandPath("./src/native/output"), pattern:"*.so*", recursive:true)) - { - var lddOutput = ReadShell($"ldd {file}"); - foreach (var _line in lddOutput.Split(Environment.NewLine)) - { - var line = _line.TrimStart('\t').TrimStart('\n'); - var match = Regex.Match(line, @"(.*) =>.*"); - if (match.Success) - { - var linkedFile = match.Groups[1].Value; - if(!linkedFiles.Contains(linkedFile)) - { - linkedFiles.Add(linkedFile); - } - } - } - } - - // Let's remove any file from lib/ that isn't linked against anything. - foreach(var file in GetFiles(ExpandPath("./src/native/output/lib"), recursive:true)) - { - var fileName = Path.GetFileName(file); - if (!linkedFiles.Contains(fileName)) - { - DeleteFile(file); - } - } - - foreach (var directory in GetDirecories(ExpandPath("./src/native/output"), recursive: true)) - { - if (!DirectoryExists(directory)) - { - continue; - } - - var directoryName = Path.GetFileName(directory); - if (directoryName == "cmake") - { - DeleteDirectory(directory); - continue; - } - - if (directoryName == "pkgconfig") - { - DeleteDirectory(directory); - continue; - } - - Info(directory); - } - - foreach (var file in GetFiles(ExpandPath("./src/native/output"), recursive: true)) - { - var fileName = Path.GetFileName(file); - var fileExtension = Path.GetExtension(fileName); - - if (fileExtension == ".qmlc") - { - DeleteFile(file); - } - } - } + RunShell($"{ExpandPath("./src/native/build.sh")}"); } }); diff --git a/build/travis.linux.sh b/build/travis.linux.sh index 9800482a..b37b3079 100755 --- a/build/travis.linux.sh +++ b/build/travis.linux.sh @@ -9,6 +9,8 @@ mkdir -p $QT_DIR wget -O- -q https://github.com/qmlnet/qt-runtimes/releases/download/releases/qt-5.12.2-de3f7b1-linux-x64-dev.tar.gz | tar xpz -C $QT_DIR export PATH=$QT_DIR/qt/bin:$PATH -export LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/src/native/output +export LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/src/native/output:$QT_DIR/qt/lib +export QT_PLUGIN_PATH=$QT_DIR/qt/plugins +export QML2_IMPORT_PATH=$QT_DIR/qt/qml $TRAVIS_BUILD_DIR/build.sh ci \ No newline at end of file diff --git a/build/travis.osx.sh b/build/travis.osx.sh index 8d21cd29..d347032c 100755 --- a/build/travis.osx.sh +++ b/build/travis.osx.sh @@ -8,7 +8,9 @@ mkdir -p $QT_DIR wget -O- -q https://github.com/qmlnet/qt-runtimes/releases/download/releases/qt-5.12.2-de3f7b1-osx-x64-dev.tar.gz | tar xpz -C $QT_DIR export PATH=$QT_DIR/qt/bin:$PATH -export DYLD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/src/native/output +export DYLD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/src/native/output:$QT_DIR/qt/lib +export QT_PLUGIN_PATH=$QT_DIR/qt/plugins +export QML2_IMPORT_PATH=$QT_DIR/qt/qml # We need to source this script, so that DYLD_LIBRARY_PATH get's passed. . $TRAVIS_BUILD_DIR/build.sh ci \ No newline at end of file diff --git a/src/native/QmlNet/QmlNet.pro b/src/native/QmlNet/QmlNet.pro index 6778d79c..e944e2e5 100644 --- a/src/native/QmlNet/QmlNet.pro +++ b/src/native/QmlNet/QmlNet.pro @@ -17,49 +17,3 @@ include(QmlNet.pri) target.path = $$(PREFIX)/ INSTALLS += target - -CONFIG(install-qt-libs) { - win32 { - qtlibs.path = $$(PREFIX) - qtlibs.files = $$[QT_INSTALL_BINS]/*.dll - INSTALLS += qtlibs - - qtplugins.path = $$(PREFIX)/plugins - qtplugins.files = $$[QT_INSTALL_PLUGINS]/* - INSTALLS += qtplugins - - qtqml.path = $$(PREFIX)/qml - qtqml.files = $$[QT_INSTALL_QML]/* - INSTALLS += qtqml - } - macx { - qtlibs.path = $$(PREFIX)/lib - qtlibs.files = $$[QT_INSTALL_LIBS]/* - INSTALLS += qtlibs - - qtplugins.path = $$(PREFIX)/plugins - qtplugins.files = $$[QT_INSTALL_PLUGINS]/* - INSTALLS += qtplugins - - qtqml.path = $$(PREFIX)/qml - qtqml.files = $$[QT_INSTALL_QML]/* - INSTALLS += qtqml - - QMAKE_RPATHDIR += @loader_path/lib - } - unix:!macx { - qtlibs.path = $$(PREFIX)/lib - qtlibs.files = $$[QT_INSTALL_LIBS]/* - INSTALLS += qtlibs - - qtplugins.path = $$(PREFIX)/plugins - qtplugins.files = $$[QT_INSTALL_PLUGINS]/* - INSTALLS += qtplugins - - qtqml.path = $$(PREFIX)/qml - qtqml.files = $$[QT_INSTALL_QML]/* - INSTALLS += qtqml - - QMAKE_RPATHDIR = $ORIGIN/lib - } -} diff --git a/src/native/build.bat b/src/native/build.bat index f129ec14..58c9ccc6 100644 --- a/src/native/build.bat +++ b/src/native/build.bat @@ -7,7 +7,7 @@ mkdir %BATCHDIR%output cd %BATCHDIR%build set PREFIX=%BATCHDIR%output -qmake ../QmlNet CONFIG+=install-qt-libs +qmake ../QmlNet jom jom install diff --git a/src/native/build.sh b/src/native/build.sh index e0bc2109..152f53d5 100755 --- a/src/native/build.sh +++ b/src/native/build.sh @@ -8,6 +8,6 @@ OUTPUT_DIR=$DIR/output mkdir -p $BUILD_DIR cd $BUILD_DIR -PREFIX=$OUTPUT_DIR qmake ../QmlNet CONFIG+=install-qt-libs +PREFIX=$OUTPUT_DIR qmake ../QmlNet make make install