Bernhard
10/02/2024, 10:12 AMresources.srcDir(tasks.named<CombineJsonFiles>("combineJsonFiles"))
but I'm getting a Task with name 'combineJsonFiles' not found in root project 'pfrpg2eKingdomCampingWeather'.Javier
10/02/2024, 10:34 AMresources.srcDir(tasks.withType<CombineJsonFiles>())
Does it work?
If this last is working, probably you are calling register
after named
and that is the reason it is not found.Bernhard
10/02/2024, 10:34 AMJavier
10/02/2024, 10:35 AMJavier
10/02/2024, 10:36 AMnamed { }
would work, it was added recentlyJavier
10/02/2024, 10:36 AMresources.srcDir(tasks.named { it == "combineJsonFiles" })
Bernhard
10/02/2024, 10:37 AMJavier
10/02/2024, 10:40 AMBernhard
10/02/2024, 10:47 AMBernhard
10/02/2024, 10:48 AMBernhard
10/02/2024, 10:52 AMVampire
10/02/2024, 11:06 AMwithType<...>()
before doing named { ... }
.
But be careful.
.named { ... }
does not work like advertised yet.
If not combined with configureEach { ... }
it will break task-configuration avoidance, in your case for each and every task, if combined with withType
just for all tasks of that type.
Better register the task first and then give the returned task provider to srcDir
, then you are on the safe side.Bernhard
10/02/2024, 11:11 AM