Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 4eef5b3

Browse files
authored
Merge pull request #1761 from github/refactor/sdk-csproj
Update eligible projects to new SDK format.
2 parents 510154b + cf25357 commit 4eef5b3

File tree

85 files changed

+514
-5440
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+514
-5440
lines changed

Directory.Build.Props

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project>
2+
<PropertyGroup>
3+
<Product>GitHub Extension for Visual Studio</Product>
4+
<Version>2.5.6.0</Version>
5+
<Copyright>Copyright © GitHub, Inc. 2014-2018</Copyright>
6+
<LangVersion>7.3</LangVersion>
7+
</PropertyGroup>
8+
</Project>

GitHubVS.sln

Lines changed: 46 additions & 59 deletions
Large diffs are not rendered by default.

global.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"msbuild-sdks": {
3+
"MSBuild.Sdk.Extras": "1.6.52"
4+
}
5+
}

scripts/Bump-Version.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ if ($Trace) { Set-PSDebug -Trace 1 }
5353
. $scriptsDirectory\Modules\Vsix.ps1 | out-null
5454
. $scriptsDirectory\Modules\SolutionInfo.ps1 | out-null
5555
. $scriptsDirectory\Modules\AppVeyor.ps1 | out-null
56+
. $scriptsDirectory\Modules\DirectoryBuildProps.ps1 | out-null
5657

5758
if ($NewVersion -eq $null) {
5859
if (!$BumpMajor -and !$BumpMinor -and !$BumpPatch -and !$BumpBuild){

scripts/modules.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ New-Module -ScriptBlock {
126126

127127
$msbuild = Find-MSBuild
128128

129-
Write-Host "$msbuild $solution /target:$target /property:Configuration=$configuration /p:DeployExtension=false /verbosity:minimal /p:VisualStudioVersion=14.0 $flag1 $flag2"
130-
Run-Command -Fatal { & $msbuild $solution /target:$target /property:Configuration=$configuration /p:DeployExtension=false /verbosity:minimal /p:VisualStudioVersion=14.0 $flag1 $flag2 }
129+
Write-Host "$msbuild $solution /target:$target /property:Configuration=$configuration /p:DeployExtension=false /verbosity:minimal /p:VisualStudioVersion=15.0 $flag1 $flag2"
130+
Run-Command -Fatal { & $msbuild $solution /target:$target /property:Configuration=$configuration /p:DeployExtension=false /verbosity:minimal /p:VisualStudioVersion=15.0 $flag1 $flag2 }
131131
}
132132

133133
Export-ModuleMember -Function Find-MSBuild,Build-Solution
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Set-StrictMode -Version Latest
2+
3+
New-Module -ScriptBlock {
4+
function Get-DirectoryBuildPropsPath {
5+
Join-Path $rootDirectory Directory.Build.Props
6+
}
7+
8+
function Get-DirectoryBuildProps {
9+
$xmlLines = Get-Content (Get-DirectoryBuildPropsPath) -encoding UTF8
10+
[xml] $xmlLines
11+
}
12+
13+
function Write-DirectoryBuildProps([System.Version]$version) {
14+
15+
$document = Get-DirectoryBuildProps
16+
17+
$numberOfReplacements = 0
18+
$document.Project.PropertyGroup.Version = $version.ToString()
19+
20+
$document.Save((Get-DirectoryBuildPropsPath))
21+
}
22+
23+
Export-ModuleMember -Function Write-DirectoryBuildProps
24+
}

scripts/modules/Versioning.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ New-Module -ScriptBlock {
4242
Write-VersionVsixManifest $version
4343
Write-VersionSolutionInfo $version
4444
Write-VersionAppVeyor $version
45+
Write-DirectoryBuildProps $version
4546
Push-Location $rootDirectory
4647
New-Item -Type Directory -ErrorAction SilentlyContinue build | out-null
4748
Set-Content build\version $version
Lines changed: 5 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,12 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1+
<Project Sdk="Microsoft.NET.Sdk">
42
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{41A47C5B-C606-45B4-B83C-22B9239E4DA0}</ProjectGuid>
8-
<OutputType>Library</OutputType>
9-
<AppDesignerFolder>Properties</AppDesignerFolder>
10-
<RootNamespace>CredentialManagement</RootNamespace>
11-
<AssemblyName>GitHub.CredentialManagement</AssemblyName>
12-
<LangVersion>7.3</LangVersion>
13-
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
14-
<FileAlignment>512</FileAlignment>
15-
<CodeAnalysisRuleSet>..\common\GitHubVS.ruleset</CodeAnalysisRuleSet>
16-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
17-
<CodeAnalysisIgnoreGeneratedCode>true</CodeAnalysisIgnoreGeneratedCode>
18-
</PropertyGroup>
19-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
20-
<DebugSymbols>true</DebugSymbols>
21-
<DebugType>full</DebugType>
22-
<Optimize>false</Optimize>
23-
<DefineConstants>DEBUG;TRACE</DefineConstants>
24-
<ErrorReport>prompt</ErrorReport>
25-
<WarningLevel>4</WarningLevel>
26-
<RunCodeAnalysis>false</RunCodeAnalysis>
27-
<OutputPath>bin\Debug\</OutputPath>
28-
</PropertyGroup>
29-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugCodeAnalysis|AnyCPU'">
30-
<DebugSymbols>true</DebugSymbols>
31-
<DebugType>full</DebugType>
32-
<Optimize>false</Optimize>
33-
<DefineConstants>CODE_ANALYSIS;DEBUG;TRACE</DefineConstants>
34-
<ErrorReport>prompt</ErrorReport>
35-
<WarningLevel>4</WarningLevel>
36-
<RunCodeAnalysis>true</RunCodeAnalysis>
37-
<OutputPath>bin\Debug\</OutputPath>
38-
</PropertyGroup>
39-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
40-
<DebugType>pdbonly</DebugType>
41-
<Optimize>true</Optimize>
42-
<DefineConstants>TRACE</DefineConstants>
43-
<ErrorReport>prompt</ErrorReport>
44-
<WarningLevel>4</WarningLevel>
45-
<RunCodeAnalysis>true</RunCodeAnalysis>
46-
<OutputPath>bin\Release\</OutputPath>
3+
<TargetFramework>net461</TargetFramework>
474
</PropertyGroup>
485
<Import Project="$(SolutionDir)\src\common\signing.props" />
496
<ItemGroup>
50-
<Reference Include="System" />
51-
<Reference Include="System.Core" />
52-
<Reference Include="System.Xml.Linq" />
53-
<Reference Include="System.Data.DataSetExtensions" />
54-
<Reference Include="Microsoft.CSharp" />
55-
<Reference Include="System.Data" />
56-
<Reference Include="System.Net.Http" />
57-
<Reference Include="System.Xml" />
58-
</ItemGroup>
59-
<ItemGroup>
60-
<Compile Include="..\common\SolutionInfo.cs">
61-
<Link>Properties\SolutionInfo.cs</Link>
62-
</Compile>
63-
<Compile Include="Credential.cs" />
64-
<Compile Include="CredentialSet.cs" />
65-
<Compile Include="CredentialType.cs" />
66-
<Compile Include="NativeMethods.cs" />
67-
<Compile Include="PersistenceType.cs" />
68-
<Compile Include="SecureStringHelper.cs" />
69-
<Compile Include="Properties\AssemblyInfo.cs" />
7+
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.1" />
708
</ItemGroup>
719
<ItemGroup>
72-
<ProjectReference Include="..\GitHub.Extensions\GitHub.Extensions.csproj">
73-
<Project>{6afe2e2d-6db0-4430-a2ea-f5f5388d2f78}</Project>
74-
<Name>GitHub.Extensions</Name>
75-
</ProjectReference>
10+
<ProjectReference Include="..\GitHub.Extensions\GitHub.Extensions.csproj" />
7611
</ItemGroup>
77-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
78-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
79-
Other similar extension points exist, see Microsoft.Common.targets.
80-
<Target Name="BeforeBuild">
81-
</Target>
82-
<Target Name="AfterBuild">
83-
</Target>
84-
-->
85-
</Project>
12+
</Project>

src/CredentialManagement/Properties/AssemblyInfo.cs

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

src/GitHub.Api/GitHub.Api.csproj

Lines changed: 21 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -1,132 +1,33 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1+
<Project Sdk="Microsoft.NET.Sdk">
42
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{B389ADAF-62CC-486E-85B4-2D8B078DF763}</ProjectGuid>
8-
<OutputType>Library</OutputType>
9-
<AppDesignerFolder>Properties</AppDesignerFolder>
10-
<RootNamespace>GitHub.Api</RootNamespace>
11-
<AssemblyName>GitHub.Api</AssemblyName>
12-
<LangVersion>7.3</LangVersion>
13-
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
14-
<FileAlignment>512</FileAlignment>
15-
<CodeAnalysisRuleSet>..\common\GitHubVS.ruleset</CodeAnalysisRuleSet>
16-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
17-
<CodeAnalysisIgnoreGeneratedCode>true</CodeAnalysisIgnoreGeneratedCode>
18-
</PropertyGroup>
19-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
20-
<DebugSymbols>true</DebugSymbols>
21-
<DebugType>full</DebugType>
22-
<Optimize>false</Optimize>
23-
<DefineConstants>DEBUG;TRACE</DefineConstants>
24-
<ErrorReport>prompt</ErrorReport>
25-
<WarningLevel>4</WarningLevel>
26-
<RunCodeAnalysis>false</RunCodeAnalysis>
27-
<OutputPath>bin\Debug\</OutputPath>
28-
</PropertyGroup>
29-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugCodeAnalysis|AnyCPU'">
30-
<DebugSymbols>true</DebugSymbols>
31-
<DebugType>full</DebugType>
32-
<Optimize>false</Optimize>
33-
<DefineConstants>CODE_ANALYSIS;DEBUG;TRACE</DefineConstants>
34-
<ErrorReport>prompt</ErrorReport>
35-
<WarningLevel>4</WarningLevel>
36-
<RunCodeAnalysis>true</RunCodeAnalysis>
37-
<OutputPath>bin\Debug\</OutputPath>
38-
</PropertyGroup>
39-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
40-
<DebugType>pdbonly</DebugType>
41-
<Optimize>true</Optimize>
42-
<DefineConstants>TRACE</DefineConstants>
43-
<ErrorReport>prompt</ErrorReport>
44-
<WarningLevel>4</WarningLevel>
45-
<RunCodeAnalysis>true</RunCodeAnalysis>
46-
<OutputPath>bin\Release\</OutputPath>
3+
<TargetFramework>net461</TargetFramework>
474
</PropertyGroup>
5+
486
<Import Project="$(SolutionDir)\src\common\signing.props" />
49-
<ItemGroup>
50-
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
51-
<HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
52-
</Reference>
53-
<Reference Include="Octokit.GraphQL, Version=0.1.1.0, Culture=neutral, PublicKeyToken=0be8860aee462442, processorArchitecture=MSIL">
54-
<HintPath>..\..\packages\Octokit.GraphQL.0.1.1-beta\lib\netstandard1.1\Octokit.GraphQL.dll</HintPath>
55-
</Reference>
56-
<Reference Include="Octokit.GraphQL.Core, Version=0.1.1.0, Culture=neutral, PublicKeyToken=0be8860aee462442, processorArchitecture=MSIL">
57-
<HintPath>..\..\packages\Octokit.GraphQL.0.1.1-beta\lib\netstandard1.1\Octokit.GraphQL.Core.dll</HintPath>
58-
</Reference>
59-
<Reference Include="Serilog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
60-
<HintPath>..\..\packages\Serilog.2.5.0\lib\net46\Serilog.dll</HintPath>
61-
<Private>True</Private>
62-
</Reference>
63-
<Reference Include="System" />
64-
<Reference Include="System.ComponentModel.Composition" />
65-
<Reference Include="System.Core" />
66-
<Reference Include="System.Net.Http" />
67-
<Reference Include="System.Xml.Linq" />
68-
<Reference Include="System.Data.DataSetExtensions" />
69-
<Reference Include="Microsoft.CSharp" />
70-
<Reference Include="System.Data" />
71-
<Reference Include="System.Xml" />
72-
</ItemGroup>
73-
<ItemGroup>
74-
<Compile Include="ApiClientConfiguration.cs" />
75-
<Compile Include="..\..\script\src\ApiClientConfiguration_User.cs" Condition="$(Buildtype) == 'Internal'">
7+
8+
<ItemGroup Condition="$(Buildtype) == 'Internal'">
9+
<Compile Remove="ApiClientConfiguration_User.cs" />
10+
<Compile Include="..\..\script\src\ApiClientConfiguration_User.cs">
7611
<Link>ApiClientConfiguration_User.cs</Link>
7712
</Compile>
78-
<Compile Include="ApiClientConfiguration_User.cs" Condition="$(Buildtype) != 'Internal'" />
79-
<Compile Include="GraphQLKeychainCredentialStore.cs" />
80-
<Compile Include="IGraphQLClientFactory.cs" />
81-
<Compile Include="GraphQLClientFactory.cs" />
82-
<Compile Include="IKeychain.cs" />
83-
<Compile Include="ILoginManager.cs" />
84-
<Compile Include="IOAuthCallbackListener.cs" />
85-
<Compile Include="IncorrectScopesException.cs" />
86-
<Compile Include="ITwoFactorChallengeHandler.cs" />
87-
<Compile Include="LoginManager.cs" />
88-
<Compile Include="KeychainCredentialStore.cs" />
89-
<Compile Include="WindowsKeychain.cs" />
90-
<Compile Include="Properties\AssemblyInfo.cs" />
91-
<Compile Include="..\common\SolutionInfo.cs">
92-
<Link>Properties\SolutionInfo.cs</Link>
93-
</Compile>
9413
</ItemGroup>
14+
9515
<ItemGroup>
96-
<Compile Include="SimpleApiClient.cs" />
97-
<Compile Include="SimpleApiClientFactory.cs" />
16+
<Reference Include="System.ComponentModel.Composition" />
17+
<Reference Include="System.Net.Http" />
9818
</ItemGroup>
19+
9920
<ItemGroup>
100-
<ProjectReference Include="..\..\submodules\octokit.net\Octokit\Octokit.csproj">
101-
<Project>{08dd4305-7787-4823-a53f-4d0f725a07f3}</Project>
102-
<Name>Octokit</Name>
103-
</ProjectReference>
104-
<ProjectReference Include="..\CredentialManagement\CredentialManagement.csproj">
105-
<Project>{41a47c5b-c606-45b4-b83c-22b9239e4da0}</Project>
106-
<Name>CredentialManagement</Name>
107-
</ProjectReference>
108-
<ProjectReference Include="..\GitHub.Exports\GitHub.Exports.csproj">
109-
<Project>{9aea02db-02b5-409c-b0ca-115d05331a6b}</Project>
110-
<Name>GitHub.Exports</Name>
111-
</ProjectReference>
112-
<ProjectReference Include="..\GitHub.Extensions\GitHub.Extensions.csproj">
113-
<Project>{6afe2e2d-6db0-4430-a2ea-f5f5388d2f78}</Project>
114-
<Name>GitHub.Extensions</Name>
115-
</ProjectReference>
116-
<ProjectReference Include="..\GitHub.Logging\GitHub.Logging.csproj">
117-
<Project>{8d73575a-a89f-47cc-b153-b47dd06837f0}</Project>
118-
<Name>GitHub.Logging</Name>
119-
</ProjectReference>
21+
<ProjectReference Include="..\..\submodules\octokit.net\Octokit\Octokit.csproj" />
22+
<ProjectReference Include="..\CredentialManagement\CredentialManagement.csproj" />
23+
<ProjectReference Include="..\GitHub.Exports\GitHub.Exports.csproj" />
24+
<ProjectReference Include="..\GitHub.Extensions\GitHub.Extensions.csproj" />
25+
<ProjectReference Include="..\GitHub.Logging\GitHub.Logging.csproj" />
12026
</ItemGroup>
27+
12128
<ItemGroup>
122-
<None Include="packages.config" />
29+
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.1" />
30+
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
31+
<PackageReference Include="Octokit.GraphQL" Version="0.1.1-beta" />
12332
</ItemGroup>
124-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
125-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
126-
Other similar extension points exist, see Microsoft.Common.targets.
127-
<Target Name="BeforeBuild">
128-
</Target>
129-
<Target Name="AfterBuild">
130-
</Target>
131-
-->
132-
</Project>
33+
</Project>

0 commit comments

Comments
 (0)