Skip to content

Commit

Permalink
Build/test upgrades
Browse files Browse the repository at this point in the history
- Update assembly info in project file instead of AssemblyVersion.fs
- update README
- build with VS2019
- run test with `dotnet test`
- fix tests in ADO runner
- upgrade test runner nuget
  • Loading branch information
blumu committed Jul 13, 2019
1 parent 4ca3e05 commit 8736e3e
Show file tree
Hide file tree
Showing 15 changed files with 99 additions and 120 deletions.
23 changes: 10 additions & 13 deletions CI-vsts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
# SignBuild - Set to 'true' if code signing is required
# PublishRelease - Set to 'true' to publish a new release to Github and Nuget

queue:
demands: vstest
pool:
vmImage: windows-2019

variables:
# Increase version number before every official release (if PublishRelease is set to true)
Expand All @@ -31,22 +31,19 @@ steps:
inputs:
arguments: '--no-incremental /t:rebuild /p:Configuration="$(BuildConfiguration)"'

- task: VSTest@2
displayName: Test Assemblies
- task: DotNetCoreCLI@2
displayName: dotnet test
inputs:
testAssemblyVer2: |
**\*test*.dll
!**\obj\**
vsTestVersion: '15.0'
runInParallel: false
codeCoverageEnabled: false
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
command: test
arguments: --no-build --collect:"Code Coverage" --configuration $(BuildConfiguration) --test-adapter-path $(System.DefaultWorkingDirectory)\FSharpLu.Tests\bin\$(BuildConfiguration)\net472
projects: |-
**\\*test*.fsproj
**\\*test*.csproj
- task: DotNetCoreCLI@2
displayName: dotnet build with delaysigning
inputs:
arguments: '--no-incremental /t:rebuild /p:Configuration="$(BuildConfiguration)" /p:CompilationSymbols=DELAYSIGNING'
arguments: '--no-incremental /t:rebuild /p:Configuration="$(BuildConfiguration)" /p:DELAYSIGNING=True'

- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: ESRP CodeSign .Net assemblies
Expand Down
8 changes: 6 additions & 2 deletions FSharpLu.Azure.Test/FSharpLu.Azure.Test.fsproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.2</TargetFrameworks>
<TargetFrameworks>net472</TargetFrameworks>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<ProductName>Microsoft.FSharpLu.Azure.Test</ProductName>
<Copyright>Microsoft</Copyright>
<Description></Description>
<AssemblyVersion>0.11.*</AssemblyVersion>
<PackageVersion>0.11.0-pre</PackageVersion>
<Version>0.11.0</Version>
<Title>Microsoft.FSharpLu.Azure.Test</Title>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<Compile Include="Azure.Test.Keyvault.fs" />
Expand All @@ -17,7 +19,9 @@
<Compile Include="Azure.Test.Queue.fs" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="FSharp.Core" Version="4.5.4" />
<PackageReference Include="FsCheck" Version="2.14.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
<PackageReference Include="xunit" Version="2.4.1" />
Expand Down
11 changes: 10 additions & 1 deletion FSharpLu.Azure/FSharpLu.Azure.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,17 @@
<Copyright>Microsoft</Copyright>
<Description>Azure Management Helpers API for F#</Description>
<Company>Microsoft</Company>
<AssemblyVersion>0.11.*</AssemblyVersion>
<Version>0.11.0</Version>
<PackageId>Microsoft.FSharpLu.Azure</PackageId>
<PackageVersion>0.11.0-pre</PackageVersion>
<Title>Microsoft.FSharpLu.Azure.Test</Title>
</PropertyGroup>
<PropertyGroup Condition=" '$(DELAYSIGNING)' == 'True' ">
<SignAssembly>true</SignAssembly>
<DelaySign>true</DelaySign>
<AssemblyOriginatorKeyFile>..\msft-StrongName.pub</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<Compile Include="HttpCommunication.fs" />
<Compile Include="Types.fs" />
Expand All @@ -36,6 +44,7 @@
<Compile Include="AzureFunctions.fs" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="FSharp.Core" Version="4.5.4" />
<PackageReference Include="FSharp.Control.AsyncSeq" Version="2.0.21" />
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.10.0" />
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.7" />
Expand Down
15 changes: 0 additions & 15 deletions FSharpLu.Json/AssemblyInfo.fs

This file was deleted.

11 changes: 8 additions & 3 deletions FSharpLu.Json/FSharpLu.Json.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@
<RepositoryType>Git</RepositoryType>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<AssemblyVersion>0.11.*</AssemblyVersion>
<Version>0.11.0</Version>
<Title>FSharpLu Json Utilities for F#</Title>
</PropertyGroup>
<PropertyGroup Condition=" '$(DELAYSIGNING)' == 'True' ">
<SignAssembly>true</SignAssembly>
<DelaySign>true</DelaySign>
<AssemblyOriginatorKeyFile>..\msft-StrongName.pub</AssemblyOriginatorKeyFile>
</PropertyGroup>


<ItemGroup>
<None Include="..\LICENSE.MD" Pack="true" PackagePath="$(PackageLicenseFile)"/>
<None Include="..\LICENSE.MD" Pack="true" PackagePath="$(PackageLicenseFile)" />
</ItemGroup>

<PropertyGroup>
Expand All @@ -46,7 +52,6 @@
</PropertyGroup>

<ItemGroup>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="Helpers.fs" />
<Compile Include="WithFunctor.fs" />
<Compile Include="Default.fs" />
Expand Down
5 changes: 3 additions & 2 deletions FSharpLu.Tests/FSharpLu.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<TargetFrameworks>net452;net462;net472</TargetFrameworks>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<Compile Include="Async.fs" />
Expand Down Expand Up @@ -32,8 +33,8 @@
</ItemGroup>
<ItemGroup />
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />

<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
<PackageReference Include="FsCheck" Version="2.13.0" />
Expand Down
15 changes: 0 additions & 15 deletions FSharpLu.Windows/AssemblyInfo.fs

This file was deleted.

23 changes: 10 additions & 13 deletions FSharpLu.Windows/FSharpLu.Windows.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<AssemblyTitle>FSharpLu.Windows</AssemblyTitle>
<AssemblyVersion>0.11.*</AssemblyVersion>
<AssemblyName>Microsoft.FSharpLu.Windows</AssemblyName>

<Version>0.11.0</Version>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\Microsoft.FSharpLu.Windows.Xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(DELAYSIGNING)' == 'True' ">
<SignAssembly>true</SignAssembly>
<DelaySign>true</DelaySign>
<AssemblyOriginatorKeyFile>..\msft-StrongName.pub</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<None Include="..\LICENSE.MD" Pack="true" PackagePath="$(PackageLicenseFile)" />
Expand Down Expand Up @@ -64,7 +68,6 @@
</PropertyGroup>

<ItemGroup>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="Security.fs" />
<Compile Include="Certificate.fs" />
<Compile Include="Registry.fs" />
Expand All @@ -90,21 +93,15 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.Win32.Registry">
<Version>4.5.0</Version>
</PackageReference>
</ItemGroup>
<PackageReference Include="Microsoft.Win32.Registry" Version ="4.5.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<PackageReference Include="Microsoft.Win32.Registry">
<Version>4.5.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Win32.Registry" Version ="4.5.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net472'">
<PackageReference Include="Microsoft.Win32.Registry">
<Version>4.5.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Win32.Registry" Version ="4.5.0" />
</ItemGroup>

</Project>
15 changes: 0 additions & 15 deletions FSharpLu/AssemblyInfo.fs

This file was deleted.

13 changes: 9 additions & 4 deletions FSharpLu/FSharpLu.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,21 @@
<Title>FSharpLu F# Utility libary</Title>
<PackageId>Microsoft.FSharpLu</PackageId>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<Version>0.11.0</Version>
</PropertyGroup>

<PropertyGroup Condition=" '$(DELAYSIGNING)' == 'True' ">
<SignAssembly>true</SignAssembly>
<DelaySign>true</DelaySign>
<AssemblyOriginatorKeyFile>..\msft-StrongName.pub</AssemblyOriginatorKeyFile>
</PropertyGroup>

<PropertyGroup>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\Microsoft.FSharpLu.xml</DocumentationFile>
<AssemblyName>Microsoft.FSharpLu</AssemblyName>
</PropertyGroup>

<ItemGroup>
<Reference Include="System.Net.Http.WebRequest" Condition="'$(TargetFramework)' != 'netstandard2.0'" />
</ItemGroup>
Expand Down Expand Up @@ -64,8 +71,6 @@
<Compile Include="CacheMap.fs" />
<Compile Include="ExecutableInfo.fs" />
<Compile Include="MachineOperations.fs" />

<Compile Include="AssemblyInfo.fs" />
</ItemGroup>

<ItemGroup>
Expand All @@ -82,7 +87,7 @@
<ItemGroup Condition="'$(TargetFramework)' == 'net452'">
<Reference Include="System.Configuration" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<PackageReference Include="System.Configuration" Version="2.0.5" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.5.0" />
Expand Down
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ This is by no means a full-fledged utility library for F#, but rather a small co

Some of the provided utilities are just thin `let`-bindings wrappers around existing .Net libraries (e.g. module `FSharpLu.Text` or `FSharpLu.Parsing`) whereas some provide additional features (e.g. Json serialization in module `FSharpLu.Json`).


## Build status

| Branch | Status |
Expand All @@ -20,16 +19,17 @@ Some of the provided utilities are just thin `let`-bindings wrappers around exis
- F# compiler. See https://fsharp.org/use/Windows and https://fsharp.org/use/linux/

- Install .NET Core SDK from https://dotnet.microsoft.com/download/visual-studio-sdks.
- .NET Core 2.2 SDK
- .NET Core 3.0 SDK

- .NET Core 2.2 SDK
- .NET Core 3.0 SDK

- Install .NET Framework Developer Packs from https://www.microsoft.com/net/download/visual-studio-sdks
for the following versions of .NET:
- .NET Framework 4.5.2
- .NET Framework 4.6.1
- .NET Framework 4.6.2
- .NET Framework 4.7.2

- .NET Framework 4.5.2
- .NET Framework 4.6.1
- .NET Framework 4.6.2
- .NET Framework 4.7.2

To build project run `dotnet build` under the top-level directory or run the script `scripts\build.ps1`.

Expand Down Expand Up @@ -76,7 +76,6 @@ Here is a list of helper modules provided by FSharpLu.
- [FSharpLu.TraceLogging](FSharpLu/TraceLogging.fs)
- [FSharp.Azure](FSharpLu.Azure/)


## Microsoft Open Source Code of Conduct

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
25 changes: 14 additions & 11 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# AppVeyor build for public CI builds
# To be moved to public Azure DevOps repo in the future.
version: 0.11.{build}
pull_requests:
do_not_increment_build_number: true
image: Visual Studio 2017
image: Visual Studio 2019
configuration:
- Debug
- Release
Expand All @@ -14,8 +16,6 @@ before_build:
.\scripts\Update-AssemblyVersion.ps1 -version $Env:APPVEYOR_BUILD_VERSION
build:
verbosity: minimal
after_build:
- ps: .\scripts\packnuget.ps1 -pack -configuration $Env:CONFIGURATION -version $Env:APPVEYOR_BUILD_VERSION
artifacts:
- path: FSharpLu.Json\bin\Debug\
name: FSharpLu.Json-Debug
Expand All @@ -25,17 +25,20 @@ artifacts:
name: FSharpLu-Debug
- path: FSharpLu\bin\Release\
name: FSharpLu-Release
- path: '**\*.nupkg'
name: FSharpLu-Nuget-Packages
type: NuGetPackage

# Deployment commented out: instead of auto-releasing to nuget
# deployment to nuget is done manually using AppVeyor environments.
# Configuraiton used is left here for reference:

# Deployment of nuget packages is commented out:
# This is now done instead after code-signing via the Azure DevOps pipeline.
# The yaml configuration used previously is left here for reference:
#
#after_build:
#- ps: .\scripts\packnuget.ps1 -pack -configuration $Env:CONFIGURATION -version $Env:APPVEYOR_BUILD_VERSION
#artifacts:
# - path: '**\*.nupkg'
# name: FSharpLu-Nuget-Packages
# type: NuGetPackage
#deploy:
# We publish to Nuget only if building release configuration and
# for master branch
#deploy:
#- provider: NuGet
# on:
# branch: master
Expand Down
6 changes: 4 additions & 2 deletions scripts/Update-AssemblyVersion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ param(
[Parameter(Mandatory=$true)][string]$version
)

$assemblyInfoFiles = Get-ChildItem -Recurse -Filter AssemblyInfo.fs -File $PSScriptRoot\..\
$assemblyInfoFiles = Get-ChildItem -Recurse -Filter *.fsproj -File $PSScriptRoot\..\

$components = $version -split '\.'
if($components.Length -lt 2 -or ($components.Length -gt 3)) {
Expand All @@ -26,6 +26,8 @@ Write-Host "Assembly version format: $assemblyVersion"
$assemblyInfoFiles | `
ForEach-Object { $file = $_.FullName
$x = Get-Content $file -Raw -Encoding UTF8
$r = $x -replace '(Assembly.*Version)\(".*"\)', "`$1(`"$assemblyVersion`")"
$r = $x -replace '<AssemblyVersion>[ \d.`*]*([-<]?)', "<AssemblyVersion>$assemblyVersion`$1" `
-replace '<Version>[ \d.`*]*([-<]?)', "<Version>$version`$1" `
-replace '<PackageVersion>[ \d.`*]*([-<]?)', "<PackageVersion>$version`$1"
$r | Set-Content -Path $file -Encoding UTF8 -NoNewline
}
Loading

0 comments on commit 8736e3e

Please sign in to comment.