Skip to content

Commit

Permalink
fix install dlls and online update for windows, format and lint code
Browse files Browse the repository at this point in the history
* install dlls on bin, and compiler-specific libraries (#18)

* use the latest common scripts and dependencies

* added qmllint and codeformat actions
  • Loading branch information
EddyTheCo authored Apr 23, 2024
1 parent 98f92f9 commit eafe454
Show file tree
Hide file tree
Showing 15 changed files with 511 additions and 539 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/build-test-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,23 @@ on:
branches: [develop]
jobs:
build_test_package:
permissions: read-all
strategy:
matrix:
os: [ubuntu-latest,macos-latest,windows-latest]

uses: EddyTheCo/Common/.github/workflows/build-test-install.yml@v0.3.0
uses: EddyTheCo/Common/.github/workflows/build-test-install.yml@v0.4.0
with:
os: ${{ matrix.os }}
qtVersion: '6.6.0'
cmakeArgs: " -DQTDEPLOY=ON -DBUILD_EXAMPLES=ON -DCPACK_PACKAGE_CONTACT=estervtech@gmail.com -DREPO_URL=https://eddytheco.github.io/DateTimePickers -DCPACK_PACKAGE_VENDOR=estervtech"
qtModules: 'qtshadertools'
test: false
test: false
qmllint: ${{ startsWith(matrix.os, 'ubuntu') && startsWith(github.base_ref, 'develop') }}

build_doxygen:
if: startsWith(github.ref, 'refs/tags/v')
uses: EddyTheCo/Common/.github/workflows/build-docs.yml@v0.3.0
uses: EddyTheCo/Common/.github/workflows/build-docs.yml@v0.4.0

release:
if: startsWith(github.ref, 'refs/tags/v')
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/codeFormat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: codeFormat
run-name: Format code and do PR
on:
pull_request_target:
types: [closed]
branches: [develop]
jobs:
checkout-format-pr:
runs-on: ubuntu-latest
if: ${{ (github.event.pull_request.merged == true) && (startsWith(github.base_ref, 'develop')) }}
permissions:
contents: write
pull-requests: write
steps:

- name: checkout
uses: actions/checkout@v4

- name: Install dependencies on ubuntu
run: |
sudo apt-get update
sudo apt-get install clang-format
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
aqtversion: '==3.1.*'
version: '6.6.0'
host: 'linux'
target: 'desktop'
arch: 'gcc_64'

- name: Format code
run: |
rm aqtinstall.log
find . -regex '.*\.\(cpp\|hpp\|cu\|cuh\|c\|h\)' -exec clang-format -style=file -i {} \;
find . -regex '.*\.\(qml\)' -exec qmlformat -i {} \;
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6.0.4
with:
commit-message: C/C++/QML formatted code
branch: formattedCode
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
title: Fixed the format of your nice code
body: Every time you change the format, I am here to fix your mess.
35 changes: 35 additions & 0 deletions .github/workflows/qmllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: qmllintbot
run-name: Linting QML for PR
on:

workflow_run:
workflows: [push-build-release]
types:
- completed
jobs:
download-comment:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
permissions:
actions: read
pull-requests: write
steps:
- name: 'Download artifact'
uses: actions/download-artifact@v4
with:
name: qmllint
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}

- name: Read pr number
id: getprn
run: |
cat pr_number
echo "prn=$(cat pr_number)" >> $GITHUB_OUTPUT
- name: 'Run reviewer'
uses: EddyTheCo/qmllint-action/@main
with:
jsondir: ${{ github.workspace }}
pr_number: ${{ steps.getprn.outputs.prn }}

12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ include(FetchContent)
FetchContent_Declare(
ccommon
GIT_REPOSITORY https://github.com/EddyTheCo/Common.git
GIT_TAG v0.3.0
GIT_TAG v0.4.0
)
FetchContent_MakeAvailable(ccommon)
version_from_git(
Expand All @@ -25,8 +25,8 @@ include(GNUInstallDirs)
FetchContent_Declare(
EstervDesigns
GIT_REPOSITORY https://github.com/EddyTheCo/MyDesigns.git
GIT_TAG v1.2.0
FIND_PACKAGE_ARGS 1.2 COMPONENTS SimpleStyle CustomControls CONFIG
GIT_TAG v1.2.1
FIND_PACKAGE_ARGS 1.2 COMPONENTS SimpleStyle CustomControls Controls CONFIG
)
FetchContent_MakeAvailable(EstervDesigns)

Expand Down Expand Up @@ -76,6 +76,7 @@ if (Qt6_FOUND)
EXPORT ${PROJECT_NAME}-config
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT DTPickers
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT DTPickers
)

install(DIRECTORY ${CMAKE_BINARY_DIR}/Esterv/CustomControls/DateTimePickers
Expand All @@ -87,15 +88,16 @@ if (Qt6_FOUND)
EXPORT ${PROJECT_NAME}-config
DESTINATION ${CMAKE_INSTALL_LIBDIR}/Esterv/CustomControls/DateTimePickers
COMPONENT DTPickers
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT DTPickers
)

build_exports()
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
add_subdirectory(examples)
build_cpack()
endif()
endif(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
endif()

if(BUILD_DOCS)
build_docs()
endif()
endif(BUILD_DOCS)
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
if(BUILD_EXAMPLES)
include(InstallRequiredSystemLibraries)
if(EMSCRIPTEN OR ANDROID)
find_package(Qt6 REQUIRED COMPONENTS QuickControls2)
find_package(EstervDesigns 0.4 REQUIRED COMPONENTS Controls CONFIG )
endif(EMSCRIPTEN OR ANDROID)

foreach(example "datepickerExample"
Expand Down
19 changes: 9 additions & 10 deletions examples/datepickerExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,20 @@
#include <QQuickStyle>
#endif

int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
int main(int argc, char *argv[]) {
QGuiApplication app(argc, argv);
#if defined(FORCE_STYLE)
QQuickStyle::setStyle(FORCE_STYLE);
QQuickStyle::setStyle(FORCE_STYLE);
#endif

QQmlApplicationEngine engine;
QQmlApplicationEngine engine;

engine.addImportPath("qrc:/esterVtech.com/imports");
engine.addImportPath("qrc:/esterVtech.com/imports");

const QUrl url=QUrl("qrc:/esterVtech.com/imports/EdatepickerExample/qml/datepickerExample.qml");
const QUrl url = QUrl("qrc:/esterVtech.com/imports/EdatepickerExample/qml/"
"datepickerExample.qml");

engine.load(url);
engine.load(url);

return app.exec();
return app.exec();
}

19 changes: 9 additions & 10 deletions examples/datetimepickerExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,19 @@
#include <QQuickStyle>
#endif

int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
int main(int argc, char *argv[]) {
QGuiApplication app(argc, argv);
#if defined(FORCE_STYLE)
QQuickStyle::setStyle(FORCE_STYLE);
QQuickStyle::setStyle(FORCE_STYLE);
#endif
QQmlApplicationEngine engine;
QQmlApplicationEngine engine;

engine.addImportPath("qrc:/esterVtech.com/imports");
engine.addImportPath("qrc:/esterVtech.com/imports");

const QUrl url=QUrl("qrc:/esterVtech.com/imports/EdatetimepickerExample/qml/datetimepickerExample.qml");
const QUrl url = QUrl("qrc:/esterVtech.com/imports/EdatetimepickerExample/"
"qml/datetimepickerExample.qml");

engine.load(url);
engine.load(url);

return app.exec();
return app.exec();
}

16 changes: 6 additions & 10 deletions examples/qml/datepickerExample.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,16 @@ import QtQuick
import QtQuick.Controls
import Esterv.CustomControls.DateTimePickers
import Esterv.Styles.Simple

ApplicationWindow {
id: window
visible: true
id:window

background:Rectangle
{
color:Style.backColor1
background: Rectangle {
color: Style.backColor1
}

DatePicker
{
anchors.fill:parent
DatePicker {
anchors.fill: parent
}



}
27 changes: 11 additions & 16 deletions examples/qml/datetimepickerExample.qml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,25 @@ import QtQuick.Controls
import Esterv.CustomControls.DateTimePickers
import Esterv.Styles.Simple
import Esterv.CustomControls

ApplicationWindow {
id: window
visible: true
id:window

background:Rectangle
{
color:Style.backColor1
background: Rectangle {
color: Style.backColor1
}
ThemeSwitch
{
id:themeswitch
width:50
height:50
ThemeSwitch {
id: themeswitch
width: 50
height: 50
}

ShowDateTimePicker
{
height:parent.height-themeswitch.height
width:parent.width
ShowDateTimePicker {
height: parent.height - themeswitch.height
width: parent.width
anchors.top: themeswitch.bottom
//initDate:new Date('December 10, 1990 04:25:00')
//mode:DateTimePicker.Mode.DateOnly
}



}
16 changes: 5 additions & 11 deletions examples/qml/timepickerExample.qml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,14 @@ import Esterv.Styles.Simple
import QtQuick
import QtQuick.Controls


ApplicationWindow {
id: window
visible: true
id:window

background:Rectangle
{
color:Style.backColor1
background: Rectangle {
color: Style.backColor1
}
TimePicker
{
anchors.fill:parent
TimePicker {
anchors.fill: parent
}



}
20 changes: 9 additions & 11 deletions examples/timepickerExample.cpp
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
#include <QGuiApplication>
#include <QQmlApplicationEngine>


#if defined(FORCE_STYLE)
#include <QQuickStyle>
#endif
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
int main(int argc, char *argv[]) {
QGuiApplication app(argc, argv);

#if defined(FORCE_STYLE)
QQuickStyle::setStyle(FORCE_STYLE);
QQuickStyle::setStyle(FORCE_STYLE);
#endif
QQmlApplicationEngine engine;
QQmlApplicationEngine engine;

engine.addImportPath("qrc:/esterVtech.com/imports");
engine.addImportPath("qrc:/esterVtech.com/imports");

const QUrl url=QUrl("qrc:/esterVtech.com/imports/EtimepickerExample/qml/timepickerExample.qml");
const QUrl url = QUrl("qrc:/esterVtech.com/imports/EtimepickerExample/qml/"
"timepickerExample.qml");

engine.load(url);
engine.load(url);

return app.exec();
return app.exec();
}

Loading

0 comments on commit eafe454

Please sign in to comment.