diff --git a/CHANGELOG.md b/CHANGELOG.md index da0737308..71fd1e0a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ Important changes to data models, configuration, and migrations between each AppEngine version, listed here to ease deployment and troubleshooting. ## Next Release (replace with git tag when deployed) + * Bump runtimeVersion to `2024.11.26`. + * `dartdoc 8.3.0` is used for packages depending on `package:macros`. ## `20241121t150900-all` * Bump runtimeVersion to `2024.11.21`. diff --git a/app/lib/shared/versions.dart b/app/lib/shared/versions.dart index dcebc893b..1313227ec 100644 --- a/app/lib/shared/versions.dart +++ b/app/lib/shared/versions.dart @@ -24,10 +24,10 @@ final RegExp runtimeVersionPattern = RegExp(r'^\d{4}\.\d{2}\.\d{2}$'); /// when the version switch happens. const _acceptedRuntimeVersions = [ // The current [runtimeVersion]. - '2024.11.21', + '2024.11.26', // Fallback runtime versions. + '2024.11.21', '2024.11.18', - '2024.11.11', ]; /// Sets the current runtime versions. diff --git a/pkg/pub_worker/lib/src/bin/pana_wrapper.dart b/pkg/pub_worker/lib/src/bin/pana_wrapper.dart index ac81cf849..15f9eb915 100644 --- a/pkg/pub_worker/lib/src/bin/pana_wrapper.dart +++ b/pkg/pub_worker/lib/src/bin/pana_wrapper.dart @@ -99,6 +99,9 @@ Future main(List args) async { final pkgDir = Directory(p.join(pkgDownloadDir.path, '$package-$version')); final detected = await _detectSdks(pkgDir.path); + final dartdocVersion = + (await _overrideDartdocVersion(pkgDir.path)) ?? _dartdocVersion; + final toolEnv = await ToolEnvironment.create( dartSdkConfig: SdkConfig( rootPath: detected.dartSdkPath, @@ -109,7 +112,7 @@ Future main(List args) async { configHomePath: _configHomePath('flutter', detected.configKind), ), pubCacheDir: pubCache, - dartdocVersion: _dartdocVersion, + dartdocVersion: dartdocVersion, ); //final dartdocOutputDir = @@ -191,6 +194,21 @@ String? _configHomePath(String sdk, String kind) { return path; } +/// Detects the package dependencies and overrides the dartdoc version to +/// 8.3.0 if macros is being used. +/// +/// TODO: remove this after the 3.6 SDK is released. +Future _overrideDartdocVersion(String pkgDir) async { + final pubspecFile = File(p.join(pkgDir, 'pubspec.yaml')); + final pubspec = Pubspec.parseYaml(await pubspecFile.readAsString()); + final minMacrosVersion = pubspec.getDependencyContraintRangeMin('macros'); + if (minMacrosVersion != null && + minMacrosVersion.compareTo(Version.parse('0.1.3-main.0')) >= 0) { + return '8.3.0'; + } + return null; +} + Future<({String configKind, String? dartSdkPath, String? flutterSdkPath})> _detectSdks(String pkgDir) async { // Load the pubspec so we detect which SDK to use for analysis