Skip to content

Commit

Permalink
Update Qt version in AppVeyor (#42)
Browse files Browse the repository at this point in the history
* Update Qt version

* Update readme and access token

Resolves #37
  • Loading branch information
jesperhh authored Mar 29, 2023
1 parent 0eab93c commit 088ae92
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 22 deletions.
41 changes: 23 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[![Build Status](https://travis-ci.org/jesperhh/qmlfmt.svg?branch=master)](https://travis-ci.org/jesperhh/qmlfmt)
[![Build status](https://ci.appveyor.com/api/projects/status/qti9p9s9q9r3pkoo/branch/master?svg=true)](https://ci.appveyor.com/project/jesperhh/qmlfmt/branch/master)

# qmlfmt
Expand All @@ -15,9 +14,9 @@ brew install martindelille/tap/qmlfmt
## Build instructions
Requires
- CMake 3.1 or later
- Qt 5.10 or later.
- Tested with Visual Studio 2017, GCC 6.0 and Clang 5.0
- Tested on Windows, Linux and Mac OS
- Qt 6.4.2 or later.
- Tested with Visual Studio 2019 and GCC 9.4. May work with Clang as well.
- Tested on Windows, Linux. May work on Mac OS as well.

After checking out the repository, `cd` to it and run:

Expand All @@ -33,20 +32,26 @@ After checking out the repository, `cd` to it and run:
Without an explicit path, it processes the standard input. Given a file, it operates on that file; given a directory, it operates on all qml files in that directory, recursively. (Files starting with a period are ignored.) By default, qmlfmt prints the reformatted sources to standard output.

### Options:
-?, -h, --help Displays this help.
-v, --version Displays version information.
-t, --tab-size <tab size> How many spaces to replace tabs with
-i, --indent <indent> How many spaces to use for indentation
-l, --list Do not print reformatted sources to standard
output. If a file's formatting is different from
qmlfmt's, print its name to standard output.
-w, --overwrite Do not print reformatted sources to standard
output. If a file's formatting is different from
qmlfmt's, overwrite it with qmlfmt's version.
-e, --error Print all errors.
-d, --diff Do not print reformatted sources to standard
output. If a file's formatting is different than
qmlfmt's, print diffs to standard output.
-?, -h, --help Displays help on commandline options.
--help-all Displays help including Qt specific options.
-v, --version Displays version information.
-b, --line-length <line length> How many characters before line will be
broken.
-t, --tab-size <tab size> How many spaces to replace tabs with
-i, --indent <indent> How many spaces to use for indentation
-l, --list Do not print reformatted sources to standard
output. If a file's formatting is different
from qmlfmt's, print its name to standard
output.
-w, --overwrite Do not print reformatted sources to standard
output. If a file's formatting is different
from qmlfmt's, overwrite it with qmlfmt's
version.
-e, --error Print all errors.
-d, --diff Do not print reformatted sources to standard
output. If a file's formatting is different
than qmlfmt's, print diffs to standard
output.

### Arguments:
path file(s) or directory to process. If not set,
Expand Down
8 changes: 4 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ install:
- sh: sudo apt-get -y install libgl1-mesa-dev
- git submodule update --init qt-creator
before_build:
- cmd: 'cmake ./ -G "Visual Studio 16 2019" -A x64 -DCMAKE_PREFIX_PATH=C:/Qt/6.2.2/msvc2019_64 -DQMLFMT_VERSION:STRING=%APPVEYOR_REPO_TAG_NAME% -DQMLFMT_COMMIT:STRING=%APPVEYOR_REPO_COMMIT%'
- sh: 'cmake ./ -DCMAKE_BUILD_TYPE=$Configuration -DCMAKE_PREFIX_PATH=$HOME/Qt/6.2.1/gcc_64 -DQMLFMT_VERSION:STRING=%APPVEYOR_REPO_TAG_NAME% -DQMLFMT_COMMIT:STRING=%APPVEYOR_REPO_COMMIT%'
- cmd: 'cmake ./ -G "Visual Studio 16 2019" -A x64 -DCMAKE_PREFIX_PATH=C:/Qt/6.4/msvc2019_64 -DQMLFMT_VERSION:STRING=%APPVEYOR_REPO_TAG_NAME% -DQMLFMT_COMMIT:STRING=%APPVEYOR_REPO_COMMIT%'
- sh: 'cmake ./ -DCMAKE_BUILD_TYPE=$Configuration -DCMAKE_PREFIX_PATH=$HOME/Qt/6.4/gcc_64 -DQMLFMT_VERSION:STRING=%APPVEYOR_REPO_TAG_NAME% -DQMLFMT_COMMIT:STRING=%APPVEYOR_REPO_COMMIT%'
build_script:
- cmd: msbuild qmlfmt.sln /p:Configuration=Release -maxcpucount
- sh: make qmlfmt -j 2
Expand All @@ -21,7 +21,7 @@ after_build:
- sh: 7z a qmlfmt-linux.zip qmlfmt
test_script:
- cmd: >-
set PATH=C:\Qt\6.2.2\msvc2019_64\bin;%PATH%
set PATH=C:\Qt\6.4\msvc2019_64\bin;%PATH%
msbuild check.vcxproj
- sh: make check
Expand All @@ -44,7 +44,7 @@ for:
deploy:
- provider: GitHub
auth_token:
secure: a/eMX85I7Kw+Mk4vfjfg5pN+jMqjfq4hXr3/JxIDeqcp+s+3iWV+r/TwUVQRSxAj
secure: XIz4qTwkoW4CJdlLJMCP0u5rVojet+W6/PtmACrj1cHfQym8RWpg57omgV3nCKME
artifact: qmlfmt-linux, qmlfmt-windows
on:
branch: master
Expand Down
17 changes: 17 additions & 0 deletions test/data/in_lambda_complex.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import QtQuick 2.7

Item {
MouseArea {
onPressed: (mouse)=> {
if (mouse.modifiers & Qt.AltModifier) {
if (mouse.button == Qt.LeftButton) {
state = 1;
} else if (mouse.button == Qt.RightButton) {
state = 2;
} else if (mouse.button == Qt.MiddleButton) {
state = 3;
}
}
}
}
}
17 changes: 17 additions & 0 deletions test/data/out_lambda_complex.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import QtQuick 2.7

Item {
MouseArea {
onPressed: mouse => {
if (mouse.modifiers & Qt.AltModifier) {
if (mouse.button == Qt.LeftButton) {
state = 1
} else if (mouse.button == Qt.RightButton) {
state = 2
} else if (mouse.button == Qt.MiddleButton) {
state = 3
}
}
}
}
}

0 comments on commit 088ae92

Please sign in to comment.