Skip to content

Commit

Permalink
Upgrade netcoreapp from Multitool (#1962)
Browse files Browse the repository at this point in the history
* Upgrade netcoreapp from Multitool

update

* adding system.runtime
  • Loading branch information
eddynaka authored Jul 2, 2020
1 parent a84947f commit b234ef5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
14 changes: 7 additions & 7 deletions scripts/BuildMultitoolForNpm.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.SYNOPSIS
Build and package the Sarif Multitool NPM package.
.DESCRIPTION
Builds the Sarif.Multitool NPM package, including building the .NET Core 3.0 single-file-exe of the Multitool for all supported platforms.
Builds the Sarif.Multitool NPM package, including building the .NET Core 3.1 single-file-exe of the Multitool for all supported platforms.
.PARAMETER Configuration
The build configuration: Release or Debug. Default=Release
#>
Expand Down Expand Up @@ -38,15 +38,15 @@ $npmBuildFolder = "$BuildRoot\Publish\npm"
if (-not $SkipBuild) {
Write-Information "Building Sarif.Multitool for Windows, Linux, and MacOS..."
foreach ($runtime in "win-x64", "linux-x64", "osx-x64") {
dotnet publish $SourceRoot\$project\$project.csproj -c $Configuration -f netcoreapp3.0 -r $runtime
dotnet publish $SourceRoot\$project\$project.csproj -c $Configuration -f netcoreapp3.1 -r $runtime
}

Write-Information "Merging binaries [$projectBinDirectory] and NPM configuration [$npmSourceFolder]..."
New-DirectorySafely $npmBuildFolder\
Copy-Item -Force -Container -Recurse -Path $npmSourceFolder\* -Destination $npmBuildFolder\
Copy-Item -Force -Container -Recurse -Path $projectBinDirectory\Publish\netcoreapp3.0\win-x64\* -Destination $npmBuildFolder\sarif-multitool-win32\
Copy-Item -Force -Container -Recurse -Path $projectBinDirectory\Publish\netcoreapp3.0\linux-x64\* -Destination $npmBuildFolder\sarif-multitool-linux\
Copy-Item -Force -Container -Recurse -Path $projectBinDirectory\Publish\netcoreapp3.0\osx-x64\* -Destination $npmBuildFolder\sarif-multitool-darwin\
Copy-Item -Force -Container -Recurse -Path $projectBinDirectory\Publish\netcoreapp3.1\win-x64\* -Destination $npmBuildFolder\sarif-multitool-win32\
Copy-Item -Force -Container -Recurse -Path $projectBinDirectory\Publish\netcoreapp3.1\linux-x64\* -Destination $npmBuildFolder\sarif-multitool-linux\
Copy-Item -Force -Container -Recurse -Path $projectBinDirectory\Publish\netcoreapp3.1\osx-x64\* -Destination $npmBuildFolder\sarif-multitool-darwin\
}

# Match SARIF SDK version (from 2.2.1 forward).
Expand All @@ -67,8 +67,8 @@ foreach ($package in (Get-ChildItem $npmBuildFolder).FullName) {

# After merging outputs, delete the other 250MB copies of the Multitool single file exes (saving only the bld\Publish\npm copy)
if (-not $NoPostClean) {
Remove-DirectorySafely $projectBinDirectory\netcoreapp3.0
Remove-DirectorySafely $projectBinDirectory\Publish\netcoreapp3.0
Remove-DirectorySafely $projectBinDirectory\netcoreapp3.1
Remove-DirectorySafely $projectBinDirectory\Publish\netcoreapp3.1
}

Write-Information "$ScriptName SUCCEEDED."
4 changes: 2 additions & 2 deletions src/Sarif.Multitool/Sarif.Multitool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.props))\build.props" />

<PropertyGroup>
<TargetFrameworks>netcoreapp3.0;netcoreapp2.1;net461</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;netcoreapp2.1;net461</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -77,7 +77,7 @@

<ItemGroup>
<EmbeddedResource Include=".\DotnetToolSettings.xml" CopyToOutputDirectory="PreserveNewest" />
<EmbeddedResource Include="$(MsBuildThisFileDirectory)..\Sarif\Schemata\sarif-$(SchemaVersionAsPublishedToSchemaStoreOrg).json" Link="sarif-2.1.0.json" CopyToOutputDirectory="PreserveNewest"/>
<EmbeddedResource Include="$(MsBuildThisFileDirectory)..\Sarif\Schemata\sarif-$(SchemaVersionAsPublishedToSchemaStoreOrg).json" Link="sarif-2.1.0.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/Sarif/Sarif.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

<ItemGroup>
<Reference Condition="'$(TargetFramework)' == 'net45' Or '$(TargetFramework)' == 'net461' " Include="System.Web" />
<Reference Condition="'$(TargetFramework)' == 'net45' " Include="System.Runtime" />
</ItemGroup>

<ItemGroup Label="Packaging">
Expand Down

0 comments on commit b234ef5

Please sign in to comment.