Skip to content

Commit

Permalink
Fixed linux build
Browse files Browse the repository at this point in the history
  • Loading branch information
Haplois committed Nov 3, 2020
1 parent 2f9043d commit 0dba966
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
10 changes: 6 additions & 4 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,16 @@ function install_cli()
return 1
fi
chmod u+x $install_script
# Get netcoreapp1.1 shared components
$install_script --runtime dotnet --version "2.1.0" --channel "release/2.1.0" --install-dir "$TP_DOTNET_DIR" --no-path --architecture x64
$install_script --runtime dotnet --version "3.1.0" --channel "release/3.1.0" --install-dir "$TP_DOTNET_DIR" --no-path --architecture x64

log "install_cli: Get the latest dotnet cli toolset..."
$install_script --install-dir "$TP_DOTNET_DIR" --no-path --channel "master" --version $DOTNET_CLI_VERSION

# Get netcoreapp1.1 shared components
$install_script --install-dir "$TP_DOTNET_DIR" --no-path --channel "release/2.1.0" --version "2.1.0" --runtime dotnet
#log "install_cli: Get shared components which is compatible with dotnet cli version $DOTNET_CLI_VERSION..."
#$install_script --install-dir "$TP_DOTNET_DIR" --no-path --channel "master" --version $DOTNET_RUNTIME_VERSION --runtime dotnet

log " ---- dotnet x64"
"$TP_DOTNET_DIR/dotnet" --info
fi

local dotnet_path=$(_get_dotnet_path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
<Import Project="$(TestPlatformRoot)scripts/build/TestPlatform.Settings.targets" />
<PropertyGroup>
<AssemblyName>Microsoft.TestPlatform.PlatformAbstractions</AssemblyName>
<TargetFrameworks>netcoreapp2.1;net451;uap10.0;netstandard2.0;netstandard1.0</TargetFrameworks>
<TargetFrameworks>netcoreapp2.1;netstandard2.0;netstandard1.0;net451</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);uap10.0</TargetFrameworks>
<TargetFrameworks Condition=" '$(DotNetBuildFromSource)' == 'true' ">netstandard2.0;netstandard1.0;netcoreapp2.1</TargetFrameworks>
<EnableCodeAnalysis>true</EnableCodeAnalysis>
<NoWarn>NU1605</NoWarn>
Expand All @@ -21,10 +22,6 @@
<TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<DefineConstants>$(DefineConstants);WINDOWS_UWP</DefineConstants>

<!-- On non windows environment, make UAP behave like desktop .NET framework -->
<TargetFrameworkIdentifier Condition="'$(OS)' != 'Windows_NT'">.NETFramework</TargetFrameworkIdentifier>
<TargetFrameworkVersion Condition="'$(OS)' != 'Windows_NT'">v4.5.1</TargetFrameworkVersion>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">
Expand Down
10 changes: 6 additions & 4 deletions src/datacollector/datacollector.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
</PropertyGroup>
<PropertyGroup>
<AssemblyName>datacollector</AssemblyName>
<TargetFrameworks>netcoreapp2.1;net472</TargetFrameworks>
<TargetFrameworks>netcoreapp2.1</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'WINDOWS_NT' ">$(TargetFrameworks);net472</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'WINDOWS_NT' ">$(TargetFrameworks);net451</TargetFrameworks>
<TargetFrameworks Condition=" '$(DotNetBuildFromSource)' == 'true' ">netcoreapp2.1</TargetFrameworks>
<WarningsAsErrors>true</WarningsAsErrors>
<PlatformTarget Condition="'$(TargetFramework)' == 'net451'">AnyCPU</PlatformTarget>
<PlatformTarget Condition="$(TargetFramework.StartsWith('net4'))">AnyCPU</PlatformTarget>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net451'">
<PropertyGroup Condition="$(TargetFramework.StartsWith('net4'))">
<RuntimeIdentifier>win7-x64</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup>
Expand All @@ -29,7 +31,7 @@
<FromP2P>true</FromP2P>
</ProjectReference>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
<ItemGroup Condition="$(TargetFramework.StartsWith('net4'))">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Xml" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<FromP2P>true</FromP2P>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' != 'net451' ">
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
Expand Down

0 comments on commit 0dba966

Please sign in to comment.