Build: findAssets can't find files outside of lib/ folder for aggregate builders

Created on 4 Sep 2019  路  3Comments  路  Source: dart-lang/build

Hey there!

I'm trying to create an aggregate builder, but it appears that I can't find any asset but pubspec.* outside lib/ folder, regardless of what this test says.

I've created a minimal reproduction repository with the exact same code as the test pointed above, but the output is empty! https://github.com/comigor/repro_aggregate_builder

Is there any other configuration that need to be done to work with $lib$ synthetic input?

Most helpful comment

That's good to know! Thanks for pointing this to me!

All 3 comments

Okay, answering my own question (after taking a look at the code): you need to explicitly whitelist the folders you want to be processed on build.yaml file:

targets:
  $default:
    sources:
      - lib/**
      - data/**

If you don't do this, by default it will consider only some inputs.

Correct, this is to avoid accidentally including build output directories and hidden directories etc. Fwiw we derived the default include list from the package layout conventions page (to be clear it is fine if you use other directories, it will just require explicit config as you discovered).

That's good to know! Thanks for pointing this to me!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jakemac53 picture jakemac53  路  7Comments

greglittlefield-wf picture greglittlefield-wf  路  4Comments

kentcb picture kentcb  路  7Comments

atreeon picture atreeon  路  3Comments

Tokenyet picture Tokenyet  路  8Comments