Skip to content

Commit 9307e28

Browse files
committed
Add input no-qt-binaries as a synonym for tools-only
If a user wants to install source, docs, or examples, without installing Qt binaries, then that user would have to turn on `tools-only`. That option does not make semantic sense for these use cases, since the user is not installing tools alone, and may not be installing tools at all. This change allows a user to turn off installation of Qt binaries using an option that makes sense semantically.
1 parent a6c6d11 commit 9307e28

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,17 @@ Set this to false if you want to avoid setting environment variables for whateve
123123

124124
Default: `true`
125125

126+
### `no-qt-binaries`
127+
128+
Set this to true if you want to skip installing Qt.
129+
This option is useful if you want to install tools, source, documentation, or examples.
130+
131+
Default: `false`
132+
126133
### `tools-only`
127134

128-
Set this to true if you only want to install tools, and not Qt.
135+
This is a synonym for `no-qt-binaries`. It only exists to preserve backwards compatibility.
136+
If you set either `no-qt-binaries` or `tools-only` to `true`, you will skip installation of Qt.
129137

130138
Default: `false`
131139

action/action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@ inputs:
3939
set-env:
4040
default: true
4141
description: Whether or not to set environment variables after running aqtinstall
42+
no-qt-binaries:
43+
description: Turns off installation of Qt. Useful for installing tools, source, documentation, or examples.
44+
default: false
4245
tools-only:
43-
description: Whether or not to actually install Qt or just the tools from the tools argument
46+
description: Synonym for `no-qt-binaries`, used for backwards compatibility.
4447
default: false
4548
aqtversion:
4649
description: Version of aqtinstall to use in case of issues

action/src/main.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class Inputs {
6868
readonly installDeps: boolean | "nosudo";
6969
readonly cache: boolean;
7070
readonly cacheKeyPrefix: string;
71-
readonly toolsOnly: boolean;
71+
readonly isInstallQtBinaries: boolean;
7272
readonly setEnv: boolean;
7373

7474
readonly aqtVersion: string;
@@ -166,7 +166,8 @@ class Inputs {
166166

167167
this.cacheKeyPrefix = core.getInput("cache-key-prefix");
168168

169-
this.toolsOnly = Inputs.getBoolInput("tools-only");
169+
this.isInstallQtBinaries =
170+
!Inputs.getBoolInput("tools-only") && !Inputs.getBoolInput("no-qt-binaries");
170171

171172
this.setEnv = Inputs.getBoolInput("set-env");
172173

@@ -288,7 +289,7 @@ const run = async (): Promise<void> => {
288289
]);
289290

290291
// Install Qt
291-
if (!inputs.toolsOnly) {
292+
if (inputs.isInstallQtBinaries) {
292293
const qtArgs = [inputs.host, inputs.target, inputs.version];
293294

294295
if (inputs.arch) {
@@ -336,7 +337,7 @@ const run = async (): Promise<void> => {
336337
if (inputs.tools.length) {
337338
core.exportVariable("IQTA_TOOLS", nativePath(`${inputs.dir}/Tools`));
338339
}
339-
if (!inputs.toolsOnly) {
340+
if (inputs.isInstallQtBinaries) {
340341
const qtPath = nativePath(locateQtArchDir(inputs.dir));
341342
if (process.platform === "linux") {
342343
setOrAppendEnvVar("LD_LIBRARY_PATH", nativePath(`${qtPath}/lib`));

0 commit comments

Comments
 (0)