Skip to content

Commit d4130af

Browse files
authored
Use the latest version of the xml package (#59)
1 parent f4fe7fd commit d4130af

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 1.0.0-beta.11
2+
3+
* Use the latest version of the `xml` package.
4+
15
# 1.0.0-beta.10
26

37
* **Breaking change:** All configurable variables are now defined as

lib/src/chocolatey.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import 'package:archive/archive.dart';
1919
import 'package:grinder/grinder.dart';
2020
import 'package:meta/meta.dart';
2121
import 'package:path/path.dart' as p;
22-
import 'package:xml/xml.dart' as xml;
2322
import 'package:xml/xml.dart' hide parse;
2423

2524
import 'config_variable.dart';
@@ -136,7 +135,7 @@ XmlDocument get _nuspec {
136135
if (__nuspec != null) return __nuspec;
137136

138137
try {
139-
__nuspec = xml.parse(chocolateyNuspec.value);
138+
__nuspec = XmlDocument.parse(chocolateyNuspec.value);
140139
} on XmlParserException catch (error) {
141140
fail("Invalid nuspec: $error");
142141
}
@@ -290,8 +289,7 @@ Future<void> _deploy() async {
290289
///
291290
/// If [allowNone] is `true`, this returns `null` if there are no children of
292291
/// [parent] named [name]. Otherwise, it throws an error.
293-
XmlElement _findElement(XmlParent parent, String name,
294-
{bool allowNone = false}) {
292+
XmlElement _findElement(XmlNode parent, String name, {bool allowNone = false}) {
295293
var elements = parent.findElements(name);
296294
if (elements.length == 1) return elements.single;
297295
if (allowNone && elements.isEmpty) return null;

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: cli_pkg
2-
version: 1.0.0-beta.10
2+
version: 1.0.0-beta.11
33
description: Grinder tasks for releasing Dart CLI packages.
44
homepage: https://github.com/google/dart_cli_pkg
55

@@ -25,7 +25,7 @@ dependencies:
2525
string_scanner: '^1.0.0'
2626
test: '^1.0.0'
2727
test_process: '^1.0.0'
28-
xml: '^3.6.0'
28+
xml: '^4.2.0'
2929
yaml: '^2.0.0'
3030

3131
dev_dependencies:

test/chocolatey_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import 'dart:convert';
1717

1818
import 'package:test/test.dart';
1919
import 'package:test_process/test_process.dart';
20-
import 'package:xml/xml.dart' as xml;
20+
import 'package:xml/xml.dart' hide parse;
2121

2222
import 'package:cli_pkg/src/chocolatey.dart';
2323
import 'package:cli_pkg/src/utils.dart';
@@ -336,7 +336,7 @@ d.FileDescriptor _nuspec([String extraMetadata]) {
336336
/// [expected], ignoring whitespace.
337337
Matcher _equalsXml(String expected) => predicate((actual) {
338338
expect(actual, isA<String>());
339-
expect(xml.parse(actual as String).toXmlString(pretty: true),
340-
equals(xml.parse(expected).toXmlString(pretty: true)));
339+
expect(XmlDocument.parse(actual as String).toXmlString(pretty: true),
340+
equals(XmlDocument.parse(expected).toXmlString(pretty: true)));
341341
return true;
342342
});

0 commit comments

Comments
 (0)