Skip to content

Commit 1295aa1

Browse files
vbfoxKrzysztof-Cieslak
authored andcommitted
Fable 1.2 (ionide#522)
1 parent a457bfd commit 1295aa1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+5490
-317
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,4 @@ release-preview.cmd
7171
paket-files
7272
issueList.md
7373
release/package-lock\.json
74+
*.vsix

.paket/Paket.Restore.targets

+239
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>

.vscode/launch.json

+10-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,16 @@
44
"configurations": [
55
{
66
"preLaunchTask": "Default",
7-
"name": "Launch Extension",
7+
"name": "Build and Launch Extension",
8+
"type": "extensionHost",
9+
"runtimeExecutable": "${execPath}",
10+
"args": ["--extensionDevelopmentPath=${workspaceRoot}/release" ],
11+
"stopOnEntry": false,
12+
"request": "launch",
13+
"sourceMaps": false
14+
},
15+
{
16+
"name": "Launch Only",
817
"type": "extensionHost",
918
"runtimeExecutable": "${execPath}",
1019
"args": ["--extensionDevelopmentPath=${workspaceRoot}/release" ],

.vscode/tasks.json

+40-23
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,47 @@
1-
// Available variables which can be used inside of strings.
2-
// ${workspaceRoot}: the root folder of the team
3-
// ${file}: the current opened file
4-
// ${fileBasename}: the current opened file's basename
5-
// ${fileDirname}: the current opened file's dirname
6-
// ${fileExtname}: the current opened file's extension
7-
// ${cwd}: the current working directory of the spawned process
8-
91
{
10-
"version": "0.1.0",
11-
"isShellCommand": true,
12-
"showOutput": "silent",
13-
"osx": {
14-
"command": "${workspaceRoot}/build.sh"
15-
},
16-
"windows": {
17-
"command": "${workspaceRoot}/build.cmd"
18-
},
19-
"linux": {
20-
"command": "${workspaceRoot}/build.sh"
2+
"version": "2.0.0",
3+
"presentation": {
4+
"reveal": "silent"
215
},
6+
"type": "shell",
227
"tasks": [
238
{
24-
"taskName": "Default",
25-
"args": ["Default"],
26-
"isBuildCommand": true
9+
"command": "${workspaceRoot}/build.sh",
10+
"windows": {
11+
"command": "${workspaceRoot}/build.cmd"
12+
},
13+
"taskName": "Build",
14+
"args": [
15+
"Default"
16+
],
17+
"group": {
18+
"kind": "build",
19+
"isDefault": true
20+
}
21+
},
22+
{
23+
"command": "${workspaceRoot}/build.sh",
24+
"windows": {
25+
"command": "${workspaceRoot}/build.cmd"
26+
},
27+
"taskName": "Full Build",
28+
"args": [
29+
"Build"
30+
],
31+
"group": "build"
32+
},
33+
{
34+
"command": "${workspaceRoot}/build.sh",
35+
"windows": {
36+
"command": "${workspaceRoot}/build.cmd"
37+
},
38+
"taskName": "Watch",
39+
"args": [
40+
"Watch"
41+
],
42+
"group": "build",
43+
"isBackground": true,
44+
"problemMatcher": []
2745
}
2846
]
29-
3047
}

CONTRIBUTING.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# How to contribute
2+
3+
## Prerequisites
4+
5+
- [Visual Studio Code][vscode] 🙄
6+
- [Mono][mono]
7+
- [.Net Core 2.0][dotnet]
8+
- [Node.js][nodejs]
9+
- [Yarn][yarn]
10+
11+
## Building
12+
13+
Everything is done via `build.cmd` \ `build.sh`.
14+
15+
- `build Build` does a full-build, including package installation and copying some necessary files.<br/>
16+
It should always be done at least once after any clone/pull.
17+
- If a git dependency fail to build paket won't re-do it you can run their build scripts manually:
18+
- In `paket-files\github.com\fsharp\FsAutoComplete` run `build LocalRelease`
19+
- In `paket-files\github.com\fsharp-editing\Forge` run `build Build`
20+
- In VSCode two configurations are possible to run:
21+
- Use `Build and Launch Extension`
22+
- Start the `Watch` task and when a build is done start `Launch Only`
23+
24+
## Working with FSAC
25+
26+
1. Run `build.cmd Build` \ `build.sh Build`
27+
1. Open Ionide-vscode-fsharp in VSCode.
28+
2. Set `devMode` to `true` in `src/Core/LanguageService.fs`
29+
3. Open FSAC in VS
30+
4. Start FSAC.Suave in VS
31+
5. Press F5 in VSCode to build Ionide and start experimental instance
32+
33+
[dotnet]: https://www.microsoft.com/net/download/core
34+
[mono]: http://www.mono-project.com/download/
35+
[nodejs]: https://nodejs.org/en/download/
36+
[yarn]: https://yarnpkg.com/en/docs/install
37+
[vscode]: https://code.visualstudio.com/Download

DEVGUIDE.md

-23
This file was deleted.

0 commit comments

Comments
 (0)