Ice Gradle Plugin

in Help Center
I'm attempting to use the ICE Builder for Gradle (https://github.com/zeroc-ice/ice-builder-gradle). My slice files have includes for other slice files. They are in the same directory, but I cannot figure out how to pass the include directory to the gradle plugin.
Here is my basic gradle.build
And the error I get is:
The README doc on the Ice Builder describes the "slice" and "java" blocks where to put arguments and includes, but I cannot figure out where to put this in my rudimentary gradle script.
I realize this is something that is a result of not knowing gradle, but maybe if you could put a full very simple example up on the ice-builder-gradle github that would be helpful to others. The gradle scripts that come with Ice-Demos is quite in depth and includes sub projects.
Any help very much appreciated.
Here is my basic gradle.build
group 'co.xxx.yyy' version '1.0-SNAPSHOT' apply plugin: 'java' repositories { mavenCentral() } dependencies { testCompile group: 'junit', name: 'junit', version: '4.11' } buildscript { repositories { maven { url 'https://repo.zeroc.com/nexus/content/repositories/releases' } } dependencies { classpath group: 'com.zeroc.gradle.ice-builder', name: 'slice', version: '1.0.3' } } apply plugin: "com.zeroc.gradle.ice-builder.slice"
And the error I get is:
4:10:28 PM: Executing external task 'compileSlice'... :compileSlice ... error: Can't open include file "myslicefile.ice" #include <myinclude.ice> 1 error in preprocessor.
The README doc on the Ice Builder describes the "slice" and "java" blocks where to put arguments and includes, but I cannot figure out where to put this in my rudimentary gradle script.
I realize this is something that is a result of not knowing gradle, but maybe if you could put a full very simple example up on the ice-builder-gradle github that would be helpful to others. The gradle scripts that come with Ice-Demos is quite in depth and includes sub projects.
Any help very much appreciated.
0
Comments
The Ice minimal demo contains a simple Gradle build system which should help you get started.
Cheers,
Joe
Rick
I get the following error out of the plugin
Any help appreciated
Yes, I'm trying to use Gradle integration in IntelliJ IDEA. The default for the Ice Builder for Gradle is to put generated code in the output (build) directory, which I find a touch confusing. I think if the generated code would go to a source directory outside the build folders, you can use IntelliJ to mark the folder as "generated root", and then the IDE can find that code as a dependency directly in the project. Just a thought.
But anyway, I can't figure out how to change the output behavior of the ICE gradle plugin because of that error I listed above. I appreciate you replying.
Rick
This seems to be a bug in the builder. As a temporary workaround, can you try creating the "build" directory (${projectDir}/build) manually.
Cheers,
Joe
I think my issue is being lost in translation... By default, the ICE Gradle builder outputs the generated code to the build folder, and that seems to work as expected (and it will create the build folder after a clean by the way).
What I desire is to target the output of slice2java to a different folder. Something like src\generated, then I can market that folder as a generated-root in IDEA. I can't get the Grade Plugin to target this non-default folder without an error.
Thanks for your efforts-
Rick
The builder expects to store dependency data in the "build" folder, which by default is where it also stores generated java files. However, there is a bug which causes the builder to crash if the build directory does not exist and you change the output directory to not be inside the build directory.
As a temporary fix you should be able to just manually create the "build" directory. Your generated code should then end up in the right place.
Cheers,
Joe
We've published a new version of Ice Builder for Gradle (v1.0.5) to address this issue. Please let me know if this resolves your problem.
Cheers,
Joe
Thanks a ton, I believe this is working properly now.
Rick