Build script didn't work when building for the first time

Because the ItemGroup was evaluated before the compilation.