From ad09575a4df1594c333ea9298a886252ffe1e9de Mon Sep 17 00:00:00 2001 From: Scott Schreckengaust Date: Wed, 17 Jul 2024 18:29:48 -0700 Subject: [PATCH 1/4] feat: first pass at net6.0 framework addition --- packages/jsii-pacmak/lib/targets/dotnet.ts | 2 +- packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/jsii-pacmak/lib/targets/dotnet.ts b/packages/jsii-pacmak/lib/targets/dotnet.ts index 70727b8c9b..9cc95903d2 100644 --- a/packages/jsii-pacmak/lib/targets/dotnet.ts +++ b/packages/jsii-pacmak/lib/targets/dotnet.ts @@ -18,7 +18,7 @@ import { toReleaseVersion } from './version-utils'; import { TargetName } from '.'; -export const TARGET_FRAMEWORK = 'netcoreapp3.1'; +export const TARGET_FRAMEWORKS = 'netcoreapp3.1;net6.0'; /** * Build .NET packages all together, by generating an aggregate solution file diff --git a/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts b/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts index 66da0fa773..8918072e8b 100644 --- a/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts +++ b/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts @@ -6,7 +6,7 @@ import * as xmlbuilder from 'xmlbuilder'; import { TargetName } from '..'; import * as logging from '../../logging'; import { VERSION } from '../../version'; -import { TARGET_FRAMEWORK } from '../dotnet'; +import { TARGET_FRAMEWORKS } from '../dotnet'; import { toNuGetVersionRange, toReleaseVersion } from '../version-utils'; import { DotNetNameUtils } from './nameutils'; @@ -112,7 +112,7 @@ export class FileGenerator { propertyGroup.ele('IncludeSource', 'true'); propertyGroup.ele('Nullable', 'enable'); propertyGroup.ele('SymbolPackageFormat', 'snupkg'); - propertyGroup.ele('TargetFramework', TARGET_FRAMEWORK); + propertyGroup.ele('TargetFrameworks', TARGET_FRAMEWORKS); // Transparently rolll forward across major SDK releases if needed propertyGroup.ele('RollForward', 'Major'); @@ -154,6 +154,8 @@ export class FileGenerator { '0109', // The member 'member' does not hide an inherited member. The new keyword is not required. ].join(','), ); + warnings.comment('Quiet "Consider upgrading your TargetFramework to net6.0 or later" messages from "netcoreapp3.1" target framework') + warnings.ele('SuppressTfmSupportBuildWarnings').text('true') const xml = rootNode.end({ pretty: true, spaceBeforeSlash: true }); // Sending the xml content to the codemaker to ensure the file is written From 83439c29939f5579dd0789a2812cb4587dbe5505 Mon Sep 17 00:00:00 2001 From: Scott Schreckengaust Date: Wed, 17 Jul 2024 18:50:48 -0700 Subject: [PATCH 2/4] fix: remove multiple target frameworks --- packages/jsii-pacmak/lib/targets/dotnet.ts | 2 +- packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/jsii-pacmak/lib/targets/dotnet.ts b/packages/jsii-pacmak/lib/targets/dotnet.ts index 9cc95903d2..f9f6409c88 100644 --- a/packages/jsii-pacmak/lib/targets/dotnet.ts +++ b/packages/jsii-pacmak/lib/targets/dotnet.ts @@ -18,7 +18,7 @@ import { toReleaseVersion } from './version-utils'; import { TargetName } from '.'; -export const TARGET_FRAMEWORKS = 'netcoreapp3.1;net6.0'; +export const TARGET_FRAMEWORK = 'net6.0'; /** * Build .NET packages all together, by generating an aggregate solution file diff --git a/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts b/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts index 8918072e8b..1d16c2a1d5 100644 --- a/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts +++ b/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts @@ -6,7 +6,7 @@ import * as xmlbuilder from 'xmlbuilder'; import { TargetName } from '..'; import * as logging from '../../logging'; import { VERSION } from '../../version'; -import { TARGET_FRAMEWORKS } from '../dotnet'; +import { TARGET_FRAMEWORK } from '../dotnet'; import { toNuGetVersionRange, toReleaseVersion } from '../version-utils'; import { DotNetNameUtils } from './nameutils'; @@ -112,7 +112,7 @@ export class FileGenerator { propertyGroup.ele('IncludeSource', 'true'); propertyGroup.ele('Nullable', 'enable'); propertyGroup.ele('SymbolPackageFormat', 'snupkg'); - propertyGroup.ele('TargetFrameworks', TARGET_FRAMEWORKS); + propertyGroup.ele('TargetFramework', TARGET_FRAMEWORK); // Transparently rolll forward across major SDK releases if needed propertyGroup.ele('RollForward', 'Major'); From ce53d3fbfc3be71e89d67eb50f61311c341de2a0 Mon Sep 17 00:00:00 2001 From: Scott Schreckengaust Date: Thu, 18 Jul 2024 09:56:39 -0700 Subject: [PATCH 3/4] fix: semicolon --- packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts b/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts index 1d16c2a1d5..64846496b8 100644 --- a/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts +++ b/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts @@ -154,8 +154,8 @@ export class FileGenerator { '0109', // The member 'member' does not hide an inherited member. The new keyword is not required. ].join(','), ); - warnings.comment('Quiet "Consider upgrading your TargetFramework to net6.0 or later" messages from "netcoreapp3.1" target framework') - warnings.ele('SuppressTfmSupportBuildWarnings').text('true') + warnings.comment('Quiet "Consider upgrading your TargetFramework to net6.0 or later" messages from "netcoreapp3.1" target framework'); + warnings.ele('SuppressTfmSupportBuildWarnings').text('true'); const xml = rootNode.end({ pretty: true, spaceBeforeSlash: true }); // Sending the xml content to the codemaker to ensure the file is written From 1d2b00ed454b3c676f2e45ed84e143b23e815061 Mon Sep 17 00:00:00 2001 From: Scott Schreckengaust Date: Fri, 19 Jul 2024 15:11:30 -0700 Subject: [PATCH 4/4] fix: remove the suppression --- packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts b/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts index 64846496b8..0c9c033289 100644 --- a/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts +++ b/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts @@ -154,8 +154,8 @@ export class FileGenerator { '0109', // The member 'member' does not hide an inherited member. The new keyword is not required. ].join(','), ); - warnings.comment('Quiet "Consider upgrading your TargetFramework to net6.0 or later" messages from "netcoreapp3.1" target framework'); - warnings.ele('SuppressTfmSupportBuildWarnings').text('true'); + // warnings.comment('Suppress Target Framework Moniker build warnings messages from the netcoreapp3.1 target framework'); + // warnings.ele('SuppressTfmSupportBuildWarnings').text('true'); const xml = rootNode.end({ pretty: true, spaceBeforeSlash: true }); // Sending the xml content to the codemaker to ensure the file is written