Separate builder and annotation package

This commit is contained in:
Ming Ming 2022-12-22 22:07:29 +08:00
parent 6905e503fe
commit c48492597e
12 changed files with 103 additions and 26 deletions

View file

@ -8,7 +8,7 @@ targets:
new_sql_code_generation: true new_sql_code_generation: true
scoped_dart_components: true scoped_dart_components: true
generate_connect_constructor: true generate_connect_constructor: true
to_string: to_string_build:
options: options:
formatStringNameMapping: formatStringNameMapping:
double: "${$?.toStringAsFixed(3)}" double: "${$?.toStringAsFixed(3)}"

View file

@ -834,12 +834,19 @@ packages:
source: hosted source: hosted
version: "2.0.1" version: "2.0.1"
np_codegen: np_codegen:
dependency: "direct dev" dependency: "direct main"
description: description:
path: "../codegen" path: "../codegen"
relative: true relative: true
source: path source: path
version: "1.0.0" version: "1.0.0"
np_codegen_build:
dependency: "direct dev"
description:
path: "../codegen_build"
relative: true
source: path
version: "1.0.0"
octo_image: octo_image:
dependency: transitive dependency: transitive
description: description:
@ -1287,11 +1294,20 @@ packages:
source: hosted source: hosted
version: "1.0.0" version: "1.0.0"
to_string: to_string:
dependency: "direct main"
description:
path: to_string
ref: HEAD
resolved-ref: "104d4bf9db5ed8982ffb802c0acaaf1a3f0acf3a"
url: "https://gitlab.com/nkming2/dart-to-string"
source: git
version: "1.0.0"
to_string_build:
dependency: "direct dev" dependency: "direct dev"
description: description:
path: "." path: to_string_build
ref: "1c8c2df0eace366a87eb5a5642b4528f3d7af3f4" ref: HEAD
resolved-ref: "1c8c2df0eace366a87eb5a5642b4528f3d7af3f4" resolved-ref: "104d4bf9db5ed8982ffb802c0acaaf1a3f0acf3a"
url: "https://gitlab.com/nkming2/dart-to-string" url: "https://gitlab.com/nkming2/dart-to-string"
source: git source: git
version: "1.0.0" version: "1.0.0"

View file

@ -87,6 +87,8 @@ dependencies:
native_device_orientation: ^1.1.0 native_device_orientation: ^1.1.0
nc_photos_plugin: nc_photos_plugin:
path: ../plugin path: ../plugin
np_codegen:
path: ../codegen
page_view_indicators: ^2.0.0 page_view_indicators: ^2.0.0
path: ^1.8.0 path: ^1.8.0
path_provider: ^2.0.6 path_provider: ^2.0.6
@ -97,6 +99,11 @@ dependencies:
sqlite3: any sqlite3: any
sqlite3_flutter_libs: ^0.5.8 sqlite3_flutter_libs: ^0.5.8
synchronized: ^3.0.0 synchronized: ^3.0.0
to_string:
git:
url: https://gitlab.com/nkming2/dart-to-string
ref: HEAD
path: to_string
tuple: ^2.0.0 tuple: ^2.0.0
url_launcher: ^6.0.3 url_launcher: ^6.0.3
uuid: ^3.0.6 uuid: ^3.0.6
@ -123,12 +130,13 @@ dev_dependencies:
sdk: flutter sdk: flutter
# integration_test: # integration_test:
# sdk: flutter # sdk: flutter
np_codegen: np_codegen_build:
path: ../codegen path: ../codegen_build
to_string: to_string_build:
git: git:
url: https://gitlab.com/nkming2/dart-to-string url: https://gitlab.com/nkming2/dart-to-string
ref: 1c8c2df0eace366a87eb5a5642b4528f3d7af3f4 ref: HEAD
path: to_string_build
# For information on the generic Dart part of this file, see the # For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec # following page: https://dart.dev/tools/pub/pubspec

View file

@ -6,17 +6,5 @@ version: 1.0.0
environment: environment:
sdk: '>=2.17.0 <3.0.0' sdk: '>=2.17.0 <3.0.0'
dependencies:
analyzer: '>=4.0.0'
build: ^2.3.1
source_gen: ^1.2.6
dev_dependencies: dev_dependencies:
build_test: ^2.1.5
lints: ^2.0.0 lints: ^2.0.0
test: ^1.16.0
code_gen_tester:
git:
url: https://github.com/rrousselGit/functional_widget
ref: v0.10.0
path: packages/code_gen_tester

10
codegen_build/.gitignore vendored Normal file
View file

@ -0,0 +1,10 @@
# Files and directories created by pub.
.dart_tool/
.packages
# Conventional directory for build outputs.
build/
# Omit committing pubspec.lock for library packages; see
# https://dart.dev/guides/libraries/private-files#pubspeclock.
pubspec.lock

View file

@ -0,0 +1,30 @@
# This file configures the static analysis results for your project (errors,
# warnings, and lints).
#
# This enables the 'recommended' set of lints from `package:lints`.
# This set helps identify many issues that may lead to problems when running
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
# style and format.
#
# If you want a smaller set of lints you can change this to specify
# 'package:lints/core.yaml'. These are just the most critical lints
# (the recommended set includes the core lints).
# The core lints are also what is used by pub.dev for scoring packages.
include: package:lints/recommended.yaml
# Uncomment the following section to specify additional rules.
# linter:
# rules:
# - camel_case_types
# analyzer:
# exclude:
# - path/to/excluded/files/**
# For more information about the core and recommended set of lints, see
# https://dart.dev/go/core-lints
# For additional information about configuring this file, see
# https://dart.dev/guides/language/analysis-options

View file

@ -1,6 +1,6 @@
builders: builders:
np_log: np_log_build:
import: "package:np_codegen/builder.dart" import: "package:np_codegen_build/builder.dart"
builder_factories: ["npLogBuilder"] builder_factories: ["npLogBuilder"]
# The `partId` argument to `SharedPartBuilder` is "some_cool_builder" # The `partId` argument to `SharedPartBuilder` is "some_cool_builder"
build_extensions: {".dart": [".np_log.g.part"]} build_extensions: {".dart": [".np_log.g.part"]}

View file

@ -1,5 +1,5 @@
import 'package:build/build.dart'; import 'package:build/build.dart';
import 'package:np_codegen/src/np_log_generator.dart'; import 'package:np_codegen_build/src/np_log_generator.dart';
import 'package:source_gen/source_gen.dart'; import 'package:source_gen/source_gen.dart';
Builder npLogBuilder(BuilderOptions options) => Builder npLogBuilder(BuilderOptions options) =>

View file

@ -1,6 +1,6 @@
import 'package:analyzer/dart/element/element.dart'; import 'package:analyzer/dart/element/element.dart';
import 'package:build/build.dart'; import 'package:build/build.dart';
import 'package:np_codegen/src/np_log_annotations.dart'; import 'package:np_codegen/np_codegen.dart';
import 'package:source_gen/source_gen.dart'; import 'package:source_gen/source_gen.dart';
/// Add a properly tagged logger to a class or extension /// Add a properly tagged logger to a class or extension

View file

@ -0,0 +1,25 @@
name: np_codegen_build
description: A starting point for Dart libraries or applications.
version: 1.0.0
# homepage: https://www.example.com
publish_to: none
environment:
sdk: '>=2.17.0 <3.0.0'
dependencies:
analyzer: '>=4.0.0'
build: ^2.3.1
np_codegen:
path: ../codegen
source_gen: ^1.2.6
dev_dependencies:
build_test: ^2.1.5
lints: ^2.0.0
test: ^1.16.0
code_gen_tester:
git:
url: https://github.com/rrousselGit/functional_widget
ref: v0.10.0
path: packages/code_gen_tester

View file

@ -1,5 +1,5 @@
import 'package:code_gen_tester/code_gen_tester.dart'; import 'package:code_gen_tester/code_gen_tester.dart';
import 'package:np_codegen/src/np_log_generator.dart'; import 'package:np_codegen_build/src/np_log_generator.dart';
import 'package:test/test.dart'; import 'package:test/test.dart';
// dummy class to free us from importing the actual logger library // dummy class to free us from importing the actual logger library