Skip to content

Commit 745090e

Browse files
committed
[build] Use vcxproj for building
1 parent 9b88363 commit 745090e

2 files changed

Lines changed: 16 additions & 88 deletions

File tree

appveyor.yml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,32 +27,27 @@ build_script:
2727
--mount "type=bind,source=C:\projects\optimized-azerty-win\src,target=C:\sources" `
2828
--env "KBFRZ71_VERSION=$Env:KBFRZ71_VERSION" `
2929
private/msklc:1.4 > build.log
30-
- ps: |
31-
$content = (Get-Content -Path ".\build.log" -Raw)
32-
Write-Host "`r`n"
33-
if ($content.Contains("Error")) {
34-
Write-Host $content -ForegroundColor Red
35-
throw "Build failed."
36-
}
37-
else {
38-
Write-Host $content -ForegroundColor Green
39-
Remove-Item -Path ".\KBFRZ71.klc"
40-
}
30+
31+
- ps: msbuild .\src\KBFRZ71 /p:Configuration=Release /p:Platform:Win32
32+
- ps: msbuild .\src\KBFRZ71 /p:Configuration=Release /p:Platform:x64
33+
- ps: msbuild .\src\KBFRZ71N /p:Configuration=Release /p:Platform:Win32
34+
- ps: msbuild .\src\KBFRZ71N /p:Configuration=Release /p:Platform:x64
35+
4136
- ps: nuget restore .\src\Setup.sln
4237
- ps: msbuild .\src\Setup.sln /p:Configuration=Release /p:SolutionDir=.\src /p:ProductVersion=$Env:KBFRZ71_VERSION
4338

4439
after_build:
4540
- ps: 7z a artifacts\setup.zip .\src\Setup\bin\x86\Release\net452\*.msi
46-
- ps: 7z a artifacts\setup.zip .\src\Setup\bin\x86\Release\net452\*.exe
41+
- ps: 7z a artifacts\setup.zip .\src\Setup\bin\x86\Release\net452\*.exe
4742
- ps: 7z a artifacts\setup.zip .\src\Setup\bin\x86\Release\net452\*.config
4843
- ps: copy .\src\Setup\bin\x86\Release\net452\*.msi .\artifacts\
4944

5045
artifacts:
5146
- path: artifacts\setup.zip
5247
name: setup
53-
type: file
48+
type: File
5449
- path: 'artifacts\*.msi'
55-
type: file
50+
type: File
5651

5752
deploy:
5853
- provider: GitHub

context/Make-KeyboardLayout.ps1

Lines changed: 7 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -16,73 +16,6 @@ BEGIN {
1616
Write-Output $result
1717
}
1818

19-
Function Build-Layout {
20-
param(
21-
[string] $name
22-
)
23-
24-
BEGIN {
25-
26-
Function Compile-Layout {
27-
param(
28-
[string] $name,
29-
[string] $option,
30-
[string] $target,
31-
[switch] $quiet = $false
32-
)
33-
34-
Push-Location "src/$($name)/"
35-
36-
$expression = "msbuild /p:Configuration=Release $($option)"
37-
Invoke-Expression -Command $expression | % {
38-
if (-not $quiet.IsPresent) {
39-
Write-Host $_
40-
}
41-
}
42-
43-
Pop-Location
44-
}
45-
46-
Function Make-Readonly {
47-
param(
48-
[string] $name,
49-
[switch] $readwrite = $false
50-
)
51-
if ($readwrite.IsPresent) {
52-
attrib -R "$name.C"
53-
attrib -R "$name.H"
54-
attrib -R "$name.RC"
55-
attrib -R "$name.DEF"
56-
}
57-
else {
58-
attrib +R "$name.C"
59-
attrib +R "$name.H"
60-
attrib +R "$name.RC"
61-
attrib +R "$name.DEF"
62-
}
63-
}
64-
65-
$x86 = "..\Package_x86\bin\"
66-
$x64 = "..\Package_x64\bin\"
67-
}
68-
69-
PROCESS {
70-
71-
## Protect the files to prevent kbdutool from overwriting them
72-
73-
Make-ReadOnly -Name $name
74-
75-
## Compile layout
76-
77-
".C", ".DEF", ".H", ".RC" |% {
78-
Move-Item -Force -Path "$($name)$($_)" -Destination "src/$($name)/$($name)$($_)"
79-
}
80-
81-
Compile-Layout -Name $name -Option "/p:Platform=x86 /p:OutDir=$($x86)" -Target $x86
82-
Compile-Layout -Name $name -Option "/p:Platform=x64 /p:OutDir=$($x64)" -Target $x64
83-
}
84-
}
85-
8619
Function Fix-Encoding {
8720
param(
8821
[string] $name
@@ -184,18 +117,18 @@ PROCESS {
184117
Patch-Version -Name KBFRZ71 -Version $version
185118
Patch-Version -Name KBFRZ71N -Version $version
186119

187-
Build-Layout -Name KBFRZ71
188-
## Build-Layout -Name KBFRZ71N
120+
## Move C source code to Visual Studio project folder
189121

190-
##Remove-Item -Path KBFRZ71.C
191-
##Remove-Item -Path KBFRZ71.H
192-
##Remove-Item -Path KBFRZ71.RC
193-
##Remove-Item -Path KBFRZ71.DEF
122+
".C", ".DEF", ".H", ".RC" |% {
123+
Move-Item -Force -Path "KBFRZ71$($_)" -Destination "KBFRZ71/KBFR71$($_)"
124+
Move-Item -Force -Path "KBFRZ71N$($_)" -Destination "KBFRZ71N/KBFR71N$($_)"
125+
}
194126

195127
## Copy MSKLC KbdMsi.dll used as Windows Installer custom actions
196128
## in the resulting .MSI packages
197129

198-
Copy-Item -Path C:\MSKLC\bin\i386\KbdMsi.dll -Destination Package_x86\bin | Out-Null
130+
New-Item -ItemType Directory -Path Package_x86\bin -EA SilentlyContinue | Out-Null
131+
Copy-Item -Path C:\MSKLC\bin\i386\KbdMsi.dll -Destination Package_x86\bin\ | Out-Null
199132

200133
Pop-Location
201134
}

0 commit comments

Comments
 (0)