Skip to content

Commit ca4dd87

Browse files
authored
Fixed empty description on Nuget package (#4)
* Updated appveyor badge * Fixed missing description on NuGet Package - Removed AssemblyInfo and use csproj instead - Use dotnet CLI to update version and file version instead of assembly info
1 parent 9630965 commit ca4dd87

File tree

4 files changed

+46
-53
lines changed

4 files changed

+46
-53
lines changed

Directory.Build.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<Project>
22
<PropertyGroup>
3-
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
43
<Authors>Kimserey Lam</Authors>
54
<RepositoryUrl>https://github.com/OrleansContrib/Orleans.Persistence.Minio</RepositoryUrl>
65
<RepositoryType>git</RepositoryType>

Orleans.Persistence.Minio/AssemblyInfo.cs

Lines changed: 0 additions & 11 deletions
This file was deleted.

Orleans.Persistence.Minio/Orleans.Persistence.Minio.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
<TargetFramework>netstandard2.0</TargetFramework>
55
</PropertyGroup>
66

7+
<PropertyGroup>
8+
<Description>Microsoft Orleans persistence provider for Minio</Description>
9+
<PackageId>Orleans.Persistence.Minio</PackageId>
10+
<PackageVersion>1.0.0</PackageVersion>
11+
<Version>1.0.0</Version>
12+
<FileVersion>1.0.0</FileVersion>
13+
</PropertyGroup>
14+
715
<ItemGroup>
816
<PackageReference Include="Microsoft.Orleans.Core.Abstractions" Version="2.0.0" />
917
<PackageReference Include="Microsoft.Orleans.Runtime.Abstractions" Version="2.0.0" />

build.fsx

Lines changed: 38 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -18,45 +18,39 @@ module Environment =
1818
let [<Literal>] REPOSITORY = "https://github.com/OrleansContrib/Orleans.Persistence.Minio.git"
1919

2020
module GitVersion =
21-
module Process =
22-
let exec f =
21+
let showVariable =
22+
let execProcess f =
2323
Process.execWithResult f (System.TimeSpan.FromMinutes 2.)
24-
25-
let private exec commit args =
26-
match Environment.environVarOrNone Environment.APPVEYOR_REPO_BRANCH, Environment.environVarOrNone Environment.APPVEYOR_PULL_REQUEST_NUMBER with
27-
| Some branch, None ->
28-
Process.exec (fun info ->
29-
{ info with
30-
FileName = "gitversion"
31-
Arguments = sprintf "/url %s /b b-%s /dynamicRepoLocation .\gitversion /c %s %s" Environment.REPOSITORY branch commit args })
32-
| _ ->
33-
Process.exec (fun info -> { info with FileName = "gitversion"; Arguments = args })
34-
35-
let private getResult (result: ProcessResult) =
36-
result.Messages |> List.head
24+
|> fun r -> r.Messages
25+
|> List.head
26+
27+
let commit =
28+
match Environment.environVarOrNone Environment.APPVEYOR_REPO_COMMIT with
29+
| Some c -> c
30+
| None -> execProcess (fun info -> { info with FileName = "git"; Arguments = "rev-parse HEAD" })
31+
32+
printfn "Executing gitversion from commit '%s'." commit
33+
34+
fun variable ->
35+
match Environment.environVarOrNone Environment.APPVEYOR_REPO_BRANCH, Environment.environVarOrNone Environment.APPVEYOR_PULL_REQUEST_NUMBER with
36+
| Some branch, None ->
37+
execProcess (fun info ->
38+
{ info with
39+
FileName = "gitversion"
40+
Arguments = sprintf "/showvariable %s /url %s /b b-%s /dynamicRepoLocation .\gitversion /c %s" variable Environment.REPOSITORY branch commit })
41+
| _ ->
42+
execProcess (fun info -> { info with FileName = "gitversion"; Arguments = sprintf "/showvariable %s" variable })
3743

3844
let get =
39-
let mutable value: Option<(unit -> ProcessResult) * string * string> = None
45+
let mutable value: Option<string * string * string> = None
4046

4147
fun () ->
4248
match value with
4349
| None ->
44-
let commit =
45-
match Environment.environVarOrNone Environment.APPVEYOR_REPO_COMMIT with
46-
| Some c -> c
47-
| None -> Process.exec (fun info -> { info with FileName = "git"; Arguments = "rev-parse HEAD" }) |> getResult
48-
49-
printfn "Executing gitversion from commit '%s'." commit
50-
51-
match Environment.environVarOrNone Environment.APPVEYOR_REPO_TAG_NAME with
52-
| Some v ->
53-
printfn "Full sementic versioning: '%s', NuGet sementic versioning: '%s'" v v
54-
value <- Some ((fun () -> exec commit "/updateassemblyinfo"), v, v)
55-
| None ->
56-
let fullSemVer = exec commit "/showvariable FullSemVer" |> getResult
57-
let nuGetVer = exec commit "/showvariable NuGetVersionV2" |> getResult
58-
printfn "Full sementic versioning: '%s', NuGet sementic versioning: '%s'" fullSemVer nuGetVer
59-
value <- Some ((fun () -> exec commit "/updateassemblyinfo"), fullSemVer, nuGetVer)
50+
value <-
51+
match Environment.environVarOrNone Environment.APPVEYOR_REPO_TAG_NAME with
52+
| Some v -> Some (v, showVariable "AssemblySemVer", v)
53+
| None -> Some (showVariable "FullSemVer", showVariable "AssemblySemVer", showVariable "NuGetVersionV2")
6054

6155
Target.activateFinal "ClearGitVersionRepositoryLocation"
6256
Option.get value
@@ -70,24 +64,27 @@ Target.create "Clean" (fun _ ->
7064
|> Shell.deleteDirs
7165
)
7266

73-
Target.create "PatchAssemblyInfo" (fun _ ->
74-
let (updateAssemblyInfo, _, _) = GitVersion.get()
75-
76-
updateAssemblyInfo()
77-
|> fun res -> res.Messages
78-
|> List.iter (printfn "%s")
67+
Target.create "PrintVersion" (fun _ ->
68+
let (fullSemVer, assemblyVer, nugetVer) = GitVersion.get()
69+
printfn "Full version: '%s'" fullSemVer
70+
printfn "Assembly version: '%s'" assemblyVer
71+
printfn "NuGet version: '%s'" nugetVer
7972
)
8073

8174
Target.create "UpdateBuildVersion" (fun _ ->
82-
let (_, fullSemVer, _) = GitVersion.get()
75+
let (fullSemVer, _, _) = GitVersion.get()
8376

8477
Shell.Exec("appveyor", sprintf "UpdateBuild -Version \"%s (%s)\"" fullSemVer (Environment.environVar Environment.APPVEYOR_BUILD_NUMBER))
8578
|> ignore
8679
)
8780

8881
Target.create "Build" (fun _ ->
82+
let (fullSemVer, assemblyVer, _) = GitVersion.get()
83+
8984
let setParams (buildOptions: DotNet.BuildOptions) =
90-
{ buildOptions with Configuration = DotNet.BuildConfiguration.fromEnvironVarOrDefault Environment.BUILD_CONFIGURATION DotNet.BuildConfiguration.Debug }
85+
{ buildOptions with
86+
Common = { buildOptions.Common with DotNet.CustomParams = Some (sprintf "/p:Version=%s /p:FileVersion=%s" fullSemVer assemblyVer) }
87+
Configuration = DotNet.BuildConfiguration.fromEnvironVarOrDefault Environment.BUILD_CONFIGURATION DotNet.BuildConfiguration.Debug }
9188

9289
!! "**/*.*proj"
9390
-- "**/Orleans.Persistence.Minio.*Test.*proj"
@@ -118,7 +115,7 @@ Target.createFinal "ClearGitVersionRepositoryLocation" (fun _ ->
118115
Target.create "All" ignore
119116

120117
"Clean"
121-
=?> ("PatchAssemblyInfo", Environment.environVarAsBool Environment.APPVEYOR)
118+
==> "PrintVersion"
122119
=?> ("UpdateBuildVersion", Environment.environVarAsBool Environment.APPVEYOR)
123120
==> "Build"
124121
==> "Pack"

0 commit comments

Comments
 (0)