03-06-2020, 03:40 PM
Sorry for the long delay. I just finally got around to testing it, and it does seem to work correctly on my end (using the 0.6 version of Ludii, and the matching version of the LudiiExampleAI repo, as they are currently available).
In the Project Structure > Modules setting of IntelliJ, where I added the Ludii.jar file as a dependency, I unticked the "Export" checkbox, and I set the Scope of the dependency to "Provided". I'm not sure if both of these are required, or just one... I'm not really an IntelliJ expert. Anyway, I took these steps because I wanted to ensure that the built JAR file would only include classes from the LudiiExampleAI repo, and would not include any of the classes from Ludii itself. These steps seemed to accomplish this, but I suppose the same is possible by directly tweaking things in the Project Structure > Artifacts menu. The Output Layout should really just contain the 'LudiiExampleAI' compile output (plus any non-Ludii dependencies that your custom AIs may have).
A JAR file built in this way (it should be a really small one, just 16kB here for the current LudiiExampleAI code) works just fine.
If I launch Ludii.jar, and then try to load the same Ludii.jar file itself again as a provider of third-party AIs, this does indeed cause some errors. So the same probably happens if you directly include all of the Ludii.jar contents in the new JAR you build. I'll see if this can be fixed for the next version...
In the Project Structure > Modules setting of IntelliJ, where I added the Ludii.jar file as a dependency, I unticked the "Export" checkbox, and I set the Scope of the dependency to "Provided". I'm not sure if both of these are required, or just one... I'm not really an IntelliJ expert. Anyway, I took these steps because I wanted to ensure that the built JAR file would only include classes from the LudiiExampleAI repo, and would not include any of the classes from Ludii itself. These steps seemed to accomplish this, but I suppose the same is possible by directly tweaking things in the Project Structure > Artifacts menu. The Output Layout should really just contain the 'LudiiExampleAI' compile output (plus any non-Ludii dependencies that your custom AIs may have).
A JAR file built in this way (it should be a really small one, just 16kB here for the current LudiiExampleAI code) works just fine.
If I launch Ludii.jar, and then try to load the same Ludii.jar file itself again as a provider of third-party AIs, this does indeed cause some errors. So the same probably happens if you directly include all of the Ludii.jar contents in the new JAR you build. I'll see if this can be fixed for the next version...