Skip to content

source_gen custom header – for copyright #59

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 1 commit into from
Oct 9, 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
4 changes: 4 additions & 0 deletions json_serializable/example/example.g.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Copyright (c) 2017, 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.

// GENERATED CODE - DO NOT MODIFY BY HAND

part of json_serializable.example;
Expand Down
2 changes: 1 addition & 1 deletion json_serializable/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies:
# `json_annotation`. Properly constrains all features it provides.
json_annotation: '>=0.2.0 <0.2.1'
path: ^1.3.2
source_gen: ^0.7.0
source_gen: ^0.7.1
dev_dependencies:
build_runner: '>=0.4.0 <0.6.0'
build_test: '>=0.6.0 <0.9.0'
Expand Down
4 changes: 4 additions & 0 deletions json_serializable/test/test_files/bathtub.g.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Copyright (c) 2017, 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.

// GENERATED CODE - DO NOT MODIFY BY HAND

part of json_serializable.test.bathtub;
Expand Down
4 changes: 4 additions & 0 deletions json_serializable/test/test_files/json_literal.g.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Copyright (c) 2017, 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.

// GENERATED CODE - DO NOT MODIFY BY HAND

part of json_serializable.example;
Expand Down
4 changes: 4 additions & 0 deletions json_serializable/test/test_files/json_test_example.g.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Copyright (c) 2017, 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.

// GENERATED CODE - DO NOT MODIFY BY HAND

part of json_serializable.test.example;
Expand Down
4 changes: 4 additions & 0 deletions json_serializable/test/test_files/kitchen_sink.g.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Copyright (c) 2017, 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.

// GENERATED CODE - DO NOT MODIFY BY HAND

part of json_serializable.test.kitche_sink;
Expand Down
22 changes: 15 additions & 7 deletions json_serializable/tool/build_actions.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
Copy link
Member

Choose a reason for hiding this comment

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

I think we don't generally bother updating years when we touch a 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.

Expand All @@ -8,10 +8,18 @@ import 'package:source_gen/source_gen.dart';

final List<BuildAction> buildActions = [
new BuildAction(
new PartBuilder(const [
const JsonSerializableGenerator(),
const JsonLiteralGenerator()
]),
'json_serializable',
inputs: const ['example/*.dart', 'test/test_files/*.dart'])
new PartBuilder(
const [const JsonSerializableGenerator(), const JsonLiteralGenerator()],
header: _copyrightHeader),
'json_serializable',
inputs: const ['example/*.dart', 'test/test_files/*.dart'],
)
];

final _copyrightHeader =
'''// Copyright (c) 2017, 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.

$defaultFileHeader
''';