Created
January 12, 2017 00:39
-
-
Save denmerc/61c883ac8f1061659f99671e62d94719 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// include Fake lib | |
#r "packages/FAKE/tools/FakeLib.dll" | |
#r "System.Xml.Linq" | |
open Fake | |
open System.Xml.Linq | |
RestorePackages() | |
// Properties | |
let artifactsNuGetDir = @"./artifacts/nuget/" | |
let artifactsBuildDir = "./artifacts/build/" | |
// Targets | |
Target "Clean" (fun _ -> | |
trace "Cleanup..." | |
CleanDir artifactsNuGetDir | |
CleanDir artifactsBuildDir | |
) | |
Target "BuildApp" (fun _ -> | |
trace "Building App..." | |
!! "**/*.csproj" | |
|> MSBuildRelease artifactsBuildDir "Build" | |
|> Log "AppBuild-Output: " | |
) | |
Target "BuildNuGet" (fun _ -> | |
let doc = System.Xml.Linq.XDocument.Load("./CreateNuGetViaFake/Test.nuspec") | |
let vers = doc.Descendants(XName.Get("version", doc.Root.Name.NamespaceName)) | |
NuGet (fun p -> | |
{p with | |
Version = (Seq.head vers).Value | |
OutputPath = artifactsNuGetDir | |
WorkingDir = artifactsBuildDir | |
}) "./CreateNuGetViaFake/Test.nuspec" | |
) | |
Target "Default" (fun _ -> | |
trace "Default Target invoked." | |
) | |
// Dependencies | |
"Clean" | |
==> "BuildApp" | |
==> "BuildNuGet" | |
==> "Default" | |
// start build | |
RunTargetOrDefault "Default" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment