Skip to content

Commit

Permalink
version 0.3.1
Browse files Browse the repository at this point in the history
* updated analyzer dependency to ^5.2.0
* updated lints
  • Loading branch information
denniskaselow committed Jul 7, 2023
1 parent aabfc06 commit c9cebb9
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 24 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,10 @@
# Changelog

## 0.3.1
### Minor Changes
- fixed error in code example in README.md
- updated analyzer dependency to ^5.2.0

## 0.3.0
### Enhancements
- **BREAKING CHANGE:** generated code now creates a `processEntity` method with the
Expand Down
41 changes: 24 additions & 17 deletions analysis_options.yaml
Expand Up @@ -4,20 +4,18 @@ analyzer:
unused_import: error
unused_local_variable: error
dead_code: error
strong-mode:
implicit-casts: false
language:
strict-inference: true
strict-raw-types: true
strict-casts: true
# http://dart-lang.github.io/linter/lints/options/options.html
linter:
rules:
# http://dart-lang.github.io/linter/lints/options/options.html
- always_declare_return_types
- always_put_control_body_on_new_line
- always_put_required_named_parameters_first
- always_require_non_null_named_parameters
# - always_specify_types
# - always_use_package_imports
# - always_specify_types
# - always_use_package_imports
- annotate_overrides
- avoid_annotating_with_dynamic
- avoid_bool_literals_in_conditional_expressions
Expand All @@ -27,10 +25,10 @@ linter:
- avoid_double_and_int_checks
- avoid_dynamic_calls
- avoid_empty_else
# - avoid_equals_and_hash_code_on_mutable_classes
- avoid_equals_and_hash_code_on_mutable_classes
- avoid_escaping_inner_quotes
- avoid_field_initializers_in_const_classes
# - avoid_final_parameters
- avoid_final_parameters
- avoid_function_literals_in_foreach_calls
- avoid_implementing_value_types
- avoid_init_to_null
Expand All @@ -44,8 +42,6 @@ linter:
- avoid_relative_lib_imports
- avoid_renaming_method_parameters
- avoid_return_types_on_setters
- avoid_returning_null
- avoid_returning_null_for_future
- avoid_returning_null_for_void
- avoid_returning_this
- avoid_setters_without_getters
Expand All @@ -66,14 +62,17 @@ linter:
- cascade_invocations
- cast_nullable_to_non_nullable
- close_sinks
- collection_methods_unrelated_type
- combinators_ordering
- comment_references
- conditional_uri_does_not_exist
- constant_identifier_names
- control_flow_in_finally
- curly_braces_in_flow_control_structures
- dangling_library_doc_comments
- depend_on_referenced_packages
- deprecated_consistency
- deprecated_member_use_from_same_package
- diagnostic_describe_all_properties
- directives_ordering
- discarded_futures
Expand All @@ -87,23 +86,29 @@ linter:
- flutter_style_todos
- hash_and_equals
- implementation_imports
- iterable_contains_unrelated_type
- implicit_call_tearoffs
- implicit_reopen
- invalid_case_patterns
- join_return_with_assignment
- leading_newlines_in_multiline_strings
- library_annotations
- library_names
- library_prefixes
- library_private_types_in_public_api
- lines_longer_than_80_chars
- list_remove_unrelated_type
- literal_only_boolean_expressions
- matching_super_parameters
- missing_whitespace_between_adjacent_strings
- no_adjacent_strings_in_list
- no_default_cases
- no_duplicate_case_values
- no_leading_underscores_for_library_prefixes
- no_leading_underscores_for_local_identifiers
- no_literal_bool_comparisons
- no_logic_in_create_state
- no_runtimeType_toString
- no_self_assignments
- no_wildcard_variable_uses
- non_constant_identifier_names
- noop_primitive_operations
- null_check_on_nullable_type_parameter
Expand All @@ -127,13 +132,12 @@ linter:
- prefer_const_literals_to_create_immutables
- prefer_constructors_over_static_methods
- prefer_contains
# - prefer_double_quotes
- prefer_equal_for_default_values
# - prefer_double_quotes
- prefer_expression_function_bodies
- prefer_final_fields
- prefer_final_in_for_each
- prefer_final_locals
# - prefer_final_parameters
# - prefer_final_parameters
- prefer_for_elements_to_map_fromIterable
- prefer_foreach
- prefer_function_declarations_over_variables
Expand Down Expand Up @@ -165,23 +169,26 @@ linter:
- sized_box_shrink_expand
- slash_for_doc_comments
- sort_child_properties_last
# - sort_constructors_first
- sort_constructors_first
- sort_pub_dependencies
- sort_unnamed_constructors_first
- test_types_in_equals
- throw_in_finally
- tighten_type_of_initializing_formals
- type_annotate_public_apis
- type_init_formals
- type_literal_in_constant_pattern
- unawaited_futures
- unnecessary_await_in_return
- unnecessary_brace_in_string_interps
- unnecessary_breaks
- unnecessary_const
- unnecessary_constructor_name
# - unnecessary_final
# - unnecessary_final
- unnecessary_getters_setters
- unnecessary_lambdas
- unnecessary_late
- unnecessary_library_directive
- unnecessary_new
- unnecessary_null_aware_assignments
- unnecessary_null_aware_operator_on_extension_on_nullable
Expand Down
8 changes: 4 additions & 4 deletions lib/system_generator.dart
Expand Up @@ -23,11 +23,11 @@ class SystemGenerator extends GeneratorForAnnotation<Generate> {
final combineAspects = classConstructor.parameters.any(_isAspectParameter);
final objectValue = annotation.objectValue;
final baseClassType = objectValue.getField('base')!.toTypeValue()!;
final realBaseClassName = baseClassType.element2!.name;
final realBaseClassName = baseClassType.element!.name;
final isBaseClassEntityProcessingSystem =
realBaseClassName == 'EntityProcessingSystem';
final baseClassTypeParameters =
(baseClassType.element2! as ClassElement).typeParameters;
(baseClassType.element! as ClassElement).typeParameters;
final mapper = _getValues(objectValue, 'mapper');
final systems = _getValues(objectValue, 'systems');
final managers = _getValues(objectValue, 'manager');
Expand All @@ -39,7 +39,7 @@ class SystemGenerator extends GeneratorForAnnotation<Generate> {
final baseClassName =
shouldCreateCustomProcessEntity ? 'EntitySystem' : realBaseClassName;
final baseClassConstructor =
(annotation.read('base').typeValue.element2! as ClassElement)
(annotation.read('base').typeValue.element! as ClassElement)
.unnamedConstructor!;
final hasGeneratedAspects = allOfAspects.isNotEmpty ||
oneOfAspects.isNotEmpty ||
Expand Down Expand Up @@ -189,7 +189,7 @@ class SystemGenerator extends GeneratorForAnnotation<Generate> {

final parameters = [
...allOfAspects.map((e) => '$e ${_toVariableName(e)}'),
...oneOfAspects.map((e) => '$e? ${_toVariableName(e)}')
...oneOfAspects.map((e) => '$e? ${_toVariableName(e)}'),
].join(', ');
result.writeln(' void processEntity(int entity, $parameters);');
}
Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
@@ -1,13 +1,13 @@
name: dartemis_builder
description: A builder for use with dartemis to generate code that initializes EntitySystems and Managers.
version: 0.3.0
version: 0.3.1
homepage: https://github.com/denniskaselow/dartemis_builder

environment:
sdk: '>=2.17.0 <3.0.0'
sdk: '>=2.17.0 <4.0.0'

dependencies:
analyzer: ^5.0.0
analyzer: ^5.2.0
build: ^2.0.0
build_config: ^1.0.0
dartemis: ^0.9.0
Expand Down

0 comments on commit c9cebb9

Please sign in to comment.