I have a problem using gradle in intellij, maybe one of you have come across a solution and can help me. Intellij generates an “out” folder in a project when building. This gets generated in my assets folder, and the out folder contains compiled code, so all the assets are copied into it. And so when gradle builds the assets jar, it contains all the assets twice. I don’t know what I’m doing wrong. Here is the gradle.build:
Yes, it is intellij creating that folder. I think my problem was I would use the intellij build button “ctrl+F9” and I believe that does not use gradle build, even though the project is imported as a gradle. Every time I build using that, it creates an out folder in the assets folder, and an out folder in that assets folder, recursively… ended up with my assets.jar (when I used gradle build) being over 2gb and taking a few minutes to build… its always an issue with something between the monitor and the seat cushion. I will use the gradle build from now on and exclude the out folder from the build.
You got some explaining to do.
What do you actually want to do? Why do you manipulate like all sources with non convention paths?
Why do you do project specific configuration (“assets”) not in a build file in the assets project, as that would be the expected convention to do it.
why do you use some folder under build at all in the assets project?
Basically you would need two projects (and a pretty empty rootproject)
->one contains only the ressources and would create a jar with them, please read up on the conventions, using a simple apply plugin: ‘java’ should be enough to do this.
→ The second project references the first one via a dependency, and does a pretty normal java build as well.
That you are using idea should then be irrelevant, as no longer any path overlap with idea paths.
However since you kinda actually do not want two jars seperate as I understand it, but one jar with everything.
a simple java project with the assets at the right location should already do this.
How he has his project laid out looks like how we recommend in our examples. It’s a way of having an assets folder just like the SDK expects with no extra project file… which gradle is 10000% totally fine with.
It’s nice because it gives you a separate assets.jar just like the SDK would produce.
Thanks for the info. We’re trying to maintain compatibility with the SDK if we can, so someone could download the project and be able to build it in the sdk, minus our special gradle tasks. We do want two separate jars - one for assets and one for code. With gradle being so extensible, further down the road if the project becomes bigger we could break out the assets folder into more jars, so they can be updated individually. If the game is updated through for example, steam, the user would not have a large download every time.