My Gradle project is not including packages containing data and shaders

Hi gradlers :stuck_out_tongue:

I started learning Gradle few days ago, I really like it, especially the part about having nothing to do with XMLs :slight_smile:

I use Netbeans and after having installed the plugin, I followed a couple of tutorials with sample projects. Now I decided to implement it in a small project of mine.

You can find it here, it is a small project to load dds, dxgi and ktx texture in java. It is a port of the original gli.

But now I am stuck, because I see that when I build it, it does not copy under the build folder also my packages data, containing the textures for a simple test, and shaders, containing, unsurprisingly, shaders :expressionless:.

How can I solve it?

Edit: I found out I needed to move them under resources, now the question is, how do I reference them from src/main/java?

Anything under src/main/resources will ultimately end up packed inside the jar (or war) and be available at runtime on the classpath.

Eg: src/main/resources/foo/bar.txt can be accessed via getClass().getClassLoader().getResourceAsStream("/foo/bar.txt")

1 Like

Thanks @Lance_Java, it worked