diff --git a/pkgs/cronet_http/tool/prepare_for_embedded.dart b/pkgs/cronet_http/tool/prepare_for_embedded.dart index e0f99d7a23..a13f4c333b 100644 --- a/pkgs/cronet_http/tool/prepare_for_embedded.dart +++ b/pkgs/cronet_http/tool/prepare_for_embedded.dart @@ -88,13 +88,19 @@ void updateCronetDependency(String latestVersion) { fBuildGradle.writeAsStringSync(newGradleContent); } -/// Update pubspec.yaml +/// Update pubspec.yaml and example/pubspec.yaml void updatePubSpec() { final fPubspec = File('${_packageDirectory.path}/pubspec.yaml'); final yamlEditor = YamlEditor(fPubspec.readAsStringSync()) ..update(['name'], _packageName) ..update(['description'], _packageDescription); fPubspec.writeAsStringSync(yamlEditor.toString()); + final examplePubspec = File('${_packageDirectory.path}/pubspec.yaml'); + final replaced = examplePubspec.readAsStringSync().replaceAll( + 'cronet_http:' + 'cronet_http_embedded:', + ); + examplePubspec.writeAsStringSync(replaced); } /// Move README_EMBEDDED.md to replace README.md