Skip to content

Commit

Permalink
Version 3.2.0-115.0.dev
Browse files Browse the repository at this point in the history
Merge c9f8d41 into dev
  • Loading branch information
Dart CI committed Aug 28, 2023
2 parents 5d3ab5d + c9f8d41 commit 78a2d46
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 5 deletions.
2 changes: 1 addition & 1 deletion runtime/observatory_2/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: observatory
name: observatory_2
environment:
sdk: '>=2.6.0 <3.0.0'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: observatory_test_package
name: observatory_test_package_2
publish_to: none
environment:
sdk: '^2.7.0'
2 changes: 1 addition & 1 deletion tools/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ CHANNEL dev
MAJOR 3
MINOR 2
PATCH 0
PRERELEASE 114
PRERELEASE 115
PRERELEASE_PATCH 0
30 changes: 28 additions & 2 deletions tools/generate_package_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,19 @@ void writeIfDifferent(File file, String contents) {
/// Generates package configurations for each package in [packageDirs].
Iterable<Package> makePackageConfigs(List<String> packageDirs) sync* {
for (var packageDir in packageDirs) {
var name = pubspecName(packageDir);
// TODO(https://github.com/dart-lang/webdev/issues/2201): Wait for webdev
// to roll in the fix for the pubspec and then remove this workaround.
if (posix(packageDir) ==
'third_party/pkg/webdev/fixtures/_webdevSoundSmoke') {
name = '_webdev_sound_smoke';
}
var version = pubspecLanguageVersion(packageDir);
var hasLibDirectory =
Directory(join(repoRoot, packageDir, 'lib')).existsSync();

yield Package(
name: basename(packageDir),
name: name,
rootUri: packageDir,
packageUri: hasLibDirectory ? 'lib/' : null,
languageVersion: version,
Expand Down Expand Up @@ -201,11 +208,30 @@ Iterable<String> listSubdirectories(String parentPath) sync* {

final versionRE = RegExp(r"(?:\^|>=)(\d+\.\d+)");

/// Parses the package name in the pubspec for [packageDir]
String pubspecName(String packageDir) {
var pubspecFile = File(join(repoRoot, packageDir, 'pubspec.yaml'));

if (!pubspecFile.existsSync()) {
print("Error: Missing pubspec for $packageDir.");
exit(1);
}

var contents = pubspecFile.readAsLinesSync();
if (!contents.any((line) => line.contains('name: '))) {
print("Error: Pubspec for $packageDir has no name.");
exit(1);
}

var name = contents.firstWhere((line) => line.contains('name: '));
return name.trim().substring('name:'.length).trim();
}

/// Infers the language version from the SDK constraint in the pubspec for
/// [packageDir].
///
/// The version is returned in the form `major.minor`.
String? pubspecLanguageVersion(String packageDir) {
String pubspecLanguageVersion(String packageDir) {
var pubspecFile = File(join(repoRoot, packageDir, 'pubspec.yaml'));

if (!pubspecFile.existsSync()) {
Expand Down

0 comments on commit 78a2d46

Please sign in to comment.