Skip to content

Commit 2e236ee

Browse files
committed
Fix build problems
1 parent 9bfe63e commit 2e236ee

36 files changed

+219
-409
lines changed

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,12 @@ dotnet_code_quality_unused_parameters = non_public:warning
137137
# 'using' directive preferences
138138
csharp_using_directive_placement = outside_namespace:warning
139139

140+
# Use primary constructor
141+
csharp_style_prefer_primary_constructors = false
142+
143+
# Use collection expression
144+
dotnet_style_prefer_collection_expression = false
145+
140146
###############################
141147
# Formatting Rules #
142148
###############################

.github/workflows/Build Redevelopment.yml

Lines changed: 0 additions & 81 deletions
This file was deleted.

.github/workflows/Build.yml

Lines changed: 67 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Build
22

33
on:
4+
workflow_dispatch:
5+
46
push:
57
branches:
68
- master
@@ -12,68 +14,75 @@ on:
1214

1315
jobs:
1416
build:
15-
runs-on: windows-2019
17+
strategy:
18+
matrix:
19+
vsVersion: ["2017", "2019", "2022"]
20+
21+
runs-on: windows-2022
1622

1723
outputs:
1824
version: ${{ steps.version.outputs.version }}
1925

2026
steps:
21-
- name: Checkup code
22-
uses: actions/[email protected]
23-
with:
24-
fetch-depth: 0
25-
26-
- name: Setup NuGet
27-
uses: nuget/setup-nuget@v2
27+
- name: Checkup code
28+
uses: actions/[email protected]
29+
with:
30+
fetch-depth: 0
31+
32+
- name: Setup NuGet
33+
uses: nuget/setup-nuget@v2
34+
35+
- name: Setup MSBuild
36+
uses: microsoft/setup-msbuild@v2
2837

29-
- name: Setup MSBuild
30-
uses: microsoft/setup-msbuild@v2
31-
32-
- name: Search and increment last version
33-
id: version
34-
run: |
35-
$latestTag = git tag --list 'v*' | Where-Object { $_ -match '^v[0-9]+\.[0-9]+\.[0-9]+$' } | Sort-Object { [Version]($_.TrimStart('v')) } | Select-Object -Last 1
36-
$oldVersion = $latestTag.TrimStart('v')
37-
$versionParts = $oldVersion -split '\.'
38-
$versionParts[2] = [int]$versionParts[2] + 1
39-
$newVersion = "$($versionParts -join '.')"
40-
echo version=$newVersion >> $env:GITHUB_OUTPUT
41-
42-
- name: Set extension manifest versions
43-
shell: pwsh
44-
run: |
45-
$paths = @(
46-
"src\VS2017\source.extension.vsixmanifest",
47-
"src\VS2019\source.extension.vsixmanifest",
48-
"src\VS2022\source.extension.vsixmanifest",
49-
"src\VS2017\source.extension.cs",
50-
"src\VS2019\source.extension.cs",
51-
"src\VS2022\source.extension.cs"
52-
)
53-
foreach ($path in $paths) {
54-
(Get-Content -Path $path) -Replace '1.2.9999', '${{ steps.version.outputs.version }}' | Set-Content -Path $path
55-
}
56-
57-
- name: NuGet Restore
58-
run: nuget restore
59-
60-
- name: Run build
61-
run: msbuild ExtensionManager.sln /p:configuration=Release /p:DeployExtension=false /p:ZipPackageCompressionLevel=normal /v:m
62-
63-
- name: Archive VSIX 2017
64-
uses: actions/upload-artifact@v3
65-
with:
66-
name: ExtensionManager2017.vsix
67-
path: src/VS2017/bin/Release/ExtensionManager2017.vsix
68-
69-
- name: Archive VSIX 2019
70-
uses: actions/upload-artifact@v3
71-
with:
72-
name: ExtensionManager2019.vsix
73-
path: src/VS2019/bin/Release/ExtensionManager2019.vsix
38+
- name: Setup .NET Core SDK
39+
uses: actions/setup-dotnet@v4
40+
with:
41+
dotnet-version: '8.0.x'
42+
43+
- name: Search and increment last version
44+
id: version
45+
run: |
46+
$latestTag = git tag --list 'v*' | Where-Object { $_ -match '^v[0-9]+\.[0-9]+\.[0-9]+$' } | Sort-Object { [Version]($_.TrimStart('v')) } | Select-Object -Last 1
47+
$oldVersion = $latestTag.TrimStart('v')
48+
$versionParts = $oldVersion -split '\.'
49+
$versionParts[2] = [int]$versionParts[2] + 1
50+
$newVersion = "$($versionParts -join '.')"
51+
echo version=$newVersion >> $env:GITHUB_OUTPUT
52+
53+
- name: Set manifest versions
54+
shell: pwsh
55+
run: |
56+
$paths = @(
57+
"src/ExtensionManager.Vsix.VS${{ matrix.vsVersion }}/source.extension.vsixmanifest",
58+
"src/ExtensionManager.Vsix.VS${{ matrix.vsVersion }}/source.extension.cs"
59+
)
7460
75-
- name: Archive VSIX 2022
76-
uses: actions/upload-artifact@v3
77-
with:
78-
name: ExtensionManager2022.vsix
79-
path: src/VS2022/bin/Release/ExtensionManager2022.vsix
61+
foreach ($path in $paths) {
62+
(Get-Content -Path $path) -Replace '9.9.9999', '${{ steps.version.outputs.version }}' | Set-Content -Path $path
63+
}
64+
65+
- name: Build library projects
66+
shell: pwsh
67+
run: |
68+
$projects = Get-ChildItem -Recurse -Filter *.csproj -Exclude *.Vsix.*.csproj | Select-Object -ExpandProperty FullName
69+
70+
foreach ($project in $projects) {
71+
dotnet build "$project" -c Release
72+
}
73+
74+
- name: Build vsix project
75+
shell: pwsh
76+
run: |
77+
$project = "src/ExtensionManager.Vsix.VS${{ matrix.vsVersion }}/ExtensionManager.Vsix.VS${{ matrix.vsVersion }}.csproj"
78+
79+
nuget restore "$project"
80+
msbuild /p:BuildProjectReferences=False /p:RestorePackages=False /p:Configuration=Release /p:DeployExtension=False /p:ZipPackageCompressionLevel=normal /v:n "$project"
81+
82+
- name: Upload artifact
83+
uses: actions/[email protected]
84+
with:
85+
name: ExtensionManager${{ matrix.vsVersion }}.vsix
86+
path: src/ExtensionManager.Vsix.VS${{ matrix.vsVersion }}/bin/Release/ExtensionManager${{ matrix.vsVersion }}.vsix
87+
if-no-files-found: error
88+
compression-level: 0

.github/workflows/Release.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,26 @@ jobs:
2121
fetch-depth: 0
2222

2323
- name: Download VSIX 2017
24-
uses: actions/download-artifact@v3
24+
uses: actions/download-artifact@v4.1.4
2525
with:
2626
name: ExtensionManager2017.vsix
27-
path: artifacts
2827

2928
- name: Download VSIX 2019
30-
uses: actions/download-artifact@v3
29+
uses: actions/download-artifact@v4.1.4
3130
with:
3231
name: ExtensionManager2019.vsix
33-
path: artifacts
3432

3533
- name: Download VSIX 2022
36-
uses: actions/download-artifact@v3
34+
uses: actions/download-artifact@v4.1.4
3735
with:
3836
name: ExtensionManager2022.vsix
39-
path: artifacts
37+
38+
- name: Unzip VSIX Archives
39+
shell: pwsh
40+
run: |
41+
Get-ChildItem . -Filter *.zip | ForEach-Object {
42+
Expand-Archive -LiteralPath $_.FullName -DestinationPath .
43+
}
4044
4145
- name: Create version tag
4246
run: |
@@ -55,4 +59,4 @@ jobs:
5559
env:
5660
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5761
run: |
58-
gh release upload v${{ needs.build.outputs.version }} "artifacts/ExtensionManager2017.vsix" "artifacts/ExtensionManager2019.vsix" "artifacts/ExtensionManager2022.vsix"
62+
gh release upload v${{ needs.build.outputs.version }} "ExtensionManager2017.vsix" "ExtensionManager2019.vsix" "ExtensionManager2022.vsix"

ExtensionManager.sln

Lines changed: 4 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ EndProject
2323
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "VisualStudio", "VisualStudio", "{DD63B191-4457-40BA-984A-0C1D6B95D197}"
2424
ProjectSection(SolutionItems) = preProject
2525
src\ExtensionManager.VisualStudio.md = src\ExtensionManager.VisualStudio.md
26-
src\ExtensionManager.VisualStudio.props = src\ExtensionManager.VisualStudio.props
2726
EndProjectSection
2827
EndProject
2928
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ExtensionManager.VisualStudio.Abstractions", "src\ExtensionManager.VisualStudio.Abstractions\ExtensionManager.VisualStudio.Abstractions.csproj", "{3A474662-F23F-4339-BF62-22D52B834CFC}"
@@ -50,7 +49,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{431E
5049
EndProject
5150
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{5C6EB350-6BEE-4D5A-B02F-7B331D6D8FE8}"
5251
ProjectSection(SolutionItems) = preProject
53-
.github\workflows\Build Redevelopment.yml = .github\workflows\Build Redevelopment.yml
5452
.github\workflows\Build.yml = .github\workflows\Build.yml
5553
.github\workflows\Release.yml = .github\workflows\Release.yml
5654
EndProjectSection
@@ -61,15 +59,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ExtensionManager.VisualStud
6159
EndProject
6260
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Adapter", "Adapter", "{F180C738-5477-4CE7-9D4A-247BB4E5C1DF}"
6361
ProjectSection(SolutionItems) = preProject
64-
ExtensionManager.VisualStudio.Adapter.md = ExtensionManager.VisualStudio.Adapter.md
62+
src\ExtensionManager.VisualStudio.Adapter.md = src\ExtensionManager.VisualStudio.Adapter.md
6563
EndProjectSection
6664
EndProject
67-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ExtensionManager.VisualStudio.VS2019", "src\ExtensionManager.VisualStudio.VS2019\ExtensionManager.VisualStudio.VS2019.csproj", "{37A5DBB8-C876-4D60-A972-4EC91A857C11}"
68-
EndProject
69-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ExtensionManager.VisualStudio.VS2017", "src\ExtensionManager.VisualStudio.VS2017\ExtensionManager.VisualStudio.VS2017.csproj", "{76FBCF19-CCFF-450E-9B37-4601CDEA0D71}"
70-
EndProject
71-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ExtensionManager.VisualStudio.VS2022", "src\ExtensionManager.VisualStudio.VS2022\ExtensionManager.VisualStudio.VS2022.csproj", "{E669F8BE-9801-4794-ADF9-26949DBAFF8D}"
72-
EndProject
7365
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExtensionManager.Vsix.VS2017", "src\ExtensionManager.Vsix.VS2017\ExtensionManager.Vsix.VS2017.csproj", "{E2DDEDFD-659B-40D1-A8DB-2048E3556FDB}"
7466
EndProject
7567
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExtensionManager.Vsix.VS2019", "src\ExtensionManager.Vsix.VS2019\ExtensionManager.Vsix.VS2019.csproj", "{44FB8945-D937-4F89-B8F5-3DEB763BDD0E}"
@@ -158,42 +150,6 @@ Global
158150
{9BACA2E2-713C-42FC-9AA0-A128D48E2D12}.Release|arm64.Build.0 = Release|Any CPU
159151
{9BACA2E2-713C-42FC-9AA0-A128D48E2D12}.Release|x86.ActiveCfg = Release|Any CPU
160152
{9BACA2E2-713C-42FC-9AA0-A128D48E2D12}.Release|x86.Build.0 = Release|Any CPU
161-
{37A5DBB8-C876-4D60-A972-4EC91A857C11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
162-
{37A5DBB8-C876-4D60-A972-4EC91A857C11}.Debug|Any CPU.Build.0 = Debug|Any CPU
163-
{37A5DBB8-C876-4D60-A972-4EC91A857C11}.Debug|arm64.ActiveCfg = Debug|Any CPU
164-
{37A5DBB8-C876-4D60-A972-4EC91A857C11}.Debug|arm64.Build.0 = Debug|Any CPU
165-
{37A5DBB8-C876-4D60-A972-4EC91A857C11}.Debug|x86.ActiveCfg = Debug|Any CPU
166-
{37A5DBB8-C876-4D60-A972-4EC91A857C11}.Debug|x86.Build.0 = Debug|Any CPU
167-
{37A5DBB8-C876-4D60-A972-4EC91A857C11}.Release|Any CPU.ActiveCfg = Release|Any CPU
168-
{37A5DBB8-C876-4D60-A972-4EC91A857C11}.Release|Any CPU.Build.0 = Release|Any CPU
169-
{37A5DBB8-C876-4D60-A972-4EC91A857C11}.Release|arm64.ActiveCfg = Release|Any CPU
170-
{37A5DBB8-C876-4D60-A972-4EC91A857C11}.Release|arm64.Build.0 = Release|Any CPU
171-
{37A5DBB8-C876-4D60-A972-4EC91A857C11}.Release|x86.ActiveCfg = Release|Any CPU
172-
{37A5DBB8-C876-4D60-A972-4EC91A857C11}.Release|x86.Build.0 = Release|Any CPU
173-
{76FBCF19-CCFF-450E-9B37-4601CDEA0D71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
174-
{76FBCF19-CCFF-450E-9B37-4601CDEA0D71}.Debug|Any CPU.Build.0 = Debug|Any CPU
175-
{76FBCF19-CCFF-450E-9B37-4601CDEA0D71}.Debug|arm64.ActiveCfg = Debug|Any CPU
176-
{76FBCF19-CCFF-450E-9B37-4601CDEA0D71}.Debug|arm64.Build.0 = Debug|Any CPU
177-
{76FBCF19-CCFF-450E-9B37-4601CDEA0D71}.Debug|x86.ActiveCfg = Debug|Any CPU
178-
{76FBCF19-CCFF-450E-9B37-4601CDEA0D71}.Debug|x86.Build.0 = Debug|Any CPU
179-
{76FBCF19-CCFF-450E-9B37-4601CDEA0D71}.Release|Any CPU.ActiveCfg = Release|Any CPU
180-
{76FBCF19-CCFF-450E-9B37-4601CDEA0D71}.Release|Any CPU.Build.0 = Release|Any CPU
181-
{76FBCF19-CCFF-450E-9B37-4601CDEA0D71}.Release|arm64.ActiveCfg = Release|Any CPU
182-
{76FBCF19-CCFF-450E-9B37-4601CDEA0D71}.Release|arm64.Build.0 = Release|Any CPU
183-
{76FBCF19-CCFF-450E-9B37-4601CDEA0D71}.Release|x86.ActiveCfg = Release|Any CPU
184-
{76FBCF19-CCFF-450E-9B37-4601CDEA0D71}.Release|x86.Build.0 = Release|Any CPU
185-
{E669F8BE-9801-4794-ADF9-26949DBAFF8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
186-
{E669F8BE-9801-4794-ADF9-26949DBAFF8D}.Debug|Any CPU.Build.0 = Debug|Any CPU
187-
{E669F8BE-9801-4794-ADF9-26949DBAFF8D}.Debug|arm64.ActiveCfg = Debug|Any CPU
188-
{E669F8BE-9801-4794-ADF9-26949DBAFF8D}.Debug|arm64.Build.0 = Debug|Any CPU
189-
{E669F8BE-9801-4794-ADF9-26949DBAFF8D}.Debug|x86.ActiveCfg = Debug|Any CPU
190-
{E669F8BE-9801-4794-ADF9-26949DBAFF8D}.Debug|x86.Build.0 = Debug|Any CPU
191-
{E669F8BE-9801-4794-ADF9-26949DBAFF8D}.Release|Any CPU.ActiveCfg = Release|Any CPU
192-
{E669F8BE-9801-4794-ADF9-26949DBAFF8D}.Release|Any CPU.Build.0 = Release|Any CPU
193-
{E669F8BE-9801-4794-ADF9-26949DBAFF8D}.Release|arm64.ActiveCfg = Release|Any CPU
194-
{E669F8BE-9801-4794-ADF9-26949DBAFF8D}.Release|arm64.Build.0 = Release|Any CPU
195-
{E669F8BE-9801-4794-ADF9-26949DBAFF8D}.Release|x86.ActiveCfg = Release|Any CPU
196-
{E669F8BE-9801-4794-ADF9-26949DBAFF8D}.Release|x86.Build.0 = Release|Any CPU
197153
{E2DDEDFD-659B-40D1-A8DB-2048E3556FDB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
198154
{E2DDEDFD-659B-40D1-A8DB-2048E3556FDB}.Debug|Any CPU.Build.0 = Debug|Any CPU
199155
{E2DDEDFD-659B-40D1-A8DB-2048E3556FDB}.Debug|arm64.ActiveCfg = Debug|arm64
@@ -249,9 +205,6 @@ Global
249205
{78E14F78-6B4A-4E64-95C1-7CC4E91D4A9F} = {F180C738-5477-4CE7-9D4A-247BB4E5C1DF}
250206
{9BACA2E2-713C-42FC-9AA0-A128D48E2D12} = {F180C738-5477-4CE7-9D4A-247BB4E5C1DF}
251207
{F180C738-5477-4CE7-9D4A-247BB4E5C1DF} = {DD63B191-4457-40BA-984A-0C1D6B95D197}
252-
{37A5DBB8-C876-4D60-A972-4EC91A857C11} = {DD63B191-4457-40BA-984A-0C1D6B95D197}
253-
{76FBCF19-CCFF-450E-9B37-4601CDEA0D71} = {DD63B191-4457-40BA-984A-0C1D6B95D197}
254-
{E669F8BE-9801-4794-ADF9-26949DBAFF8D} = {DD63B191-4457-40BA-984A-0C1D6B95D197}
255208
{E2DDEDFD-659B-40D1-A8DB-2048E3556FDB} = {DA9ABE41-806C-442B-B8D5-56AD9C958E32}
256209
{44FB8945-D937-4F89-B8F5-3DEB763BDD0E} = {DA9ABE41-806C-442B-B8D5-56AD9C958E32}
257210
{DD73CF2D-9D26-4760-928B-454B9B682246} = {DA9ABE41-806C-442B-B8D5-56AD9C958E32}
@@ -260,17 +213,17 @@ Global
260213
SolutionGuid = {1BD96434-7B7A-4183-ABA0-CA3DC2FCD23B}
261214
EndGlobalSection
262215
GlobalSection(SharedMSBuildProjectFiles) = preSolution
263-
src\ExtensionManager.VisualStudio.Shared\ExtensionManager.VisualStudio.Shared.projitems*{37a5dbb8-c876-4d60-a972-4ec91a857c11}*SharedItemsImports = 5
216+
src\ExtensionManager.VisualStudio.Shared\ExtensionManager.VisualStudio.Shared.projitems*{44fb8945-d937-4f89-b8f5-3deb763bdd0e}*SharedItemsImports = 4
264217
src\ExtensionManager.Vsix.Shared\ExtensionManager.Vsix.Shared.projitems*{44fb8945-d937-4f89-b8f5-3deb763bdd0e}*SharedItemsImports = 4
265218
src\ExtensionManager.Shared\ExtensionManager.Shared.projitems*{6468e392-1c88-4f3c-b8d7-e61f942adbfc}*SharedItemsImports = 5
266219
src\ExtensionManager.Shared\ExtensionManager.Shared.projitems*{6539aa53-aa60-402d-9334-83d3a63459db}*SharedItemsImports = 5
267-
src\ExtensionManager.VisualStudio.Shared\ExtensionManager.VisualStudio.Shared.projitems*{76fbcf19-ccff-450e-9b37-4601cdea0d71}*SharedItemsImports = 5
268220
src\ExtensionManager.Vsix.Shared\ExtensionManager.Vsix.Shared.projitems*{77052739-b59a-4e8b-9e4a-8d1372f0e6b5}*SharedItemsImports = 13
269221
src\ExtensionManager.Shared\ExtensionManager.Shared.projitems*{c67042cb-6c88-4273-bef3-6a99b87b4c3f}*SharedItemsImports = 5
270222
src\ExtensionManager.VisualStudio.Shared\ExtensionManager.VisualStudio.Shared.projitems*{db482bd0-94ba-4e7d-8a51-ac2a2663267a}*SharedItemsImports = 13
223+
src\ExtensionManager.VisualStudio.Shared\ExtensionManager.VisualStudio.Shared.projitems*{dd73cf2d-9d26-4760-928b-454b9b682246}*SharedItemsImports = 4
271224
src\ExtensionManager.Vsix.Shared\ExtensionManager.Vsix.Shared.projitems*{dd73cf2d-9d26-4760-928b-454b9b682246}*SharedItemsImports = 4
272225
src\ExtensionManager.Shared\ExtensionManager.Shared.projitems*{e21ceac2-5e8c-4ae9-84ee-2e390cd272a9}*SharedItemsImports = 13
226+
src\ExtensionManager.VisualStudio.Shared\ExtensionManager.VisualStudio.Shared.projitems*{e2ddedfd-659b-40d1-a8db-2048e3556fdb}*SharedItemsImports = 4
273227
src\ExtensionManager.Vsix.Shared\ExtensionManager.Vsix.Shared.projitems*{e2ddedfd-659b-40d1-a8db-2048e3556fdb}*SharedItemsImports = 4
274-
src\ExtensionManager.VisualStudio.Shared\ExtensionManager.VisualStudio.Shared.projitems*{e669f8be-9801-4794-adf9-26949dbaff8d}*SharedItemsImports = 5
275228
EndGlobalSection
276229
EndGlobal

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22

33
<PropertyGroup>
4-
<TargetFramework>net4.8.1</TargetFramework>
4+
<TargetFramework>net472</TargetFramework>
55
<LangVersion>preview</LangVersion>
66
<Nullable>enable</Nullable>
77
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>

0 commit comments

Comments
 (0)