Skip to content

Commit aa589cf

Browse files
authored
Merge pull request #82 from eiriktsarpalis/multi-target
Fix multi-target packaging issues
2 parents 3b5cabc + f6b4d17 commit aa589cf

File tree

12 files changed

+1299
-1640
lines changed

12 files changed

+1299
-1640
lines changed

.gitignore

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
# Xamarin Studio / monodevelop user-specific
1010
*.userprefs
11+
*.dll.mdb
12+
*.exe.mdb
1113

1214
# Build results
1315

@@ -18,9 +20,6 @@ build/
1820
[Bb]in/
1921
[Oo]bj/
2022

21-
# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
22-
!packages/*/build/
23-
2423
# MSTest test Results
2524
[Tt]est[Rr]esult*/
2625
[Bb]uild[Ll]og.*
@@ -62,6 +61,9 @@ ipch/
6261
*.vsp
6362
*.vspx
6463

64+
# Other Visual Studio data
65+
.vs/
66+
6567
# Guidance Automation Toolkit
6668
*.gpState
6769

@@ -108,6 +110,9 @@ csx
108110
# Windows Store app package directory
109111
AppPackages/
110112

113+
# VSCode
114+
.vscode/
115+
111116
# Others
112117
sql/
113118
*.Cache
@@ -180,6 +185,14 @@ release.sh
180185
localpackages/
181186
paket-files
182187
*.orig
188+
.paket/paket.exe
183189
docs/content/license.md
184190
docs/content/release-notes.md
185191
.fake
192+
docs/tools/FSharp.Formatting.svclog
193+
194+
# xunit
195+
xunit*.html
196+
197+
# exclude artifacts folder
198+
artifacts/

.paket/paket.exe

-8.02 MB
Binary file not shown.

.travis.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@ matrix:
44
include:
55
- os: linux # Ubuntu 14.04
66
dist: trusty
7-
sudo: required
7+
sudo: false
8+
mono: latest
89
dotnet: 2.0.0
910
- os: osx # OSX 10.12
1011
osx_image: xcode9.1
1112
dotnet: 2.0.0
12-
dist: trusty
13-
sudo: required
13+
mono: latest
14+
sudo: false
1415

1516
script:
17+
- dotnet --info
1618
- ./build.sh All
1719

1820
branches:
1921
except:
20-
- gh-pages
22+
- gh-pages

FSharp.Control.AsyncSeq.sln

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".paket", ".paket", "{63297B
1010
EndProject
1111
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "project", "project", "{BF60BC93-E09B-4E5F-9D85-95A519479D54}"
1212
ProjectSection(SolutionItems) = preProject
13+
.gitignore = .gitignore
14+
.travis.yml = .travis.yml
15+
appveyor.yml = appveyor.yml
16+
build.cmd = build.cmd
1317
build.fsx = build.fsx
18+
build.sh = build.sh
1419
LICENSE.txt = LICENSE.txt
1520
README.md = README.md
1621
RELEASE_NOTES.md = RELEASE_NOTES.md
@@ -38,11 +43,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{83F16175
3843
EndProject
3944
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{86625A13-D7E2-4EAD-B13A-4F37BD89DE2A}"
4045
EndProject
41-
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Control.AsyncSeq", "src\FSharp.Control.AsyncSeq\FSharp.Control.AsyncSeq.fsproj", "{DBDF64C3-BE92-4272-8737-5001C469D9AA}"
46+
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Control.AsyncSeq", "src\FSharp.Control.AsyncSeq\FSharp.Control.AsyncSeq.fsproj", "{DBDF64C3-BE92-4272-8737-5001C469D9AA}"
4247
EndProject
4348
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{561B2DD4-BBFB-4E0D-BF73-C10A3E42507C}"
4449
EndProject
45-
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Control.AsyncSeq.Tests", "tests\FSharp.Control.AsyncSeq.Tests\FSharp.Control.AsyncSeq.Tests.fsproj", "{F2404B35-0DAD-483D-9406-7C763CDDC029}"
50+
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Control.AsyncSeq.Tests", "tests\FSharp.Control.AsyncSeq.Tests\FSharp.Control.AsyncSeq.Tests.fsproj", "{F2404B35-0DAD-483D-9406-7C763CDDC029}"
4651
EndProject
4752
Global
4853
GlobalSection(SolutionConfigurationPlatforms) = preSolution

build.cmd

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
@echo off
22
cls
33

4+
.paket\paket.bootstrapper.exe
5+
if errorlevel 1 (
6+
exit /b %errorlevel%
7+
)
8+
49
.paket\paket.exe restore
510
if errorlevel 1 (
611
exit /b %errorlevel%
@@ -10,4 +15,4 @@ IF NOT EXIST build.fsx (
1015
.paket\paket.exe update
1116
packages\build\FAKE\tools\FAKE.exe init.fsx
1217
)
13-
packages\build\FAKE\tools\FAKE.exe build.fsx %*
18+
packages\build\FAKE\tools\FAKE.exe build.fsx %*

build.fsx

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,17 @@ Target "CleanDocs" (fun _ ->
5252
CleanDirs ["docs/output"]
5353
)
5454

55+
Target "Restore" (fun _ ->
56+
DotNetCli.Restore id
57+
)
58+
5559
// --------------------------------------------------------------------------------------
5660
// Build library & test project
5761

5862
Target "Build" (fun _ ->
59-
DotNetCli.Build (fun p ->
60-
{ p with Project = solutionFile })
61-
)
63+
!! solutionFile
64+
|> MSBuild null "Rebuild" [("Configuration", "Release")]
65+
|> ignore)
6266

6367
// --------------------------------------------------------------------------------------
6468
// Run the unit tests using test runner
@@ -77,23 +81,11 @@ Target "RunTests" (fun _ ->
7781
// Build a NuGet package
7882

7983
Target "NuGet" (fun _ ->
80-
81-
//Paket.Pack (fun p ->
82-
// { p with
83-
// OutputPath = buildDir
84-
// Version = release.NugetVersion
85-
// ReleaseNotes = (toLines release.Notes) })
86-
87-
DotNetCli.Pack (fun p ->
84+
Paket.Pack (fun p ->
8885
{ p with
89-
Project = project
9086
OutputPath = buildDir
91-
AdditionalArgs =
92-
[ "--no-build"
93-
sprintf "/p:Version=%s" release.NugetVersion
94-
//"/p:ReleaseNotes=" + (toLines release.Notes)
95-
]
96-
})
87+
Version = release.NugetVersion
88+
ReleaseNotes = (toLines release.Notes) })
9789
)
9890

9991
Target "PublishNuget" (fun _ ->
@@ -248,6 +240,7 @@ Target "BuildPackage" DoNothing
248240
Target "All" DoNothing
249241

250242
"Clean"
243+
==> "Restore"
251244
==> "Build"
252245
==> "RunTests"
253246
=?> ("GenerateReferenceDocs",isLocalBuild && not isMono)

build.sh

Lines changed: 71 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,76 @@
1-
#!/bin/bash
2-
export FrameworkPathOverride=$(dirname $(which mono))/../lib/mono/4.5/
1+
#!/usr/bin/env bash
32

4-
if test "$OS" = "Windows_NT"
3+
set -eu
4+
5+
cd `dirname $0`
6+
7+
PAKET_BOOTSTRAPPER_EXE=.paket/paket.bootstrapper.exe
8+
PAKET_EXE=.paket/paket.exe
9+
FAKE_EXE=packages/build/FAKE/tools/FAKE.exe
10+
11+
FSIARGS=""
12+
FSIARGS2=""
13+
OS=${OS:-"unknown"}
14+
if [ "$OS" != "Windows_NT" ]
515
then
6-
# use .Net
7-
.paket/paket.exe restore
8-
exit_code=$?
9-
if [ $exit_code -ne 0 ]; then
10-
exit $exit_code
11-
fi
12-
13-
[ ! -e build.fsx ] && .paket/paket.exe update
14-
[ ! -e build.fsx ] && packages/build/FAKE/tools/FAKE.exe init.fsx
15-
packages/build/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx
16-
else
17-
# use mono
18-
mono .paket/paket.exe restore
19-
exit_code=$?
20-
if [ $exit_code -ne 0 ]; then
21-
exit $exit_code
16+
# Can't use FSIARGS="--fsiargs -d:MONO" in zsh, so split it up
17+
# (Can't use arrays since dash can't handle them)
18+
FSIARGS="--fsiargs"
19+
FSIARGS2="-d:MONO"
20+
fi
21+
22+
run() {
23+
if [ "$OS" != "Windows_NT" ]
24+
then
25+
mono "$@"
26+
else
27+
"$@"
2228
fi
29+
}
2330

24-
[ ! -e build.fsx ] && mono .paket/paket.exe update
25-
[ ! -e build.fsx ] && mono packages/build/FAKE/tools/FAKE.exe init.fsx
26-
mono packages/build/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx
31+
yesno() {
32+
# NOTE: Defaults to NO
33+
read -p "$1 [y/N] " ynresult
34+
case "$ynresult" in
35+
[yY]*) true ;;
36+
*) false ;;
37+
esac
38+
}
39+
40+
set +e
41+
run $PAKET_BOOTSTRAPPER_EXE
42+
bootstrapper_exitcode=$?
43+
set -e
44+
45+
if [ "$OS" != "Windows_NT" ] &&
46+
[ $bootstrapper_exitcode -ne 0 ] &&
47+
[ $(certmgr -list -c Trust | grep X.509 | wc -l) -le 1 ] &&
48+
[ $(certmgr -list -c -m Trust | grep X.509 | wc -l) -le 1 ]
49+
then
50+
echo "Your Mono installation has no trusted SSL root certificates set up."
51+
echo "This may result in the Paket bootstrapper failing to download Paket"
52+
echo "because Github's SSL certificate can't be verified. One way to fix"
53+
echo "this issue would be to download the list of SSL root certificates"
54+
echo "from the Mozilla project by running the following command:"
55+
echo ""
56+
echo " mozroots --import --sync"
57+
echo ""
58+
echo "This will import over 100 SSL root certificates into your Mono"
59+
echo "certificate repository."
60+
echo ""
61+
if yesno "Run 'mozroots --import --sync' now?"
62+
then
63+
mozroots --import --sync
64+
else
65+
echo "Attempting to continue without running mozroots. This might fail."
66+
fi
67+
# Re-run bootstrapper whether or not the user ran mozroots, because maybe
68+
# they fixed the problem in a separate terminal window.
69+
run $PAKET_BOOTSTRAPPER_EXE
2770
fi
71+
72+
run $PAKET_EXE restore
73+
74+
[ ! -e build.fsx ] && run $PAKET_EXE update
75+
[ ! -e build.fsx ] && run $FAKE_EXE init.fsx
76+
run $FAKE_EXE "$@" $FSIARGS $FSIARGS2 build.fsx

paket.dependencies

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
source https://api.nuget.org/v3/index.json
2+
framework: netstandard2.0
23
redirects: on
34
storage: none
45

5-
nuget FSharp.Core
6+
nuget FSharp.Core >= 4.3.2 lowest_matching: true
7+
8+
group Legacy
9+
source https://api.nuget.org/v3/index.json
10+
framework: net452
11+
storage: none
12+
13+
nuget FSharp.Core >= 3.1.2 lowest_matching: true
614

715
group Build
816
source https://api.nuget.org/v3/index.json

0 commit comments

Comments
 (0)