Upgrade dependencies, regenerate code with latest json_serializable
MODIFY
lib/src/common.g.dart
lib/src/common.g.dart
@@ -6,7 +6,8 @@ part of github.common;
// Generator: JsonSerializableGenerator
// **************************************************************************
-GitTree _$GitTreeFromJson(Map<String, dynamic> json) => new GitTree(
+GitTree _$GitTreeFromJson(Map<String, dynamic> json) {
+ return new GitTree(
json['sha'] as String,
json['url'] as String,
json['truncated'] as bool,
@@ -15,33 +16,39 @@ GitTree _$GitTreeFromJson(Map<String, dynamic> json) => new GitTree(
? null
: new GitTreeEntry.fromJson(e as Map<String, dynamic>))
?.toList());
+}
-GitTreeEntry _$GitTreeEntryFromJson(Map<String, dynamic> json) =>
- new GitTreeEntry(
+GitTreeEntry _$GitTreeEntryFromJson(Map<String, dynamic> json) {
+ return new GitTreeEntry(
json['path'] as String,
json['mode'] as String,
json['type'] as String,
json['size'] as int,
json['sha'] as String,
json['url'] as String);
+}
-GitHubComparison _$GitHubComparisonFromJson(Map<String, dynamic> json) =>
- new GitHubComparison(
+GitHubComparison _$GitHubComparisonFromJson(Map<String, dynamic> json) {
+ return new GitHubComparison(
json['url'] as String,
json['status'] as String,
json['ahead_by'] as int,
json['behind_by'] as int,
json['total_commits'] as int);
+}
-Tag _$TagFromJson(Map<String, dynamic> json) => new Tag(
+Tag _$TagFromJson(Map<String, dynamic> json) {
+ return new Tag(
json['name'] as String,
json['commit'] == null
? null
: new CommitInfo.fromJson(json['commit'] as Map<String, dynamic>),
json['zipball_url'] as String,
json['tarball_url'] as String);
+}
-CommitData _$CommitDataFromJson(Map<String, dynamic> json) => new CommitData(
+CommitData _$CommitDataFromJson(Map<String, dynamic> json) {
+ return new CommitData(
json['sha'] as String,
json['commit'] == null ? null : new GitCommit.fromJson(json['commit']),
json['url'] as String,
@@ -54,24 +61,33 @@ CommitData _$CommitDataFromJson(Map<String, dynamic> json) => new CommitData(
? null
: new CommitDataUser.fromJson(
json['committer'] as Map<String, dynamic>),
- (json['parents'] as List)?.map((e) => e as Map<String, dynamic>)?.toList());
+ (json['parents'] as List)
+ ?.map((e) => e as Map<String, dynamic>)
+ ?.toList());
+}
-CommitDataUser _$CommitDataUserFromJson(Map<String, dynamic> json) =>
- new CommitDataUser(
+CommitDataUser _$CommitDataUserFromJson(Map<String, dynamic> json) {
+ return new CommitDataUser(
json['login'] as String, json['id'] as int, json['type'] as String);
+}
-CommitInfo _$CommitInfoFromJson(Map<String, dynamic> json) => new CommitInfo(
+CommitInfo _$CommitInfoFromJson(Map<String, dynamic> json) {
+ return new CommitInfo(
json['sha'] as String,
json['tree'] == null
? null
: new GitTree.fromJson(json['tree'] as Map<String, dynamic>));
+}
-UserInformation _$UserInformationFromJson(Map<String, dynamic> json) =>
- new UserInformation(json['login'] as String, json['id'] as int,
+UserInformation _$UserInformationFromJson(Map<String, dynamic> json) {
+ return new UserInformation(json['login'] as String, json['id'] as int,
json['avatar_url'] as String, json['html_url'] as String);
+}
-Branch _$BranchFromJson(Map<String, dynamic> json) => new Branch(
+Branch _$BranchFromJson(Map<String, dynamic> json) {
+ return new Branch(
json['name'] as String,
json['commit'] == null
? null
: new CommitData.fromJson(json['commit'] as Map<String, dynamic>));
+}

MODIFY
pubspec.yaml
pubspec.yaml
@@ -8,14 +8,12 @@ environment:
dependencies:
html: '>=0.12.0 <0.14.0'
http: '^0.11.3'
- json_annotation: '^0.2.0'
- markdown: '^0.11.1'
- quiver: '>=0.20.0 <0.26.0'
- xml: '^2.0.0'
+ json_annotation: '^0.2.8'
+ quiver: '>=0.20.0 <0.29.0'
+ xml: '>=2.0.0 <4.0.0'
dev_dependencies:
browser: '^0.10.0+2'
- build_runner: ^0.5.0
- json_serializable: '^0.2.4'
- source_gen: '^0.7.0'
+ build_runner: ^0.8.0
+ json_serializable: ^0.5.7
test: '^0.12.0'
mockito: '^1.0.1'

DELETE
tool/build.dart
-#!/usr/bin/env dart --checked
-// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:async';
-
-import 'package:build_runner/build_runner.dart';
-
-import 'phases.dart';
-
-Future main() async {
- await build(buildActions, deleteFilesByDefault: true);
-}

DELETE
tool/phases.dart
-import 'package:build_runner/build_runner.dart';
-import 'package:json_serializable/generators.dart';
-import 'package:source_gen/source_gen.dart';
-
-final buildActions = <BuildAction>[
- new BuildAction(
- new PartBuilder(const [
- const JsonSerializableGenerator(),
- ]),
- 'github',
- inputs: ['lib/src/common.dart'])
-];

DELETE
tool/watch.dart
-// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:build_runner/build_runner.dart';
-
-import 'phases.dart';
-
-void main() {
- watch(buildActions, deleteFilesByDefault: true);
-}

Upgrade dependencies, regenerate code with latest json_serializable (#104)