# We run drift's builder in two different configurations on this package. The
# default configuration (in the `$default`) package applies a range of
# recommended builder options that are unlikely to cause problems.
# For additional testing, the version of drift_dev generating the custom tables
# file has `store_date_time_values_as_text` build option enabled.
# This way, we get to write integration tests for both date time modes.

targets:
  $default:
    sources:
      exclude:
        # Exlude sources used for the drift-file based generation source
        - "test/generated/custom_tables.dart"
        - "test/generated/data_classes.dart"
        - "test/generated/tables.drift*"
    builders:
      drift_dev:
        options:
          override_hash_and_equals_in_result_sets: true
          use_column_name_as_json_key_when_defined_in_moor_file: true
          write_from_json_string_constructor: true
          raw_result_set_data: true
          named_parameters: true
          fatal_warnings: true
          sql:
            dialect: sqlite
            options:
              version: "3.37"
              modules:
                - json1
                - fts5
      build_web_compilers:entrypoint:
        generate_for:
          - "web/drift_worker.dart"
        options:
          compiler: dart2js

  custom:
    auto_apply_builders: false
    sources:
     - "test/generated/custom_tables.dart"
     - "test/generated/data_classes.dart"
     - "test/generated/tables.drift*"
    builders:
      drift_dev:
        options:
          fatal_warnings: true
          store_date_time_values_as_text: true
          # Dart doesn't support YAML merge tags yet, https://github.com/dart-lang/yaml/issues/121
          override_hash_and_equals_in_result_sets: true
          use_column_name_as_json_key_when_defined_in_moor_file: true
          write_from_json_string_constructor: true
          raw_result_set_data: true
          named_parameters: true
          sql:
            dialect: sqlite
            options:
              version: "3.37"
              modules:
                - json1
                - fts5
