Hi,
Have a problem with the tooling api not exposing one of compile dependencies defined at the build.gradle file. A sample project can be found here - http://devnet.jetbrains.com/message/5488434#5488434. A program below illustrates the problem:
package org;
import java.io.File;
import org.gradle.tooling.GradleConnector; import org.gradle.tooling.ModelBuilder; import org.gradle.tooling.ProjectConnection; import org.gradle.tooling.model.idea.*;
public class TestClient {
private static final String PROJECT_PATH = “/home/denis/Downloads/test-web”;
private static final String GRADLE_HOME = “/home/denis/dev/gradle/gradle-1.6”;
public static void main(String[] args) throws InterruptedException {
GradleConnector connector = GradleConnector.newConnector();
connector.useInstallation(new File(GRADLE_HOME));
connector.forProjectDirectory(new File(PROJECT_PATH));
ProjectConnection connection = connector.connect();
ModelBuilder modelBuilder = connection.model(IdeaProject.class);
IdeaProject project = modelBuilder.get();
for (IdeaModule module : project.getModules()) {
System.out.println("module: " + module.getName());
for (IdeaDependency dependency : module.getDependencies()) {
if (dependency instanceof IdeaModuleDependency) {
System.out.println(" module dependency: " + ((IdeaModuleDependency)dependency).getDependencyModule().getName());
} else if (dependency instanceof IdeaSingleEntryLibraryDependency) {
System.out.println(" library dependency: " + ((IdeaSingleEntryLibraryDependency)dependency).getFile().getName());
}
}
}
connection.close();
} }
I.e. no dependency is listed here, only a single module.