0

I am currently accessing the assets directory for a project as follows (where it has type Project):

SourceDirectorySet resources = it.sourceSets.main.resources
File file = resources.srcDirs.find { it.name == "assets" }
if (file != null) { ... }

Is this guaranteed to be correct? Or is there a better way (probably through android)?

Alexey Romanov
  • 167,066
  • 35
  • 309
  • 487

1 Answers1

0

In fact the code in the question doesn't work correctly. Instead I needed

it.android.sourceSets.main.assets
Alexey Romanov
  • 167,066
  • 35
  • 309
  • 487