Remove F# dead code

now living in ortools/dotnet/*
This commit is contained in:
Corentin Le Molgat
2018-11-30 15:13:11 +01:00
parent ff4ae0aed7
commit 4cc4ef330a
9 changed files with 0 additions and 626 deletions

View File

@@ -1,48 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26124.0
MinimumVisualStudioVersion = 15.0.26124.0
Project("{f2a71f9b-5d33-465a-a702-920d77279786}") = "OrTools.FSharp", "OrTools.FSharp\OrTools.FSharp.fsproj", "{B7DC098E-1334-47D2-88D4-7DA1EF8A4076}"
EndProject
Project("{f2a71f9b-5d33-465a-a702-920d77279786}") = "OrTools.FSharp.Test", "OrTools.FSharp.Test\OrTools.FSharp.Test.fsproj", "{C3B40B0A-23B6-4629-9A45-01F52722A97D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B7DC098E-1334-47D2-88D4-7DA1EF8A4076}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B7DC098E-1334-47D2-88D4-7DA1EF8A4076}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B7DC098E-1334-47D2-88D4-7DA1EF8A4076}.Debug|x64.ActiveCfg = Debug|x64
{B7DC098E-1334-47D2-88D4-7DA1EF8A4076}.Debug|x64.Build.0 = Debug|x64
{B7DC098E-1334-47D2-88D4-7DA1EF8A4076}.Debug|x86.ActiveCfg = Debug|x86
{B7DC098E-1334-47D2-88D4-7DA1EF8A4076}.Debug|x86.Build.0 = Debug|x86
{B7DC098E-1334-47D2-88D4-7DA1EF8A4076}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B7DC098E-1334-47D2-88D4-7DA1EF8A4076}.Release|Any CPU.Build.0 = Release|Any CPU
{B7DC098E-1334-47D2-88D4-7DA1EF8A4076}.Release|x64.ActiveCfg = Release|x64
{B7DC098E-1334-47D2-88D4-7DA1EF8A4076}.Release|x64.Build.0 = Release|x64
{B7DC098E-1334-47D2-88D4-7DA1EF8A4076}.Release|x86.ActiveCfg = Release|x86
{B7DC098E-1334-47D2-88D4-7DA1EF8A4076}.Release|x86.Build.0 = Release|x86
{C3B40B0A-23B6-4629-9A45-01F52722A97D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C3B40B0A-23B6-4629-9A45-01F52722A97D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C3B40B0A-23B6-4629-9A45-01F52722A97D}.Debug|x64.ActiveCfg = Debug|x64
{C3B40B0A-23B6-4629-9A45-01F52722A97D}.Debug|x64.Build.0 = Debug|x64
{C3B40B0A-23B6-4629-9A45-01F52722A97D}.Debug|x86.ActiveCfg = Debug|x86
{C3B40B0A-23B6-4629-9A45-01F52722A97D}.Debug|x86.Build.0 = Debug|x86
{C3B40B0A-23B6-4629-9A45-01F52722A97D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C3B40B0A-23B6-4629-9A45-01F52722A97D}.Release|Any CPU.Build.0 = Release|Any CPU
{C3B40B0A-23B6-4629-9A45-01F52722A97D}.Release|x64.ActiveCfg = Release|x64
{C3B40B0A-23B6-4629-9A45-01F52722A97D}.Release|x64.Build.0 = Release|x64
{C3B40B0A-23B6-4629-9A45-01F52722A97D}.Release|x86.ActiveCfg = Release|x86
{C3B40B0A-23B6-4629-9A45-01F52722A97D}.Release|x86.Build.0 = Release|x86
EndGlobalSection
EndGlobal

View File

@@ -1,27 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
<AssemblyName>Google.OrTools.FSharp.Test</AssemblyName>
<RootNamespace>Google.OrTools.FSharp.Test</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>full</DebugType>
</PropertyGroup>
<ItemGroup>
<Compile Include="Tests.fs" />
<Compile Include="Program.fs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.console" Version="2.3.1" />
</ItemGroup>
<ItemGroup>
<Reference Include="Google.OrTools.FSharp">
<HintPath>..\..\..\bin\Google.OrTools.FSharp.dll</HintPath>
</Reference>
<Reference Include="Google.OrTools">
<HintPath>..\..\..\bin\Google.OrTools.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

View File

@@ -1,7 +0,0 @@
namespace Google.OrTools.FSharp
module Program =
[<EntryPoint>]
let main _ =
printfn "Google.OrTools.FSharp Tests"
0

View File

@@ -1,54 +0,0 @@
namespace Google.OrTools.FSharp
module Tests =
open System
open Xunit
open Google.OrTools.LinearSolver
open Google.OrTools.FSharp
[<Fact>]
let ``Equality Matrix cannot be empty`` () =
try
let opts = SolverOpts.Default.Name("Equality Constraints").Goal(Minimize).Objective([2.0;1.0;0.0;0.0;0.0]).Algorithm(LP CLP)
opts |> lpSolve |> SolverSummary |> ignore
with
| Failure msg ->
Assert.Equal("Must provide at least one Matrix/Vector pair for inequality/equality contraints", msg)
[<Fact>]
let ``Linear Solver with GLOP Solver`` () =
let svr = Solver.CreateSolver("LinearProgramming", LinearProgramming.GLOP.ToString())
// x1, x2 are continuous non-negative variables.
let x1 = svr.MakeNumVar(Double.NegativeInfinity, Double.PositiveInfinity, "x1")
let x2 = svr.MakeNumVar(Double.NegativeInfinity, Double.PositiveInfinity, "x2")
// Maximize 8 * x1 + 4 * x2
let objective = svr.Objective()
objective.SetCoefficient(x1, 8.0)
objective.SetCoefficient(x2, 4.0)
objective.SetMaximization()
// x1 + x2 <= 10.
let c0 = svr.MakeConstraint(Double.NegativeInfinity, 10.0)
c0.SetCoefficient(x1, 1.0)
c0.SetCoefficient(x2, 1.0)
// 5 * x1 + x2 <= 15.
let c1 = svr.MakeConstraint(Double.NegativeInfinity, 15.0)
c1.SetCoefficient(x1, 5.0)
c1.SetCoefficient(x2, 1.0)
Assert.Equal(svr.NumVariables(), 2)
Assert.Equal(svr.NumConstraints(), 2)
let resultStatus = svr.Solve()
Assert.Equal(resultStatus, Solver.OPTIMAL)
Assert.Equal(svr.Objective().Value(), 45.0)
Assert.Equal(x1.SolutionValue(), 5.0/4.0)
Assert.Equal(x2.SolutionValue(), 35.0/4.0)

View File

@@ -1,39 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../netfx.props" />
<PropertyGroup>
<OutputType>Library</OutputType>
<AssemblyTitle>Google.OrTools.FSharp</AssemblyTitle>
<TargetFrameworks>netstandard2.0;net462</TargetFrameworks>
<AssemblyName>Google.OrTools.FSharp</AssemblyName>
<NuspecFile>OrTools.FSharp.nuspec</NuspecFile>
<AssemblyOriginatorKeyFile>..\..\..\bin\or-tools.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Version>0.0.0.0</Version>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<FileVersion>0.0.0.0</FileVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<GenerateTailCalls>true</GenerateTailCalls>
</PropertyGroup>
<ItemGroup>
<Compile Include="OrTools.fs" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net462' ">
<Reference Include="System.Runtime" />
</ItemGroup>
<ItemGroup>
<Reference Include="Google.OrTools">
<HintPath>..\..\..\bin\Google.OrTools.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

View File

@@ -1,22 +0,0 @@
<?xml version="1.0"?>
<package >
<metadata>
<id>MMMM</id>
<version>VVVV</version>
<authors>Google Inc.</authors>
<licenseUrl>https://github.com/google/or-tools/blob/master/LICENSE-2.0.txt</licenseUrl>
<projectUrl>https://developers.google.com/optimization</projectUrl>
<description>F# wrapper for the Operations Research Tools project</description>
<copyright>Copyright 2018 Google, Inc</copyright>
<tags>Operations Research Math Linear Constraint Programming F#</tags>
<dependencies>
<dependency id="Google.OrTools" version="VVVV" />
</dependencies>
</metadata>
<files>
<file src="bin/Release/netstandard2.0/*.*" target="lib/netstandard2.0"/>
<file src="bin/Release/net462/Google.OrTools.FSharp.*" target="lib/net462"/>
<file src="../../../examples/fsharp/*.*" target="examples"/>
<file src="../../../LICENSE-2.0.txt"/>
</files>
</package>

View File

@@ -1,358 +0,0 @@
namespace Google.OrTools
module FSharp =
open System
open Google.OrTools.Algorithms
open Google.OrTools.LinearSolver
type Goal =
/// Maximize the Objective Function
| Maximize
/// Minimize the Objective Function
| Minimize
/// Linear Programming Algorithm
type LinearProgramming =
/// Coin-Or (Recommended default)
| CLP
/// GNU Linear Programming Kit
| GLPK
/// Google Linear Optimization
| GLOP
/// Gurobi Optimizer
| GUROBI
/// IBM CPLEX
| CPLEX
/// Solver Name
override this.ToString() =
match this with
| CLP -> "CLP_LINEAR_PROGRAMMING"
| GLPK -> "GLPK_LINEAR_PROGRAMMING"
| GLOP -> "GLOP_LINEAR_PROGRAMMING"
| GUROBI -> "GUROBI_LINEAR_PROGRAMMING"
| CPLEX -> "CPLEX_LINEAR_PROGRAMMING"
/// Solver Id
member this.Id =
match this with
| CLP -> 0
| GLPK -> 1
| GLOP -> 2
| GUROBI -> 6
| CPLEX -> 10
/// Integer Programming Algoritm
type IntegerProgramming =
/// Solving Constraint Integer Programs (Recommended default)
| SCIP
/// GNU Linear Programming Kit
| GLPK
/// Coin-Or Branch and Cut
| CBC
/// Gurobi Optimizer
| GUROBI
/// IBM CPLEX
| CPLEX
/// Binary Optimizer
| BOP
/// Solver Name
override this.ToString() =
match this with
| SCIP -> "SCIP_MIXED_INTEGER_PROGRAMMING"
| GLPK -> "GLPK_MIXED_INTEGER_PROGRAMMING"
| CBC -> "CBC_MIXED_INTEGER_PROGRAMMING"
| GUROBI -> "GUROBI_MIXED_INTEGER_PROGRAMMING"
| CPLEX -> "CPLEX_MIXED_INTEGER_PROGRAMMING"
| BOP -> "BOP_INTEGER_PROGRAMMING"
/// Solver Id
member this.Id =
match this with
| SCIP -> 3
| GLPK -> 4
| CBC -> 5
| GUROBI -> 7
| CPLEX -> 11
| BOP -> 12
type LinearSolverAlgorithm =
| LP of LinearProgramming
| IP of IntegerProgramming
/// Max Flow Solver Result
type MaximumFlowResult =
| Optimal
| IntegerOverflow
| BadInput
| BadResult
member this.Id =
match this with
| Optimal -> 0
| IntegerOverflow -> 1
| BadInput -> 2
| BadResult -> 3
/// Minimum Cost Flow Result
type MinimumCostFlowResult =
| NotSolved
| Optimal
| Feasible
| Infeasible
| Unbalanced
| BadResult
| BadCostRange
member this.Id =
match this with
| NotSolved -> 0
| Optimal -> 1
| Feasible -> 2
| Infeasible -> 3
| Unbalanced -> 4
| BadResult -> 5
| BadCostRange -> 6
/// Knapsack Solver Algorithm
type KnapsackSolverAlgorithm =
| BruteForce
| SixtyFourItems
| DynamicProgramming
| MultidimensionCBC
| MultidimensionGLPK
| MultidimensionBranchAndBound
| MultidimensionSCIP
/// Solver Id
member this.Id =
match this with
| BruteForce -> 0
| SixtyFourItems -> 1
| DynamicProgramming -> 2
| MultidimensionCBC -> 3
| MultidimensionGLPK -> 4
| MultidimensionBranchAndBound -> 5
| MultidimensionSCIP -> 6
let knapsackSolve (name: string) (solverAlgorithm:KnapsackSolverAlgorithm) (profits:int64 list) (weights:int64 list) (capacities:int64 list) =
// extract the specific algorithm so its Id can be used to create solver
let algorithm =
match solverAlgorithm with
| MultidimensionBranchAndBound ->
MultidimensionBranchAndBound.Id
| BruteForce ->
BruteForce.Id
| SixtyFourItems ->
SixtyFourItems.Id
| DynamicProgramming ->
DynamicProgramming.Id
| MultidimensionCBC ->
MultidimensionCBC.Id
| MultidimensionGLPK ->
MultidimensionGLPK.Id
| MultidimensionSCIP ->
MultidimensionSCIP.Id
let solver = new KnapsackSolver(algorithm, name)
// transform lists to compatible structures for C++ Solver
let profits = new KInt64Vector( List.toArray profits )
let weights =
let tempVector = new KInt64VectorVector(1)
let tempWeights = new KInt64Vector(List.toArray weights)
tempVector.Add(tempWeights)
tempVector
let capacities = new KInt64Vector (List.toArray capacities)
solver.Init(profits, weights, capacities)
solver
type SolverOpts = {
/// Name of the solver
SolverName: string;
/// Linear objective function vector
ObjectiveFunction: float list;
/// Matrix for linear inequality constraints
ConstraintMatrix: float list list option;
/// Upper Bound vector for linear inequality constraints
ConstraintVectorUpperBound: float list option;
/// Lower Bound vector for linear inequality constraints
ConstraintVectorLowerBound: float list option;
/// Vector of variable upper bounds
VariableUpperBound: float list;
/// Vector of variable lower bounds
VariableLowerBound: float list;
/// Matrix for linear equality constraints
ConstraintMatrixEq: float list list option;
/// Vector for linear equality constraints
ConstraintVectorEq: float list option;
/// Solver Algorithm to use
SolverAlgorithm: LinearSolverAlgorithm;
/// Solver Goal (Minimize/Maximize)
SolverGoal: Goal
} with
member this.Name(nm:string)=
{this with SolverName = nm}
member this.Objective(objVector:float list) =
{this with ObjectiveFunction = objVector}
member this.Matrix(mat:float list list) =
{this with ConstraintMatrix = Some(mat)}
member this.VectorUpperBound(vec:float list) =
{this with ConstraintVectorUpperBound = Some(vec)}
member this.VectorLowerBound(vec:float list) =
{this with ConstraintVectorLowerBound = Some(vec)}
member this.MatrixEq(mat:float list list) =
{this with ConstraintMatrixEq = Some(mat)}
member this.VectorEq(vec:float list) =
{this with ConstraintVectorEq = Some(vec)}
member this.VarUpperBound(ub:float list) =
{this with VariableUpperBound = ub}
member this.VarLowerBound(lb:float list) =
{this with VariableLowerBound = lb}
member this.Algorithm(algo:LinearSolverAlgorithm) =
{this with SolverAlgorithm = algo}
member this.Goal(goal:Goal) =
{this with SolverGoal = goal}
static member Default =
{
SolverName = "Solver";
ObjectiveFunction = [];
ConstraintMatrix = None;
ConstraintVectorUpperBound = None;
ConstraintVectorLowerBound = None;
VariableUpperBound = [];
VariableLowerBound = [];
ConstraintMatrixEq = None;
ConstraintVectorEq = None;
SolverAlgorithm = LP CLP
SolverGoal = Maximize
}
let lpSolve (solverOptions:SolverOpts) =
// extract the specific algorithm so its Id can be used to create solver
let algorithm =
match solverOptions.SolverAlgorithm with
| LP lp -> lp.Id
| IP ip -> ip.Id
let solver = new Solver(solverOptions.SolverName, algorithm)
// Detect errors on required parameters
if (solverOptions.ConstraintMatrix.IsNone && solverOptions.ConstraintVectorUpperBound.IsNone && solverOptions.ConstraintVectorLowerBound.IsNone)
&& (solverOptions.ConstraintMatrixEq.IsNone && solverOptions.ConstraintVectorEq.IsNone) then
failwith "Must provide at least one Matrix/Vector pair for inequality/equality contraints"
if solverOptions.ObjectiveFunction.IsEmpty then
failwith "Objective function cannot be empty"
if solverOptions.VariableUpperBound.IsEmpty then
failwith "Variable upper bound values cannot be empty"
if solverOptions.VariableLowerBound.IsEmpty then
failwith "Variable lower bound values cannot be empty"
// check inequality matrix dimensions against bounds
match (solverOptions.ConstraintMatrix, solverOptions.ConstraintVectorLowerBound, solverOptions.ConstraintVectorUpperBound) with
| _, Some lb, Some ub when lb.Length <> ub.Length ->
failwithf "Constraint vector dimensions should be equal.\nLower Bound Length: %i\nUpper Bound Length: %i" lb.Length ub.Length
| _ -> ()
// Check Objective function dimensions with variable bounds dimensions
match (solverOptions.ObjectiveFunction.Length, solverOptions.VariableLowerBound.Length, solverOptions.VariableUpperBound.Length) with
| _ , lb, ub when lb <> ub ->
failwithf "Variable vector dimensions should be equal.\nLower Bound Length: %i\nUpper Bound Length: %i" lb ub
| obj, _ , ub when obj <> ub ->
failwithf "Variable vector dimensions should be equal.\nUpper Bound Length: %i\nObjective Function Length: %i" ub obj
| obj, lb, _ when obj <> lb ->
failwithf "Variable vector dimensions should be equal.\nLower Bound Length: %i\nObjective Function Length: %i" lb obj
| _ -> ()
// Variables
let vars =
match solverOptions.SolverAlgorithm with
| LP lp ->
[ for i in 0 .. (solverOptions.VariableLowerBound.Length-1) -> solver.MakeNumVar(solverOptions.VariableLowerBound.[i], solverOptions.VariableUpperBound.[i], (sprintf "var[%i]" i ) ) ]
| IP ip ->
[ for i in 0 .. (solverOptions.VariableLowerBound.Length-1) -> solver.MakeIntVar(solverOptions.VariableLowerBound.[i], solverOptions.VariableUpperBound.[i], (sprintf "var[%i]" i ) ) ]
// Constraints
let cols = [ for i in 0 .. (solverOptions.VariableLowerBound.Length-1) -> i ] // generate column index selectors
// Inequality Constraints
match (solverOptions.ConstraintMatrix, solverOptions.ConstraintVectorLowerBound, solverOptions.ConstraintVectorUpperBound) with
| (None, Some lb, Some ub) ->
failwithf "Matrix for Equality Constraints undefined."
| (Some mat, None, Some ub) ->
for row = 0 to (ub.Length-1) do
// generate constraint operands based on indices
let constraintOperands = List.map (fun c -> vars.[c] * mat.[c].[row]) cols
let linearExp = List.reduce (+) constraintOperands
// create the constraint
let rangeConstraint = RangeConstraint(linearExp, Double.NegativeInfinity, ub.[row])
solver.Add(rangeConstraint) |> ignore
| (Some mat, Some lb, None) ->
for row = 0 to (lb.Length-1) do
// generate constraint operands based on indices
let constraintOperands = List.map (fun c -> vars.[c] * mat.[c].[row]) cols
let linearExp = List.reduce (+) constraintOperands
// create the constraint
let rangeConstraint = RangeConstraint(linearExp, lb.[row], Double.PositiveInfinity)
solver.Add(rangeConstraint) |> ignore
| (Some mat, Some lb, Some ub) ->
for row = 0 to (ub.Length-1) do
// generate constraint operands based on indices
let constraintOperands = List.map (fun c -> vars.[c] * mat.[c].[row]) cols
let linearExp = List.reduce (+) constraintOperands
// create the constraint
let rangeConstraint = RangeConstraint(linearExp, lb.[row], ub.[row])
solver.Add(rangeConstraint) |> ignore
| _ -> ()
// Equality Constraints
match (solverOptions.ConstraintMatrixEq, solverOptions.ConstraintVectorEq) with
| (None, Some b) ->
failwithf "Matrix for Equality Constraints undefined."
| (Some mat, Some vec) ->
for row = 0 to (vec.Length-1) do
// generate constraint operands based on indices
let constraintOperands = List.map (fun c -> vars.[c] * mat.[c].[row]) cols
let linearExp = List.reduce (+) constraintOperands
// create the constraint
let equalityConstraint = RangeConstraint(linearExp, vec.[row], vec.[row])
solver.Add(equalityConstraint) |> ignore
| _ -> ()
// Objective
let objectiveOperands = List.map (fun c -> solverOptions.ObjectiveFunction.[c] * vars.[c]) cols
let objectiveExp = List.reduce (+) objectiveOperands
match solverOptions.SolverGoal with
| Minimize ->
solver.Minimize(objectiveExp)
| Maximize ->
solver.Maximize(objectiveExp)
solver
/// Solves the optimization problem and prints the results to console
let SolverSummary (solver:Solver) =
let resultStatus = solver.Solve();
match resultStatus with
| status when status <> Solver.OPTIMAL ->
printfn "The problem does not have an optimal solution!"
exit 0
| _ ->
printfn "\nProblem solved in %d milliseconds" (solver.WallTime())
printfn "Iterations: %i\n" (solver.Iterations())
printfn "Objective: %f" (solver.Objective().Value())
for i in 0 .. (solver.NumVariables()-1) do
printfn "%-10s: %f " (sprintf "var[%i]" i) ((solver.LookupVariableOrNull(sprintf "var[%i]" i)).SolutionValue())
solver

View File

@@ -1,20 +0,0 @@
# Google OrTools - F#
## Pre-requisites
- dotnet core 2.0
- Mono framework 5.4+
## Compiling a standalone binary
Use the makefile found in the root folder.
```shell
make fsharp
```
To see the targets type `make help_fsharp`. Note that a keyfile must exist in the `bin` folder as it will be used to sign the assembly.
## Building Nuget package
Ensure nuget executable is installed and then from root folder run the following:
```shell
make nuget-pkg_fsharp
```
The output package will include the FSharp binary and examples. It contains binaries for `netstandard2.0` metaframework and `net462`. If using the NETstandard binary you'll need to include a reference in the example to that library on your local system.

View File

@@ -1,51 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
The MIT License (MIT)
Copyright (c) Microsoft Corporation.
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-->
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- When compiling .NET SDK 2.0 projects targeting .NET 4.x on Mono using 'dotnet build' you -->
<!-- have to teach MSBuild where the Mono copy of the reference asssemblies is -->
<TargetIsMono Condition="$(TargetFramework.StartsWith('net4')) and '$(OS)' == 'Unix'">true</TargetIsMono>
<!-- Look in the standard install locations -->
<BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND '$(TargetIsMono)' == 'true' AND EXISTS('/Library/Frameworks/Mono.framework/Versions/Current/lib/mono')">/Library/Frameworks/Mono.framework/Versions/Current/lib/mono</BaseFrameworkPathOverrideForMono>
<BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND '$(TargetIsMono)' == 'true' AND EXISTS('/usr/lib/mono')">/usr/lib/mono</BaseFrameworkPathOverrideForMono>
<BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND '$(TargetIsMono)' == 'true' AND EXISTS('/usr/local/lib/mono')">/usr/local/lib/mono</BaseFrameworkPathOverrideForMono>
<!-- If we found Mono reference assemblies, then use them -->
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net45'">$(BaseFrameworkPathOverrideForMono)/4.5-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net451'">$(BaseFrameworkPathOverrideForMono)/4.5.1-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net452'">$(BaseFrameworkPathOverrideForMono)/4.5.2-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net46'">$(BaseFrameworkPathOverrideForMono)/4.6-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net461'">$(BaseFrameworkPathOverrideForMono)/4.6.1-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net462'">$(BaseFrameworkPathOverrideForMono)/4.6.2-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net47'">$(BaseFrameworkPathOverrideForMono)/4.7-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net471'">$(BaseFrameworkPathOverrideForMono)/4.7.1-api</FrameworkPathOverride>
<EnableFrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != ''">true</EnableFrameworkPathOverride>
<!-- Add the Facades directory. Not sure how else to do this. Necessary at least for .NET 4.5 -->
<AssemblySearchPaths Condition="'$(BaseFrameworkPathOverrideForMono)' != ''">$(FrameworkPathOverride)/Facades;$(AssemblySearchPaths)</AssemblySearchPaths>
</PropertyGroup>
</Project>