From 7157cdcf08e359efbb653fee2f26361d32d92d6c Mon Sep 17 00:00:00 2001 From: Koen Van Looveren Date: Sat, 13 Jun 2020 09:29:37 +0200 Subject: [PATCH] Added analyzer & fixed the analyzer issues --- .../lib/src/injector_generator.dart | 6 +-- tool/kiwi_analyze.sh | 39 +++++++++++++++++++ tool/kiwi_build.sh | 8 ++-- 3 files changed, 46 insertions(+), 7 deletions(-) create mode 100755 tool/kiwi_analyze.sh diff --git a/kiwi_generator/lib/src/injector_generator.dart b/kiwi_generator/lib/src/injector_generator.dart index 9269461..6465428 100644 --- a/kiwi_generator/lib/src/injector_generator.dart +++ b/kiwi_generator/lib/src/injector_generator.dart @@ -84,9 +84,9 @@ class InjectorGenerator extends Generator { final DartType concrete = registerObject.getField('from').toTypeValue(); final DartType concreteType = concrete ?? type; - final String className = concreteType.name; + final String className = concreteType.getDisplayString(); final String typeParameters = - concrete == null ? '' : '<${type.name}, $className>'; + concrete == null ? '' : '<${type.getDisplayString()}, $className>'; final String nameArgument = name == null ? '' : ", name: '$name'"; final String constructorName = @@ -140,7 +140,7 @@ class InjectorGenerator extends Generator { ) { final String name = resolvers == null ? null : resolvers[parameter.type]; final String nameArgument = name == null ? '' : "'$name'"; - return '${parameter.isNamed ? parameter.name + ': ' : ''}c<${parameter.type.name}>($nameArgument)'; + return '${parameter.isNamed ? parameter.name + ': ' : ''}c<${parameter.type.getDisplayString()}>($nameArgument)'; } Map _computeResolvers( diff --git a/tool/kiwi_analyze.sh b/tool/kiwi_analyze.sh new file mode 100755 index 0000000..df45622 --- /dev/null +++ b/tool/kiwi_analyze.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +cd .. + +echo "" +echo "===========================" +echo "example analyze" +echo "---------------------------" +cd example +flutter analyze +echo "===========================" +cd .. + +echo "" +echo "===========================" +echo "flutter_example analyze" +echo "---------------------------" +cd flutter_example +flutter analyze +echo "===========================" +cd .. + +echo "" +echo "===========================" +echo "kiwi analyze" +echo "---------------------------" +cd kiwi +flutter analyze +echo "===========================" +cd .. + +echo "" +echo "===========================" +echo "kiwi_generator analyze" +echo "---------------------------" +cd kiwi_generator +flutter analyze +echo "===========================" +cd .. diff --git a/tool/kiwi_build.sh b/tool/kiwi_build.sh index ca3b741..a6fcf28 100755 --- a/tool/kiwi_build.sh +++ b/tool/kiwi_build.sh @@ -4,7 +4,7 @@ cd .. echo "" echo "===========================" -echo "example format lib" +echo "example build_runner build" echo "---------------------------" cd example flutter packages pub run build_runner build --delete-conflicting-outputs @@ -13,7 +13,7 @@ cd .. echo "" echo "===========================" -echo "flutter_example format lib" +echo "flutter_example build_runner build" echo "---------------------------" cd flutter_example flutter packages pub run build_runner build --delete-conflicting-outputs @@ -22,7 +22,7 @@ cd .. echo "" echo "===========================" -echo "kiwi format lib" +echo "kiwi build_runner build" echo "---------------------------" cd kiwi echo "Nothing to generate here" @@ -31,7 +31,7 @@ cd .. echo "" echo "===========================" -echo "kiwi_generator format lib" +echo "kiwi_generator build_runner build" echo "---------------------------" cd kiwi_generator flutter packages pub run build_runner build --delete-conflicting-outputs