Skip to content

Commit

Permalink
fix(jsii-pacmak): invalid dotnet version suffixes (#1568)
Browse files Browse the repository at this point in the history
Removes version suffix from version ranges in `.csproj` files generated
by jsii-pacmak.

Dotnet doesn't allow version suffixes that start with a number. Version
ranges by default don't include prereleases so the resolved version is
as intended without the suffix in this case.
  • Loading branch information
MrArnoldPalmer authored and RomainMuller committed Apr 20, 2020
1 parent b58299e commit fac53d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/jsii-pacmak/lib/targets/version-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function toMavenVersionRange(semverRange: string, suffix?: string): strin
* @see https://docs.microsoft.com/en-us/nuget/concepts/package-versioning#version-ranges-and-wildcards
*/
export function toNuGetVersionRange(semverRange: string): string {
return toBracketNotation(semverRange);
return toBracketNotation(semverRange, undefined, { semver: false });
}

/**
Expand Down
8 changes: 4 additions & 4 deletions packages/jsii-pacmak/test/targets/version-utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ const examples: Record<string, { maven: string, nuget: string, python: string }>
},
'~1.2.3': {
maven: '[1.2.3,1.3.0)',
nuget: '[1.2.3,1.3.0-0)',
nuget: '[1.2.3,1.3.0)',
python: '>=1.2.3, <1.3.0',
},
'^1.2.3': {
maven: '[1.2.3,2.0.0)',
nuget: '[1.2.3,2.0.0-0)',
nuget: '[1.2.3,2.0.0)',
python: '>=1.2.3, <2.0.0',
},

Expand All @@ -26,12 +26,12 @@ const examples: Record<string, { maven: string, nuget: string, python: string }>
},
'~0.1.2': {
maven: '[0.1.2,0.2.0)',
nuget: '[0.1.2,0.2.0-0)',
nuget: '[0.1.2,0.2.0)',
python: '>=0.1.2, <0.2.0',
},
'^0.1.2': {
maven: '[0.1.2,0.2.0)',
nuget: '[0.1.2,0.2.0-0)',
nuget: '[0.1.2,0.2.0)',
python: '>=0.1.2, <0.2.0',
},

Expand Down

0 comments on commit fac53d9

Please sign in to comment.