Skip to content

Commit 64a0599

Browse files
author
heku
committed
Move CICD to azure-pipelines
1 parent 8741ca3 commit 64a0599

9 files changed

+200
-40
lines changed

Kool.EditProject.sln

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.27130.2020
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.29519.181
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kool.EditProject", "Kool.EditProject\Kool.EditProject.csproj", "{52FBE367-4D6B-445D-A042-F4B2553F471F}"
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{81143BF0-C559-4B59-860F-130543C2C504}"
99
ProjectSection(SolutionItems) = preProject
1010
.editorconfig = .editorconfig
11-
appveyor.yml = appveyor.yml
11+
azure-pipelines.yml = azure-pipelines.yml
12+
publish.manifest.json = publish.manifest.json
13+
publish.overview.md = publish.overview.md
1214
Readme.md = Readme.md
15+
vsix.psm1 = vsix.psm1
1316
EndProjectSection
1417
EndProject
1518
Global

Kool.EditProject/Vsix.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
internal static class Vsix
44
{
5-
public const string VERSION = "1.6";
5+
public const string VERSION = "0.0.0";
66
public const string PRODUCT = "Kool";
77
public const string PACKAGE = "Edit Project";
88
public const string URL = "https://github.com/heku/kool.editproject";

Kool.EditProject/source.extension.vsixmanifest

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
33
<Metadata>
4-
<Identity Id="Kool.EditProject.51be3f7e-0e8b-4ad4-b2c9-126445f2ce6a" Version="1.6" Language="en-US" Publisher="Heku" />
4+
<Identity Id="Kool.EditProject.51be3f7e-0e8b-4ad4-b2c9-126445f2ce6a" Version="0.0.0" Language="en-US" Publisher="Heku" />
55
<DisplayName>Edit Project</DisplayName>
66
<Description xml:space="preserve">An open source Visual Studio extension to add the context menu for editing project/solution file.</Description>
77
<MoreInfo>https://github.com/heku/kool.editproject</MoreInfo>
88
<Icon>Resources\Logo.ico</Icon>
9-
<Tags>heku;kool;edit;project;proj;csproj</Tags>
9+
<Tags>edit;project;csproj</Tags>
1010
</Metadata>
1111
<Installation>
1212
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[14.0,17.0)" />

Readme.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
## About
1+
[![master branch](https://img.shields.io/azure-devops/build/heku/18bbd6e7-59f0-4bc9-a26a-1c9049793678/12/master?label=master)](https://dev.azure.com/heku/Kool.EditProject/_build/latest?definitionId=12&branchName=master)
2+
[![rel branch](https://img.shields.io/azure-devops/build/heku/18bbd6e7-59f0-4bc9-a26a-1c9049793678/12/rel?label=rel)](https://dev.azure.com/heku/Kool.EditProject/_build/latest?definitionId=12&branchName=rel)
3+
[![deployment](https://vsrm.dev.azure.com/heku/_apis/public/Release/badge/18bbd6e7-59f0-4bc9-a26a-1c9049793678/1/2)](https://dev.azure.com/heku/Kool.EditProject/_dashboards)
4+
[![marketplace](https://img.shields.io/visual-studio-marketplace/v/heku.editproject.svg?label=Marketplace)](https://marketplace.visualstudio.com/items?itemName=heku.EditProject)
5+
[![downloads](https://img.shields.io/visual-studio-marketplace/d/heku.editproject.svg?label=Downloads)](https://marketplace.visualstudio.com/items?itemName=heku.EditProject)
26

3-
master (development) | rel (release)
4-
------------------------------------------------------------ | ------------------------------------------------------------
5-
[![Build status](https://ci.appveyor.com/api/projects/status/luf891iask6ci15n/branch/master?svg=true)](https://ci.appveyor.com/project/heku/kool-editproject/branch/master) | [![Build status](https://ci.appveyor.com/api/projects/status/luf891iask6ci15n/branch/rel?svg=true)](https://ci.appveyor.com/project/heku/kool-editproject/branch/rel)
7+
--------
68

79
An open source Visual Studio extension to add the context menu for editing project/solution file.
810

appveyor.yml

-30
This file was deleted.

azure-pipelines.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
trigger:
2+
- 'master'
3+
- 'rel'
4+
5+
variables:
6+
patch: $[counter('versioncounter', 0)]
7+
solution: '**/*.sln'
8+
buildPlatform: 'Any CPU'
9+
buildConfiguration: 'Release'
10+
11+
name: 1.6.$(patch)
12+
13+
pool:
14+
vmImage: 'windows-2019'
15+
16+
steps:
17+
- task: NuGetToolInstaller@1
18+
displayName: Ensure nuget tool installed
19+
20+
- task: NuGetCommand@2
21+
displayName: Restore nuget packages
22+
inputs:
23+
restoreSolution: '$(solution)'
24+
25+
- task: PowerShell@2
26+
displayName: Update versions
27+
inputs:
28+
targetType: 'inline'
29+
script: |
30+
Import-Module -Force -Verbose .\vsix.psm1
31+
UpdateVersion '$(Build.BuildNumber)'
32+
33+
- task: VSBuild@1
34+
displayName: Build solution
35+
inputs:
36+
solution: '$(solution)'
37+
maximumCpuCount: true
38+
platform: '$(BuildPlatform)'
39+
configuration: '$(BuildConfiguration)'
40+
msbuildArgs: '/v:m'
41+
42+
- task: CopyFiles@2
43+
displayName: Select files for publish
44+
inputs:
45+
Contents: |
46+
vsix.psm1
47+
publish.*
48+
Screenshots/*
49+
*/bin/Release/*.vsix
50+
TargetFolder: '$(Build.ArtifactStagingDirectory)'
51+
CleanTargetFolder: true
52+
53+
- task: PublishBuildArtifacts@1
54+
displayName: Publish files for release
55+
inputs:
56+
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
57+
ArtifactName: 'drop'
58+
publishLocation: 'Container'

publish.manifest.json

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"$schema": "http://json.schemastore.org/vsix-publish",
3+
"categories": [
4+
"Coding",
5+
"Other"
6+
],
7+
"identity": {
8+
"internalName": "EditProject",
9+
"displayName": "Edit Project",
10+
"tags": [
11+
"edit",
12+
"project",
13+
"csproj"
14+
]
15+
},
16+
"overview": "publish.overview.md",
17+
"assetFiles": [
18+
{
19+
"pathOnDisk": "Screenshots/SingleProject.png",
20+
"targetPath": "Screenshots/SingleProject.png"
21+
},
22+
{
23+
"pathOnDisk": "Screenshots/MultipleProjects.png",
24+
"targetPath": "Screenshots/MultipleProjects.png"
25+
},
26+
{
27+
"pathOnDisk": "Screenshots/Solution.png",
28+
"targetPath": "Screenshots/Solution.png"
29+
}
30+
],
31+
"priceCategory": "free",
32+
"publisher": "Heku",
33+
"private": false,
34+
"qna": false,
35+
"repo": "https://github.com/heku/kool.editproject"
36+
}

publish.overview.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
An open source Visual Studio extension to add the context menu for editing project/solution file.
2+
3+
## Features
4+
- Add **Edit Solution File** menu.
5+
6+
![Edit Solution Screenshot](Screenshots/Solution.png)
7+
8+
- Add **Edit Project File** menu for non .NETCore projects.
9+
10+
![Edit Single Project Screenshot](Screenshots/SingleProject.png)
11+
12+
- Add **Edit Selected Projects** menu for multiple selected projects.
13+
14+
![Edit Multiple Projects Screenshot](Screenshots/MultipleProjects.png)
15+
16+
## A known 'issue'
17+
Because the **Edit Selected Projects** menu works for all kinds of projects, include .NETCore projects which have the VS built-in Edit Project menu.
18+
If you edit a .NETCore project via this menu then edit it via the VS built-in menu (vice versa), then two edit windows will be opened.
19+
20+
## Feedback
21+
If you have any question or problem, feel free to open an issue on [GitHub](https://github.com/heku/kool.editproject)

vsix.psm1

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
2+
$VsixCs = Resolve-Path ".\*\Vsix.cs"
3+
$VsixCsVersionPattern = 'VERSION = "([\d\\.]+)"'
4+
$VsixCsVersionFormat = 'VERSION = "{0}"'
5+
6+
$SourceManifest = Resolve-Path ".\*\source.extension.vsixmanifest"
7+
$PublishManifest = ".\publish.manifest.json"
8+
$PublishVsixFile = Resolve-Path ".\*\bin\Release\*.vsix"
9+
10+
11+
function UpdateVersion {
12+
[cmdletbinding()]
13+
param(
14+
[Parameter(Mandatory=$true)]
15+
[string] $Version
16+
)
17+
18+
Write-Host "Update vsix version to :" $Version -ForegroundColor Green
19+
UpdateVersionFile $Version
20+
UpdateManifestVersion $Version
21+
}
22+
23+
function UpdateVersionFile {
24+
param(
25+
[string] $Version
26+
)
27+
28+
(Get-Content $VsixCs) | ForEach-Object {
29+
if ($_ -cmatch $VsixCsVersionPattern){
30+
$_ -creplace $VsixCsVersionPattern, ($VsixCsVersionFormat -f $Version)
31+
}
32+
else {
33+
$_
34+
}
35+
} | Set-Content $VsixCs -Encoding UTF8
36+
37+
Write-Host "Version updated:" $VsixCs -ForegroundColor Green
38+
}
39+
40+
function UpdateManifestVersion {
41+
param(
42+
[string] $Version
43+
)
44+
45+
[xml]$content = Get-Content $SourceManifest
46+
$content.PackageManifest.Metadata.Identity.Version = $Version
47+
$content.Save($SourceManifest)
48+
49+
Write-Host "Version updated:" $SourceManifest -ForegroundColor Green
50+
}
51+
52+
function PublishVsix {
53+
[cmdletbinding()]
54+
param(
55+
[Parameter(Mandatory=$true)]
56+
[string] $PAT
57+
)
58+
59+
$installation = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -prerelease -format json | ConvertFrom-Json
60+
$path = $installation.installationPath
61+
$vsixPublisher = Join-Path -Path $path -ChildPath "VSSDK\VisualStudioIntegration\Tools\Bin\VsixPublisher.exe" -Resolve
62+
Write-Host "VsixPublisher:" $vsixPublisher -ForegroundColor Green
63+
64+
Write-Host "Publish Manifest:" $PublishManifest -ForegroundColor Green
65+
Write-Host "Vsix:" $PublishVsixFile -ForegroundColor Green
66+
67+
& $vsixPublisher publish -payload $PublishVsixFile -publishManifest $PublishManifest -personalAccessToken $PAT -ignoreWarnings "VSIXValidatorWarning01,VSIXValidatorWarning02,VSIXValidatorWarning08"
68+
}
69+
70+
Export-ModuleMember -Function UpdateVersion, PublishVsix

0 commit comments

Comments
 (0)