8000 move to new-style project files and compile for .NET Standard 2.0 (#47) · DiffSharp/DiffSharp@0cbfbdb · GitHub
[go: up one dir, main page]

Skip to content

Commit 0cbfbdb

Browse files
authored
move to new-style project files and compile for .NET Standard 2.0 (#47)
* move to new-style project files and compile for .NET Standard 2.0 * turn test discovery off on appveyor
1 parent 9bba790 commit 0cbfbdb

27 files changed

+173
-561
lines changed

.paket/paket.bootstrapper.exe

23.8 KB
Binary file not shown.

.travis.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
1-
language: csharp
2-
solution: DiffSharp.sln
31

4-
# sudo to install packages
5-
sudo: required
2+
services:
3+
- docker
64

75
before_install:
8-
- sudo add-apt-repository ppa:ginggs/julia-backports -y
9-
- sudo apt-get update -y
10-
- sudo apt-get install libopenblas-dev -y
6+
- docker pull ubuntu:16.04
117

12-
os:
13-
- linux
14-
mono:
15-
- latest
16-
script:
17-
- ./build.sh
8+
script:
9+
- docker build .
1810

1911
notifications:
2012
email:

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM microsoft/dotnet:sdk AS build-env
2+
3+
RUN apt-get update
4+
RUN apt-get install -y libopenblas-dev
5+
6+
# Copy everything and build
7+
COPY . ./
8+
RUN ./build.sh
9+

NuGet.config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
5+
<add key="dotnet" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" protocolVersion="3"/>
6+
</packageSources>
7+
</configuration>

appveyor.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1+
image: Visual Studio 2017
2+
13
build_script:
2-
- ps: .\build.cmd
4+
- cmd: .\build.cmd
5+
6+
test: off

build.cmd

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
1-
@echo off
21
cls
32

4-
.paket\paket.bootstrapper.exe
5-
if errorlevel 1 (
6-
exit /b %errorlevel%
7-
)
8-
9-
.paket\paket.exe restore
10-
if errorlevel 1 (
11-
exit /b %errorlevel%
12-
)
13-
msbuild DiffSharp.sln /p:Configuration=Debug
14-
packages\NUnit.Runners\tools\nunit-console "tests\DiffSharp.Tests\bin\Debug\DiffSharp.Tests.dll"
3+
dotnet --version
4+
dotnet build DiffSharp.sln -c release -v:n
5+
dotnet test tests/DiffSharp.Tests -c release -v:n

build.sh

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
11
#!/bin/bash
2-
# next part copied from (check there for newest version):
3-
# https://github.com/deeplearningparis/dl-machine/blob/master/scripts/install-deeplearning-libraries.sh
4-
# Build latest stable release of OpenBLAS without OPENMP to make it possible
5-
# to use Python multiprocessing and forks without crash
6-
# The torch install script will install OpenBLAS with OPENMP enabled in
7-
# /opt/OpenBLAS so we need to install the OpenBLAS used by Python in a
8-
# distinct folder.
9-
# Note: the master branch only has the release tags in it
10-
#sudo apt-get install -y gfortran
11-
#export OPENBLAS_ROOT=/opt/OpenBLAS-no-openmp
12-
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OPENBLAS_ROOT/lib
13-
#if [ ! -d "OpenBLAS" ]; then
14-
# git clone -q --branch=master git://github.com/xianyi/OpenBLAS.git
15-
# (cd OpenBLAS && make FC=gfortran USE_OPENMP=0 NO_AFFINITY=1 NUM_THREADS=4 && sudo make install PREFIX=$OPENBLAS_ROOT)
16-
# echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> ~/.bashrc
17-
#fi
18-
#sudo ldconfig
192

20-
sudo apt-get -y update
21-
sudo apt-get -y install libopenblas-dev
3+
case "$(uname -s)" in
224

23-
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/lib/OpenBLAS-v0.2.14-Linux64
5+
Darwin)
6+
brew install homebrew/science/openblas
7+
;;
8+
9+
CYGWIN*|MINGW32*|MSYS*|Linux)
10+
echo 'Linux, Cygwin, etc'
11+
# sudo apt-get -y update
12+
# sudo apt-get -y install libopenblas-dev
13+
;;
14+
15+
*)
16+
echo 'other OS'
17+
;;
18+
esac
19+
20+
# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/OpenBLAS-v0.2.8-Linux64;/usr/local/lib/OpenBLAS-v0.2.8-Linux64
21+
22+
if [ -d "MONO" ]; then
23+
msbuild DiffSharp.sln /p:Configuration=Release
24+
msbuild /p:Configuration=Release DiffSharp.sln
25+
# not currently testing on mono
26+
# mono ./packages/NUnit.Runners/tools/nunit-console.exe ./tests/DiffSharp.Tests/bin/Release/DiffSharp.Tests.dll
27+
else
28+
dotnet build DiffSharp.sln -c debug
29+
dotnet test tests/DiffSharp.Tests -c release -f netcoreapp2.0
30+
fi
2431

25-
mono .paket/paket.bootstrapper.exe && \
26-
mono .paket/paket.exe restore && \
27-
msbuild /p:Configuration=Release DiffSharp.sln && \
28-
mono ./packages/NUnit.Runners/tools/nunit-console.exe ./tests/DiffSharp.Tests/bin/Release/DiffSharp.Tests.dll

netfx.props

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -->
3+
<!-- Make .NET 4.5 reference assemblies available even on Linux -->
4+
<!-- See https://github.com/dotnet/sdk/issues/335#issuecomment-371484670 -->
5+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
6+
<PropertyGroup>
7+
<RestoreAdditionalProjectSources>https://dotnet.myget.org/F/dotnet-core/api/v3/index.json</RestoreAdditionalProjectSources>
8+
</PropertyGroup>
9+
<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
10+
<FrameworkPathOverride>$(NuGetPackageRoot)microsoft.targetingpack.netframework.v4.6.1/1.0.1/lib/net461/</FrameworkPathOverride>
11+
</PropertyGroup>
12+
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
13+
<!-- Make sure the reference assemblies are available -->
14+
<PackageReference Include="Microsoft.TargetingPack.NETFramework.v4.6.1" Version="1.0.1" ExcludeAssets="All" PrivateAssets="All" />
15+
</ItemGroup>
16+
</Project>

paket.dependencies

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
source https://www.nuget.org/api/v2/
2-
strategy: max
3-
framework >= net46
4-
redirects: on
2+
frameworks: net461, netstandard2.0, netcoreapp2.0
53

64
nuget FsCheck.NUnit
75
nuget FSharp.Charting
8-
nuget FSharp.Core 4.0.0.1
6+
nuget FSharp.Core 4.3.4
97
nuget FSharp.Data
108
nuget FSharp.Formatting
119
nuget FSharp.Quotations.Evaluator
12-
nuget NUnit 2.6.4
10+
nuget NUnit 3.9.0

paket.lock

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,37 @@
1-
REDIRECTS: ON
2-
STRATEGY: MAX
3-
RESTRICTION: >= net46
1+
RESTRICTION: || (== net45) (== netcoreapp2.0) (== netstandard2.0)
42
NUGET
53
remote: https://www.nuget.org/api/v2
6-
FsCheck (2.8.2)
7-
FSharp.Core (>= 3.1.2.5)
8-
FsCheck.Nunit (2.6.3)
9-
FsCheck (>= 2.6.3)
10-
NUnit (>= 2.6.4 < 2.7)
11-
NUnit.Runners (>= 2.6.4 < 2.7)
12-
FSharp.Charting (0.90.14)
4+
FsCheck (2.11)
5+
FSharp.Core (>= 4.0.0.1) - restriction: || (== net45) (&& (== netcoreapp2.0) (>= net452)) (&& (== netcoreapp2.0) (< netstandard1.6)) (&& (== netcoreapp2.0) (< portable-net45+win8)) (&& (== netcoreapp2.0) (< portable-net45+win8+wp8)) (&& (== netstandard2.0) (>= net452)) (&& (== netstandard2.0) (< netstandard1.6)) (&& (== netstandard2.0) (< portable-net45+win8)) (&& (== netstandard2.0) (< portable-net45+win8+wp8))
6+
FSharp.Core (>= 4.3.4) - restriction: || (&& (== net45) (< net452) (>= netstandard1.6)) (== netcoreapp2.0) (== netstandard2.0)
7+
NETStandard.Library (>= 1.6.1) - restriction: || (&& (== net45) (< net452) (>= netstandard1.6)) (== netcoreapp2.0) (== netstandard2.0)
8+
System.ValueTuple (>= 4.5) - restriction: || (&& (== net45) (< net452) (>= netstandard1.6)) (== netcoreapp2.0) (== netstandard2.0)
9+
FsCheck.NUnit (2.11)
10+
FsCheck (>= 2.11) - restriction: || (&& (== net45) (< net452) (>= netstandard1.6)) (== netcoreapp2.0) (== netstandard2.0)
11+
FsCheck (2.11) - restriction: || (== net45) (&& (== netcoreapp2.0) (>= net452)) (&& (== netstandard2.0) (>= net452))
12+
FSharp.Core (>= 4.3.4) - restriction: || (&& (== net45) (< net452) (>= netstandard1.6)) (== netcoreapp2.0) (== netstandard2.0)
13+
NETStandard.Library (>= 1.6.1) - restriction: || (&& (== net45) (< net452) (>= netstandard1.6)) (== netcoreapp2.0) (== netstandard2.0)
14+
NUnit (>= 3.9) - restriction: || (&& (== net45) (< net452) (>= netstandard1.6)) (== netcoreapp2.0) (== netstandard2.0)
15+
NUnit (>= 3.8.1 < 4.0) - restriction: || (== net45) (&& (== netcoreapp2.0) (>= net452)) (&& (== netstandard2.0) (>= net452))
16+
System.ValueTuple (>= 4.5) - restriction: || (&& (== net45) (< net452) (>= netstandard1.6)) (== netcoreapp2.0) (== netstandard2.0)
17+
FSharp.Charting (2.1)
18+
FSharp.Core (>= 4.0.0.1)
1319
FSharp.Compiler.Service (2.0.0.6)
14-
FSharp.Core (4.0.0.1)
15-
FSharp.Data (2.3.3)
20+
FSharp.Core (4.3.4)
21+
FSharp.Data (2.4.6)
22+
Zlib.Portable (>= 1.11) - restriction: || (&& (== net45) (< net40)) (== netcoreapp2.0) (== netstandard2.0)
1623
FSharp.Formatting (2.14.4)
1724
FSharp.Compiler.Service (2.0.0.6)
1825
FSharpVSPowerTools.Core (>= 2.3 < 2.4)
19-
FSharp.Quotations.Evaluator (1.0.7)
26+
FSharp.Quotations.Evaluator (1.1.2)
27+
FSharp.Core (>= 3.0.2) - restriction: || (== net45) (&& (== netcoreapp2.0) (>= net45)) (&& (== netstandard2.0) (>= net45))
28+
FSharp.Core (>= 4.3.1) - restriction: || (&& (== net45) (< net45) (>= netstandard2.0)) (== netcoreapp2.0) (== netstandard2.0)
2029
FSharpVSPowerTools.Core (2.3)
2130
FSharp.Compiler.Service (>= 2.0.0.3)
22-
NUnit (2.6.4)
23-
NUnit.Runners (2.6.4)
31+
Microsoft.NETCore.Platforms (2.1) - restriction: || (&& (== net45) (< net20) (>= netstandard2.0)) (&& (== net45) (>= netcoreapp2.0)) (&& (== net45) (< netstandard1.0) (>= netstandard2.0) (>= win8)) (&& (== net45) (< netstandard1.3) (>= netstandard2.0) (>= wpa81)) (&& (== net45) (>= netstandard2.0) (>= uap10.0)) (&& (== net45) (>= netstandard2.0) (>= uap10.1)) (&& (== net45) (>= netstandard2.0) (>= wp8)) (== netcoreapp2.0) (== netstandard2.0)
32+
NETStandard.Library (2.0.3) - restriction: || (&& (== net45) (< net20) (>= netstandard2.0)) (== netcoreapp2.0) (== netstandard2.0)
33+
Microsoft.NETCore.Platforms (>= 1.1)
34+
NUnit (3.10.1)
35+
NETStandard.Library (>= 2.0) - restriction: || (&& (== net45) (< net20) (>= netstandard2.0)) (== netcoreapp2.0) (== netstandard2.0)
36+
System.ValueTuple (4.5) - restriction: || (&& (== net45) (< net452) (>= netstandard1.6)) (== netcoreapp2.0) (== netstandard2.0)
37+
Zlib.Portable (1.11) - restriction: || (&& (== net45) (< net40)) (== netcoreapp2.0) (== netstandard2.0)

0 commit comments

Comments
 (0)
0