Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Run FSharp.Formatting on FCS only #432

Merged
merged 50 commits into from
Apr 23, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
2a128a6
update paket, packages, and FSharp.Core
cloudRoutine Apr 1, 2017
2af8bfe
update packages
cloudRoutine Apr 2, 2017
d835950
additional token categories
cloudRoutine Apr 2, 2017
18b155c
use FCS semantic classification for tokens
cloudRoutine Apr 2, 2017
b346b4d
update packages
cloudRoutine Apr 2, 2017
d5227c3
update css and load paths
cloudRoutine Apr 2, 2017
1dfe1cb
setup editorconfig
cloudRoutine Apr 14, 2017
4ee32b2
formatting and organization
cloudRoutine Apr 14, 2017
63a52a0
update packages
cloudRoutine Apr 14, 2017
c0e9934
more formatting
cloudRoutine Apr 14, 2017
bdc4cf4
update test api usage
cloudRoutine Apr 14, 2017
fab5861
update project files
cloudRoutine Apr 14, 2017
ae51d4a
update paket and bootstrapper
cloudRoutine Apr 14, 2017
f113638
working vs and commandline build
cloudRoutine Apr 14, 2017
bff1198
update FSharp.Core in /lib/
cloudRoutine Apr 15, 2017
3a66f41
change debug version from portable to full
cloudRoutine Apr 15, 2017
fbe9294
Set NUnit to 3.6.0 for FsUnit Compatibility
cloudRoutine Apr 15, 2017
ea013da
update fsunit api calls
cloudRoutine Apr 15, 2017
28bba86
parameterize CSS class names
cloudRoutine Apr 15, 2017
f99d80d
tweak CSS classes
cloudRoutine Apr 15, 2017
2dc2dc5
update fsunit api calls and paramaterize CSS class usage
cloudRoutine Apr 15, 2017
529c4fb
formatting
cloudRoutine Apr 16, 2017
7301c45
ignore test until FCS supports escaped char colorization
cloudRoutine Apr 16, 2017
e0f0df8
remove commented code, formatting
cloudRoutine Apr 16, 2017
33d8c46
fix cli build
cloudRoutine Apr 16, 2017
dfd2e28
simplify build.fsx
cloudRoutine Apr 16, 2017
e5761c4
fix test xml doc generation
cloudRoutine Apr 16, 2017
e7ca53f
temporarily use custom script host
cloudRoutine Apr 16, 2017
53ccadc
ignore lib dir unless forcibly checked in
cloudRoutine Apr 17, 2017
a144f6d
update test project layout
cloudRoutine Apr 17, 2017
c32937a
update FsUnit api usage
cloudRoutine Apr 17, 2017
e84a823
error handling for assembly loading
cloudRoutine Apr 17, 2017
a6ed59e
unify tests output dir
cloudRoutine Apr 17, 2017
fb09ad0
report loaded assemblies on metadata test failure
cloudRoutine Apr 17, 2017
18d2f3e
update target frameworks
cloudRoutine Apr 17, 2017
4993b17
unify test output into 'tests\bin'
cloudRoutine Apr 17, 2017
f4de496
fix pathing in metadata tests
cloudRoutine Apr 17, 2017
3fe0c85
paket magic mode
cloudRoutine Apr 17, 2017
54e4663
update packages
cloudRoutine Apr 17, 2017
4c31049
update redirects, fix some references files
cloudRoutine Apr 17, 2017
89b9091
add magic mode paket.exe (bootstrapper)
cloudRoutine Apr 17, 2017
34737f4
fix build script error and add app.config to MetadataFormat.Tests
matthid Apr 17, 2017
0698e48
ensure dir
matthid Apr 17, 2017
042f949
fix pattern
matthid Apr 17, 2017
b443c8e
set newline to lf in editorconfig
cloudRoutine Apr 17, 2017
4fbf4f7
fix metadata tests
cloudRoutine Apr 17, 2017
58bb4d6
yield keyword tokens while parsing ident islands
cloudRoutine Apr 17, 2017
d4ce827
match xml doc files case insensitive
cloudRoutine Apr 17, 2017
ac6ab34
fix build
matthid Apr 23, 2017
f610e5f
trigger build
matthid Apr 23, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ release.cmd
*.log
*.svclog

.paket/paket.exe
.paket/paket.exe
fsbuild.targets
62 changes: 43 additions & 19 deletions .paket/paket.targets
Original file line number Diff line number Diff line change
@@ -1,38 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<!-- Enable the restore command to run before builds -->
<RestorePackages Condition=" '$(RestorePackages)' == '' ">true</RestorePackages>
<!-- Download Paket.exe if it does not already exist -->
<DownloadPaket Condition=" '$(DownloadPaket)' == '' ">true</DownloadPaket>
<PaketToolsPath>$(MSBuildThisFileDirectory)</PaketToolsPath>
<PaketRootPath>$(MSBuildThisFileDirectory)..\</PaketRootPath>
<MonoPath Condition="'$(MonoPath)' == '' And Exists('/Library/Frameworks/Mono.framework/Commands/mono')">/Library/Frameworks/Mono.framework/Commands/mono</MonoPath>
<MonoPath Condition="'$(MonoPath)' == ''">mono</MonoPath>
</PropertyGroup>

<PropertyGroup>
<!-- Paket command -->
<PaketExePath Condition=" '$(PaketExePath)' == '' AND Exists('$(PaketRootPath)paket.exe')">$(PaketRootPath)paket.exe</PaketExePath>
<PaketExePath Condition=" '$(PaketExePath)' == '' ">$(PaketToolsPath)paket.exe</PaketExePath>
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' ">$(PaketToolsPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
<PaketCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketExePath)"</PaketCommand>
<PaketCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(PaketExePath)</PaketCommand>
<PaketBootStrapperCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketBootStrapperExePath)"</PaketBootStrapperCommand>
<PaketBootStrapperCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(PaketBootStrapperExePath)</PaketBootStrapperCommand>
<!-- Commands -->
<PaketReferences Condition="!Exists('$(MSBuildProjectFullPath).paket.references')">$(MSBuildProjectDirectory)\paket.references</PaketReferences>
<PaketCommand Condition=" '$(OS)' != 'Windows_NT' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)"</PaketCommand>
</PropertyGroup>

<Choose> <!-- MyProject.fsproj.paket.references has the highest precedence -->
<When Condition="Exists('$(MSBuildProjectFullPath).paket.references')">
<PropertyGroup>
<PaketReferences>$(MSBuildProjectFullPath).paket.references</PaketReferences>
</PropertyGroup>
</When> <!-- MyProject.paket.references -->
<When Condition="Exists('$(MSBuildProjectDirectory)\$(MSBuildProjectName).paket.references')">
<PropertyGroup>
<PaketReferences>$(MSBuildProjectDirectory)\$(MSBuildProjectName).paket.references</PaketReferences>
</PropertyGroup>
</When> <!-- paket.references -->
<When Condition="Exists('$(MSBuildProjectDirectory)\paket.references')">
<PropertyGroup>
<PaketReferences>$(MSBuildProjectDirectory)\paket.references</PaketReferences>
</PropertyGroup>
</When> <!-- Set to empty if a reference file isn't found matching one of the 3 format options -->
<Otherwise>
<PropertyGroup>
<PaketReferences></PaketReferences>
</PropertyGroup>
</Otherwise>
</Choose>

<PropertyGroup>
<!-- Commands -->
<PaketReferences Condition="!Exists('$(MSBuildProjectFullPath).paket.references')">$(MSBuildProjectDirectory)\$(MSBuildProjectName).paket.references</PaketReferences>
<PaketReferences Condition="!Exists('$(MSBuildProjectDirectory)\$(MSBuildProjectName).paket.references')">$(MSBuildProjectDirectory)\paket.references</PaketReferences>
<PaketReferences Condition="!Exists('$(PaketReferences)')">$(MSBuildStartupDirectory)\paket.references</PaketReferences>
<PaketReferences Condition="Exists('$(MSBuildProjectFullPath).paket.references')">$(MSBuildProjectFullPath).paket.references</PaketReferences>
<RestoreCommand>$(PaketCommand) restore --references-files "$(PaketReferences)"</RestoreCommand>
<DownloadPaketCommand>$(PaketBootStrapperCommand)</DownloadPaketCommand>
<!-- We need to ensure packages are restored prior to assembly resolve -->
<BuildDependsOn Condition="$(RestorePackages) == 'true'">RestorePackages; $(BuildDependsOn);</BuildDependsOn>
</PropertyGroup>
<Target Name="CheckPrerequisites">
<!-- Raise an error if we're unable to locate paket.exe -->
<Error Condition="'$(DownloadPaket)' != 'true' AND !Exists('$(PaketExePath)')" Text="Unable to locate '$(PaketExePath)'" />
<MsBuild Targets="DownloadPaket" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadPaket=$(DownloadPaket)" />
</Target>
<Target Name="DownloadPaket">
<Exec Command="$(DownloadPaketCommand)" Condition=" '$(DownloadPaket)' == 'true' AND !Exists('$(PaketExePath)')" />
</Target>
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
<Exec Command="$(RestoreCommand)" WorkingDirectory="$(PaketRootPath)" Condition="Exists('$(PaketReferences)')" />
<Target Name="RestorePackages">
<Exec Command="$(RestoreCommand)"
IgnoreStandardErrorWarningFormat="true"
WorkingDirectory="$(PaketRootPath)"
ContinueOnError="true"
Condition=" Exists('$(PaketReferences)') AND '$(PaketReferences)' != '' "
/>
</Target>
</Project>
10 changes: 0 additions & 10 deletions FSharp.Formatting.nunit

This file was deleted.

8 changes: 6 additions & 2 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
@echo off

.paket\paket.exe restore
.paket\paket.bootstrapper.exe
if errorlevel 1 (
exit /b %errorlevel%
)

packages\FAKE\tools\FAKE.exe build.fsx %*
.paket\paket.exe restore
if errorlevel 1 (
exit /b %errorlevel%
)

packages\FAKE\tools\FAKE.exe build.fsx %*
6 changes: 3 additions & 3 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ let solutionFile = "FSharp.Formatting.sln"

let msbuild14 = ProgramFilesX86</>"MSBuild"</>"14.0"</>"Bin"</>"MSBuild.exe"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from inside the commit 😉


if isWindows && fileExists msbuild14 then
if isWindows && fileExists msbuild14 then
setEnvironVar "MSBUILD" msbuild14

Target "Build" (fun _ ->
Expand Down Expand Up @@ -143,7 +143,7 @@ Target "MergeVSPowerTools" (fun _ ->
Target "BuildTests" (fun _ ->
{ BaseDirectory = __SOURCE_DIRECTORY__
Includes = ["FSharp.Formatting.sln"]
Excludes = []
Excludes = []
} |> MSBuildRelease "" "Build"
|> ignore

Expand Down Expand Up @@ -172,7 +172,7 @@ Target "BuildTests" (fun _ ->
|> ignore
)

open Fake.Testing
open Fake.Testing

let testProjects =
[ "FSharp.CodeFormat.Tests"; "FSharp.Literate.Tests";
Expand Down
35 changes: 28 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,45 @@
#!/bin/bash
#!/usr/bin/env bash
if test "$OS" = "Windows_NT"
then
# use .Net

.paket/paket.bootstrapper.exe
exit_code=$?
if [ $exit_code -ne 0 ]; then
exit $exit_code
fi

.paket/paket.exe restore
exit_code=$?
if [ $exit_code -ne 0 ]; then
exit $exit_code
exit $exit_code
fi

packages/FAKE/tools/FAKE.exe build.fsx $@
packages/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx
else
# use mono

mono .paket/paket.bootstrapper.exe
exit_code=$?
if [ $exit_code -ne 0 ]; then
certificate_count=$(certmgr -list -c Trust | grep X.509 | wc -l)
if [ $certificate_count -le 1 ]; then
echo "Couldn't download Paket. This might be because your Mono installation"
echo "doesn't have the right SSL root certificates installed. One way"
echo "to fix this would be to download the list of SSL root certificates"
echo "from the Mozilla project by running the following command:"
echo ""
echo " mozroots --import --sync"
echo ""
echo "This will import over 100 SSL root certificates into your Mono"
echo "certificate repository. Then try running the build script again."
fi
exit $exit_code
fi

mono .paket/paket.exe restore
exit_code=$?
if [ $exit_code -ne 0 ]; then
exit $exit_code
exit $exit_code
fi

mono packages/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx
mono packages/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx
fi
13 changes: 2 additions & 11 deletions csharp/MarkdownSharp/MarkdownSharp.csproj
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{37619116-CCE8-465A-8B1F-081CA53364BB}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MarkdownSharp</RootNamespace>
<AssemblyName>MarkdownSharp</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<StartupObject>
</StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
Expand Down
3 changes: 1 addition & 2 deletions paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ source https://dotnet.myget.org/F/dotnet-corefxlab/api/v3/index.json
redirects: on

nuget FSharp.Data
nuget FSharp.Compiler.Tools
nuget FAKE
nuget CommandLineParser
nuget FSharp.Core redirects:force, content:none
nuget Microsoft.AspNet.Razor
nuget RazorEngine 3.9.3 framework: net45
nuget RazorEngine 3.9.3 framework: >= net45
nuget FSharp.Compiler.Service content:none
nuget ILRepack
nuget Argu
Expand Down
3 changes: 1 addition & 2 deletions paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ NUGET
System.Text.Encoding.Extensions (>= 4.3) - framework: >= netstandard16
System.Threading (>= 4.3) - framework: >= netstandard16
System.Threading.Tasks (>= 4.3) - framework: >= netstandard16
FSharp.Compiler.Tools (4.1.5)
FSharp.Core (4.1.12) - content: none, redirects: force
System.Collections (>= 4.0.11) - framework: >= netstandard16
System.Console (>= 4.0) - framework: >= netstandard16
Expand Down Expand Up @@ -156,7 +155,7 @@ NUGET
System.Threading.Timer (>= 4.3) - framework: >= net451, >= netstandard12
System.Xml.ReaderWriter (>= 4.3) - framework: >= netstandard10
System.Xml.XDocument (>= 4.3) - framework: >= netstandard10
RazorEngine (3.9.3) - framework: net45
RazorEngine (3.9.3) - framework: >= net45
Microsoft.AspNet.Razor (>= 3.0) - framework: >= net45
runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3) - content: none, framework: >= net463, >= netstandard16
runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3) - content: none, framework: >= net463, >= netstandard16
Expand Down
2 changes: 1 addition & 1 deletion src/CSharpFormat/CSharpFormat.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand Down
4 changes: 2 additions & 2 deletions src/FSharp.CodeFormat/FSharp.CodeFormat.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
</PropertyGroup>
<Choose>
<When Condition="Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\4.0\Framework\v4.1\Microsoft.FSharp.Targets')">
<When Condition="Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\4.1\Framework\v4.0\Microsoft.FSharp.Targets')">
<PropertyGroup>
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\4.0\Framework\v4.1\Microsoft.FSharp.Targets</FSharpTargetsPath>
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\4.1\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</When>
<When Condition="'$(VisualStudioVersion)' != '11.0' and Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets')">
Expand Down
14 changes: 7 additions & 7 deletions src/FSharp.CodeFormat/SourceCode.fs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ namespace FSharp.CodeFormat
type ToolTipSpans = list<ToolTipSpan>

/// A tool tip span can be emphasized text, plain text `Literal` or a line brak
and ToolTipSpan =
and ToolTipSpan =
| Emphasis of ToolTipSpans
| Literal of string
| HardLineBreak

/// Classifies tokens reported by the FCS
[<Struct>][<RequireQualifiedAccess>]
type TokenKind =
[<RequireQualifiedAccess>]
type TokenKind =
| Keyword
| String
| Comment
Expand All @@ -30,7 +30,7 @@ type TokenKind =
| Punctuation
| Preprocessor
| Module
| ReferenceType
| ReferenceType
| ValueType
| Interface
| TypeArgument
Expand All @@ -47,16 +47,16 @@ type TokenKind =


/// Represents a kind of error reported from the F# compiler (warning or error)
[<Struct>][<RequireQualifiedAccess>]
type ErrorKind =
[<RequireQualifiedAccess>]
type ErrorKind =
| Error
| Warning

/// A token in a parsed F# code snippet. Aside from standard tokens reported from
/// the compiler (`Token`), this also includes `Error` (wrapping the underlined
/// tokens), `Omitted` for the special `[omit:...]` tags and `Output` for the special
/// `[output:...]` tag
type TokenSpan =
type TokenSpan =
| Token of TokenKind * string * ToolTipSpans option
| Error of ErrorKind * string * TokenSpans
| Omitted of string * string
Expand Down
15 changes: 7 additions & 8 deletions src/FSharp.CodeFormat/app.config
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<runtime>

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<runtime><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<Paket>True</Paket>
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
Expand All @@ -16,10 +11,14 @@
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="1.2.1.0" />
</dependentAssembly>
<dependentAssembly>
<Paket>True</Paket>
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<Paket>True</Paket>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.0.1.0" />
</dependentAssembly>
</assemblyBinding></runtime>
</configuration>
</assemblyBinding></runtime></configuration>
Loading