Skip to content
This repository was archived by the owner on Jan 22, 2020. It is now read-only.

Migration to netcore2 + support for new project files #4

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -240,3 +240,5 @@ ModelManifest.xml

# FAKE - F# Make
.fake/
/src/dotnet-bump/Properties/launchSettings.json
/src/dotnet-bump/Properties/PublishProfiles/FolderProfile.pubxml
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/runtime:6.0 AS base
WORKDIR /app

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["src/dotnet-bump/dotnet-bump.csproj", "src/dotnet-bump/"]
RUN dotnet restore "src/dotnet-bump/dotnet-bump.csproj"
COPY . .
WORKDIR "/src/src/dotnet-bump"
RUN dotnet build "dotnet-bump.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "dotnet-bump.csproj" -c Release -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "dotnet-bump-version.dll"]
15 changes: 9 additions & 6 deletions dotnet-bump.sln
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio Version 17
VisualStudioVersion = 17.3.32811.315
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{D45B9303-5D06-45E7-BF9A-183AA38C42E0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D88039FE-C432-42B5-B47C-9D850A1B9DAD}"
ProjectSection(SolutionItems) = preProject
global.json = global.json
Dockerfile = Dockerfile
readme.md = readme.md
EndProjectSection
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "dotnet-bump", "src\dotnet-bump\dotnet-bump.xproj", "{DAB044EF-EDBF-4D78-BCFF-DCC4D3B942D4}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-bump", "src\dotnet-bump\dotnet-bump.csproj", "{DAB044EF-EDBF-4D78-BCFF-DCC4D3B942D4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DAB044EF-EDBF-4D78-BCFF-DCC4D3B942D4}.Debug|Any CPU.ActiveCfg = Release|Any CPU
{DAB044EF-EDBF-4D78-BCFF-DCC4D3B942D4}.Debug|Any CPU.Build.0 = Release|Any CPU
{DAB044EF-EDBF-4D78-BCFF-DCC4D3B942D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DAB044EF-EDBF-4D78-BCFF-DCC4D3B942D4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DAB044EF-EDBF-4D78-BCFF-DCC4D3B942D4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DAB044EF-EDBF-4D78-BCFF-DCC4D3B942D4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
Expand All @@ -30,4 +30,7 @@ Global
GlobalSection(NestedProjects) = preSolution
{DAB044EF-EDBF-4D78-BCFF-DCC4D3B942D4} = {D45B9303-5D06-45E7-BF9A-183AA38C42E0}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B2D5EF42-9B32-4A80-88C2-A20C529E734C}
EndGlobalSection
EndGlobal
6 changes: 0 additions & 6 deletions global.json

This file was deleted.

71 changes: 43 additions & 28 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,57 @@
# dotnet-bump
# dotnet-bump-version

A dotnet-cli command that bumps the version number of the current project. This is useful when working with multiple .NET Core projects
placed in different solutions, referencing each other as NuGet packages. Use this command before `dotnet pack` to increment a specific part of
the version number in `project.json` before pushing your project to your local NuGet feed. This ensures that NuGet will not fetch the package from cache,
and all your .NET Core projects in different solutions can reference the latest compiled version.

## Whats new in v 2.0.0
- Upgraded to dotnet 6.0
- Interface for command line is upgraded to `System.CommandLine`, for pretty command line options
- Solution file support added, use `--sln` option with `.sln` file and it will update all available `.csproj` files
- `Version`, `AssemblyVersion` and `FileVersion` is now searched and updated in `.csproj` file
- `Docker` support added, can be handy to be used in `CI/CD` pipelines

## Whats new in v 2.0.1
- Bugfix, when `--csproj` is provided it doesn't work
- `--suffix` command line option is added

## Usage

Add `dotnet bump` as a tool to your project by including the following into your `project.json`:
### Version 2.0.1

```json
{
"tools":
{
"dotnet-bump": "1.0.1"
}
}
```
```sh
Description:
Command line tool for version bump of dotnet applications v 2.0.1.0

Update the `scripts` section of `project.json` so that the version number is incremented before `dotnet pack`:

```json
{
"scripts": {
"postcompile": [
"dotnet bump revision",
"dotnet pack ..."
]
}
}
```
Usage:
dotnet-bump-version <part> [options]

The command will increment a part of the version number of your `project.json` according to the argument passed to it (`major`, `minor`, `patch` or `revision`).
When this argument is ommited, the revision number is bumped.
Arguments:
<part> The part of version to be updated, supported values are major, minor, patch, revision.

Alternatively, you can limit bumping the version number to a specific configuration by adding a `-t` (or `--target-configuration`) option
paired with a `-c` (or `--configuration`) option that gets its value from a macro:
Options:
--suffix <suffix> The suffix to be appended to version, it would be appended to version with leading -. e.g. if
suffix is set to 'rc1' final version would be x.x.x.x-rc1
--csproj <csproj> The path to C# project (.csproj) file. This option will be given precedence over --sln if both are
provided at same time.
--sln <sln> The path to solution (.sln) file. If --csproj is provided, this option will be ignored.
--version Show version information
-?, -h, --help Show help and usage information
```

### Older versions
Add `dotnet bump` as a tool to your project by including the following into your `.csproj`:

```xml
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<DotNetCliToolReference Include="dotnet-bump-2" Version="1.2.0" />
</ItemGroup>
</Project>
```
dotnet bump revision -t Release -c %compile:Configuration%
```

Run `dotnet restore` to fetch bump-version binaries, after that you may use `dotnet bump-version` command to maintain version.

The command will increment a part of the version number of your `.csproj` according to the argument passed to it (`major`, `minor`, `patch` or `revision`).
When this argument is ommited, the revision number is bumped. You may specify path to `.csproj` on the command line as nameless argument or rely on automatic discovery which would look for first `.csproj` file in the current directory.
Loading