forked from torizon/vscode-torizon-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
updateQtCreatorIni.ps1
48 lines (40 loc) · 1.3 KB
/
updateQtCreatorIni.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# suppress warnings that we need to use
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSAvoidOverwritingBuiltInCmdlets', ""
)]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSAvoidUsingWriteHost', ""
)]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSAvoidUsingInvokeExpression', ""
)]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSAvoidUsingPositionalParameters', ""
)]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSAvoidGlobalVars', ""
)]
param()
# include
. "$(Split-Path $MyInvocation.MyCommand.Path -Parent)/utils/iniFiles.ps1"
# get arguments
$_path = $args[0]
$_deviceHostname = $args[1]
$_projectName = $args[2]
$_deviceArch = $args[3]
# get the ini structured
$datas = `
Get-IniFile "$_path/.qt/QtProject/QtCreator.ini"
# debug
Write-Host $datas.DebugMode["StartApplication\2\LastServerAddress"]
Write-Host "to"
Write-Host $_deviceHostname
# replace
$datas.DebugMode["StartApplication\2\LastServerAddress"] = `
"$_deviceHostname"
$datas.DebugMode["StartApplication\2\LastExternalExecutable"] = `
"$_path/build-$_deviceArch/debug/$_projectName"
$datas.DebugMode["StartApplication\2\LastExternalWorkingDirectory"] = `
"$_path/build-$_deviceArch/debug"
# write
New-IniContent $datas | Out-File -FilePath "$_path/.qt/QtProject/QtCreator.ini"