Skip to content

Prepare json_annotation for release #63

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 2 commits into from
Nov 2, 2017
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
2 changes: 1 addition & 1 deletion json_annotation/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: json_annotation
version: 0.2.1-dev
version: 0.2.1
description: Annotations for the json_serializable package
homepage: https://github.com/dart-lang/json_serializable
author: Dart Team <misc@dartlang.org>
Expand Down
19 changes: 10 additions & 9 deletions json_serializable/test/ensure_build_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,30 @@
import 'dart:convert';
import 'dart:io';

import 'package:path/path.dart' as p;
import 'package:test/test.dart';

void main() {
String pkgRoot;
try {

setUpAll(() {
pkgRoot = _runProc('git', ['rev-parse', '--show-toplevel']);
var currentDir = Directory.current.resolveSymbolicLinksSync();
if (pkgRoot != currentDir) {

if (!p.equals(p.join(pkgRoot, 'json_serializable'), currentDir)) {
throw new StateError('Expected the git root ($pkgRoot) '
'to match the current directory ($currentDir).');
}
} catch (e) {
print("Skipping this test – git didn't run correctly");
print(e);
return;
}
});

test('ensure local build succeeds with no changes', () {
// 1 - get a list of modified `.g.dart` files - should be empty
//expect(_changedGeneratedFiles(), isEmpty);

// 2 - run build - should be no output, since nothing should change
var result = _runProc('dart', ['--checked', 'tool/build.dart']);
// TODO(kevmoo): run checked after github.com/dart-lang/build/issues/566
// is fixed
var result = _runProc('dart', ['tool/build.dart']);
expect(result,
contains(new RegExp(r'Build: Succeeded after \S+ with \d+ outputs')));

Expand All @@ -46,7 +47,7 @@ Set<String> _changedGeneratedFiles() {
return LineSplitter
.split(output)
.map((line) => line.split(_whitespace).last)
.where((path) => path.endsWith('.g.dart'))
.where((path) => path.endsWith('.dart'))
.toSet();
}

Expand Down