Skip to content

Commit 9ea3810

Browse files
bergmeisterJamesWTruher
authored andcommitted
Upgrade .Net Core SDK from '1.0 Preview 2' to '1.1.5' (this is the LTS branch) and from Visual Studio 2015 to 2017 (#835)
* Upgrade to .Net Core SDK 1.1.5 * fix restore * use newer vs 2017 image instead of wmf5 * do not install pester for new image because it is already installed * replace project.json reference with new csproj in build.ps1 * Fix problem with ressource binding * csproj xml syntax fix * install .net sdk 1.1 for legacy wmf4 image * add missing parenthesis * use iwr instead of bitstransfer for wmf4 build due to mixed assembly mode and do not use aliases any more * Update appveyor.yml * correct iwr syntax do downlod dotnet-install * correct syntax to install dotnet * install pester for wmf 4 build * appveyor syntax fix * PowerShellGet is not available in wmf4 -> use cinst instead * use fullsemver of pester to install * add cache back to appveyor * cleanup * restore packages automatically the first time * rename VS solutions appropriately * simplify restore to do it on the solution * update download link for .net core 1.1.5 sdk * add pester version to readme * try to see if it is possible to get rid of the old solution * try to get rid of the last call to the resource generation script * update readme with full path to out directory * remove the remainders of the ressource generation script calls and document it * csproj cleanup from the old DNX or preview days
1 parent e973047 commit 9ea3810

17 files changed

+822
-224
lines changed

.build.ps1

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ param(
99
# todo remove aliases
1010
# todo make each project have its own build script
1111

12-
$resourceScript = Join-Path $BuildRoot "New-StronglyTypedCsFileForResx.ps1"
1312
$outPath = "$BuildRoot/out"
1413
$modulePath = "$outPath/PSScriptAnalyzer"
1514

@@ -81,8 +80,8 @@ function Get-BuildTaskParams($project) {
8180

8281
function Get-RestoreTaskParams($project) {
8382
@{
84-
Inputs = "$BuildRoot/$project/project.json"
85-
Outputs = "$BuildRoot/$project/project.lock.json"
83+
Inputs = "$BuildRoot/$project/$project.csproj"
84+
Outputs = "$BuildRoot/$project/$project.csproj"
8685
Jobs = {dotnet restore}
8786
}
8887
}
@@ -109,20 +108,6 @@ function Get-TestTaskParam($project) {
109108
}
110109
}
111110

112-
function Get-ResourceTaskParam($project) {
113-
@{
114-
Inputs = "$project/Strings.resx"
115-
Outputs = "$project/Strings.cs"
116-
Data = $project
117-
Jobs = {
118-
Push-Location $BuildRoot
119-
& $resourceScript $Task.Data
120-
Pop-Location
121-
}
122-
Before = "$project/build"
123-
}
124-
}
125-
126111
function Add-ProjectTask([string]$project, [string]$taskName, [hashtable]$taskParams, [string]$pathPrefix = $buildRoot) {
127112
$jobs = [scriptblock]::Create(@"
128113
pushd $pathPrefix/$project
@@ -136,14 +121,12 @@ popd
136121

137122
$projects = @("engine", "rules")
138123
$projects | ForEach-Object {
139-
Add-ProjectTask $_ buildResource (Get-ResourceTaskParam $_)
140124
Add-ProjectTask $_ build (Get-BuildTaskParams $_)
141125
Add-ProjectTask $_ restore (Get-RestoreTaskParams $_)
142126
Add-ProjectTask $_ clean (Get-CleanTaskParams $_)
143127
Add-ProjectTask $_ test (Get-TestTaskParam $_) "$BuildRoot/tests"
144128
}
145129

146-
task buildResource -Before build "engine/buildResource", "rules/buildResource"
147130
task build "engine/build", "rules/build"
148131
task restore "engine/restore", "rules/restore"
149132
task clean "engine/clean", "rules/clean"

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ TestResult.xml
3838
[Rr]eleasePS/
3939
dlldata.c
4040

41-
# DNX
41+
# .Net Core CLI
4242
project.lock.json
4343
artifacts/
4444

Engine/Engine.csproj

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<VersionPrefix>1.16.1</VersionPrefix>
5+
<TargetFrameworks>netstandard1.6;net451</TargetFrameworks>
6+
<AssemblyName>Microsoft.Windows.PowerShell.ScriptAnalyzer</AssemblyName>
7+
<PackageId>Engine</PackageId>
8+
<RootNamespace>Microsoft.Windows.PowerShell.ScriptAnalyzer</RootNamespace> <!-- Namespace needs to match Assembly name for ressource binding -->
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="System.Management.Automation" Version="6.0.0-alpha13" />
13+
</ItemGroup>
14+
15+
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
16+
<Reference Include="System.ComponentModel.Composition" />
17+
<Reference Include="System" />
18+
<Reference Include="Microsoft.CSharp" />
19+
</ItemGroup>
20+
21+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net451' ">
22+
<DebugType>portable</DebugType>
23+
</PropertyGroup>
24+
25+
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.6' ">
26+
<DefineConstants>$(DefineConstants);CORECLR</DefineConstants>
27+
</PropertyGroup>
28+
29+
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.6' ">
30+
<Compile Remove="SafeDirectoryCatalog.cs" />
31+
</ItemGroup>
32+
33+
<ItemGroup>
34+
<Compile Remove="Commands\GetScriptAnalyzerLoggerCommand.cs" />
35+
</ItemGroup>
36+
37+
<ItemGroup>
38+
<Compile Update="Strings.Designer.cs">
39+
<DesignTime>True</DesignTime>
40+
<AutoGen>True</AutoGen>
41+
<DependentUpon>Strings.resx</DependentUpon>
42+
</Compile>
43+
</ItemGroup>
44+
45+
<ItemGroup>
46+
<EmbeddedResource Update="Strings.resx">
47+
<Generator>ResXFileCodeGenerator</Generator>
48+
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
49+
</EmbeddedResource>
50+
</ItemGroup>
51+
52+
<PropertyGroup Condition=" '$(Configuration)' == 'PSV3Release' ">
53+
<DefineConstants>$(DefineConstants);PSV3;PSV5</DefineConstants>
54+
</PropertyGroup>
55+
56+
</Project>

0 commit comments

Comments
 (0)