-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Feature/5.x build output #2806
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
Feature/5.x build output #2806
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ | |
| #load @"Versioning.fsx" | ||
|
|
||
| open System | ||
| open System.IO | ||
| open Fake | ||
| open FSharp.Data | ||
|
|
||
|
|
@@ -41,6 +42,7 @@ module Build = | |
| "CurrentAssemblyFileVersion", (Versioning.CurrentAssemblyFileVersion.ToString()); | ||
| "DoSourceLink", sourceLink; | ||
| "DotNetCoreOnly", if buildingOnTravis then "1" else ""; | ||
| "OutputPathBaseDir", Path.GetFullPath Paths.BuildOutput; | ||
| ] | ||
| |> List.map (fun (p,v) -> sprintf "%s=%s" p v) | ||
| |> String.concat ";" | ||
|
|
@@ -77,4 +79,4 @@ module Build = | |
| DotNetCli.RunCommand (fun p -> { p with TimeOut = TimeSpan.FromMinutes(3.) }) "clean src/Elasticsearch.sln -c Release" |> ignore | ||
| DotNetProject.All |> Seq.iter(fun p -> CleanDir(Paths.BinFolder p.Name)) | ||
| | (_, _) -> | ||
| tracefn "Skiping clean target only run when calling 'release', 'canary', 'clean' as targets directly" | ||
| tracefn "Skipping clean target only run when calling 'release', 'canary', 'clean' as targets directly" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. /me 😭 |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,11 @@ module Release = | |
|
|
||
| let year = sprintf "%i" DateTime.UtcNow.Year | ||
|
|
||
| let jsonDotNetVersion = 10 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would have given this PR ⭐️⭐️⭐️⭐️⭐️ had this been read from our csproj files. That said, submitting a PR that brings us back to |
||
|
|
||
| let jsonDotNetCurrentVersion = sprintf "%i" jsonDotNetVersion | ||
| let jsonDotNetNextVersion = sprintf "%i" (jsonDotNetVersion + 1) | ||
|
|
||
| let properties = | ||
| let addKeyValue (e:Expr<string>) (builder:StringBuilder) = | ||
| // the binding for this tuple looks like key/value should | ||
|
|
@@ -46,6 +51,8 @@ module Release = | |
| new StringBuilder() | ||
| |> addKeyValue <@nextMajorVersion@> | ||
| |> addKeyValue <@year@> | ||
| |> addKeyValue <@jsonDotNetCurrentVersion@> | ||
| |> addKeyValue <@jsonDotNetNextVersion@> | ||
| |> toText | ||
|
|
||
| Tooling.Nuget.Exec [ "pack"; nuspec; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,12 +43,13 @@ module Versioning = | |
| let bv = getBuildParam "version" | ||
| let buildVersion = if (isNullOrEmpty bv) then None else Some(parse(bv)) | ||
| match (getBuildParam "target", buildVersion) with | ||
| | ("release", None) -> failwithf "can not run release because no explicit version number was passed on the command line" | ||
| | ("release", None) -> failwithf "cannot run release because no explicit version number was passed on the command line" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. /me 😭 |
||
| | ("release", Some v) -> | ||
| if (currentVersion >= v) then failwithf "tried to create release %s but current version is already at %s" (v.ToString()) (currentVersion.ToString()) | ||
| // Warn if version is same as current version | ||
| if (currentVersion >= v) then traceImportant (sprintf "creating release %s when current version is already at %s" (v.ToString()) (currentVersion.ToString())) | ||
| writeVersionIntoGlobalJson v | ||
| v | ||
| | ("canary", Some v) -> failwithf "can not run canary release, expected no version number to specified but received %s" (v.ToString()) | ||
| | ("canary", Some v) -> failwithf "cannot run canary release, expected no version number to specified but received %s" (v.ToString()) | ||
| | ("canary", None) -> | ||
| let timestampedVersion = (sprintf "ci%s" (DateTime.UtcNow.ToString("MMddHHmmss"))) | ||
| tracefn "Canary suffix %s " timestampedVersion | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <PropertyGroup> | ||
| <OutputPath Condition="'$(OutputPathBaseDir)' != ''">$(OutputPathBaseDir)\$(TargetFrameworkVersion)\$(MSBuildProjectName)\</OutputPath> | ||
| <OutputPath Condition="'$(OutputPathBaseDir)' != ''">$(OutputPathBaseDir)\$(MSBuildProjectName)\</OutputPath> | ||
| </PropertyGroup> | ||
| </Project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️ 💯