From 1b4df63694593235b3f6a056afe7fa2499f6053c Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Sat, 20 Jul 2019 23:10:58 +0200 Subject: [PATCH 1/2] Actually support analyzer 0.37 in moor_generator --- moor_generator/CHANGELOG.md | 5 ++++- moor_generator/lib/src/parser/table_parser.dart | 7 ++----- moor_generator/pubspec.yaml | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/moor_generator/CHANGELOG.md b/moor_generator/CHANGELOG.md index 78ac339c..ec4ece73 100644 --- a/moor_generator/CHANGELOG.md +++ b/moor_generator/CHANGELOG.md @@ -1,6 +1,9 @@ -## 1.6.0+1 +## 1.6.0+2 - Generate code to expand array variables +_The +1 release has no changes to 1.6.0, there were issues while uploading to pub. +2 fixes +delivers on the promise of supporting the analyze 0.37_ + ## 1.5.0 - Parse custom queries and write generated mapping code. - Refactorings and minor improvements in the generator diff --git a/moor_generator/lib/src/parser/table_parser.dart b/moor_generator/lib/src/parser/table_parser.dart index 678b191f..34aaf361 100644 --- a/moor_generator/lib/src/parser/table_parser.dart +++ b/moor_generator/lib/src/parser/table_parser.dart @@ -87,10 +87,7 @@ class TableParser extends ParserBase { final parsedPrimaryKey = {}; if (expression is SetOrMapLiteral) { - // todo replace with just "elements" when dropping support for analyzer - // 0.35.0 - // ignore: deprecated_member_use - for (var entry in expression.elements2) { + for (var entry in expression.elements) { if (entry is Identifier) { final column = columns .singleWhere((column) => column.dartGetterName == entry.name); @@ -98,7 +95,7 @@ class TableParser extends ParserBase { } else { // Don't add an error, these features aren't on a stable dart release // yet. - print('Unexpected entry in expression.elements2: $entry'); + print('Unexpected entry in expression.elements: $entry'); } } } else { diff --git a/moor_generator/pubspec.yaml b/moor_generator/pubspec.yaml index 8f992d7c..ff2799d9 100644 --- a/moor_generator/pubspec.yaml +++ b/moor_generator/pubspec.yaml @@ -1,6 +1,6 @@ name: moor_generator description: Dev-dependency to generate table and dataclasses together with the moor package. -version: 1.6.0+1 +version: 1.6.0+2 repository: https://github.com/simolus3/moor homepage: https://moor.simonbinder.eu/ issue_tracker: https://github.com/simolus3/moor/issues @@ -12,7 +12,7 @@ environment: sdk: '>=2.2.0 <3.0.0' dependencies: - analyzer: '>=0.35.2 <0.38.0' + analyzer: '>=0.36.0 <0.38.0' recase: ^2.0.1 built_value: '>=6.3.0 <7.0.0' source_gen: ^0.9.4 From 364e3f0c1a2cba91e0ea68305c24747fa240c7b2 Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Thu, 3 Oct 2019 15:39:32 +0200 Subject: [PATCH 2/2] Release moor 2.0 --- moor/pubspec.yaml | 2 +- moor/tools/analyzer_plugin/pubspec.yaml | 2 +- moor_generator/CHANGELOG.md | 5 +++++ moor_generator/pubspec.yaml | 3 ++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/moor/pubspec.yaml b/moor/pubspec.yaml index 46602c29..496519cc 100644 --- a/moor/pubspec.yaml +++ b/moor/pubspec.yaml @@ -19,7 +19,7 @@ dependencies: pedantic: ^1.0.0 dev_dependencies: - moor_generator: ^1.7.0 + moor_generator: ^2.0.0 build_runner: '>=1.3.0 <2.0.0' build_test: ^0.10.8 test: ^1.6.4 diff --git a/moor/tools/analyzer_plugin/pubspec.yaml b/moor/tools/analyzer_plugin/pubspec.yaml index 5c1de820..fea3f18d 100644 --- a/moor/tools/analyzer_plugin/pubspec.yaml +++ b/moor/tools/analyzer_plugin/pubspec.yaml @@ -3,7 +3,7 @@ version: 1.0.0 description: This pubspec is a part of moor and determines the version of the moor analyzer to load dependencies: - moor_generator: + moor_generator: ^2.0.0 web_socket_channel: ^1.0.15 # These overrides are only needed when working on the plugin with useDebuggingVariant = false (not recommended) diff --git a/moor_generator/CHANGELOG.md b/moor_generator/CHANGELOG.md index 37971e78..0aca29d3 100644 --- a/moor_generator/CHANGELOG.md +++ b/moor_generator/CHANGELOG.md @@ -1,3 +1,8 @@ +## 2.0.0 +- Rewritten generator with looser coupling to the build package +- Implementation of an SQL IDE as analyzer plugin +- Support `sqlparser` 0.3.0 and updated grammar for `moor` files + ## 1.7.1 - Drop support for analyzer versions `<0.36.4`. They weren't supported in version 1.7.0 either, but the `pubspec.yaml` did not specify this correctly. diff --git a/moor_generator/pubspec.yaml b/moor_generator/pubspec.yaml index c2447136..336a58ca 100644 --- a/moor_generator/pubspec.yaml +++ b/moor_generator/pubspec.yaml @@ -24,7 +24,8 @@ dependencies: build_config: '>=0.3.1 <1.0.0' moor: ^2.0.0 meta: ^1.1.0 - sqlparser: ^0.2.0 + path: ^1.6.0 + sqlparser: ^0.3.0 dev_dependencies: test: ^1.6.0 test_core: ^0.2.0