Skip to content

Commit

Permalink
copy constants - cannot publish otherwise (#800)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmoo authored Feb 12, 2021
1 parent 145d8cc commit 829b45a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
2 changes: 0 additions & 2 deletions json_serializable/lib/src/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// 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.

// @dart=2.12

/// Name used for closure argument when generating calls to `map`.
const closureArg = 'e';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
import 'dart:collection';

import 'package:json_annotation/json_annotation.dart';
import 'package:json_serializable/src/constants.dart';

// ignore: import_of_legacy_library_into_null_safe
import 'package:source_gen_test/annotations.dart';

part 'constants_copy.dart';

part 'checked_test_input.dart';

part 'core_subclass_type_input.dart';
Expand Down
23 changes: 23 additions & 0 deletions json_serializable/test/src/constants_copy.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) 2021, 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.

// @dart=2.12

part of '_json_serializable_test_input.dart';

// TODO: remove this and return link to lib/src/constants.dart once this
// package runs with full null safety

/// Name used for closure argument when generating calls to `map`.
const closureArg = 'e';

const generatedLocalVarName = 'val';
const toJsonMapHelperName = 'writeNotNull';

const converterOrKeyInstructions = r'''
* Use `JsonConverter`
https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonConverter-class.html
* Use `JsonKey` fields `fromJson` and `toJson`
https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonKey/fromJson.html
https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonKey/toJson.html''';

0 comments on commit 829b45a

Please sign in to comment.