Merge branch 'version_1_0' of github.com:QuasarApp/Console-QtDeployer into version_1_0

This commit is contained in:
a.yankovich 2018-09-24 11:20:34 +03:00
commit f2b8ea7f41
9 changed files with 124 additions and 11 deletions

12
.gitignore vendored
View File

@ -8,6 +8,7 @@
*.so
*.dll
*.dylib
*.snap
# Qt-es
object_script.*.Release
@ -29,6 +30,9 @@ ui_*.h
Makefile*
*build-*
build/*
stage/*
prime/*
parts/*
# Qt unit tests
target_wrapper.*
@ -42,3 +46,11 @@ target_wrapper.*
# QtCreator CMake
CMakeLists.txt.user*
snap/\.snapcraft/
\.buildconfig
sharedQt/
staticQt/

View File

@ -36,4 +36,8 @@ HEADERS += \
QMAKE_LFLAGS += -Wl,-rpath,"'$$DESTDIR'"
DISTFILES += \
../README.md
../snapBuild.sh \
../staticBuild.sh \
../snap/snapcraft.yaml \
../README.md \
../sharedBuild.sh

View File

@ -88,13 +88,13 @@ bool Deploy::createRunScript() {
QString content =
"#!/bin/sh\n"
"BASEDIR=$(dirname $0)\n"
"BASE_DIR=$(dirname \"$(readlink -f \"$0\")\")\n"
"export LD_LIBRARY_PATH=$BASEDIR/lib:$BASEDIR:$LD_LIBRARY_PATH\n"
"export QML_IMPORT_PATH=$BASEDIR/qml:QML_IMPORT_PATH\n"
"export QML2_IMPORT_PATH=$BASEDIR/qml:QML2_IMPORT_PATH\n"
"export QT_PLUGIN_PATH=$BASEDIR/plugins:QT_PLUGIN_PATH\n"
"export QT_QPA_PLATFORM_PLUGIN_PATH=$BASEDIR/plugins/platforms:QT_QPA_PLATFORM_PLUGIN_PATH\n"
"$BASEDIR/%1 \"$@\"";
".$BASEDIR/%1 \"$@\"";
content = content.arg(QFileInfo(target).fileName());

View File

@ -15,7 +15,7 @@
void help() {
qInfo() << "";
qInfo() << "Usage: CDQ <-bin [params]> [options]";
qInfo() << "Usage: cqtdeployer <-bin [params]> [options]";
qInfo() << "";
qInfo() << "Options:";
qInfo() << " help / h : show help.";
@ -35,20 +35,31 @@ void help() {
qInfo() << " -libDir [list,params] : set additional path for extralib of app.";
qInfo() << " | for example -libDir ~/myLib,~/newLibs";
qInfo() << " -extraPlugin[list,params]: set additional path for extraPlugin of app";
qInfo() << " verbose : show debug log";
qInfo() << "";
qInfo() << "Example: CDQ -bin myApp -qmlDir ~/Qt/5.11.1/gcc_64/qml -qmake ~/Qt/5.11.1/gcc_64/bin/qmake clear";
qInfo() << "Example (only C libs): CDQ -bin myApp clear";
qInfo() << "Example: cqtdeployer -bin myApp -qmlDir ~/Qt/5.11.1/gcc_64/qml -qmake ~/Qt/5.11.1/gcc_64/bin/qmake clear";
qInfo() << "Example (only C libs): cqtdeployer -bin myApp clear";
}
void verboseLog(const QString& str) {
if (QuasarAppUtils::isEndable("verbose")) {
qDebug() << str;
}
}
bool parseQt(Deploy& deploy) {
auto bin = QuasarAppUtils::getStrArg("bin");
QFileInfo info(bin);
if (!info.isFile()) {
verboseLog(QDir::homePath());
verboseLog(QDir("./").absolutePath());
verboseLog("bin file is not file path: " + bin);
return false;
}

View File

@ -14,7 +14,7 @@ Key differences of this program:
### How to use
#### Usage: CQtDeployer <-bin [params]> [options]
#### Usage: cqtdeployer <-bin [params]> [options]
#### Options:
| Option | Descriptiion |
@ -39,7 +39,7 @@ Key differences of this program:
#### Example: CQtDeployer -bin myApp -qmlDir ~/Qt/5.11.1/gcc_64/qml -qmake ~/Qt/5.11.1/gcc_64/bin/qmake clear
#### Example: cqtdeployer -bin myApp -qmlDir ~/Qt/5.11.1/gcc_64/qml -qmake ~/Qt/5.11.1/gcc_64/bin/qmake clear
@ -69,7 +69,7 @@ Console QtDeployer является консольной реализацией
##### Данный проект преднозначен для сборки проектов состоящих всего из одного pro файла, если вам необходимо собрать крупный проект то вам нужно воспользоватся нашим [шаблоном](https://quasarapp.github.io/QtDeployTemplate/) для сборки и развертывания qt приложений
### Как использовать
#### пример : CQtDeployer <-bin [params]> [options]
#### пример : cqtdeployer <-bin [params]> [options]
#### Options:
| Option | Descriptiion |
@ -93,7 +93,7 @@ Console QtDeployer является консольной реализацией
| -extraPlugin [list,params] | установить дополнительный путь для extraPlugin приложения |
#### Пример: CQtDeployer -bin myApp -qmlDir ~/Qt/5.11.1/gcc_64/qml -qmake ~/Qt/5.11.1/gcc_64/bin/qmake clear
#### Пример: cqtdeployer -bin myApp -qmlDir ~/Qt/5.11.1/gcc_64/qml -qmake ~/Qt/5.11.1/gcc_64/bin/qmake clear
## Build для Linux
- qmake & make или установите qtcreator и соберите проект с qt5.9 или выше.

2
qtBase

@ -1 +1 @@
Subproject commit bd42e2f0cebb2fe8de77a054e9d30aa803749a61
Subproject commit b0dce506cc91c4b623eb323db7bbc18469e721c2

45
sharedBuild.sh Executable file
View File

@ -0,0 +1,45 @@
#!/bin/bash
declare -a QTLIBS
BASE_DIR=$(dirname "$(readlink -f "$0")")
QTLIBS=( libQt5Sql.so libQt5Xml.so libQt5Core.so libQt5Test.so libQt5Network.so libQt5Concurrent.so)
make clean
find $BASE_DIR -type f -name 'Makefile' -exec rm {} \;
cd $BASE_DIR/qtBase
for var in "${QTLIBS[@]}"
do
if [ -e "$BASE_DIR/sharedQt/lib/$var" ]
then
echo "$var - ok"
else
echo "$var - not exits!. rebuild qt ..."
rm -rdf $BASE_DIR/sharedQt
git clean -xdf
./configure -confirm-license -prefix $BASE_DIR/sharedQt -release -shared -no-opengl -no-openssl -opensource -nomake tests -nomake examples -no-gui -no-widgets -no-dbus -no-accessibility
make install -j$(nproc)
break
fi
done
cd ..
rm -rdf $BASE_DIR/build
export PATH=$PATH:$BASE_DIR/sharedQt
$BASE_DIR/sharedQt/bin/qmake CQtDeployer.pro
make -j$(nproc)
strip build/*
chmod +x $BASE_DIR/build/CQtDeployer
$BASE_DIR/build/CQtDeployer -runScript cqtdeployer.sh -bin $BASE_DIR/build/CQtDeployer -qmake $BASE_DIR/sharedQt/bin/qmake
cd $BASE_DIR/build
tar -czvf $BASE_DIR/build/cqtdeployer.tar.gz ./*
cd $BASE_DIR
rm $BASE_DIR/build/lib -rdf $BASE_DIR/build/*.so* $BASE_DIR/build/*.sh*

28
snap/snapcraft.yaml Normal file
View File

@ -0,0 +1,28 @@
name: cqtdeployer # you probably want to 'snapcraft register <name>'
version: '1.0.1' # just for humans, typically '1.2+git' or '1.3.2'
summary: deploy your qt projects # 79 char long summary
description: |
Console app for deploy qt libs.
Key differences of this program
Performance-this program deploys the application several times faster (up to 10 seconds)
Flexibility-this application has flags that will help you configure the deployment as you need and your project
grade: stable # must be 'stable' to release into candidate/stable channels
confinement: strict # use 'strict' once you have the right plugs and slots
base: core18
apps:
cqtdeployer:
command: desktop-launch $SNAP/CQtDeployer
plugs: [home, removable-media]
parts:
cqtdeployer:
# See 'snapcraft plugins'
plugin: dump
source: build
after: [desktop-glib-only]

13
snapBuild.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
BASE_DIR=$(dirname $0)
echo "clean build dir"
rm -rfd $BASE_DIR/build
echo "Start static build"
$BASE_DIR/staticBuild.sh
snapcraft clean cqtdeployer -s pull
snapcraft