Skip to content

Commit

Permalink
Merge pull request #251 from dsyme/fix8
Browse files Browse the repository at this point in the history
fix warnings and add TreatWarningsAsErrors
  • Loading branch information
dsyme authored Sep 6, 2018
2 parents e7a726f + e0da3c7 commit 3921636
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 4 deletions.
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ matrix:
- mono: latest
env: USE_MSBUILD=1
os: linux
- mono: weekly
env: USE_MSBUILD=1
os: linux

sudo: true # use the new container-based Travis infrastructure

script:
- ./build.sh Pack

allow_failures:
- mono: weekly
env: USE_MSBUILD=1
os: linux
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,37 @@ See examples the [`examples`](examples) directory.
* ComboProvider: the TPDTC and TPRTC are combined together in one assembly which is a single `netstandard2.0` component
* BasicProvider: the TPDTC and TPRTC are each available as both `netstandard2.0` and `.NET 4.x` components


## Type Provider Naming Conventions

A type provider is simultaneously a tool and a library. The existing guidance is as follows, from https://fsharp.github.io/2014/09/19/fsharp-libraries.html.

> Likewise, a type provider for a data source or schema format XYZ should normally be placed in “FSharp.Data”, e.g. “FSharp.Data.XYZ”.
Good type provider naming examples:

* `FSharp.Text.RegexProvider`

* `FSharp.Azure.StorageTypeProvider`

Existing type providers that don't quite follow the guidelines but which are ok:

* `FSharp.Data`

Here are some examples of existing type providers that aren't too bad (they are clear) but could be renamed to follow the guidelines:

* `ExcelProvider` (better would be `FSharp.Interop.ExcelProvider`)

* `RProvider` (better would be `FSharp.Interop.RProvider`)

* `ApiaryProvider` (better would be `FSharp.Data.ApiaryProvider`)

* `SQLProvider` (better would be `FSharp.Data.SQLProvider`)

* `DynamicsNAVProvider` (better would be `FSharp.Interop.DynamicsNAVProvider`)

* `DynamicsCRMProvider` (better would be `FSharp.Interop.DynamicsCRMProvider`)

## Technical Notes

### Using Type Providers with ``dotnet build``
Expand Down
2 changes: 1 addition & 1 deletion build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ let release =
|> ReleaseNotesHelper.parseReleaseNotes

let useMsBuildToolchain = environVar "USE_MSBUILD" <> null
let dotnetSdkVersion = "2.1.201"
let dotnetSdkVersion = "2.1.401"
let sdkPath = lazy DotNetCli.InstallDotNetSDK dotnetSdkVersion
let getSdkPath() = sdkPath.Value

Expand Down
12 changes: 12 additions & 0 deletions fsc.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@
<FscToolPath>C:\Program Files (x86)\Microsoft SDKs\F#\4.1\Framework\v4.0</FscToolPath>
<FscToolExe>fsc.exe</FscToolExe>
</PropertyGroup>
<PropertyGroup Condition="'$(IsWindows)' == 'true' AND Exists('C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\FSharp\fsc.exe')">
<FscToolPath>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\FSharp</FscToolPath>
<FscToolExe>fsc.exe</FscToolExe>
</PropertyGroup>
<PropertyGroup Condition="'$(IsWindows)' == 'true' AND Exists('C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\FSharp\fsc.exe')">
<FscToolPath>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\FSharp</FscToolPath>
<FscToolExe>fsc.exe</FscToolExe>
</PropertyGroup>
<PropertyGroup Condition="'$(IsWindows)' == 'true' AND Exists('C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\FSharp\fsc.exe')">
<FscToolPath>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\FSharp</FscToolPath>
<FscToolExe>fsc.exe</FscToolExe>
</PropertyGroup>
<PropertyGroup Condition="'$(IsWindows)' == 'true' AND Exists('C:\Program Files (x86)\Microsoft SDKs\F#\10.1\Framework\v4.0\fsc.exe')">
<FscToolPath>C:\Program Files (x86)\Microsoft SDKs\F#\10.1\Framework\v4.0</FscToolPath>
<FscToolExe>fsc.exe</FscToolExe>
Expand Down
7 changes: 7 additions & 0 deletions paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,10 @@ group fs40
source https://api.nuget.org/v3/index.json
nuget FSharp.Core ~> 4.0.0

group fs41
source https://api.nuget.org/v3/index.json
nuget FSharp.Core ~> 4.1.18

group fs45
source https://api.nuget.org/v3/index.json
nuget FSharp.Core ~> 4.5.2
1 change: 1 addition & 0 deletions src/FSharp.TypeProviders.SDK.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<OutputType>Library</OutputType>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Compile Include="ProvidedTypes.fsi" />
Expand Down
2 changes: 2 additions & 0 deletions src/ProvidedTypes.fs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ namespace ProviderImplementation.ProvidedTypes
type Attributes<'T when 'T :> Attribute>() =
static let empty = ([| |] : 'T []) |> box |> unbox<obj[]>
static member Empty() = empty

type Attributes =
static member CreateEmpty (typ : Type) =
let gtype = typedefof<Attributes<_>>.MakeGenericType([| typ |])
let gmethod = gtype.GetMethod("Empty", BindingFlags.Static ||| BindingFlags.NonPublic )
Expand Down
1 change: 1 addition & 0 deletions src/ProvidedTypesTesting.fs
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,7 @@ module internal Targets =
| "3.1" -> "fs31"
| "4.0" -> "fs40"
| "4.1" -> "fs41"
| "4.5" -> "fs45"
| _ -> failwith ("unimplemented F# version" + fsharp)
let compatProfiles =
match profile with
Expand Down

0 comments on commit 3921636

Please sign in to comment.