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

Added testing for macOS & GTK templates #294

Merged
Merged
Changes from 1 commit
Commits
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
Next Next commit
Gtk/macOS Templates testing
TimLariviere committed Jan 23, 2019
commit d01a6f9901ae8572589dea0b5fb49272b6be4748
3 changes: 3 additions & 0 deletions .paket/Paket.Restore.targets
Original file line number Diff line number Diff line change
@@ -62,6 +62,9 @@
<!-- see https://github.com/fsharp/fslang-design/blob/master/RFCs/FS-1032-fsharp-in-dotnet-sdk.md -->
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference>

<!-- Disable Paket restore under NCrunch build -->
<PaketRestoreDisabled Condition="'$(NCrunch)' == '1'">True</PaketRestoreDisabled>
</PropertyGroup>

<Target Name="PaketBootstrapping" Condition="Exists('$(PaketToolsPath)paket.bootstrapper.proj')">
43 changes: 20 additions & 23 deletions build.fsx
Original file line number Diff line number Diff line change
@@ -169,40 +169,37 @@ Target.create "RunTests" (fun _ ->
)

Target.create "TestTemplatesNuGet" (fun _ ->
// Globally install the templates from the template nuget package we just built
DotNet.exec id "new" ("-i " + buildDir + "/Fabulous.Templates." + release.NugetVersion + ".nupkg") |> ignore
let restorePackageDotnetCli appName projectName pkgs =
DotNet.exec id "restore" (sprintf "%s/%s/%s.fsproj --source https://api.nuget.org/v3/index.json --source %s" appName projectName projectName pkgs) |> ignore

let testAppName = "testapp2" + string (abs (hash System.DateTime.Now.Ticks) % 100)
// Instantiate the template. TODO: additional parameters and variations

// Globally install the templates from the template nuget package we just built
DotNet.exec id "new" (sprintf "-i %s/Fabulous.Templates.%s.nupkg" buildDir release.NugetVersion) |> ignore

// Instantiate the template.
Shell.cleanDir testAppName
let extraArgs = if Environment.isUnix then "" else " --WPF"
DotNet.exec id "new fabulous-app" (sprintf "-n %s -lang F#%s" testAppName extraArgs) |> ignore

let pkgs = Path.GetFullPath(buildDir)
let extraArgs =
if Environment.isWindows then " --WPF"
elif Environment.isMacOS then " --macOS"
else ""

DotNet.exec id "new fabulous-app" (sprintf "-n %s -lang F# --GTK%s" testAppName extraArgs) |> ignore

// The shared project and WPF need to be restored manually as they're using the new SDK-style format
// When restoring, using the build_output as a package source to pick up the package we just compiled
DotNet.exec id "restore" (sprintf "%s/%s/%s.fsproj --source https://api.nuget.org/v3/index.json --source %s" testAppName testAppName testAppName pkgs) |> ignore
if not Environment.isUnix then
DotNet.exec id "restore" (sprintf "%s/%s.WPF/%s.WPF.fsproj --source https://api.nuget.org/v3/index.json --source %s" testAppName testAppName testAppName pkgs) |> ignore

let pkgs = Path.GetFullPath(buildDir)
restorePackageDotnetCli testAppName testAppName pkgs
if Environment.isWindows then restorePackageDotnetCli testAppName (testAppName + ".WPF") pkgs

// Build for all combinations
let slash = if Environment.isUnix then "\\" else ""
for c in ["Debug"; "Release"] do
for p in ["Any CPU"; "iPhoneSimulator"] do
let args = (sprintf "%s/%s.sln /p:Platform=\"%s\" /p:Configuration=%s /p:PackageSources=%s\"https://api.nuget.org/v3/index.json;%s%s\"" testAppName testAppName p c slash pkgs slash)
let code = Shell.Exec("msbuild", args)
if code <> 0 then failwithf "%s %s failed, error code %d" "msbuild" args code

(* Manual steps without building nupkg
.\build LibraryNuGet
dotnet new -i templates
rmdir /s /q testapp2
dotnet new fabulous-app -n testapp2 -lang F#
dotnet restore testapp2/testapp2/testapp2.fsproj -s build_output/
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
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
dotnet new -i templates && rmdir /s /q testapp2 && dotnet new fabulous-app -n testapp2 -lang F# --macOS && dotnet restore testapp2/testapp2/testapp2.fsproj && msbuild testapp2/testapp2.macOS/testapp2.macOS.fsproj /t:RestorePackages && msbuild testapp2/testapp2.macOS/testapp2.macOS.fsproj
dotnet restore testapp265/testapp265.WPF/testapp265.WPF.fsproj --source https://api.nuget.org/v3/index.json -s build_output
*)
)

Target.create "Test" ignore
138 changes: 69 additions & 69 deletions build.fsx.lock
Original file line number Diff line number Diff line change
@@ -4,103 +4,103 @@ NUGET
remote: https://api.nuget.org/v3/index.json
BlackFox.VsWhere (1.0)
FSharp.Core (>= 4.2.3)
Fake.Core.CommandLineParsing (5.11.1)
Fake.Core.CommandLineParsing (5.12)
FParsec (>= 1.0.3)
FSharp.Core (>= 4.3.4)
Fake.Core.Context (5.11.1)
Fake.Core.Context (5.12)
FSharp.Core (>= 4.3.4)
Fake.Core.Environment (5.11.1)
Fake.Core.Environment (5.12)
FSharp.Core (>= 4.3.4)
Fake.Core.FakeVar (5.11.1)
Fake.Core.Context (>= 5.11.1)
Fake.Core.FakeVar (5.12)
Fake.Core.Context (>= 5.12)
FSharp.Core (>= 4.3.4)
Fake.Core.Process (5.11.1)
Fake.Core.Environment (>= 5.11.1)
Fake.Core.FakeVar (>= 5.11.1)
Fake.Core.String (>= 5.11.1)
Fake.Core.Trace (>= 5.11.1)
Fake.IO.FileSystem (>= 5.11.1)
Fake.Core.Process (5.12)
Fake.Core.Environment (>= 5.12)
Fake.Core.FakeVar (>= 5.12)
Fake.Core.String (>= 5.12)
Fake.Core.Trace (>= 5.12)
Fake.IO.FileSystem (>= 5.12)
FSharp.Core (>= 4.3.4)
System.Diagnostics.Process (>= 4.3)
Fake.Core.ReleaseNotes (5.11.1)
Fake.Core.SemVer (>= 5.11.1)
Fake.Core.String (>= 5.11.1)
Fake.Core.ReleaseNotes (5.12)
Fake.Core.SemVer (>= 5.12)
Fake.Core.String (>= 5.12)
FSharp.Core (>= 4.3.4)
Fake.Core.SemVer (5.11.1)
Fake.Core.SemVer (5.12)
FSharp.Core (>= 4.3.4)
System.Runtime.Numerics (>= 4.3)
Fake.Core.String (5.11.1)
Fake.Core.String (5.12)
FSharp.Core (>= 4.3.4)
Fake.Core.Target (5.11.1)
Fake.Core.CommandLineParsing (>= 5.11.1)
Fake.Core.Context (>= 5.11.1)
Fake.Core.Environment (>= 5.11.1)
Fake.Core.FakeVar (>= 5.11.1)
Fake.Core.Process (>= 5.11.1)
Fake.Core.String (>= 5.11.1)
Fake.Core.Trace (>= 5.11.1)
Fake.Core.Target (5.12)
Fake.Core.CommandLineParsing (>= 5.12)
Fake.Core.Context (>= 5.12)
Fake.Core.Environment (>= 5.12)
Fake.Core.FakeVar (>= 5.12)
Fake.Core.Process (>= 5.12)
Fake.Core.String (>= 5.12)
Fake.Core.Trace (>= 5.12)
FSharp.Control.Reactive (>= 4.1)
FSharp.Core (>= 4.3.4)
System.Reactive.Compatibility (>= 4.1.2)
Fake.Core.Tasks (5.11.1)
Fake.Core.Trace (>= 5.11.1)
Fake.Core.Tasks (5.12)
Fake.Core.Trace (>= 5.12)
FSharp.Core (>= 4.3.4)
Fake.Core.Trace (5.11.1)
Fake.Core.Environment (>= 5.11.1)
Fake.Core.FakeVar (>= 5.11.1)
Fake.Core.Trace (5.12)
Fake.Core.Environment (>= 5.12)
Fake.Core.FakeVar (>= 5.12)
FSharp.Core (>= 4.3.4)
Fake.Core.Xml (5.11.1)
Fake.Core.String (>= 5.11.1)
Fake.Core.Xml (5.12)
Fake.Core.String (>= 5.12)
FSharp.Core (>= 4.3.4)
System.Xml.ReaderWriter (>= 4.3.1)
System.Xml.XDocument (>= 4.3)
System.Xml.XPath (>= 4.3)
System.Xml.XPath.XDocument (>= 4.3)
System.Xml.XPath.XmlDocument (>= 4.3)
Fake.DotNet.Cli (5.11.1)
Fake.Core.Environment (>= 5.11.1)
Fake.Core.Process (>= 5.11.1)
Fake.Core.String (>= 5.11.1)
Fake.Core.Trace (>= 5.11.1)
Fake.DotNet.MSBuild (>= 5.11.1)
Fake.IO.FileSystem (>= 5.11.1)
Fake.DotNet.Cli (5.12)
Fake.Core.Environment (>= 5.12)
Fake.Core.Process (>= 5.12)
Fake.Core.String (>= 5.12)
Fake.Core.Trace (>= 5.12)
Fake.DotNet.MSBuild (>= 5.12)
Fake.IO.FileSystem (>= 5.12)
FSharp.Core (>= 4.3.4)
Newtonsoft.Json (>= 12.0.1)
Fake.DotNet.MSBuild (5.11.1)
Fake.DotNet.MSBuild (5.12)
BlackFox.VsWhere (>= 1.0)
Fake.Core.Environment (>= 5.11.1)
Fake.Core.Process (>= 5.11.1)
Fake.Core.String (>= 5.11.1)
Fake.Core.Trace (>= 5.11.1)
Fake.IO.FileSystem (>= 5.11.1)
Fake.Core.Environment (>= 5.12)
Fake.Core.Process (>= 5.12)
Fake.Core.String (>= 5.12)
Fake.Core.Trace (>= 5.12)
Fake.IO.FileSystem (>= 5.12)
FSharp.Core (>= 4.3.4)
MSBuild.StructuredLogger (>= 2.0.61)
Fake.Dotnet.NuGet (5.11.1)
Fake.Core.Environment (>= 5.11.1)
Fake.Core.Process (>= 5.11.1)
Fake.Core.SemVer (>= 5.11.1)
Fake.Core.String (>= 5.11.1)
Fake.Core.Tasks (>= 5.11.1)
Fake.Core.Trace (>= 5.11.1)
Fake.Core.Xml (>= 5.11.1)
Fake.IO.FileSystem (>= 5.11.1)
Fake.Net.Http (>= 5.11.1)
Fake.Dotnet.NuGet (5.12)
Fake.Core.Environment (>= 5.12)
Fake.Core.Process (>= 5.12)
Fake.Core.SemVer (>= 5.12)
Fake.Core.String (>= 5.12)
Fake.Core.Tasks (>= 5.12)
Fake.Core.Trace (>= 5.12)
Fake.Core.Xml (>= 5.12)
Fake.IO.FileSystem (>= 5.12)
Fake.Net.Http (>= 5.12)
FSharp.Core (>= 4.3.4)
Newtonsoft.Json (>= 12.0.1)
System.Net.Http (>= 4.3.4)
Fake.DotNet.Paket (5.11.1)
Fake.Core.Process (>= 5.11.1)
Fake.Core.String (>= 5.11.1)
Fake.Core.Trace (>= 5.11.1)
Fake.IO.FileSystem (>= 5.11.1)
Fake.DotNet.Paket (5.12)
Fake.Core.Process (>= 5.12)
Fake.Core.String (>= 5.12)
Fake.Core.Trace (>= 5.12)
Fake.IO.FileSystem (>= 5.12)
FSharp.Core (>= 4.3.4)
Fake.IO.FileSystem (5.11.1)
Fake.Core.String (>= 5.11.1)
Fake.IO.FileSystem (5.12)
Fake.Core.String (>= 5.12)
FSharp.Core (>= 4.3.4)
System.Diagnostics.FileVersionInfo (>= 4.3)
System.IO.FileSystem.Watcher (>= 4.3)
Fake.Net.Http (5.11.1)
Fake.Core.Trace (>= 5.11.1)
Fake.Net.Http (5.12)
Fake.Core.Trace (>= 5.12)
FSharp.Core (>= 4.3.4)
System.Net.Http (>= 4.3.4)
FParsec (1.0.3)
@@ -361,10 +361,10 @@ NUGET
System.Runtime.Extensions (>= 4.3)
System.Threading (>= 4.3)
System.Threading.Tasks (>= 4.3)
System.Memory (4.5.1)
System.Memory (4.5.2)
System.Buffers (>= 4.4)
System.Numerics.Vectors (>= 4.4)
System.Runtime.CompilerServices.Unsafe (>= 4.5)
System.Runtime.CompilerServices.Unsafe (>= 4.5.2)
System.Net.Http (4.3.4)
Microsoft.NETCore.Platforms (>= 1.1.1)
runtime.native.System (>= 4.3)
@@ -579,8 +579,8 @@ NUGET
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime (>= 4.3)
System.Text.Encoding.CodePages (4.5)
System.Runtime.CompilerServices.Unsafe (>= 4.5)
System.Text.Encoding.CodePages (4.5.1)
System.Runtime.CompilerServices.Unsafe (>= 4.5.2)
System.Text.Encoding.Extensions (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
@@ -606,8 +606,8 @@ NUGET
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime (>= 4.3)
System.Threading.Tasks.Dataflow (4.9)
System.Threading.Tasks.Extensions (4.5.1)
System.Runtime.CompilerServices.Unsafe (>= 4.5)
System.Threading.Tasks.Extensions (4.5.2)
System.Runtime.CompilerServices.Unsafe (>= 4.5.2)
System.Threading.Thread (4.3)
System.Runtime (>= 4.3)
System.Threading.ThreadPool (4.3)