Skip to content

Commit

Permalink
Fix #487: split off WebSharper.Testing into a separate NuGet package
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarmil committed Nov 10, 2015
1 parent 342187e commit 774e72d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/build/WebSharper.Build/Config.fs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ open System
module Config =
let PackageId = "WebSharper"
let CompilerPackageId = "WebSharper.Compiler"
let TestingPackageId = "WebSharper.Testing"
let PlainVersion = "3.5"
let VersionSuffix = None
let PackageVersion = PlainVersion + defaultArg VersionSuffix ""
let NumericVersion = Version(PlainVersion + ".0.0")
let Company = "IntelliFactory"
let Description = "F#-to-JavaScript compiler and web application framework"
let CompilerDescription = "F#-to-JavaScript compiler"
let TestingDescription = "Testing framework for F#-to-JavaScript compiled libraries"
let LicenseUrl = "http://websharper.com/licensing"
let Tags = ["Web"; "JavaScript"; "F#"]
let Website = "http://bitbucket.org/IntelliFactory/websharper"
Expand Down
33 changes: 29 additions & 4 deletions src/build/WebSharper.Build/Main.fs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module Main =
Directory.EnumerateFiles(dir, "*.*", SearchOption.AllDirectories)
|> Seq.map (fun p -> (p, p.Substring(dir.Length).Replace("\\", "/")))

let private exports, compilerExports =
let private exports, compilerExports, testingExports =
let lib kind name =
Seq.concat [
Directory.EnumerateFiles(buildDir, name + ".dll")
Expand All @@ -80,7 +80,6 @@ module Main =
lib "lib" "WebSharper.Control"
lib "lib" "WebSharper.JavaScript"
lib "lib" "WebSharper.JQuery"
lib "lib" "WebSharper.Testing"
// foreign:
lib "tools" "FsNuGet"
lib "tools" "NuGet.Core"
Expand All @@ -101,6 +100,9 @@ module Main =
lib "lib" "Mono.Cecil.Pdb"
]
|> Seq.toList
,
// testingExports:
lib "lib" "WebSharper.Testing"

let private nuPkgs () =
let nuPkg =
Expand Down Expand Up @@ -146,10 +148,11 @@ module Main =
yield fileAt (Path.Combine(root, "src", "htmllib", "tags.csv")) ("/tools/net40/tags.csv")
}
}
let v = Version(nuPkg.GetComputedVersion().Split('-').[0])
let compilerNuPkg =
let bt =
bt.PackageId(Config.CompilerPackageId, Config.PackageVersion)
|> PackageVersion.Full.Custom (Version(nuPkg.GetComputedVersion().Split('-').[0]))
|> PackageVersion.Full.Custom v
bt.NuGet.CreatePackage()
.Configure(fun x ->
{
Expand All @@ -168,7 +171,29 @@ module Main =
yield file kind src None
}
}
[ nuPkg; compilerNuPkg ]
let testingNuPkg =
let bt =
bt.PackageId(Config.TestingPackageId, Config.PackageVersion)
|> PackageVersion.Full.Custom v
bt.NuGet.CreatePackage()
.Configure(fun x ->
{
x with
Description = Config.TestingDescription
ProjectUrl = Some Config.Website
LicenseUrl = Some Config.LicenseUrl
Authors = [ Config.Company ]
})
.AddDependency(Config.PackageId, nuPkg.GetComputedVersion())
.AddNuGetExportingProject {
new INuGetExportingProject with
member p.NuGetFiles =
seq {
for kind, src in testingExports do
yield file kind src None
}
}
[ nuPkg; compilerNuPkg; testingNuPkg ]

let Package () =
let nuPkgs = nuPkgs ()
Expand Down

0 comments on commit 774e72d

Please sign in to comment.