Skip to content

Commit 870f7dd

Browse files
authored
Merge pull request #90 from enricosada/update_infra
update build infrastructure
2 parents d8b4ab0 + 3e7f3d6 commit 870f7dd

12 files changed

Lines changed: 672 additions & 670 deletions

File tree

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ release.sh
185185
localpackages/
186186
paket-files
187187
*.orig
188-
.paket/paket.exe
189188
docs/content/license.md
190189
docs/content/release-notes.md
191190
.fake

.paket/Paket.Restore.targets

Lines changed: 38 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,26 @@
4343
<!-- Step 1 Check if lockfile is properly restored -->
4444
<PropertyGroup>
4545
<PaketRestoreRequired>true</PaketRestoreRequired>
46-
<NoWarn>$(NoWarn);NU1603</NoWarn>
46+
<NoWarn>$(NoWarn);NU1603;NU1604;NU1605;NU1608</NoWarn>
4747
</PropertyGroup>
4848

4949
<!-- Because ReadAllText is slow on osx/linux, try to find shasum and awk -->
5050
<PropertyGroup>
51-
<PaketRestoreCachedHasher Condition="'$(OS)' != 'Windows_NT' And '$(PaketRestoreCachedHasher)' == '' And Exists('/usr/bin/shasum') And Exists('/usr/bin/awk')">/usr/bin/shasum $(PaketRestoreCacheFile) | /usr/bin/awk '{ print $1 }'</PaketRestoreCachedHasher>
52-
<PaketRestoreLockFileHasher Condition="'$(OS)' != 'Windows_NT' And '$(PaketRestoreLockFileHash)' == '' And Exists('/usr/bin/shasum') And Exists('/usr/bin/awk')">/usr/bin/shasum $(PaketLockFilePath) | /usr/bin/awk '{ print $1 }'</PaketRestoreLockFileHasher>
51+
<PaketRestoreCachedHasher Condition="'$(OS)' != 'Windows_NT' And '$(PaketRestoreCachedHasher)' == '' And Exists('/usr/bin/shasum') And Exists('/usr/bin/awk')">/usr/bin/shasum "$(PaketRestoreCacheFile)" | /usr/bin/awk '{ print $1 }'</PaketRestoreCachedHasher>
52+
<PaketRestoreLockFileHasher Condition="'$(OS)' != 'Windows_NT' And '$(PaketRestoreLockFileHash)' == '' And Exists('/usr/bin/shasum') And Exists('/usr/bin/awk')">/usr/bin/shasum "$(PaketLockFilePath)" | /usr/bin/awk '{ print $1 }'</PaketRestoreLockFileHasher>
5353
</PropertyGroup>
5454

5555
<!-- If shasum and awk exist get the hashes -->
5656
<Exec StandardOutputImportance="Low" Condition=" '$(PaketRestoreCachedHasher)' != '' " Command="$(PaketRestoreCachedHasher)" ConsoleToMSBuild='true'>
57-
<Output TaskParameter="ConsoleOutput" PropertyName="PaketRestoreCachedHash" />
57+
<Output TaskParameter="ConsoleOutput" PropertyName="PaketRestoreCachedHash" />
5858
</Exec>
5959
<Exec StandardOutputImportance="Low" Condition=" '$(PaketRestoreLockFileHasher)' != '' " Command="$(PaketRestoreLockFileHasher)" ConsoleToMSBuild='true'>
60-
<Output TaskParameter="ConsoleOutput" PropertyName="PaketRestoreLockFileHash" />
60+
<Output TaskParameter="ConsoleOutput" PropertyName="PaketRestoreLockFileHash" />
6161
</Exec>
6262

63+
<!-- Debug whats going on -->
64+
<Message Importance="low" Text="calling paket restore with targetframework=$(TargetFramework) targetframeworks=$(TargetFrameworks)" />
65+
6366
<PropertyGroup Condition="Exists('$(PaketRestoreCacheFile)') ">
6467
<!-- if no hash has been done yet fall back to just reading in the files and comparing them -->
6568
<PaketRestoreCachedHash Condition=" '$(PaketRestoreCachedHash)' == '' ">$([System.IO.File]::ReadAllText('$(PaketRestoreCacheFile)'))</PaketRestoreCachedHash>
@@ -69,11 +72,22 @@
6972
<PaketRestoreRequired Condition=" '$(PaketRestoreLockFileHash)' == '' ">true</PaketRestoreRequired>
7073
</PropertyGroup>
7174

75+
<PropertyGroup Condition="'$(PaketPropsVersion)' != '5.174.2' ">
76+
<PaketRestoreRequired>true</PaketRestoreRequired>
77+
</PropertyGroup>
78+
7279
<!-- Do a global restore if required -->
7380
<Exec Command='$(PaketBootStrapperCommand)' Condition="Exists('$(PaketBootStrapperExePath)') AND !(Exists('$(PaketExePath)'))" ContinueOnError="false" />
7481
<Exec Command='$(PaketCommand) restore' Condition=" '$(PaketRestoreRequired)' == 'true' " ContinueOnError="false" />
7582

7683
<!-- Step 2 Detect project specific changes -->
84+
<ItemGroup>
85+
<MyTargetFrameworks Condition="'$(TargetFramework)' != '' " Include="$(TargetFramework)"></MyTargetFrameworks>
86+
<!-- Don't include all frameworks when msbuild explicitly asks for a single one -->
87+
<MyTargetFrameworks Condition="'$(TargetFrameworks)' != '' AND '$(TargetFramework)' == '' " Include="$(TargetFrameworks)"></MyTargetFrameworks>
88+
<PaketResolvedFilePaths Include="@(MyTargetFrameworks -> '$(MSBuildProjectDirectory)\obj\$(MSBuildProjectFile).%(Identity).paket.resolved')"></PaketResolvedFilePaths>
89+
</ItemGroup>
90+
<Message Importance="low" Text="MyTargetFrameworks=@(MyTargetFrameworks) PaketResolvedFilePaths=@(PaketResolvedFilePaths)" />
7791
<PropertyGroup>
7892
<PaketReferencesCachedFilePath>$(MSBuildProjectDirectory)\obj\$(MSBuildProjectFile).paket.references.cached</PaketReferencesCachedFilePath>
7993
<!-- MyProject.fsproj.paket.references has the highest precedence -->
@@ -82,7 +96,9 @@
8296
<PaketOriginalReferencesFilePath Condition=" !Exists('$(PaketOriginalReferencesFilePath)')">$(MSBuildProjectDirectory)\$(MSBuildProjectName).paket.references</PaketOriginalReferencesFilePath>
8397
<!-- paket.references -->
8498
<PaketOriginalReferencesFilePath Condition=" !Exists('$(PaketOriginalReferencesFilePath)')">$(MSBuildProjectDirectory)\paket.references</PaketOriginalReferencesFilePath>
85-
<PaketResolvedFilePath>$(MSBuildProjectDirectory)\obj\$(MSBuildProjectFile).$(TargetFramework).paket.resolved</PaketResolvedFilePath>
99+
100+
<DoAllResolvedFilesExist>false</DoAllResolvedFilesExist>
101+
<DoAllResolvedFilesExist Condition="Exists(%(PaketResolvedFilePaths.Identity))">true</DoAllResolvedFilesExist>
86102
<PaketRestoreRequired>true</PaketRestoreRequired>
87103
<PaketRestoreRequiredReason>references-file-or-cache-not-found</PaketRestoreRequiredReason>
88104
</PropertyGroup>
@@ -101,32 +117,39 @@
101117
</PropertyGroup>
102118

103119
<!-- Step 2 b detect relevant changes in project file (new targetframework) -->
104-
<PropertyGroup Condition=" !Exists('$(PaketResolvedFilePath)') AND '$(TargetFramework)' != '' ">
120+
<PropertyGroup Condition=" '$(DoAllResolvedFilesExist)' != 'true' ">
105121
<PaketRestoreRequired>true</PaketRestoreRequired>
106-
<PaketRestoreRequiredReason>target-framework '$(TargetFramework)'</PaketRestoreRequiredReason>
122+
<PaketRestoreRequiredReason>target-framework '$(TargetFramework)' or '$(TargetFrameworks)' files @(PaketResolvedFilePaths)</PaketRestoreRequiredReason>
107123
</PropertyGroup>
108124

109125
<!-- Step 3 Restore project specific stuff if required -->
110126
<Message Condition=" '$(PaketRestoreRequired)' == 'true' " Importance="low" Text="Detected a change ('$(PaketRestoreRequiredReason)') in the project file '$(MSBuildProjectFullPath)', calling paket restore" />
111-
<Exec Command='$(PaketCommand) restore --project "$(MSBuildProjectFullPath)"' Condition=" '$(PaketRestoreRequired)' == 'true' " ContinueOnError="false" />
127+
<Exec Command='$(PaketCommand) restore --project "$(MSBuildProjectFullPath)" --target-framework "$(TargetFrameworks)"' Condition=" '$(PaketRestoreRequired)' == 'true' AND '$(TargetFramework)' == '' " ContinueOnError="false" />
128+
<Exec Command='$(PaketCommand) restore --project "$(MSBuildProjectFullPath)" --target-framework "$(TargetFramework)"' Condition=" '$(PaketRestoreRequired)' == 'true' AND '$(TargetFramework)' != '' " ContinueOnError="false" />
112129

113130
<!-- This shouldn't actually happen, but just to be sure. -->
114-
<Error Condition=" !Exists('$(PaketResolvedFilePath)') AND '$(TargetFramework)' != '' AND '$(ResolveNuGetPackages)' != 'False' " Text="Paket file '$(PaketResolvedFilePath)' is missing while restoring $(MSBuildProjectFile). Please delete 'paket-files/paket.restore.cached' and call 'paket restore'." />
131+
<PropertyGroup>
132+
<DoAllResolvedFilesExist>false</DoAllResolvedFilesExist>
133+
<DoAllResolvedFilesExist Condition="Exists(%(PaketResolvedFilePaths.Identity))">true</DoAllResolvedFilesExist>
134+
</PropertyGroup>
135+
<Error Condition=" '$(DoAllResolvedFilesExist)' != 'true' AND '$(ResolveNuGetPackages)' != 'False' " Text="One Paket file '@(PaketResolvedFilePaths)' is missing while restoring $(MSBuildProjectFile). Please delete 'paket-files/paket.restore.cached' and call 'paket restore'." />
115136

116137
<!-- Step 4 forward all msbuild properties (PackageReference, DotNetCliToolReference) to msbuild -->
117-
<ReadLinesFromFile Condition="Exists('$(PaketResolvedFilePath)')" File="$(PaketResolvedFilePath)" >
138+
<ReadLinesFromFile Condition="($(DesignTimeBuild) != true OR '$(PaketPropsLoaded)' != 'true') AND '@(PaketResolvedFilePaths)' != ''" File="%(PaketResolvedFilePaths.Identity)" >
118139
<Output TaskParameter="Lines" ItemName="PaketReferencesFileLines"/>
119140
</ReadLinesFromFile>
120141

121-
<ItemGroup Condition=" Exists('$(PaketResolvedFilePath)') AND '@(PaketReferencesFileLines)' != '' " >
142+
<ItemGroup Condition="($(DesignTimeBuild) != true OR '$(PaketPropsLoaded)' != 'true') AND '@(PaketReferencesFileLines)' != '' " >
122143
<PaketReferencesFileLinesInfo Include="@(PaketReferencesFileLines)" >
123144
<PackageName>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0])</PackageName>
124145
<PackageVersion>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1])</PackageVersion>
125146
<AllPrivateAssets>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[4])</AllPrivateAssets>
126147
</PaketReferencesFileLinesInfo>
127148
<PackageReference Include="%(PaketReferencesFileLinesInfo.PackageName)">
128149
<Version>%(PaketReferencesFileLinesInfo.PackageVersion)</Version>
129-
<PrivateAssets Condition="%(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'true'">All</PrivateAssets>
150+
<PrivateAssets Condition=" ('%(PaketReferencesFileLinesInfo.AllPrivateAssets)' == 'true') Or ('$(PackAsTool)' == 'true') ">All</PrivateAssets>
151+
<ExcludeAssets Condition="%(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'exclude'">runtime</ExcludeAssets>
152+
<Publish Condition=" '$(PackAsTool)' == 'true' ">true</Publish>
130153
</PackageReference>
131154
</ItemGroup>
132155

@@ -183,8 +206,8 @@
183206

184207
<ConvertToAbsolutePath Condition="@(_NuspecFiles) != ''" Paths="@(_NuspecFiles)">
185208
<Output TaskParameter="AbsolutePaths" PropertyName="NuspecFileAbsolutePath" />
186-
</ConvertToAbsolutePath>
187-
209+
</ConvertToAbsolutePath>
210+
188211

189212
<!-- Call Pack -->
190213
<PackTask Condition="$(UseNewPack)"

.travis.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@ matrix:
66
dist: trusty
77
sudo: false
88
mono: latest
9-
dotnet: 2.0.0
9+
dotnet: 2.1.300
1010
- os: osx # OSX 10.12
1111
osx_image: xcode9.1
12-
dotnet: 2.0.0
12+
dotnet: 2.1.300
1313
mono: latest
1414
sudo: false
1515

16+
install:
17+
# workaround for missing .net 4.5 targing pack
18+
- export FrameworkPathOverride=$(dirname $(which mono))/../lib/mono/4.5/
19+
1620
script:
1721
- dotnet --info
1822
- ./build.sh All

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
[![Issue Stats](http://issuestats.com/github/fsprojects/FSharp.Control.AsyncSeq/badge/issue)](http://issuestats.com/github/fsprojects/FSharp.Control.AsyncSeq)
2-
[![Issue Stats](http://issuestats.com/github/fsprojects/FSharp.Control.AsyncSeq/badge/pr)](http://issuestats.com/github/fsprojects/FSharp.Control.AsyncSeq)
31
[![Build status](https://ci.appveyor.com/api/projects/status/22wknie0x5c2jfuo/branch/master?svg=true)](https://ci.appveyor.com/project/SteffenForkmann/fsharp-control-asyncseq/branch/master)
42
[![Build status](https://travis-ci.org/fsprojects/FSharp.Control.AsyncSeq.svg?branch=master)](https://travis-ci.org/fsprojects/FSharp.Control.AsyncSeq)
53

build.cmd

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
11
@echo off
22
cls
33

4-
.paket\paket.bootstrapper.exe
5-
if errorlevel 1 (
6-
exit /b %errorlevel%
7-
)
8-
94
.paket\paket.exe restore
105
if errorlevel 1 (
116
exit /b %errorlevel%
127
)
138

14-
IF NOT EXIST build.fsx (
15-
.paket\paket.exe update
16-
packages\build\FAKE\tools\FAKE.exe init.fsx
17-
)
189
packages\build\FAKE\tools\FAKE.exe build.fsx %*

build.sh

Lines changed: 26 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,30 @@
11
#!/usr/bin/env bash
2-
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" ]
15-
then
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-
"$@"
2+
if [ "$OS" = "Windows_NT" ]; then
3+
# use .Net
4+
.paket/paket.exe restore
5+
exit_code=$?
6+
if [ $exit_code -ne 0 ]; then
7+
exit $exit_code
288
fi
29-
}
30-
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."
9+
packages/build/FAKE/tools/FAKE.exe $@ --fsiargs build.fsx
10+
else
11+
# use mono
12+
mono .paket/paket.exe restore
13+
exit_code=$?
14+
if [ $exit_code -ne 0 ]; then
15+
certificate_count=$(certmgr -list -c Trust | grep X.509 | wc -l)
16+
if [ $certificate_count -le 1 ]; then
17+
echo "Couldn't download Paket. This might be because your Mono installation"
18+
echo "doesn't have the right SSL root certificates installed. One way"
19+
echo "to fix this would be to download the list of SSL root certificates"
20+
echo "from the Mozilla project by running the following command:"
21+
echo ""
22+
echo " mozroots --import --sync"
23+
echo ""
24+
echo "This will import over 100 SSL root certificates into your Mono"
25+
echo "certificate repository. Then try running the build script again."
26+
fi
27+
exit $exit_code
6628
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
29+
mono packages/build/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx
7030
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

global.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"sdk": {
3+
"version": "2.1.300"
4+
}
5+
}

paket.dependencies

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ group Legacy
1515
group Build
1616
source https://api.nuget.org/v3/index.json
1717

18-
nuget FAKE
18+
nuget FAKE ~> 4
1919
nuget FSharp.Formatting
2020
nuget Nuget.CommandLine
2121
github fsharp/FAKE modules/Octokit/Octokit.fsx

0 commit comments

Comments
 (0)