commit-and-tag-version
Advanced tools
Comparing version 11.2.4 to 11.3.0
@@ -5,2 +5,9 @@ # Changelog | ||
## [11.3.0](https://github.com/absolute-version/commit-and-tag-version/compare/v11.2.4...v11.3.0) (2023-10-10) | ||
### Features | ||
* **updater:** add .csproj file support ([#95](https://github.com/absolute-version/commit-and-tag-version/issues/95)) ([a96554c](https://github.com/absolute-version/commit-and-tag-version/commit/a96554c9467bacdf6c9d898b223883ee32f63c15)) | ||
## [11.2.4](https://github.com/absolute-version/commit-and-tag-version/compare/v11.2.3...v11.2.4) (2023-10-02) | ||
@@ -7,0 +14,0 @@ |
@@ -6,3 +6,4 @@ const path = require('path') | ||
'plain-text': require('./types/plain-text'), | ||
gradle: require('./types/gradle') | ||
gradle: require('./types/gradle'), | ||
csproj: require('./types/csproj') | ||
} | ||
@@ -29,2 +30,5 @@ const PLAIN_TEXT_BUMP_FILES = ['VERSION.txt', 'version.txt'] | ||
} | ||
if (filename.endsWith('.csproj')) { | ||
return getUpdaterByType('csproj') | ||
} | ||
throw Error( | ||
@@ -31,0 +35,0 @@ `Unsupported file (${filename}) provided for bumping.\n Please specify the updater \`type\` or use a custom \`updater\`.` |
{ | ||
"name": "commit-and-tag-version", | ||
"version": "11.2.4", | ||
"version": "11.3.0", | ||
"description": "replacement for `npm version` with automatic CHANGELOG generation", | ||
@@ -5,0 +5,0 @@ "bin": "bin/cli.js", |
@@ -22,2 +22,3 @@ # Commit and Tag Version | ||
- [Gradle Support (Java/Kotlin)](#gradle-support-javakotlin) | ||
- [.NET Support](#net-support) | ||
- [Installing `commit-and-tag-version`](#installing-commit-and-tag-version) | ||
@@ -92,3 +93,10 @@ - [As a local `npm run` script](#as-a-local-npm-run-script) | ||
### .NET Support | ||
If you are using .NET with `.csproj` files. | ||
This is going to read and update only the `<Version>` tag in the file. | ||
```sh | ||
commit-and-tag-version --packageFiles <YOUR-PROJECT-NAME>.csproj --bumpFiles <YOUR-PROJECT-NAME>.csproj | ||
``` | ||
## Installing `commit-and-tag-version` | ||
@@ -95,0 +103,0 @@ |
@@ -772,2 +772,18 @@ /* global describe it afterEach */ | ||
it('bumps version in .NET `Project.csproj` file', async function () { | ||
const expected = fs.readFileSync('./test/mocks/Project-6.4.0.csproj', 'utf-8') | ||
const filename = 'Project.csproj' | ||
mock({ | ||
bump: 'minor', | ||
fs: { | ||
[filename]: fs.readFileSync('./test/mocks/Project-6.3.1.csproj') | ||
} | ||
}) | ||
await exec({ | ||
packageFiles: [{ filename, type: 'csproj' }], | ||
bumpFiles: [{ filename, type: 'csproj' }] | ||
}) | ||
fs.readFileSync(filename, 'utf-8').should.equal(expected) | ||
}) | ||
it('bumps version # in npm-shrinkwrap.json', async function () { | ||
@@ -774,0 +790,0 @@ mock({ |
172032
55
2638
592