Skip to content

Commit

Permalink
Cleanup re #44
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed Nov 6, 2018
1 parent a09e2ce commit acb4e71
Show file tree
Hide file tree
Showing 13 changed files with 84 additions and 62 deletions.
12 changes: 11 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<!-- disable sourcelink on mono, to workaround https://github.com/dotnet/sourcelink/issues/155 -->
<EnableSourceLink Condition=" '$(OS)' != 'Windows_NT' AND '$(MSBuildRuntimeType)' != 'Core' ">false</EnableSourceLink>
<EnableSourceControlManagerQueries>$(EnableSourceLink)</EnableSourceControlManagerQueries>
</PropertyGroup>

<!-- Workaround for https://github.com/xunit/xunit/issues/1357 -->
<PropertyGroup>
<ThisDirAbsolute>$([System.IO.Path]::GetFullPath("$(MSBuildThisFileDirectory)"))</ThisDirAbsolute>
</PropertyGroup>
<ItemGroup>
<Content Include="$(ThisDirAbsolute)tests/xunit.runner.json" Condition=" '$(OS)' != 'Windows_NT' AND '$(IsTestProject)' != 'false'">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project ToolsVersion="15.0">
<!--Workaround for https://github.com/Microsoft/vstest/issues/1129 from https://dasmulli.blog/2018/01/20/make-dotnet-test-work-on-solution-files/-->
<Target Name="VSTestIfTestProject">
<CallTarget Targets="VSTest" Condition="'$(IsTestProject)' == 'true'" />
</Target>
</Project>
3 changes: 3 additions & 0 deletions Equinox.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples.Store", "Samples.St
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".project", ".project", "{7E3A7020-AE75-4513-B81A-57FD3E0D0D84}"
ProjectSection(SolutionItems) = preProject
after.Equinox.sln.targets = after.Equinox.sln.targets
azure-pipelines.yml = azure-pipelines.yml
build.proj = build.proj
build.ps1 = build.ps1
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
global.json = global.json
LICENSE = LICENSE
README.md = README.md
SECURITY.md = SECURITY.md
tests\xunit.runner.json = tests\xunit.runner.json
EndProjectSection
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Domain", "samples\Store\Domain\Domain.fsproj", "{37B4A45F-039E-4515-8A84-D242DDE12D22}"
Expand Down
6 changes: 6 additions & 0 deletions after.Equinox.sln.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project ToolsVersion="15.0">
<!--Workaround for https://github.com/Microsoft/vstest/issues/1129 from https://dasmulli.blog/2018/01/20/make-dotnet-test-work-on-solution-files/-->
<Target Name="VSTest">
<MSBuild Projects="@(ProjectReference)" Targets="VSTestIfTestProject"/>
</Target>
</Project>
40 changes: 29 additions & 11 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ jobs:
pool:
vmImage: 'vs2017-win2016'
steps:
- script: dotnet test build.proj
displayName: dotnet test build.proj
env:
EQUINOX_INTEGRATION_SKIP_EVENTSTORE=true
EQUINOX_INTEGRATION_SKIP_COSMOS=true
- task: PublishTestResults@2
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: 'tests/**/*.trx'
condition: succeededOrFailed()

- powershell: |
$buildId = $env:BUILD_BUILDNUMBER.PadLeft(7, '0');
$versionSuffixPR = "ci-$buildId-pr$($env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER)";
Expand All @@ -14,15 +25,10 @@ jobs:
$versionSuffix = if ($isTag) { "" } else { if ($isPR) { $versionSuffixPR } else { $versionSuffixBRANCH } };
Write-Host "##vso[task.setvariable variable=VersionSuffix]$versionSuffix";
displayName: compute VersionSuffix
- script: dotnet msbuild build.proj /p:SkipIntegration=true
displayName: Test + Build
- script: dotnet pack build.proj
displayName: dotnet pack build.proj
env:
VersionSuffix: '$(VersionSuffix)'
- task: PublishTestResults@2
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: 'tests/**/*.trx'
condition: succeededOrFailed()
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: 'bin'
Expand All @@ -35,29 +41,41 @@ jobs:
versioningScheme: byEnvVar
versionEnvVar: Version
packagesToPush: 'bin/*.nupkg;bin/*.symbols.nupkg'

- job: Linux
pool:
vmImage: 'ubuntu-16.04'
steps:
- script: echo "##vso[task.setvariable variable=FrameworkPathOverride]$(dirname $(which mono))/../lib/mono/4.5/"
displayName: Workaround .NET reference assemblies on linux
- script: dotnet msbuild build.proj /p:SkipIntegration=true
displayName: Test + Build
- script: dotnet test build.proj
displayName: dotnet test build.proj
env:
EQUINOX_INTEGRATION_SKIP_EVENTSTORE=true
EQUINOX_INTEGRATION_SKIP_COSMOS=true
- task: PublishTestResults@2
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: 'tests/**/*.trx'
condition: succeededOrFailed()
- script: dotnet pack build.proj
displayName: dotnet pack build.proj

- job: MacOS
pool:
vmImage: 'macOS-10.13'
steps:
- script: echo "##vso[task.setvariable variable=FrameworkPathOverride]$(dirname $(which mono))/../lib/mono/4.5/"
displayName: Workaround .NET reference assemblies on linux
- script: dotnet msbuild build.proj /p:SkipIntegration=true
displayName: Test + Build
- script: dotnet test build.proj
displayName: dotnet test build.proj
env:
EQUINOX_INTEGRATION_SKIP_EVENTSTORE=true
EQUINOX_INTEGRATION_SKIP_COSMOS=true
- task: PublishTestResults@2
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: 'tests/**/*.trx'
condition: succeededOrFailed()
- script: dotnet pack build.proj
displayName: dotnet pack build.proj
24 changes: 11 additions & 13 deletions build.proj
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
<Project ToolsVersion="15.0" DefaultTargets="Test;Build">
<Project ToolsVersion="15.0">

<Import Project="Directory.Build.props" />

<PropertyGroup>
<Name>Equinox</Name>
<Cfg>--configuration Release</Cfg>

<ThisDirAbsolute>$([System.IO.Path]::GetFullPath("$(MSBuildThisFileDirectory)"))</ThisDirAbsolute>
<PackOptions>-o $(ThisDirAbsolute)bin --version-suffix "$(VersionSuffix)"</PackOptions>
<TestOptions>--logger:trx</TestOptions>
</PropertyGroup>

<Target Name="Build">
<Exec Command="dotnet pack cli/$(Name).Cli $(Cfg) $(PackOptions)" />
<Exec Command="dotnet pack src/$(Name) $(Cfg) $(PackOptions)" />
<Exec Command="dotnet pack src/$(Name).Codec $(Cfg) $(PackOptions)" />
<Exec Command="dotnet pack src/$(Name).EventStore $(Cfg) $(PackOptions)" />
<Exec Command="dotnet pack src/$(Name).MemoryStore $(Cfg) $(PackOptions)" />
<Target Name="Pack">
<Exec Command="dotnet pack cli/Equinox.Cli $(Cfg) $(PackOptions)" />
<Exec Command="dotnet pack src/Equinox $(Cfg) $(PackOptions)" />
<Exec Command="dotnet pack src/Equinox.Codec $(Cfg) $(PackOptions)" />
<Exec Command="dotnet pack src/Equinox.EventStore $(Cfg) $(PackOptions)" />
<Exec Command="dotnet pack src/Equinox.MemoryStore $(Cfg) $(PackOptions)" />
</Target>

<Target Name="Test">
<Exec Command="dotnet test samples/Store/Domain.Tests $(Cfg) $(TestOptions)" />
<Exec Command="dotnet test tests/$(Name).MemoryStore.Integration $(Cfg) $(TestOptions)" />
<Exec Condition=" '$(SkipIntegration)' != 'true' " Command="dotnet test tests/$(Name).EventStore.Integration $(Cfg) $(TestOptions)" />
<Exec Condition=" '$(SkipIntegration)' != 'true' " Command="dotnet test samples/Store/Integration $(Cfg) $(TestOptions)" />
<Target Name="VSTest">
<Exec Command="dotnet test Equinox.sln $(Cfg) $(TestOptions)" />
</Target>

<Target Name="Build" DependsOnTargets="VSTest;Pack" />

</Project>
3 changes: 1 addition & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ $args=@("/v:$verbosity","/fl","/bl",$additionalMsBuildArgs)
function warn ($msg) { Write-Host "$msg" -BackgroundColor DarkGreen }

# Yes, this leaves the value set on exit, but I want to keep the script legible
if ($skipEs) { warn "Skipping EventStore tests" }
$env:EQUINOX_INTEGRATION_SKIP_EVENTSTORE=[string]$skipEs

if ($skipEs) { warn "Skipping EventStore tests" }

warn "RUNNING: dotnet msbuild $args"
. dotnet msbuild build.proj @args
Expand Down
1 change: 0 additions & 1 deletion cli/Equinox.Cli/Equinox.Cli.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

<ItemGroup>
<ProjectReference Include="..\..\src\Equinox.MemoryStore\Equinox.MemoryStore.fsproj" />
<ProjectReference Include="..\..\src\Equinox.Cosmos\Equinox.Cosmos.fsproj" />
<ProjectReference Include="..\..\samples\Store\Backend\Backend.fsproj" />
<ProjectReference Include="..\..\samples\Store\Domain\Domain.fsproj" />
<ProjectReference Include="..\..\src\Equinox.EventStore\Equinox.EventStore.fsproj" />
Expand Down
11 changes: 2 additions & 9 deletions samples/Store/Domain.Tests/Domain.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@
<Compile Include="ContactPreferencesTests.fs" />
<Compile Include="FavoritesTests.fs" />
</ItemGroup>

<ItemGroup>
<!-- Workaround for https://github.com/xunit/xunit/issues/1357 -->
<Content Include="xunit.runner.json" Condition=" '$(OS)' != 'Windows_NT' ">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<ProjectReference Include="..\Domain\Domain.fsproj" />
</ItemGroup>

<ItemGroup>
Expand All @@ -31,8 +28,4 @@
<PackageReference Include="unquote" Version="4.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Domain\Domain.fsproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
<Compile Include="EventStoreTokenTests.fs" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\samples\Store\Backend\Backend.fsproj" />
<ProjectReference Include="..\..\samples\Store\Domain\Domain.fsproj" />
<ProjectReference Include="..\..\src\Equinox.EventStore\Equinox.EventStore.fsproj" />
<ProjectReference Include="..\..\src\Equinox\Equinox.fsproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="FsCheck.xUnit" Version="2.12.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
Expand All @@ -22,13 +29,6 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\samples\Store\Backend\Backend.fsproj" />
<ProjectReference Include="..\..\samples\Store\Domain\Domain.fsproj" />
<ProjectReference Include="..\..\src\Equinox.EventStore\Equinox.EventStore.fsproj" />
<ProjectReference Include="..\..\src\Equinox\Equinox.fsproj" />
<Reference Include="System.Runtime.Caching" Condition=" '$(TargetFramework)' != 'netstandard2.0'" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
<Compile Include="Infrastructure.fs" />
<Compile Include="MemoryStoreIntegration.fs" />
</ItemGroup>

<ItemGroup>
<!-- Workaround for https://github.com/xunit/xunit/issues/1357 -->
<Content Include="xunit.runner.json" Condition=" '$(OS)' != 'Windows_NT' ">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ProjectReference Include="..\..\samples\Store\Domain\Domain.fsproj" />
<ProjectReference Include="..\..\samples\Store\Backend\Backend.fsproj" />
<ProjectReference Include="..\..\src\Equinox.MemoryStore\Equinox.MemoryStore.fsproj" />
<ProjectReference Include="..\..\src\Equinox\Equinox.fsproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="FsCheck.xUnit" Version="2.12.1" />
Expand All @@ -31,11 +31,4 @@
<PackageReference Include="Serilog.Sinks.Seq" Version="4.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\samples\Store\Domain\Domain.fsproj" />
<ProjectReference Include="..\..\samples\Store\Backend\Backend.fsproj" />
<ProjectReference Include="..\..\src\Equinox.MemoryStore\Equinox.MemoryStore.fsproj" />
<ProjectReference Include="..\..\src\Equinox\Equinox.fsproj" />
</ItemGroup>

</Project>
</Project>
3 changes: 0 additions & 3 deletions tests/Equinox.MemoryStore.Integration/xunit.runner.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
{
"appDomain": "denied"
}

0 comments on commit acb4e71

Please sign in to comment.