Skip to content

Commit 42b0bb5

Browse files
authored
Merge pull request #8 from SuaveIO/migration/netstandard2.0
move to netstandard1.6 and net461
2 parents 6676bd5 + 86c658f commit 42b0bb5

20 files changed

+1038
-493
lines changed

.paket/Paket.Restore.targets

Lines changed: 239 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,239 @@
1+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<!-- Prevent dotnet template engine to parse this file -->
3+
<!--/-:cnd:noEmit-->
4+
<PropertyGroup>
5+
<!-- Mark that this target file has been loaded. -->
6+
<IsPaketRestoreTargetsFileLoaded>true</IsPaketRestoreTargetsFileLoaded>
7+
<PaketToolsPath>$(MSBuildThisFileDirectory)</PaketToolsPath>
8+
<PaketRootPath>$(MSBuildThisFileDirectory)..\</PaketRootPath>
9+
<PaketRestoreCacheFile>$(PaketRootPath)paket-files\paket.restore.cached</PaketRestoreCacheFile>
10+
<PaketLockFilePath>$(PaketRootPath)paket.lock</PaketLockFilePath>
11+
<MonoPath Condition="'$(MonoPath)' == '' And Exists('/Library/Frameworks/Mono.framework/Commands/mono')">/Library/Frameworks/Mono.framework/Commands/mono</MonoPath>
12+
<MonoPath Condition="'$(MonoPath)' == ''">mono</MonoPath>
13+
<!-- Paket command -->
14+
<PaketExePath Condition=" '$(PaketExePath)' == '' AND Exists('$(PaketRootPath)paket.exe')">$(PaketRootPath)paket.exe</PaketExePath>
15+
<PaketExePath Condition=" '$(PaketExePath)' == '' ">$(PaketToolsPath)paket.exe</PaketExePath>
16+
<PaketCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketExePath)"</PaketCommand>
17+
<PaketCommand Condition=" '$(OS)' != 'Windows_NT' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)"</PaketCommand>
18+
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' AND Exists('$(PaketRootPath)paket.bootstrapper.exe')">$(PaketRootPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
19+
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' ">$(PaketToolsPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
20+
<PaketBootStrapperCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketBootStrapperExePath)"</PaketBootStrapperCommand>
21+
<PaketBootStrapperCommand Condition=" '$(OS)' != 'Windows_NT' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketBootStrapperExePath)"</PaketBootStrapperCommand>
22+
23+
<!-- Disable automagic references for F# dotnet sdk -->
24+
<!-- This will not do anything for other project types -->
25+
<!-- see https://github.com/fsharp/fslang-design/blob/master/RFCs/FS-1032-fsharp-in-dotnet-sdk.md -->
26+
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
27+
<DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference>
28+
</PropertyGroup>
29+
30+
<Target Name="PaketRestore" BeforeTargets="_GenerateDotnetCliToolReferenceSpecs;_GenerateProjectRestoreGraphPerFramework;_GenerateRestoreGraphWalkPerFramework;CollectPackageReferences" >
31+
32+
<!-- Step 1 Check if lockfile is properly restored -->
33+
<PropertyGroup>
34+
<PaketRestoreRequired>true</PaketRestoreRequired>
35+
</PropertyGroup>
36+
37+
<PropertyGroup Condition="Exists('$(PaketRestoreCacheFile)') ">
38+
<PaketRestoreCachedHash>$([System.IO.File]::ReadAllText('$(PaketRestoreCacheFile)'))</PaketRestoreCachedHash>
39+
<PaketRestoreLockFileHash>$([System.IO.File]::ReadAllText('$(PaketLockFilePath)'))</PaketRestoreLockFileHash>
40+
<PaketRestoreRequired>true</PaketRestoreRequired>
41+
<PaketRestoreRequired Condition=" '$(PaketRestoreLockFileHash)' == '$(PaketRestoreCachedHash)' ">false</PaketRestoreRequired>
42+
<PaketRestoreRequired Condition=" '$(PaketRestoreLockFileHash)' == '' ">true</PaketRestoreRequired>
43+
</PropertyGroup>
44+
45+
<!-- Do a global restore if required -->
46+
<Exec Command='$(PaketBootStrapperCommand)' Condition="Exists('$(PaketBootStrapperExePath)') AND !(Exists('$(PaketExePath)'))" ContinueOnError="false" />
47+
<Exec Command='$(PaketCommand) restore' Condition=" '$(PaketRestoreRequired)' == 'true' " ContinueOnError="false" />
48+
49+
<!-- Step 2 Detect project specific changes -->
50+
<PropertyGroup>
51+
<PaketReferencesCachedFilePath>$(MSBuildProjectDirectory)\obj\$(MSBuildProjectFile).paket.references.cached</PaketReferencesCachedFilePath>
52+
<!-- MyProject.fsproj.paket.references has the highest precedence -->
53+
<PaketOriginalReferencesFilePath>$(MSBuildProjectFullPath).paket.references</PaketOriginalReferencesFilePath>
54+
<!-- MyProject.paket.references -->
55+
<PaketOriginalReferencesFilePath Condition=" !Exists('$(PaketOriginalReferencesFilePath)')">$(MSBuildProjectDirectory)\$(MSBuildProjectName).paket.references</PaketOriginalReferencesFilePath>
56+
<!-- paket.references -->
57+
<PaketOriginalReferencesFilePath Condition=" !Exists('$(PaketOriginalReferencesFilePath)')">$(MSBuildProjectDirectory)\paket.references</PaketOriginalReferencesFilePath>
58+
<PaketResolvedFilePath>$(MSBuildProjectDirectory)\obj\$(MSBuildProjectFile).$(TargetFramework).paket.resolved</PaketResolvedFilePath>
59+
<PaketRestoreRequired>true</PaketRestoreRequired>
60+
<PaketRestoreRequiredReason>references-file-or-cache-not-found</PaketRestoreRequiredReason>
61+
</PropertyGroup>
62+
63+
<!-- Step 2 a Detect changes in references file -->
64+
<PropertyGroup Condition="Exists('$(PaketOriginalReferencesFilePath)') AND Exists('$(PaketReferencesCachedFilePath)') ">
65+
<PaketRestoreCachedHash>$([System.IO.File]::ReadAllText('$(PaketReferencesCachedFilePath)'))</PaketRestoreCachedHash>
66+
<PaketRestoreReferencesFileHash>$([System.IO.File]::ReadAllText('$(PaketOriginalReferencesFilePath)'))</PaketRestoreReferencesFileHash>
67+
<PaketRestoreRequiredReason>references-file</PaketRestoreRequiredReason>
68+
<PaketRestoreRequired Condition=" '$(PaketRestoreReferencesFileHash)' == '$(PaketRestoreCachedHash)' ">false</PaketRestoreRequired>
69+
</PropertyGroup>
70+
71+
<PropertyGroup Condition="!Exists('$(PaketOriginalReferencesFilePath)') AND !Exists('$(PaketReferencesCachedFilePath)') ">
72+
<!-- If both don't exist there is nothing to do. -->
73+
<PaketRestoreRequired>false</PaketRestoreRequired>
74+
</PropertyGroup>
75+
76+
<!-- Step 2 b detect relevant changes in project file (new targetframework) -->
77+
<PropertyGroup Condition=" !Exists('$(PaketResolvedFilePath)') AND '$(TargetFramework)' != '' ">
78+
<PaketRestoreRequired>true</PaketRestoreRequired>
79+
<PaketRestoreRequiredReason>target-framework '$(TargetFramework)'</PaketRestoreRequiredReason>
80+
</PropertyGroup>
81+
82+
<!-- Step 3 Restore project specific stuff if required -->
83+
<Warning Condition=" '$(PaketRestoreRequired)' == 'true' " Text="Detected a change ('$(PaketRestoreRequiredReason)') in the project file '$(MSBuildProjectFullPath)', calling paket restore" />
84+
<Exec Command='$(PaketCommand) restore --project "$(MSBuildProjectFullPath)"' Condition=" '$(PaketRestoreRequired)' == 'true' " ContinueOnError="false" />
85+
86+
<!-- This shouldn't actually happen, but just to be sure. -->
87+
<Error Condition=" !Exists('$(PaketResolvedFilePath)') AND '$(TargetFramework)' != '' " Text="A paket file for the framework '$(TargetFramework)' is missing. Please delete 'paket-files/paket.restore.cached' and call 'paket restore'." />
88+
89+
<!-- Step 4 forward all msbuild properties (PackageReference, DotNetCliToolReference) to msbuild -->
90+
<ReadLinesFromFile Condition="Exists('$(PaketResolvedFilePath)')" File="$(PaketResolvedFilePath)" >
91+
<Output TaskParameter="Lines" ItemName="PaketReferencesFileLines"/>
92+
</ReadLinesFromFile>
93+
94+
<ItemGroup Condition=" Exists('$(PaketResolvedFilePath)') AND '@(PaketReferencesFileLines)' != '' " >
95+
<PaketReferencesFileLinesInfo Include="@(PaketReferencesFileLines)" >
96+
<PackageName>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0])</PackageName>
97+
<PackageVersion>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1])</PackageVersion>
98+
</PaketReferencesFileLinesInfo>
99+
<PackageReference Include="%(PaketReferencesFileLinesInfo.PackageName)">
100+
<Version>%(PaketReferencesFileLinesInfo.PackageVersion)</Version>
101+
</PackageReference>
102+
</ItemGroup>
103+
104+
<PropertyGroup>
105+
<PaketCliToolFilePath>$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).paket.clitools</PaketCliToolFilePath>
106+
</PropertyGroup>
107+
108+
<ReadLinesFromFile File="$(PaketCliToolFilePath)" >
109+
<Output TaskParameter="Lines" ItemName="PaketCliToolFileLines"/>
110+
</ReadLinesFromFile>
111+
112+
<ItemGroup Condition=" '@(PaketCliToolFileLines)' != '' " >
113+
<PaketCliToolFileLinesInfo Include="@(PaketCliToolFileLines)" >
114+
<PackageName>$([System.String]::Copy('%(PaketCliToolFileLines.Identity)').Split(',')[0])</PackageName>
115+
<PackageVersion>$([System.String]::Copy('%(PaketCliToolFileLines.Identity)').Split(',')[1])</PackageVersion>
116+
</PaketCliToolFileLinesInfo>
117+
<DotNetCliToolReference Include="%(PaketCliToolFileLinesInfo.PackageName)">
118+
<Version>%(PaketCliToolFileLinesInfo.PackageVersion)</Version>
119+
</DotNetCliToolReference>
120+
</ItemGroup>
121+
122+
<PropertyGroup>
123+
<RestoreConfigFile>$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).NuGet.Config</RestoreConfigFile>
124+
</PropertyGroup>
125+
126+
</Target>
127+
128+
<Target Name="PaketDisableDirectPack" AfterTargets="_IntermediatePack" BeforeTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references')" >
129+
<PropertyGroup>
130+
<ContinuePackingAfterGeneratingNuspec>false</ContinuePackingAfterGeneratingNuspec>
131+
</PropertyGroup>
132+
</Target>
133+
134+
<Target Name="PaketOverrideNuspec" AfterTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references')" >
135+
<PropertyGroup>
136+
<PaketProjectFile>$(MSBuildProjectDirectory)/$(MSBuildProjectFile)</PaketProjectFile>
137+
<ContinuePackingAfterGeneratingNuspec>true</ContinuePackingAfterGeneratingNuspec>
138+
<UseNewPack>false</UseNewPack>
139+
<UseNewPack Condition=" '$(NuGetToolVersion)' != '4.0.0' ">true</UseNewPack>
140+
</PropertyGroup>
141+
142+
<ItemGroup>
143+
<_NuspecFiles Include="$(BaseIntermediateOutputPath)*.nuspec"/>
144+
</ItemGroup>
145+
146+
<Exec Command='$(PaketCommand) fix-nuspecs files "@(_NuspecFiles)" project-file "$(PaketProjectFile)" ' Condition="@(_NuspecFiles) != ''" />
147+
148+
<ConvertToAbsolutePath Condition="@(_NuspecFiles) != ''" Paths="@(_NuspecFiles)">
149+
<Output TaskParameter="AbsolutePaths" PropertyName="NuspecFileAbsolutePath" />
150+
</ConvertToAbsolutePath>
151+
152+
<!-- Call Pack -->
153+
<PackTask Condition="$(UseNewPack)"
154+
PackItem="$(PackProjectInputFile)"
155+
PackageFiles="@(_PackageFiles)"
156+
PackageFilesToExclude="@(_PackageFilesToExclude)"
157+
PackageVersion="$(PackageVersion)"
158+
PackageId="$(PackageId)"
159+
Title="$(Title)"
160+
Authors="$(Authors)"
161+
Description="$(Description)"
162+
Copyright="$(Copyright)"
163+
RequireLicenseAcceptance="$(PackageRequireLicenseAcceptance)"
164+
LicenseUrl="$(PackageLicenseUrl)"
165+
ProjectUrl="$(PackageProjectUrl)"
166+
IconUrl="$(PackageIconUrl)"
167+
ReleaseNotes="$(PackageReleaseNotes)"
168+
Tags="$(PackageTags)"
169+
DevelopmentDependency="$(DevelopmentDependency)"
170+
BuildOutputInPackage="@(_BuildOutputInPackage)"
171+
TargetPathsToSymbols="@(_TargetPathsToSymbols)"
172+
TargetFrameworks="@(_TargetFrameworks)"
173+
AssemblyName="$(AssemblyName)"
174+
PackageOutputPath="$(PackageOutputAbsolutePath)"
175+
IncludeSymbols="$(IncludeSymbols)"
176+
IncludeSource="$(IncludeSource)"
177+
PackageTypes="$(PackageType)"
178+
IsTool="$(IsTool)"
179+
RepositoryUrl="$(RepositoryUrl)"
180+
RepositoryType="$(RepositoryType)"
181+
SourceFiles="@(_SourceFiles->Distinct())"
182+
NoPackageAnalysis="$(NoPackageAnalysis)"
183+
MinClientVersion="$(MinClientVersion)"
184+
Serviceable="$(Serviceable)"
185+
FrameworkAssemblyReferences="@(_FrameworkAssemblyReferences)"
186+
ContinuePackingAfterGeneratingNuspec="$(ContinuePackingAfterGeneratingNuspec)"
187+
NuspecOutputPath="$(BaseIntermediateOutputPath)"
188+
IncludeBuildOutput="$(IncludeBuildOutput)"
189+
BuildOutputFolder="$(BuildOutputTargetFolder)"
190+
ContentTargetFolders="$(ContentTargetFolders)"
191+
RestoreOutputPath="$(RestoreOutputAbsolutePath)"
192+
NuspecFile="$(NuspecFileAbsolutePath)"
193+
NuspecBasePath="$(NuspecBasePath)"
194+
NuspecProperties="$(NuspecProperties)"/>
195+
196+
<PackTask Condition="! $(UseNewPack)"
197+
PackItem="$(PackProjectInputFile)"
198+
PackageFiles="@(_PackageFiles)"
199+
PackageFilesToExclude="@(_PackageFilesToExclude)"
200+
PackageVersion="$(PackageVersion)"
201+
PackageId="$(PackageId)"
202+
Title="$(Title)"
203+
Authors="$(Authors)"
204+
Description="$(Description)"
205+
Copyright="$(Copyright)"
206+
RequireLicenseAcceptance="$(PackageRequireLicenseAcceptance)"
207+
LicenseUrl="$(PackageLicenseUrl)"
208+
ProjectUrl="$(PackageProjectUrl)"
209+
IconUrl="$(PackageIconUrl)"
210+
ReleaseNotes="$(PackageReleaseNotes)"
211+
Tags="$(PackageTags)"
212+
TargetPathsToAssemblies="@(_TargetPathsToAssemblies->'%(FinalOutputPath)')"
213+
TargetPathsToSymbols="@(_TargetPathsToSymbols)"
214+
TargetFrameworks="@(_TargetFrameworks)"
215+
AssemblyName="$(AssemblyName)"
216+
PackageOutputPath="$(PackageOutputAbsolutePath)"
217+
IncludeSymbols="$(IncludeSymbols)"
218+
IncludeSource="$(IncludeSource)"
219+
PackageTypes="$(PackageType)"
220+
IsTool="$(IsTool)"
221+
RepositoryUrl="$(RepositoryUrl)"
222+
RepositoryType="$(RepositoryType)"
223+
SourceFiles="@(_SourceFiles->Distinct())"
224+
NoPackageAnalysis="$(NoPackageAnalysis)"
225+
MinClientVersion="$(MinClientVersion)"
226+
Serviceable="$(Serviceable)"
227+
AssemblyReferences="@(_References)"
228+
ContinuePackingAfterGeneratingNuspec="$(ContinuePackingAfterGeneratingNuspec)"
229+
NuspecOutputPath="$(BaseIntermediateOutputPath)"
230+
IncludeBuildOutput="$(IncludeBuildOutput)"
231+
BuildOutputFolder="$(BuildOutputTargetFolder)"
232+
ContentTargetFolders="$(ContentTargetFolders)"
233+
RestoreOutputPath="$(RestoreOutputAbsolutePath)"
234+
NuspecFile="$(NuspecFileAbsolutePath)"
235+
NuspecBasePath="$(NuspecBasePath)"
236+
NuspecProperties="$(NuspecProperties)"/>
237+
</Target>
238+
<!--/+:cnd:noEmit-->
239+
</Project>

.paket/paket.targets

Lines changed: 0 additions & 41 deletions
This file was deleted.

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Now create new web application on IIS:
106106

107107
![IIS new web app](./docs/iis_newapp.png)
108108

109-
Copy all your build files into `C:\inetpub\wwwroot\myiiswebnamemyiiswebname` and navigate to `http://localhost/myiiswebname`. You should see your web application output now.
109+
Copy all your build files into `C:\inetpub\wwwroot\myiiswebname` and navigate to `http://localhost/myiiswebname`. You should see your web application output now.
110110

111111
## IIS Site
112112

@@ -156,6 +156,24 @@ If you need to run Suave application as Site (on default port 80 or any other po
156156
</configuration>
157157
```
158158

159+
## Suave.IIS on .NET Core
160+
161+
All the previous things are exactly the same (for both IIS Site & IIS Application), but there is little change in `web.config` file.
162+
163+
For IIS Site:
164+
165+
```xml
166+
processPath="dotnet"
167+
arguments="C:\inetpub\wwwroot\myiiswebname\myiiswebname.exe %ASPNETCORE_PORT%"
168+
```
169+
170+
or IIS Application:
171+
172+
```xml
173+
processPath="dotnet"
174+
arguments="C:\inetpub\wwwroot\myiiswebname\myiiswebname.exe %ASPNETCORE_PORT% &quot;myiiswebname&quot;"
175+
```
176+
159177
## Good to know
160178

161179
1. Maybe you didn\`t notice, but using this library, you can still run Suave locally (from Visual Studio hitting F5 or FAKE script) - it there are no command line arguments, default setup is used, so you don\`t need to change anything. Just use `withPort` and create custom filter functions based on `Suave.IIS.Configuration`.

RELEASE_NOTES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#### 2.4.0 - September 07 2017
2+
* Support for .NETStandard 1.6 and .NET461
3+
14
#### 2.3.0 - July 10 2017
25
* Support for AspNetCore module reading port setup from ENV variable (if not available as direct argument) (thanks to @toburger!)
36

0 commit comments

Comments
 (0)