Skip to content

Commit 15ca47b

Browse files
committed
[build] Use vcxproj for building
1 parent 9b88363 commit 15ca47b

2 files changed

Lines changed: 16 additions & 77 deletions

File tree

appveyor.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,27 @@ build_script:
3838
Write-Host $content -ForegroundColor Green
3939
Remove-Item -Path ".\KBFRZ71.klc"
4040
}
41+
42+
- ps: msbuild .\src\KBFRZ71 /p:Configuration=Release /p:Platform:Win32
43+
- ps: msbuild .\src\KBFRZ71 /p:Configuration=Release /p:Platform:x64
44+
- ps: msbuild .\src\KBFRZ71N /p:Configuration=Release /p:Platform:Win32
45+
- ps: msbuild .\src\KBFRZ71N /p:Configuration=Release /p:Platform:x64
46+
4147
- ps: nuget restore .\src\Setup.sln
4248
- ps: msbuild .\src\Setup.sln /p:Configuration=Release /p:SolutionDir=.\src /p:ProductVersion=$Env:KBFRZ71_VERSION
4349

4450
after_build:
4551
- 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
52+
- ps: 7z a artifacts\setup.zip .\src\Setup\bin\x86\Release\net452\*.exe
4753
- ps: 7z a artifacts\setup.zip .\src\Setup\bin\x86\Release\net452\*.config
4854
- ps: copy .\src\Setup\bin\x86\Release\net452\*.msi .\artifacts\
4955

5056
artifacts:
5157
- path: artifacts\setup.zip
5258
name: setup
53-
type: file
59+
type: File
5460
- path: 'artifacts\*.msi'
55-
type: file
61+
type: File
5662

5763
deploy:
5864
- 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)