On Tue, Jun 10, 2014 at 8:07 PM, Alex Ruiz <alr...@google.com> wrote:

> Thanks a lot for the responses!
>
> Here are some comments:
>
> 1. We are obtaining buildDir from a custom model that IDEA applies to
> projects using --init-script when importing a project. I agree that writing
> models is easy, because I made the modifications to that model. The problem
> is that seems not reliable on Windows 8.1 (according to reports.)
>

Can you try to narrow down why this is not working properly and fix this
IDEA model? What if we fall into the same problem?


> 2. The Android Gradle plug-in provides a model that exposes "buildDir."
> The issue are projects that are not Android projects: 1. Java library
> projects and 2. The top-level project
>

Right, that makes sense.


> 3. It is already non-trivial to create Android applications, asking users
> to add yet another plug-in to their build files, just to obtain "buildDir"
> seems an overkill.
>

Just add this plugin in another init script. You do not have to tell people
to put it into their project nor to distribute it through some central
repository.

>
> Ideally, #1 would work, but unfortunately, doesn't. GradleProject, or even
> better, BasicGradleProject seem to be the natural home for this property.
>
> I agree but it can lock you to 2.1 or 2.0 in the best.


> The reason we need to get to buildDir is that in this directory is where
> we have the "exploded" AAR files (Android archives, like jars but with
> Android-specific information.) All the common libraries are expanded there,
> and that folder, inside buildDir, needs to be not-excluded.
>

You are looking for "exploded AAR" in non-Android projects? Interesting.

>
> Regards,
> -Alex
>
>
>
> On Tue, Jun 10, 2014 at 9:31 AM, Radim Kubacki <
> radim.kuba...@gradleware.com> wrote:
>
>> Hi,
>>
>> generally I'd agree with Magnus. You can use your own model for this
>> purpose. There is at least one big advantage to this: your model can work
>> with older Gradle releases. I think if we add this to GradleProject we
>> won't be able to adapt instances obtained from older providers to give you
>> that information.
>>
>> I'd like to see that information available for example to implement
>> http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-queries/org/netbeans/spi/queries/SharabilityQueryImplementation.html
>> in NetBeans plugin). Adding this to BasicGradleProject can be OK. It seems
>> simple enough and we want to keep its related model ligthweight.
>>
>> Some other comments below.
>>
>> On Tue, Jun 10, 2014 at 4:37 PM, Alex Ruiz <alr...@google.com> wrote:
>>
>>> Greetings,
>>>
>>> We recently discovered a bug in Android Studio we need to "unexclude"
>>> (in IDEA terminology) some folders inside the "buildDir" folder in the
>>> top-level project. The problem is that the Gradle model APIs do not expose
>>> the location of "buildDir".
>>>
>>> I am not sure why you need to do this. Can you be more specific?
>>
>>
>>> Would it be possible to add "getBuildDir"
>>> to org.gradle.tooling.model.GradleProject for Gradle 2.0? pretty please?
>>> :-) Having this information will solve this and another related issues
>>> (that we discovered a few days ago.)
>>>
>>> Or is there another way to obtain this information?
>>>
>>> I'm so sorry for the last-minute request, we were obtaining this
>>> information from an IDEA model, but it seems that this is not reliable,
>>> according to user reports.
>>>
>>
>>
>> http://www.gradle.org/docs/release-candidate/javadoc/org/gradle/tooling/model/idea/IdeaModule.html#getCompilerOutput()
>> doesn't return $project.buildDir It only returns values that can be
>> customized as shown in
>> http://www.gradle.org/docs/release-candidate/dsl/org.gradle.plugins.ide.idea.model.IdeaModule.html
>> It means if you want to know where are classes compiled by IDEA stored it
>> can be better to query IDEA project APIs directly. If you need to know
>> where Gradle puts output files you need this API.
>>
>> Perhaps if you can point us to your bug reports we can find some good way
>> how to solve this.
>>
>> -Radim
>>
>>>
>>> Many thanks,
>>> -Alex
>>>
>>
>>
>

Reply via email to