Skip to content

Commit 9577f46

Browse files
authored
Updated readme (#15)
Co-authored-by: smaillet <[email protected]>
1 parent e4ca595 commit 9577f46

File tree

1 file changed

+43
-22
lines changed

1 file changed

+43
-22
lines changed

README.md

Lines changed: 43 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
# CSemVer.Build.Tasks
22
Automated Constrained Semantic Versioning for MSBuild projects
33

4-
### Nuget
54
![Nuget](https://img.shields.io/nuget/dt/CSemVer.Build.Tasks.svg)
5+
![PR/CI Workflow Status](https://img.shields.io/github/actions/workflow/status/UbiquityDotNET/CSemVer.GitBuild/pr-build.yml?label=PR%2FCI%20Build%20Status)
6+
![Release Workflow Status](https://img.shields.io/github/actions/workflow/status/UbiquityDotNET/CSemVer.GitBuild/release-build.yml?label=Release%20Build%20Status)
67

7-
## Build Status
8-
[![Build status](https://ci.appveyor.com/api/projects/status/nfixkakus282t06u?svg=true)](https://ci.appveyor.com/project/UbiquityDotNet/csemver-gitbuild)
9-
8+
>[!NOTE]
9+
> This repository is historically named for only the build tasks but that name is not very
10+
> very representative of reality anymore. The repo does contain actual build tasks, but also
11+
> a library for working with CSemVer that includes a number of unit tests to ensure it is
12+
> operating correctly. Previous releases of only the tasks had some errors on edge cases where
13+
> it wasn't reporting the correct version for a build. This warranted an update and re-work to
14+
> support actual testing of the task itself.
1015
1116
## Overview
1217
Officially, NUGET Packages use a SemVer 2.0 (see http://semver.org).
@@ -89,27 +94,29 @@ the build definition or determined on the fly based on values set by the build.
8994
for a repository will specify these. The following is an example for setting them based on an AppVeyor build in
9095
the `Directory.Build.props` file:
9196

92-
```xml
93-
<PropertyGroup>
94-
<!-- If running in APPVEYOR it is an automated build -->
95-
<IsAutomatedBuild Condition="'$(IsAutomatedBuild)'=='' AND '$(APPVEYOR)'!=''">true</IsAutomatedBuild>
96-
<IsAutomatedBuild Condition="'$(IsAutomatedBuild)'==''">false</IsAutomatedBuild>
97+
``` xml
98+
<PropertyGroup>
99+
<!-- If running in APPVEYOR it is an automated build -->
100+
<IsAutomatedBuild Condition="'$(IsAutomatedBuild)'=='' AND '$(APPVEYOR)'!=''">true</IsAutomatedBuild>
101+
<IsAutomatedBuild Condition="'$(IsAutomatedBuild)'==''">false</IsAutomatedBuild>
97102

98-
<!-- If it has a PR number associated it is a PR build -->
99-
<IsPullRequestBuild Condition="'$(IsPullRequestBuild)'=='' AND '$(APPVEYOR_PULL_REQUEST_NUMBER)'!=''">true</IsPullRequestBuild>
100-
<IsPullRequestBuild Condition="'$(IsPullRequestBuild)'==''">false</IsPullRequestBuild>
103+
<!-- If it has a PR number associated it is a PR build -->
104+
<IsPullRequestBuild Condition="'$(IsPullRequestBuild)'=='' AND '$(APPVEYOR_PULL_REQUEST_NUMBER)'!=''">true</IsPullRequestBuild>
105+
<IsPullRequestBuild Condition="'$(IsPullRequestBuild)'==''">false</IsPullRequestBuild>
101106

102-
<!-- Tags applied without a PR are release builds -->
103-
<IsReleaseBuild Condition="'$(IsReleaseBuild)'=='' AND '$(APPVEYOR_REPO_TAG)'=='true' AND '$(APPVEYOR_PULL_REQUEST_NUMBER)'==''">true</IsReleaseBuild>
104-
<IsReleaseBuild Condition="'$(IsReleaseBuild)'==''">false</IsReleaseBuild>
105-
</PropertyGroup>
107+
<!-- Tags applied without a PR are release builds -->
108+
<IsReleaseBuild Condition="'$(IsReleaseBuild)'=='' AND '$(APPVEYOR_REPO_TAG)'=='true' AND '$(APPVEYOR_PULL_REQUEST_NUMBER)'==''">true</IsReleaseBuild>
109+
<IsReleaseBuild Condition="'$(IsReleaseBuild)'==''">false</IsReleaseBuild>
110+
</PropertyGroup>
106111
```
107112

108113
## BuildVersion.xml
109-
If the MSBuild property `BuildMajor` is not set, then the base build version is read from the repository file specified in the BuildVersion.xml, typically this is located
110-
at the root of a repository so that any child projects share the same versioning information. The location of the file
111-
is specified by an MSBuild property `BuildVersionXml`. The contents of the file are fairly simple and only requires
112-
a single `BuildVersionData` element with a set of attributes. The available attributes are:
114+
If the MSBuild property `BuildMajor` is not set, then the base build version is read from the
115+
repository file specified in the BuildVersion.xml, typically this is located at the root of a
116+
repository so that any child projects share the same versioning information. The location of the
117+
file is specified by an MSBuild property `BuildVersionXml`. The contents of the file are fairly
118+
simple and only requires a single `BuildVersionData` element with a set of attributes. The
119+
available attributes are:
113120

114121
|Name |Description|
115122
|-------------------|-----------|
@@ -122,6 +129,20 @@ a single `BuildVersionData` element with a set of attributes. The available attr
122129

123130
Only the Major, minor and Patch numbers are required.
124131

132+
### Example BuildVersion.XML
133+
``` xml
134+
<BuildVersionData
135+
BuildMajor = "5"
136+
BuildMinor = "0"
137+
BuildPatch = "0"
138+
PreReleaseName = "alpha"
139+
/>
140+
```
141+
This will set the build version to `5.0.0-alpha` for all projects in the repository
142+
125143
## Building the tasks
126-
The tasks are pure C# so building the package simply involves building the
127-
src\CSemVer.Build.Tasks.sln
144+
The build uses a common PowerShell module pattern for Ubiquity.NET projects. To build the sources
145+
use the `Build-All.ps1` script. You can also open the `src/Ubiquity.NET.Versioning.slnx` in any
146+
editor/IDE that has support for the slnx solution format. (Visual Studio 2022 is used but other
147+
options may work, though they are not supported. If you have experience then PRs are welcome for
148+
additional support - but such PRs ***MUST NOT*** break the VS support.)

0 commit comments

Comments
 (0)