@@ -15,7 +15,7 @@ open Fake
15
15
// --------------------------------------------------------------------------------------
16
16
17
17
let project = " FSharp.TypeProviders.SDK"
18
- let authors = [ " Tomas Petricek " ; " Gustavo Guerra " ; " Michael Newton " ; " Don Syme " ]
18
+ let authors = [ " FSharp.TypeProviders.SDK contributors " ]
19
19
let summary = " Helper code and examples for getting started with Type Providers"
20
20
let description = """
21
21
The F# Type Provider SDK provides utilities for authoring type providers."""
@@ -25,6 +25,7 @@ let gitHome = "https://github.com/fsprojects"
25
25
let gitName = " FSharp.TypeProviders.SDK"
26
26
27
27
let config = " Release"
28
+ let outputPath = __ SOURCE_ DIRECTORY__ + " /bin"
28
29
29
30
// Read release notes & version info from RELEASE_NOTES.md
30
31
Environment.CurrentDirectory <- __ SOURCE_ DIRECTORY__
@@ -45,6 +46,10 @@ let exec p args =
45
46
printfn " Executing %s %s " p args
46
47
Shell.Exec( p, args) |> function 0 -> () | d -> failwithf " %s %s exited with error %d " p args d
47
48
49
+ let execIn dir p args =
50
+ printfn " Executing %s %s in %s " p args dir
51
+ Shell.Exec( p, args, dir= dir) |> function 0 -> () | d -> failwithf " %s %s exited with error %d " p args d
52
+
48
53
let pullRequest =
49
54
match getBuildParamOrDefault " APPVEYOR_PULL_REQUEST_NUMBER" " " with
50
55
| " " ->
@@ -142,12 +147,57 @@ Target "RunTests" (fun _ ->
142
147
)
143
148
144
149
Target " Pack" ( fun _ ->
145
- DotNetCli.Pack ( fun p -> { p with Configuration = config; Project = " src/FSharp.TypeProviders.SDK.fsproj" ; ToolPath = getSdkPath() })
146
- DotNetCli.Pack ( fun p -> { p with Configuration = config; Project = " examples/BasicProvider/BasicProvider.fsproj" ; ToolPath = getSdkPath() })
147
- DotNetCli.Pack ( fun p -> { p with Configuration = config; Project = " examples/ComboProvider/ComboProvider.fsproj" ; ToolPath = getSdkPath() })
148
- DotNetCli.Pack ( fun p -> { p with Configuration = config; Project = " examples/StressProvider/StressProvider.fsproj" ; ToolPath = getSdkPath() })
150
+ DotNetCli.Pack ( fun p -> { p with Configuration = config;
151
+ Project = " src/FSharp.TypeProviders.SDK.fsproj" ;
152
+ ToolPath = getSdkPath(); OutputPath = outputPath;
153
+ AdditionalArgs= [ sprintf " /p:PackageVersion=%s " release.NugetVersion;
154
+ sprintf " /p:ReleaseNotes=\" %s \" " ( String.concat " " release.Notes) ] })
155
+ DotNetCli.Pack ( fun p -> { p with Configuration = config; Project = " examples/BasicProvider/BasicProvider.fsproj" ; ToolPath = getSdkPath(); OutputPath = outputPath })
156
+ DotNetCli.Pack ( fun p -> { p with Configuration = config; Project = " examples/ComboProvider/ComboProvider.fsproj" ; ToolPath = getSdkPath(); OutputPath = outputPath })
157
+ DotNetCli.Pack ( fun p -> { p with Configuration = config; Project = " examples/StressProvider/StressProvider.fsproj" ; ToolPath = getSdkPath(); OutputPath = outputPath })
158
+ NuGetHelper.NuGetPack ( fun p -> { p with WorkingDir = " templates" ; OutputPath = outputPath; Version = release.NugetVersion; ReleaseNotes = toLines release.Notes}) @" templates/FSharp.TypeProviders.Templates.nuspec"
159
+ )
160
+
161
+ Target " TestTemplatesNuGet" ( fun _ ->
162
+
163
+ // Globally install the templates from the template nuget package we just built
164
+ DotNetCli.RunCommand id ( " new -i " + outputPath + " /FSharp.TypeProviders.Templates." + release.NugetVersion + " .nupkg" )
165
+
166
+ let testAppName = " tp2" + string ( abs ( hash System.DateTime.Now.Ticks) % 100 )
167
+ CleanDir testAppName
168
+ DotNetCli.RunCommand id ( sprintf " new typeprovider -n %s -lang F#" testAppName)
169
+
170
+ let pkgs = Path.GetFullPath( outputPath)
171
+ // When restoring, using the build_output as a package source to pick up the package we just compiled
172
+ execIn testAppName " .paket/paket.exe" " update"
173
+ //DotNetCli.RunCommand id (sprintf "restore %s/%s/%s.fsproj --source https://api.nuget.org/v3/index.json --source %s" testAppName testAppName testAppName pkgs)
174
+
175
+ // let slash = if isUnix then "\\" else ""
176
+ // for c in ["Debug"; "Release"] do
177
+ // for p in ["Any CPU"; "iPhoneSimulator"] do
178
+ // exec "msbuild" (sprintf "%s/%s.sln /p:Platform=\"%s\" /p:Configuration=%s /p:PackageSources=%s\"https://api.nuget.org/v3/index.json%s;%s%s\"" testAppName testAppName p c slash slash pkgs slash)
179
+ DotNetCli.RunCommand ( fun p -> { p with WorkingDir= testAppName }) ( sprintf " build -c debug" )
180
+ DotNetCli.RunCommand ( fun p -> { p with WorkingDir= testAppName }) ( sprintf " test -c debug" )
181
+
182
+ (* Manual steps without building nupkg
183
+ dotnet pack src\FSharp.TypeProviders.SDK.fsproj /p:PackageVersion=0.0.0.99 --output bin -c release
184
+ .nuget\nuget.exe pack -OutputDirectory bin -Version 0.0.0.99 templates/FSharp.TypeProviders.Templates.nuspec
185
+ dotnet new -i bin/FSharp.TypeProviders.Templates.0.0.0.99.nupkg
186
+ dotnet new typeprovider -n tp3 -lang:F#
187
+
188
+ .\build LibraryNuGet
189
+ dotnet new -i templates
190
+ rmdir /s /q testapp2
191
+ dotnet new fabulous-app -n testapp2 -lang F#
192
+ dotnet restore testapp2/testapp2/testapp2.fsproj -s build_output/
193
+ dotnet new -i templates && rmdir /s /q testapp2 && dotnet new fabulous-app -n testapp2 -lang F# && dotnet restore testapp2/testapp2/testapp2.fsproj && msbuild testapp2/testapp2.Android/testapp2.Android.fsproj /t:RestorePackages && msbuild testapp2/testapp2.Android/testapp2.Android.fsproj
194
+ dotnet new -i templates && rmdir /s /q testapp2 && dotnet new fabulous-app -n testapp2 -lang F# && dotnet restore testapp2/testapp2/testapp2.fsproj && msbuild testapp2/testapp2.iOS/testapp2.iOS.fsproj /t:RestorePackages && msbuild testapp2/testapp2.iOS/testapp2.iOS.fsproj
195
+ dotnet new -i templates && rmdir /s /q testapp2 && dotnet new fabulous-app -n testapp2 -lang F# --CreateMacProject && dotnet restore testapp2/testapp2/testapp2.fsproj && msbuild testapp2/testapp2.macOS/testapp2.macOS.fsproj /t:RestorePackages && msbuild testapp2/testapp2.macOS/testapp2.macOS.fsproj
196
+ *)
197
+
149
198
)
150
199
200
+
151
201
" Clean" ==> " Pack"
152
202
" Build" ==> " Examples" ==> " Pack"
153
203
" Build" ==> " Examples" ==> " RunTests" ==> " Pack"
0 commit comments