Hi !
If you are impatient you could do it by using a custom model :-) It's not that 
hard (check out the tooling-api samples with the all distribution).
I've done something related for a groovy/gradle plugin for Light 
Table.Highlights:1. Created a simple plugin project 
(https://github.com/rundis/generic-gradle-model)2. Add dependency to plugin 
from my project using the tooling-api 3. Retrieve custom model through tooling 
api, apply the custom plugin through a init script (see sample code below)4. 
Enjoy retrieving the richness of the gradle project model to you hearts desire 
! :-)

Get modelthis.genericModel = con.action(new GetGenericModelAction())            
                .withArguments("--init-script", new 
File("lib/lt-project-init.gradle").absolutePath)                            
.addProgressListener(listener)                            .run()
private static class GetGenericModelAction implements Serializable, 
BuildAction<GenericModel> {        @Override        GenericModel 
execute(BuildController controller) {            
controller.getModel(GenericModel)        }    }

Sample init script:initscript {    repositories {        maven {            url 
'http://dl.bintray.com/rundis/maven'        }    }    dependencies { classpath 
"no.rundis.gradle:generic-gradle-model:0.0.1" }}allprojects {    apply plugin: 
org.gradle.tooling.model.generic.GenericGradleModelPlugin}


cheersMagnus


Date: Tue, 10 Jun 2014 07:37:14 -0700
From: alr...@google.com
To: dev@gradle.codehaus.org
Subject: [gradle-dev] Little feature request: "getBuildDir" in GradleProject

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".

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.

Many thanks,-Alex                                         

Reply via email to