Skip to content

Commit 43e5468

Browse files
authored
Update to use dotnet msbuild (IronLanguages#626)
* Update to use dotnet msbuild * Update yml files * Try to checkout submodules * Add steps.yml to solution * Include Mono.Posix reference assembly since NuGet package has been unlisted * Update NuGet packages * Set ErrorActionPreference=Continue * Fix failing test * Fix packaging * Package with full msbuild since WiX doesn't like .NET Core * Remove unused NUnit.ConsoleRunner package * Change slashes
1 parent af7bfcf commit 43e5468

25 files changed

Lines changed: 149 additions & 78 deletions

File tree

‎.vsts-ci.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
displayName: Windows
77
timeoutInMinutes: 180
88
pool:
9-
vmImage: vs2017-win2016
9+
vmImage: windows-2019
1010
steps:
1111
- template: Build/steps.yml
1212
parameters:
@@ -18,7 +18,7 @@ jobs:
1818
displayName: Linux (Ubuntu)
1919
timeoutInMinutes: 180
2020
pool:
21-
vmImage: 'ubuntu-16.04'
21+
vmImage: 'ubuntu-16.04'
2222
steps:
2323
- template: Build/steps.yml
2424
parameters:
@@ -29,8 +29,8 @@ jobs:
2929
################################################################################
3030
displayName: macOS
3131
timeoutInMinutes: 180
32-
pool:
33-
vmImage: 'macOS-10.13'
32+
pool:
33+
vmImage: 'macOS-10.13'
3434
steps:
3535
- template: Build/steps.yml
3636
parameters:

‎Build.proj‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
<ReferenceDir>$(RootDir)Util\References</ReferenceDir>
1414
<BinDir>$(RootDir)bin</BinDir>
1515
<BuildSysDir>$(RootDir)Build</BuildSysDir>
16-
<TargetFrameworks Condition="'$(TargetFrameworks)' == ''">net45;netcoreapp2.0;netcoreapp2.1</TargetFrameworks>
1716
</PropertyGroup>
1817

1918
<Import Project="$(BuildSysDir)\Tasks.Targets" />

‎Build/Tasks.Targets‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
3-
<UsingTask TaskName="Zip" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
3+
<UsingTask TaskName="Zip" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
44
<ParameterGroup>
55
<ZipFileName ParameterType="System.String" Required="true" />
66
<Files ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" />
77
<WorkingDirectory ParameterType="System.String" Required="true" />
88
</ParameterGroup>
99
<Task>
10-
<Reference Include="System.IO.Compression" />
1110
<Using Namespace="System.IO.Compression" />
1211
<Code Type="Fragment" Language="cs">
1312
<![CDATA[
@@ -50,7 +49,7 @@
5049
</Task>
5150
</UsingTask>
5251

53-
<UsingTask TaskName="FileUpdate" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
52+
<UsingTask TaskName="FileUpdate" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
5453
<ParameterGroup>
5554
<Files ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" />
5655
<Expression ParameterType="System.String" Required="true" />

‎Build/steps.yml‎

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ parameters:
22
os: ''
33

44
steps:
5+
- checkout: self
6+
submodules: true
7+
58
- powershell: |
69
710
$xml = [xml] (Get-Content CurrentVersion.props)
@@ -21,6 +24,18 @@ steps:
2124
Write-Host ("##vso[task.setvariable variable=PackageVersion;isSecret=false;isOutput=true;]$PackageVersion")
2225
displayName: Grab Package Version
2326
27+
- task: DotNetCoreInstaller@1
28+
displayName: Install .NET Core 2.1 runtime for running tests
29+
inputs:
30+
packageType: 'runtime'
31+
version: '2.1.x'
32+
33+
- task: DotNetCoreInstaller@1
34+
displayName: Install .NET Core 3.0 SDK for build
35+
inputs:
36+
packageType: 'sdk'
37+
version: '3.0.100-preview4-011223'
38+
2439
# Install mono when running on Linux
2540
- ${{ if eq(parameters.os, 'Linux') }}:
2641
- task: ms-devlabs.utilitytasks.task-Shellpp.Shell++@0
@@ -37,7 +52,7 @@ steps:
3752
msbuild /version
3853
dotnet --info
3954
df -Th
40-
55+
4156
# Dump version info on macOS
4257
- ${{ if eq(parameters.os, 'macOS') }}:
4358
- task: ms-devlabs.utilitytasks.task-Shellpp.Shell++@0
@@ -91,7 +106,7 @@ steps:
91106
**/*.zip
92107
TargetFolder: '$(Build.ArtifactStagingDirectory)'
93108
condition: and(succeededOrFailed(), eq(variables['system.pullrequest.isfork'], false))
94-
109+
95110
- ${{ if eq(parameters.os, 'Windows') }}:
96111
- task: CopyFiles@2
97112
displayName: Copy MSI Installer
@@ -131,5 +146,3 @@ steps:
131146
inputs:
132147
ArtifactName: ${{ format('{0} Artifacts', parameters.os) }}
133148
condition: and(succeededOrFailed(), eq(variables['system.pullrequest.isfork'], false))
134-
135-

‎Directory.Build.props‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<BuildSysDir Condition=" '$(BuildSysDir)' == '' ">$(RootDir)Build</BuildSysDir>
99
<ReferenceDir Condition=" '$(ReferenceDir)' == '' ">$(RootDir)Util\References</ReferenceDir>
1010

11-
<Mono Condition=" '$(Mono)' == '' AND '$(OS)' != 'Windows_NT' ">true</Mono>
11+
<Mono Condition=" '$(Mono)' == '' AND '$(MSBuildRuntimeType)' == 'Mono' ">true</Mono>
1212

1313
<!-- The following two lines prevent csc.rsp and Microsoft.NETFramework.props from adding
1414
additional assembly references. -->

‎IronPython.sln‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.26711.1
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.28803.352
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IronPython", "Src\IronPython\IronPython.csproj", "{95289EA9-5778-489D-AB48-F81F2CE2DA32}"
77
EndProject
@@ -44,6 +44,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{17737ACB
4444
Build\netcoreapp2.0.props = Build\netcoreapp2.0.props
4545
Build\netcoreapp2.1.props = Build\netcoreapp2.1.props
4646
Build\netstandard2.0.props = Build\netstandard2.0.props
47+
Build\steps.yml = Build\steps.yml
4748
EndProjectSection
4849
EndProject
4950
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IronPythonCompiler", "Src\IronPythonCompiler\IronPythonCompiler.csproj", "{3DFB096E-AC09-4E7A-9288-7F7C33C288C7}"

‎Package/nuget/IronPython.nuspec‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@
1919
<dependency id="DynamicLanguageRuntime" version="[1.2.3-alpha0]" />
2020
</group>
2121
<group targetFramework="netcoreapp2.0">
22-
<dependency id="System.Text.Encoding.CodePages" version="4.5.0" />
22+
<dependency id="System.Text.Encoding.CodePages" version="4.5.1" />
2323
<dependency id="Microsoft.Win32.Registry" version="4.5.0" />
2424
<dependency id="DynamicLanguageRuntime" version="[1.2.3-alpha0]" />
2525
</group>
2626
<group targetFramework="netcoreapp2.1">
27-
<dependency id="System.Text.Encoding.CodePages" version="4.5.0" />
27+
<dependency id="System.Text.Encoding.CodePages" version="4.5.1" />
2828
<dependency id="Microsoft.Win32.Registry" version="4.5.0" />
2929
<dependency id="DynamicLanguageRuntime" version="[1.2.3-alpha0]" />
3030
</group>
3131
<group targetFramework="netstandard2.0">
32-
<dependency id="System.Text.Encoding.CodePages" version="4.5.0" />
32+
<dependency id="System.Text.Encoding.CodePages" version="4.5.1" />
3333
<dependency id="Microsoft.Win32.Registry" version="4.5.0" />
3434
<dependency id="DynamicLanguageRuntime" version="[1.2.3-alpha0]" />
3535
</group>

‎Package/nuget/NuGet.Packaging.targets‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
</ItemGroup>
1313

1414
<PropertyGroup>
15-
<NuSpecInputs>@(Package->'%(NuSpecDir)\%(Identity).nuspec')</NuSpecInputs>
16-
<NuPkgOutputs>@(Package->'$(PackageDir)\%(Identity).$(PackageVersion).nupkg')</NuPkgOutputs>
15+
<NuSpecInputs>@(Package->'%(NuSpecDir)/%(Identity).nuspec')</NuSpecInputs>
16+
<NuPkgOutputs>@(Package->'$(PackageDir)/%(Identity).$(PackageVersion).nupkg')</NuPkgOutputs>
1717
</PropertyGroup>
1818

1919
<Target Name="NuGetPackage" DependsOnTargets="Stage" AfterTargets="Package"
@@ -29,7 +29,7 @@
2929
<Copy SourceFiles="@(DLLsFiles)" CopiedFiles="@(CopiedFiles)" DestinationFolder="$([System.IO.Path]::GetFullPath('%(DLLsFiles.RecursiveDir)\..'))">
3030
<Output TaskParameter="CopiedFiles" ItemName="TempCopied" />
3131
</Copy>
32-
<Exec Command="$(NuGet) pack &quot;%(NuSpecDir)\%(Package.Identity).nuspec&quot; -BasePath &quot;$(StageDir)&quot; -OutputDirectory &quot;$(PackageDir)&quot; -Version $(PackageVersion) %(NuSpecArguments)" />
32+
<Exec Command="$(NuGet) pack &quot;%(NuSpecDir)/%(Package.Identity).nuspec&quot; -BasePath &quot;$(StageDir)&quot; -OutputDirectory &quot;$(PackageDir)&quot; -Version $(PackageVersion) %(NuSpecArguments)" />
3333
<!-- Delete the copied files -->
3434
<Delete Files="@(TempCopied)" />
3535
</Target>

‎Src/DLR‎

Submodule DLR updated 39 files

‎Src/IronPython.Modules/IronPython.Modules.csproj‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,33 @@
77
<DocumentationFile>$(OutputPath)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
88
</PropertyGroup>
99

10-
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
11-
<Reference Include="Mono.Posix" Condition=" '$(Mono)' == 'true' ">
12-
<SpecificVersion>False</SpecificVersion>
10+
<ItemGroup Condition=" '$(IsFullFramework)' == 'true' ">
11+
<Reference Include="Mono.Posix" Version="4.0.0">
12+
<Private>True</Private>
13+
<HintPath>..\..\Util\References\Mono.Posix.dll</HintPath>
1314
</Reference>
14-
<PackageReference Include="Mono.Posix" Version="5.4.0.201" Condition=" '$(Mono)' != 'true' " />
1515
</ItemGroup>
16-
<ItemGroup>
17-
<PackageReference Include="Mono.Posix.NETStandard" Version="1.0.0" Condition=" '$(TargetFramework)' == 'netcoreapp2.0' OR '$(TargetFramework)' == 'netcoreapp2.1' OR '$(TargetFramework)' == 'netstandard2.0' " />
16+
<ItemGroup Condition=" '$(IsFullFramework)' == 'false' ">
17+
<PackageReference Include="Mono.Posix.NETStandard" Version="1.0.0" />
1818
</ItemGroup>
1919

2020
<ItemGroup>
2121
<ProjectReference Include="..\IronPython\IronPython.csproj" />
2222
</ItemGroup>
2323

2424
<ItemGroup>
25-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-18618-05" PrivateAssets="All" Condition="'$(MSBuildRuntimeType)' == 'Full'" />
25+
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0-preview.1">
26+
<PrivateAssets>all</PrivateAssets>
27+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
28+
</PackageReference>
29+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-18618-05" PrivateAssets="All" />
2630
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.3">
2731
<PrivateAssets>all</PrivateAssets>
2832
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
2933
</PackageReference>
3034
</ItemGroup>
3135

32-
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' OR '$(TargetFramework)' == 'netcoreapp2.1' OR '$(TargetFramework)' == 'netstandard2.0' ">
36+
<ItemGroup Condition=" '$(IsFullFramework)' == 'false' ">
3337
<PackageReference Include="Microsoft.Win32.Registry" Version="4.5.0" />
3438
</ItemGroup>
3539

0 commit comments

Comments
 (0)