Skip to content

Update analyzer to 1.0.0 #2524

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
sdk: [dev, stable]
sdk: [dev, beta]
job: [main, flutter, sdk-analyzer, packages, sdk-docs]
include:
- os: macos-latest
Expand All @@ -32,9 +32,9 @@ jobs:
# Do not try to run flutter against the "stable" sdk,
# it is unlikely to work and produces uninteresting
# results.
- sdk: stable
- sdk: beta
job: flutter
- sdk: stable
- sdk: beta
job: sdk-analyzer

steps:
Expand Down
10 changes: 10 additions & 0 deletions lib/src/generator/templates.renderers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,16 @@ class _Renderer_Object extends RendererBase<Object> {
return renderSimple(c.hashCode, ast, r.template, parent: r);
},
),
'runtimeType': Property(
getValue: (CT_ c) => c.runtimeType,
renderVariable:
(CT_ c, Property<CT_> self, List<String> remainingNames) =>
self.renderSimpleVariable(c, remainingNames, 'Type'),
isNullValue: (CT_ c) => c.runtimeType == null,
renderValue: (CT_ c, RendererBase<CT_> r, List<MustachioNode> ast) {
return renderSimple(c.runtimeType, ast, r.template, parent: r);
},
),
};

_Renderer_Object(
Expand Down
34 changes: 17 additions & 17 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,37 @@ version: 0.39.0
description: A non-interactive HTML documentation generator for Dart source code.
homepage: https://github.com/dart-lang/dartdoc
environment:
sdk: '>=2.10.0 <3.0.0'
sdk: '>=2.11.99 <3.0.0'

dependencies:
analyzer: ^0.41.1
args: '>=1.5.0 <2.0.0'
charcode: ^1.1.2
analyzer: ^1.0.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wowzers

args: ^2.0.0
charcode: ^1.2.0
collection: ^1.2.0
cli_util: '>=0.1.4 <0.3.0'
crypto: ^2.0.6
glob: '>=1.1.2 <2.0.0'
html: '>=0.12.1 <0.15.0'
logging: ^0.11.3+1
markdown: '>=2.1.5 <4.0.0'
cli_util: ^0.3.0
crypto: ^3.0.0
glob: ^2.0.0
html: ^0.15.0
logging: ^1.0.0
markdown: ^4.0.0
meta: ^1.2.4
mustache: ^1.1.0
package_config: '>=0.1.5 <2.0.0'
package_config: ^2.0.0
path: ^1.3.0
pub_semver: ^1.3.7
pub_semver: ^2.0.0
source_span: ^1.5.2
yaml: ^2.1.0
yaml: ^3.0.0

dev_dependencies:
async: '>=2.0.8'
async: ^2.0.8
build: ^1.5.0
build_runner: ^1.10.0
build_test: ^1.3.0
build_version: ^2.0.1
coverage: ^0.14.0
coverage: ^0.15.2
dart_style: ^1.3.9
grinder: ^0.8.2
http: ^0.12.0
grinder: ^0.9.0-nullsafety.0
http: ^0.13.0
pedantic: ^1.9.0
test: ^1.3.0

Expand Down
10 changes: 10 additions & 0 deletions test/mustachio/foo.renderers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@ class Renderer_Object extends RendererBase<Object> {
return renderSimple(c.hashCode, ast, r.template, parent: r);
},
),
'runtimeType': Property(
getValue: (CT_ c) => c.runtimeType,
renderVariable:
(CT_ c, Property<CT_> self, List<String> remainingNames) =>
self.renderSimpleVariable(c, remainingNames, 'Type'),
isNullValue: (CT_ c) => c.runtimeType == null,
renderValue: (CT_ c, RendererBase<CT_> r, List<MustachioNode> ast) {
return renderSimple(c.runtimeType, ast, r.template, parent: r);
},
),
};

Renderer_Object(
Expand Down
3 changes: 2 additions & 1 deletion test/mustachio/renderer_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ void main() {

test('property map contains all public getters', () {
var propertyMap = Renderer_Foo.propertyMap();
expect(propertyMap.keys, hasLength(5));
expect(propertyMap.keys, hasLength(6));
expect(propertyMap['b1'], isNotNull);
expect(propertyMap['s1'], isNotNull);
expect(propertyMap['l1'], isNotNull);
expect(propertyMap['baz'], isNotNull);
expect(propertyMap['hashCode'], isNotNull);
expect(propertyMap['runtimeType'], isNotNull);
});

test('property map contains valid bool Properties', () {
Expand Down
6 changes: 3 additions & 3 deletions tool/doc_packages.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,15 @@ Future<void> _printGenerationResult(

Future<List<String>> _packageUrls(int page) {
return http
.get('https://pub.dartlang.org/packages.json?page=${page}')
.get(Uri.parse('https://pub.dartlang.org/packages.json?page=${page}'))
.then((response) {
return List<String>.from(json.decode(response.body)['packages']);
});
}

Future<List<PackageInfo>> _getPackageInfos(List<String> packageUrls) {
var futures = packageUrls.map((String p) {
return http.get(p).then((response) {
return http.get(Uri.parse(p)).then((response) {
var decodedJson = json.decode(response.body);
String name = decodedJson['name'];
var versions = List<Version>.from(
Expand All @@ -151,7 +151,7 @@ Future<bool> _generateFor(PackageInfo package) async {
_logBuffer = StringBuffer();

// Get the package archive (tar zxvf foo.tar.gz).
var response = await http.get(package.archiveUrl);
var response = await http.get(Uri.parse(package.archiveUrl));
if (response.statusCode != 200) throw response;

var output = Directory('${_rootDir}/${package.name}');
Expand Down