Skip to content
This repository was archived by the owner on Jan 8, 2019. It is now read-only.
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
12 changes: 12 additions & 0 deletions test-msbuild/TestMultipleLibraryInSameDir/Helper.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace TestLibrary

open Lib

type Helper() =

static member GetMessage () = Lib.message ()

static member SayHi () = Lib.sayHi ()
12 changes: 12 additions & 0 deletions test-msbuild/TestMultipleLibraryInSameDir/Helper2.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

module Lib

open System

let message () =
"This string came from the test library!"

let sayHi () =
Console.WriteLine("Hello there!")
46 changes: 46 additions & 0 deletions test-msbuild/TestMultipleLibraryInSameDir/Test1Library.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />

<Import Project="..\TestSuite.props" />

<PropertyGroup>
<TargetFramework>netstandard1.6</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<Version>1.0.0-preview3</Version>
<Authors>Enrico Sada</Authors>
</PropertyGroup>

<ItemGroup>
<Compile Include="Helper2.fs" />
<Compile Include="Helper.fs" />
<EmbeddedResource Include="**\*.resx" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="NETStandard.Library">
<Version>1.6.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.FSharp.Core.netcore">
<Version>$(MicrosoftFSharpCorenetcoreVersion)</Version>
</PackageReference>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>$(MicrosoftNETSdkVersion)</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="FSharp.NET.Sdk">
<Version>$(FSharpNETSdkVersion)</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<DotNetCliToolReference Include="dotnet-compile-fsc">
<Version>1.0.0-preview2-020000</Version>
</DotNetCliToolReference>
</ItemGroup>

<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />

</Project>
46 changes: 46 additions & 0 deletions test-msbuild/TestMultipleLibraryInSameDir/Test2Library.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />

<Import Project="..\TestSuite.props" />

<PropertyGroup>
<TargetFramework>netstandard1.6</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<Version>1.0.0-preview3</Version>
<Authors>Enrico Sada</Authors>
</PropertyGroup>

<ItemGroup>
<Compile Include="Helper2.fs" />
<Compile Include="Helper.fs" />
<EmbeddedResource Include="**\*.resx" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="NETStandard.Library">
<Version>1.6.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.FSharp.Core.netcore">
<Version>$(MicrosoftFSharpCorenetcoreVersion)</Version>
</PackageReference>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>$(MicrosoftNETSdkVersion)</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="FSharp.NET.Sdk">
<Version>$(FSharpNETSdkVersion)</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<DotNetCliToolReference Include="dotnet-compile-fsc">
<Version>1.0.0-preview2-020000</Version>
</DotNetCliToolReference>
</ItemGroup>

<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />

</Project>
36 changes: 36 additions & 0 deletions test-msbuild/run-tests.targets
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,36 @@
<Exec Command="dotnet pack" WorkingDirectory="$(ProjectDirectory)" />
</Target>

<Target Name="TestLibraryOutOfTree">
<PropertyGroup>
<OutOfTreeDirectory>$(MSBuildThisFileDirectory)</OutOfTreeDirectory>
<ProjectDirectory>$(MSBuildThisFileDirectory)TestLibrary</ProjectDirectory>
<ProjectPath>"$(ProjectDirectory)\TestLibrary.fsproj"</ProjectPath>
</PropertyGroup>

<RemoveDir Directories="$(ProjectDirectory)\bin; $(ProjectDirectory)\obj" />
<Exec Command="dotnet restore $(ProjectPath)" WorkingDirectory="$(OutOfTreeDirectory)" />
<Exec Command="dotnet build $(ProjectPath)" WorkingDirectory="$(OutOfTreeDirectory)" />
<Exec Command="dotnet pack $(ProjectPath)" WorkingDirectory="$(OutOfTreeDirectory)" />
</Target>


<Target Name="TestMultipleLibraryInSameDir">
<PropertyGroup>
<ProjectDirectory>$(MSBuildThisFileDirectory)TestMultipleLibraryInSameDir</ProjectDirectory>
<Project1FileName>Test1Library.fsproj</Project1FileName>
<Project2FileName>Test2Library.fsproj</Project2FileName>
</PropertyGroup>

<RemoveDir Directories="$(ProjectDirectory)\bin; $(ProjectDirectory)\obj" />
<Exec Command="dotnet restore $(Project1FileName)" WorkingDirectory="$(ProjectDirectory)" />
<Exec Command="dotnet build $(Project1FileName)" WorkingDirectory="$(ProjectDirectory)" />
<Exec Command="dotnet pack $(Project1FileName)" WorkingDirectory="$(ProjectDirectory)" />
<Exec Command="dotnet restore $(Project2FileName)" WorkingDirectory="$(ProjectDirectory)" />
<Exec Command="dotnet build $(Project2FileName)" WorkingDirectory="$(ProjectDirectory)" />
<Exec Command="dotnet pack $(Project2FileName)" WorkingDirectory="$(ProjectDirectory)" />
</Target>

<Target Name="TestLibraryCrossGen">
<PropertyGroup>
<ProjectDirectory>$(MSBuildThisFileDirectory)TestLibraryCrossGen</ProjectDirectory>
Expand Down Expand Up @@ -170,12 +200,18 @@
<AllTests Include="SmokeTestExamplesPreview3" />
</ItemGroup>

<ItemGroup>
<FailingTests Include="TestMultipleLibraryInSameDir" />
</ItemGroup>

<Target Name="PrepareTests">
<MakeDir Directories="$(ProjectDirectory)src\FSharp.NET.Sdk\bin\Debug" />
</Target>

<Target Name="Test" DependsOnTargets="PrepareTests; @(AllTests)" />

<Target Name="FailingTest" DependsOnTargets="PrepareTests; @(FailingTests)" />

<Target Name="TestSuiteInfo">
<ItemGroup>
<TestLI Include="@(AllTests -> '- %(Identity)%0A')" />
Expand Down