Nunes D.
Nunes D.

Reputation: 213

How to exclude a file from the assets folder only for release buildType?

How to exclude a file from the assets folder only for release buildType. Imagine the following scenario:

I have a lot a json strings under the assets folder, with names like string_1.json, string_2.json, string_3.json

With the following snippet I can remove all files.

(gradle snippet)

aaptOptions {
    ignoreAssetsPattern "!*.json"
}

The problem is I want to keep some and remove some of them. For example, I want to keep string_2.json

Does the ignoreAssetsPattern has something for exclusions?

(Also this snippet will remove both for debug and release. Any help will be appreciated)

Upvotes: 1

Views: 3161

Answers (1)

dtx12
dtx12

Reputation: 4488

You may add additional dir with assets for your debug build for example where this file contains while release build won't have this dir.

Upvotes: 2

Related Questions