Hey Alex, This could be a bug. Configuring the output dirs should be possible - check out this integ test: https://github.com/gradle/gradle/blob/master/subprojects/tooling-api/src/integTest/groovy/org/gradle/integtests/tooling/m5/ToolingApiIdeaModelCrossVersionSpec.groovy#L111
Cheers! On Thu, Mar 6, 2014 at 8:55 PM, Radim Kubacki <radim.kuba...@gradleware.com>wrote: > Hello Alex, > > I am not sure what you want to achieve / why you want to access these > values. What I think is the expected behavior here is: > > - no inheritOutputDirs or true creates .iml saying that output dirs are > inherited from project settings > - inheritOutputDirs set to false and no output dirs will tell IDEA to use > project specific output dirs and IDEA or user will set exact location > - inheritOutputDirs set to false and output dirs tells IDEA that this > module should use specific dirs for its outputs. > > IMO if you are looking for classes from some library inside your AS plugin > you should be able to query IJ API. And if they should be separated from > classes built by android project/library then set inheritOutputDirs to > false and optionally specify folders. > > -Radim > > > On Thu, Mar 6, 2014 at 7:44 PM, Alex Ruiz <alr...@google.com> wrote: > >> Greetings, >> >> In Android Studio we set up a Gradle-based Android project by first >> getting the structure of the project from Gradle (IDEA's infrastructure >> gets a org.gradle.tooling.model.idea.IdeaProject using the Gradle tooling >> API.) >> >> We currently have a problem when setting up Java-only library modules >> (non-Android.) The problem is that when we get an IdeaCompilerOutput from >> an IdeaModule, the output paths are null. The only way I can get it return >> a value is by adding this to a build.gradle file: >> >> apply plugin: 'idea' >> >> idea { >> module { >> inheritOutputDirs = false >> outputDir = file('muchBetterOutputDir') >> testOutputDir = file('muchBetterTestOutputDir') >> } >> } >> >> Even setting up the output path in the Gradle Java plug-in as follows: >> >> sourceSets.main.output.classesDir = file('muchBetterClassesDir') >> >> has no effect on IdeaCompilerOutput. >> >> Is this the expected behavior? I originally thought this was a bug, but >> if this the expected behavior, and given that there is no Java model (like >> the Android model the Android plug-in provides,) what would make more sense: >> 1. Us writing our own Java model (IntelliJ already has something like >> this and we could extend it,) >> or >> 2. Have this functionality provided by Gradle >> ? >> >> Many thanks in advance, >> -Alex >> >> > -- Szczepan Faber Principal engineer@gradle; Founder@mockito