Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Switch to package references #475

Merged
merged 7 commits into from
Sep 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions dir.props → Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<RepositoryRootDirectory>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))</RepositoryRootDirectory>
<SourceProjectsDirectory>$(RepositoryRootDirectory)src</SourceProjectsDirectory>
</PropertyGroup>

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<OutputDrop>$(TF_BUILD_BINARIESDIRECTORY)</OutputDrop>
<OutputDrop Condition=" '$(OutputDrop)' == '' ">$(MSBuildThisFileDirectory)bin\$(Configuration)\</OutputDrop>
<OutputIntermediate>$(MSBuildThisFileDirectory)obj\$(Configuration)</OutputIntermediate>
<NoWarn>1570,1572,1573,1574,1591</NoWarn>
<NoWarn>$(NoWarn),1570,1572,1573,1574,1591,1701</NoWarn>
</PropertyGroup>

<PropertyGroup>
<OutputFullPath>$(MSBuildThisFileDirectory)</OutputFullPath>
<OutputDrop Condition=" '$(OutputDrop)' == '' ">$(OutputFullPath)bin\$(Configuration)\</OutputDrop>
<OutputPath>$(OutputDrop)\$(MSBuildProjectName)\</OutputPath>
<DocumentationFile>$(OutputPath)$(MSBuildProjectName).xml</DocumentationFile>
<BaseIntermediateOutputPath>$(OutputFullPath)obj\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
</PropertyGroup>

<!-- Assembly signing not supported on Linux, yet.
`CS7027: Error signing output with public key from file` -->
<PropertyGroup Condition="'$(OS)' == 'Windows_NT'">
Expand Down Expand Up @@ -42,4 +46,8 @@
<PackageTags>.NET portability apiport</PackageTags>
<Copyright>Copyright 2017</Copyright>
</PropertyGroup>

<!-- Some of the project types do not have a pack target. This creates a default empty pack target that will be overridden in supported project types -->
<Target Name="Pack">
</Target>
</Project>
18 changes: 13 additions & 5 deletions dir.targets → Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,22 @@

<!-- Get version info from file -->
<VersionFile>$(MSBuildProjectDirectory)\Properties\version.txt</VersionFile>
<VersionData>1.0.0</VersionData>
<VersionData Condition="Exists('$(VersionFile)')">$([System.IO.File]::ReadAllText($(VersionFile)).Trim())</VersionData>
<Version>1.0.0</Version>
<Version Condition="Exists('$(VersionFile)')">$([System.IO.File]::ReadAllText($(VersionFile)).Trim())</Version>

<!-- Set informational version -->
<InformationVersion>$(VersionData)</InformationVersion>
<InformationVersion>$(Version)</InformationVersion>
<InformationVersion Condition=" '$(VersionSuffix)' != '' ">$(InformationVersion)-$(VersionSuffix)-$(BuildVersion)</InformationVersion>
<BasicVersion>$(Version)</BasicVersion>
<Version Condition=" '$(VersionSuffix)' != '' ">$(Version)-$(VersionSuffix)</Version>
</PropertyGroup>

<ItemGroup>
<AssemblyVersionAttribute Include="System.Reflection.AssemblyVersionAttribute">
<_Parameter1>$(VersionData)</_Parameter1>
<_Parameter1>$(BasicVersion)</_Parameter1>
</AssemblyVersionAttribute>
<AssemblyVersionAttribute Include="System.Reflection.AssemblyFileVersionAttribute">
<_Parameter1>$(VersionData)</_Parameter1>
<_Parameter1>$(BasicVersion)</_Parameter1>
</AssemblyVersionAttribute>
<AssemblyVersionAttribute Include="System.Reflection.AssemblyInformationalVersionAttribute">
<_Parameter1>$(InformationVersion)</_Parameter1>
Expand All @@ -76,6 +78,12 @@
</AssemblyVersionAttribute>
</ItemGroup>

<ItemGroup>
<PackageReference Include="MicroBuild.Core" Version="0.2.0">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>

<Target Name="GenerateAssemblyInfoFile" BeforeTargets="BeforeBuild">
<MakeDir Directories="$(IntermediateOutputPath)" Condition="!Exists('$(IntermediateOutputPath)')" />
<WriteCodeFragment AssemblyAttributes="@(AssemblyVersionAttribute)" Language="C#" OutputFile="$(IntermediateOutputPath)\_GlobalAssemblyInfo.g.cs">
Expand Down
1 change: 0 additions & 1 deletion PortabilityTools.VisualStudio.Imports.targets
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
<VSIXSourceItem Include="$(OutputPath)\System.Buffers.dll" />
<VSIXSourceItem Include="$(OutputPath)\System.Collections.NonGeneric.dll" />
<VSIXSourceItem Include="$(OutputPath)\System.Console.dll" />
<VSIXSourceItem Include="$(OutputPath)\System.Diagnostics.DiagnosticSource.dll" />
<VSIXSourceItem Include="$(OutputPath)\System.Globalization.Calendars.dll" />
<VSIXSourceItem Include="$(OutputPath)\System.IO.Compression.dll" />
<VSIXSourceItem Include="$(OutputPath)\System.IO.Compression.ZipFile.dll" />
Expand Down
11 changes: 3 additions & 8 deletions PortabilityTools.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26730.3
VisualStudioVersion = 15.0.26730.15
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C991F5FC-04B5-420C-98A0-80974AA946F7}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -23,11 +23,6 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{FEEF35CB-3AC4-40C5-9CB0-85E52E38D5C6}"
ProjectSection(SolutionItems) = preProject
build\Get-Nuget.ps1 = build\Get-Nuget.ps1
build\Microsoft.Fx.Portability.MetadataReader.nuspec = build\Microsoft.Fx.Portability.MetadataReader.nuspec
build\Microsoft.Fx.Portability.nuspec = build\Microsoft.Fx.Portability.nuspec
build\Microsoft.Fx.Portability.Offline.nuspec = build\Microsoft.Fx.Portability.Offline.nuspec
build\Microsoft.Fx.Portability.Reports.Html.nuspec = build\Microsoft.Fx.Portability.Reports.Html.nuspec
build\Microsoft.Fx.Portability.Reports.Json.nuspec = build\Microsoft.Fx.Portability.Reports.Json.nuspec
build\package.ps1 = build\package.ps1
build\postbuild.ps1 = build\postbuild.ps1
build\restore.ps1 = build\restore.ps1
Expand Down Expand Up @@ -61,7 +56,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiPort.VisualStudio", "src
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Fx.Portability.Cci", "src\Microsoft.Fx.Portability.Cci\Microsoft.Fx.Portability.Cci.csproj", "{B0468D19-0F98-49A8-BA28-926331C72E26}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiPortVS.Tests", "tests\ApiPortVS.Tests\ApiPortVS.Tests.csproj", "{2D8DA586-E0EA-4AD1-BA3C-E4AC0310A45E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApiPortVS.Tests", "tests\ApiPortVS.Tests\ApiPortVS.Tests.csproj", "{2D8DA586-E0EA-4AD1-BA3C-E4AC0310A45E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Fx.Portability.Cci.Tests", "tests\Microsoft.Fx.Portability.Cci.Tests\Microsoft.Fx.Portability.Cci.Tests.csproj", "{6917BF09-E416-43F9-B184-4691AF473271}"
EndProject
Expand All @@ -73,7 +68,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiPort.VisualStudio.2017",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiPort.VisualStudio.Common", "src\ApiPort.VisualStudio.Common\ApiPort.VisualStudio.Common.csproj", "{60798B82-B273-4D39-AA52-021C7228A0AD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiPort.Tests", "tests\ApiPort.Tests\ApiPort.Tests.csproj", "{EE708186-6345-486D-9810-17D98439DAAE}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApiPort.Tests", "tests\ApiPort.Tests\ApiPort.Tests.csproj", "{EE708186-6345-486D-9810-17D98439DAAE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
4 changes: 1 addition & 3 deletions build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@ SET VersionSuffix=alpha
:: Default to a release build
IF "%Configuration%"=="" SET Configuration=Release

powershell -noprofile -executionpolicy bypass -file build.ps1 %Configuration% "AnyCPU" -RunTests -CreateNugetPackages -VersionSuffix %VersionSuffix%
powershell -noprofile -executionpolicy bypass -file build.ps1 %Configuration% "x64" -VersionSuffix %VersionSuffix%
powershell -noprofile -executionpolicy bypass -file build.ps1 %Configuration% "x86" -VersionSuffix %VersionSuffix%
powershell -noprofile -executionpolicy bypass -file .\build.ps1 %Configuration% "AnyCPU" -RunTests -VersionSuffix %VersionSuffix%
17 changes: 7 additions & 10 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -61,26 +61,23 @@ if (!(Test-Path $binFolder)) {
New-Item $binFolder -ItemType Directory
}

& $root\build\restore.ps1
& "$root\build\Get-CatalogFile.ps1" $root\.data\catalog.bin

# PortabilityTools.sln understands "Any CPU" not "AnyCPU"
$PlatformToUse = $Platform

if ($Platform -eq "AnyCPU") {
$PlatformToUse = "Any CPU"
}

pushd $root
Push-Location $root

& $MSBuild PortabilityTools.sln /p:Configuration=$Configuration /p:Platform="$PlatformToUse" /nologo /m /v:m /nr:false /flp:logfile=$binFolder\msbuild.log`;verbosity=$Verbosity
& $MSBuild PortabilityTools.sln "/t:restore;build;pack" /p:Configuration=$Configuration /p:Platform="$PlatformToUse" /nologo /m /v:m /nr:false /flp:logfile=$binFolder\msbuild.log`;verbosity=$Verbosity /p:DeployExtension=false

popd
Pop-Location

if ($RunTests) {
.\build\runtests.ps1 $Configuration
& "$root\build\runtests.ps1" $Configuration
}

if ($CreateNugetPackages) {
.\build\postbuild.ps1 $Configuration -CreateNugetPackages
} else {
.\build\postbuild.ps1 $Configuration
}
& "$root\build\postbuild.ps1" $Configuration
11 changes: 3 additions & 8 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ export NUGET_HTTP_CACHE_PATH=~/.local/share/NuGet/v3-cache

Configuration=Debug

DotNetSDKChannel="preview"
DotNetSDKVersion="1.0.4"

RootDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
DotNetSDKPath=$RootDir"/.tools/dotnet/"$DotNetSDKVersion
DotNetExe=$DotNetSDKPath"/dotnet"
Expand All @@ -19,6 +16,8 @@ TestResults=$RootDir"/TestResults"
usage() { echo "Usage: build.sh [-c|--configuration <Debug|Release>]"; }

prebuild() {
$DotNetExe restore

local catalog=$RootDir"/.data/catalog.bin"
local data=$(dirname $catalog)

Expand All @@ -44,16 +43,13 @@ installSDK() {
mkdir -p $DotNetToolsPath
fi

echo "Installing "$DotNetSDKVersion"from "$DotNetSDKChannel" channel..."

$RootDir/build/dotnet-install.sh --channel $DotNetSDKChannel --version $DotNetSDKVersion --install-dir $DotNetSDKPath
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 1.0 --install-dir $DotNetSDKPath
}

build() {
echo "Building ApiPort... Configuration: ["$Configuration"]"

pushd src/ApiPort > /dev/null
$DotNetExe restore
$DotNetExe build -f netcoreapp1.0 -c $Configuration
popd > /dev/null
}
Expand All @@ -63,7 +59,6 @@ runTest() {
do
if awk -F: '/<TargetFramework>netcoreapp1\.[0-9]<\/TargetFramework>/ { found = 1 } END { if (found == 1) { exit 0 } else { exit 1 } }' $file; then
echo "Testing "$file
$DotNetExe restore
$DotNetExe test $file -c $Configuration --logger trx
else
# Can remove this when: https://github.com/dotnet/sdk/issues/335 is resolved
Expand Down
29 changes: 0 additions & 29 deletions build/Microsoft.Fx.Portability.MetadataReader.nuspec

This file was deleted.

29 changes: 0 additions & 29 deletions build/Microsoft.Fx.Portability.Offline.nuspec

This file was deleted.

27 changes: 0 additions & 27 deletions build/Microsoft.Fx.Portability.Reports.Html.nuspec

This file was deleted.

29 changes: 0 additions & 29 deletions build/Microsoft.Fx.Portability.Reports.Json.nuspec

This file was deleted.

30 changes: 0 additions & 30 deletions build/Microsoft.Fx.Portability.nuspec

This file was deleted.

Loading