Skip to content

Commit

Permalink
Linux build (#2477)
Browse files Browse the repository at this point in the history
* Linux build fix

* a

* aaa

* build works

* Use 18.04

* Add ref

* Actually update Ubuntu version

* Procdump
  • Loading branch information
nohwnd authored Jul 16, 2020
1 parent 9380017 commit 069d8bd
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 42 deletions.
18 changes: 8 additions & 10 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,12 @@ jobs:
testResultsFiles: '**\*.trx'
condition: succeededOrFailed()

# Linux build does not work when we mix runtimes and
# we don't use the results to do anything, skipping it for now
# - job: Linux
# pool:
# vmImage: 'ubuntu-16.04'
# variables:
# buildConfiguration: 'Release'
# steps:
# - script: ./build.sh -c $(buildConfiguration)
# displayName: './build.sh -c $(buildConfiguration)'
- job: Linux
pool:
vmImage: 'ubuntu-18.04'
variables:
buildConfiguration: 'Release'
steps:
- script: ./build.sh -c $(buildConfiguration)
displayName: './build.sh -c $(buildConfiguration)'

4 changes: 2 additions & 2 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ NOCOLOR='\033[0m'
# Parse options
#
CONFIGURATION="Debug"
TARGET_RUNTIME="ubuntu.16.04-x64"
TARGET_RUNTIME="ubuntu.18.04-x64"
VERSION="" # Will set this later by reading TestPlatform.Settings.targets file.
VERSION_SUFFIX="dev"
FAIL_FAST=false
Expand Down Expand Up @@ -238,7 +238,7 @@ function invoke_build()
log ".. .. Build: Source: $TPB_Solution"

# Workaround for https://github.com/dotnet/sdk/issues/335
export FrameworkPathOverride=$TP_PACKAGES_DIR/microsoft.targetingpack.netframework.v4.6/1.0.1/lib/net46/
export FrameworkPathOverride=$TP_PACKAGES_DIR/microsoft.targetingpack.netframework.v4.7.2/1.0.0/lib/net472/
if [ -z "$PROJECT_NAME_PATTERNS" ]
then
if [[ $TP_USE_REPO_API = 0 ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,18 @@
<ProjectReference Include="..\Microsoft.TestPlatform.ObjectModel\Microsoft.TestPlatform.ObjectModel.csproj" />
<ProjectReference Include="..\..\src\Microsoft.TestPlatform.CoreUtilities\Microsoft.TestPlatform.CoreUtilities.csproj" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
<Reference Include="System" />
<Reference Include="System.Runtime" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="netstandard" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Diagnostics.NETCore.Client">
<Version>0.2.0-preview.20220.1</Version>
</PackageReference>
<PackageReference Include="NETStandard.Library" Version="2.0.3" />
</ItemGroup>
<ItemGroup>
<Compile Update="Resources\Resources.Designer.cs">
Expand All @@ -42,21 +49,5 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Diagnostics.NETCore.Client">
<Version>0.2.0-preview.20220.1</Version>
</PackageReference>
</ItemGroup>
<!-- <ItemGroup>
<None Update="procdump">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="procdump.exe">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="procdump64.exe">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup> -->
<Import Project="$(TestPlatformRoot)scripts\build\TestPlatform.targets" />
</Project>
8 changes: 4 additions & 4 deletions src/package/external/external.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</PropertyGroup>
<Import Project="$(TestPlatformRoot)scripts/build/TestPlatform.Settings.targets" />
<PropertyGroup>
<TargetFrameworks>net46</TargetFrameworks>
<TargetFrameworks>net472</TargetFrameworks>
<AssemblyName>restore</AssemblyName>
<RuntimeIdentifier>win7-x64</RuntimeIdentifier>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
Expand Down Expand Up @@ -94,10 +94,10 @@
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<!-- Required for resolution of desktop dependencies in non windows environment.
We've to set to net46 since the net451 and other packages have assemblies in wrong case.
We've to set to net472 since the net451 and other packages have assemblies in wrong case.
E.g. System.XML instead of System.Xml. -->
<PackageReference Include="Microsoft.TargetingPack.NETFramework.v4.6">
<Version>1.0.1</Version>
<PackageReference Include="Microsoft.TargetingPack.NETFramework.v4.7.2">
<Version>1.0.0</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/vstest.console/vstest.console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<Reference Include="System" />
<Reference Include="System.IO" />
<Reference Include="System.Runtime" />
<Reference Include="System.Collections" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.TestPlatform.Extensions.BlameDataCollector\Microsoft.TestPlatform.Extensions.BlameDataCollector.csproj" />
<PackageReference Include="NETStandard.Library" Version="2.0.3" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
<Reference Include="System.Runtime" />
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Xml" />
<Reference Include="netstandard" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ public void GetTestHostProcessStartInfoOnWindowsForValidPathReturnsFullPathOfDot
char separator = ';';
var dotnetExeName = "dotnet.exe";
#if !NET451
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
if (!System.Environment.OSVersion.Platform.ToString().StartsWith("Win"))
{
separator = ':';
dotnetExeName = "dotnet";
Expand All @@ -519,7 +519,7 @@ public void GetTestHostProcessStartInfoShouldThrowExceptionWhenDotnetIsNotInstal

char separator = ';';
var dotnetExeName = "dotnet.exe";
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
if (!System.Environment.OSVersion.Platform.ToString().StartsWith("Win"))
{
separator = ':';
dotnetExeName = "dotnet";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,18 @@
<PropertyGroup>
<OutputType Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">Exe</OutputType>
<AssemblyName>Microsoft.TestPlatform.TestHostProvider.UnitTests</AssemblyName>
<TargetFrameworks>netcoreapp2.1;net451</TargetFrameworks>
<TargetFrameworks>netcoreapp2.1;net472</TargetFrameworks>
<EnableCodeAnalysis>true</EnableCodeAnalysis>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.TestPlatform.TestHostProvider\Microsoft.TestPlatform.TestHostProvider.csproj" />
<ProjectReference Include="..\Microsoft.TestPlatform.Common.UnitTests\Microsoft.TestPlatform.Common.UnitTests.csproj" />
<ProjectReference Include="..\..\src\Microsoft.TestPlatform.PlatformAbstractions\Microsoft.TestPlatform.PlatformAbstractions.csproj" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
<Reference Include="System.Runtime" />
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Xml" />
<Reference Include="netstandard" />
</ItemGroup>
<Import Project="$(TestPlatformRoot)scripts\build\TestPlatform.targets" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Xml" />
<Reference Include="System.Threading.Tasks" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="DefaultCodeCoverageConfig.xml" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
<Reference Include="System.Runtime" />
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<ItemGroup>
<ProjectReference Include="..\..\src\datacollector\datacollector.csproj" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
<Reference Include="System.Runtime" />
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
Expand Down

0 comments on commit 069d8bd

Please sign in to comment.