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 14 commits
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
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# top-most EditorConfig file
root = true

[*]
end_of_line = lf

[*.{fs,fsi,fsx}]
charset = utf-8
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
Copy link
Member

Choose a reason for hiding this comment

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

Should this be gitignored? Which editor is this?

Copy link
Member Author

Choose a reason for hiding this comment

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

it's supposed to be commited, it's for many many editors,

Copy link
Member

Choose a reason for hiding this comment

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

thanks didn't know that :)

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.vs/
bin/
obj/
/.paket/paket.exe
paket-files/
nuget/*.nupkg
docs/output/
Expand All @@ -27,3 +28,6 @@ release.cmd
*.synctex
*.log
*.svclog

.paket/paket.exe
fsbuild.targets
Binary file modified .paket/paket.bootstrapper.exe
Binary file not shown.
Binary file removed .paket/paket.exe
Binary file not shown.
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.

3 changes: 2 additions & 1 deletion FSharp.Formatting.sln
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26228.9
VisualStudioVersion = 15.0.26403.3
MinimumVisualStudioVersion = 12.0.31101.0
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "project", "project", "{194BD478-0DB5-44F3-A6C2-1FC75D3F3294}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitignore = .gitignore
.travis.yml = .travis.yml
appveyor.yml = appveyor.yml
Expand Down
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 %*
16 changes: 8 additions & 8 deletions build.fsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
System.IO.Directory.SetCurrentDirectory __SOURCE_DIRECTORY__
System.IO.Directory.SetCurrentDirectory __SOURCE_DIRECTORY__

// --------------------------------------------------------------------------------------
// FAKE build script
Expand Down 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 @@ -141,11 +141,11 @@ Target "MergeVSPowerTools" (fun _ ->
// Build tests and generate tasks to run the tests in sequence

Target "BuildTests" (fun _ ->
{ BaseDirectory = __SOURCE_DIRECTORY__
Includes = ["FSharp.Formatting.sln"]
Excludes = [] }
|> MSBuildRelease "" "Build"
|> ignore
{ BaseDirectory = __SOURCE_DIRECTORY__
Includes = ["FSharp.Formatting.sln"]
Excludes = []
} |> MSBuildRelease "" "Build"
|> ignore

{ BaseDirectory = __SOURCE_DIRECTORY__
Includes = ["tests/*/files/FsLib/FsLib.sln"]
Expand All @@ -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
29 changes: 23 additions & 6 deletions docs/files/content/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,31 @@ span.pf { color:#E0C57F; }
span.e { color:#EA8675; }

/* identifiers --- and styles for more specific identifier types */
span.i { color:#d1d1d1; }
/* type or module */
span.t { color:#43AEC6; }
span.id { color:#d1d1d1; }
/* module */
span.m { color:#43AEC6; }
/* reference type */
span.rt { color:#43AEC6; }
/* value type */
span.vt { color:#43AEC6; }
/* interface */
span.if{ color:#43AEC6; }
/* type argument */
span.ta { color:#43AEC6; }
/* disposable */
span.d { color:#43AEC6; }
/* property */
span.prop { color:#43AEC6; }
/* punctuation */
span.p { color:#43AEC6; }
/* function */
span.f { color:#e1e1e1; }
/* DU case or active pattern */
span.p { color:#4ec9b0; }

/* active pattern */
span.pat { color:#4ec9b0; }
/* union case */
span.u { color:#4ec9b0; }
/* enumeration */
span.e { color:#4ec9b0; }
/* keywords */
span.k { color:#FAB11D; }
/* comment */
Expand Down
9 changes: 4 additions & 5 deletions packages/FSharp.Formatting/FSharp.Formatting.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,23 @@
// Standard NuGet or Paket location
#I __SOURCE_DIRECTORY__
#I "lib/net40"
#r "./lib/net40/System.Web.Razor.dll"
#r "../Microsoft.AspNet.Razor/lib/net45/System.Web.Razor.dll"
// Force load
if (typeof<System.Web.Razor.ParserResults>.Assembly.GetName().Version.Major <= 2) then
failwith "Wrong System.Web.Razor Version loaded!"

#r "../System.ValueTuple/lib/portable-net40+sl4+win8+wp8/System.ValueTuple.dll"
Copy link
Member

Choose a reason for hiding this comment

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

Btw this dependency was removed in latest FCS ...


// Standard NuGet locations
#I "../FSharp.Compiler.Service.2.0.0.6/lib/net45"
#I "../FSharpVSPowerTools.Core.2.3.0/lib/net45"
//#I "../FSharp.Compiler.Service.12.0.2/lib/net45"

// Standard Paket locations
#I "../FSharp.Compiler.Service/lib/net45"
#I "../FSharpVSPowerTools.Core/lib/net45"
//#I "../FSharpVSPowerTools.Core/lib/net45"


// Reference VS PowerTools, Razor and F# Formatting components
#r "RazorEngine.dll"
#r "FSharpVSPowerTools.Core.dll"
#r "FSharp.Formatting.Common.dll"
#r "FSharp.Markdown.dll"
#r "FSharp.Literate.dll"
Expand Down
20 changes: 8 additions & 12 deletions paket.dependencies
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
source https://api.nuget.org/v3/index.json
source https://nuget.org/api/v2
source https://dotnet.myget.org/F/dotnet-corefxlab/api/v3/index.json

redirects: on

nuget FSharp.Data
nuget FAKE
nuget CommandLineParser
nuget FSharp.Core 4.0.0.1 redirects:force
nuget FSharp.Core redirects:force, content:none
nuget Microsoft.AspNet.Razor
nuget RazorEngine 3.9.3 framework: net45
nuget NuGet.CommandLine
nuget FSharp.Compiler.Service 2.0.0.6
// See http://fsprojects.github.io/Paket/nuget-dependencies.html
// This basically means we need the lowest version for its dependencies (FSharp.Compiler.Service)
// Otherwise we get runtime errors without binding redirects
// (which we cannot control running as part of a build script).
// See https://github.com/tpetricek/FSharp.Formatting/issues/277 as well.
nuget FSharpVSPowerTools.Core !>= 0
nuget RazorEngine 3.9.3 framework: >= net45
nuget FSharp.Compiler.Service content:none
nuget ILRepack
nuget Argu


github matthid/Yaaf.FSharp.Scripting src/source/Yaaf.FSharp.Scripting/YaafFSharpScripting.fs

group Test
source https://api.nuget.org/v3/index.json
redirects: on

nuget FSharp.Core 4.0.0.1 redirects:force
nuget FsUnit 3.0.0 framework:net45
nuget FsUnit 3.0.0 //framework:net45
nuget NUnit
nuget NUnit.Console
Loading