Search in sources :

Example 11 with GradleProject

use of org.gradle.tooling.model.GradleProject in project intellij-community by JetBrains.

the class GradleProjectResolverUtil method getModuleId.

@NotNull
public static String getModuleId(@NotNull ProjectResolverContext resolverCtx, @NotNull IdeaModule gradleModule) {
    GradleProject gradleProject = gradleModule.getGradleProject();
    String gradlePath = gradleProject.getPath();
    String compositePrefix = "";
    if (gradleModule.getProject() != resolverCtx.getModels().getIdeaProject()) {
        if (!StringUtil.isEmpty(gradlePath) && !":".equals(gradlePath)) {
            compositePrefix = gradleModule.getProject().getName();
        }
    }
    return compositePrefix + getModuleId(gradlePath, gradleModule.getName());
}
Also used : BasicGradleProject(org.gradle.tooling.model.gradle.BasicGradleProject) GradleProject(org.gradle.tooling.model.GradleProject) NotNull(org.jetbrains.annotations.NotNull)

Example 12 with GradleProject

use of org.gradle.tooling.model.GradleProject in project gradle by gradle.

the class FetchIncludedGradleProjects method execute.

@Override
public List<GradleProject> execute(BuildController controller) {
    List<GradleProject> projects = new ArrayList<GradleProject>();
    GradleBuild build = controller.getBuildModel();
    for (GradleBuild includedBuild : build.getIncludedBuilds()) {
        projects.add(controller.getModel(includedBuild, GradleProject.class));
    }
    return projects;
}
Also used : ArrayList(java.util.ArrayList) GradleProject(org.gradle.tooling.model.GradleProject) GradleBuild(org.gradle.tooling.model.gradle.GradleBuild)

Aggregations

GradleProject (org.gradle.tooling.model.GradleProject)12 NotNull (org.jetbrains.annotations.NotNull)5 File (java.io.File)4 GradleModuleModel (com.android.tools.idea.gradle.project.model.GradleModuleModel)3 GradleScript (org.gradle.tooling.model.gradle.GradleScript)3 IdeaModule (org.gradle.tooling.model.idea.IdeaModule)3 IdeaProject (org.gradle.tooling.model.idea.IdeaProject)3 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 GradleBuild (org.gradle.tooling.model.gradle.GradleBuild)2 BasicIdeaProject (org.gradle.tooling.model.idea.BasicIdeaProject)2 BuildScriptClasspathModel (org.jetbrains.plugins.gradle.model.BuildScriptClasspathModel)2 AndroidProject (com.android.builder.model.AndroidProject)1 NativeAndroidProject (com.android.builder.model.NativeAndroidProject)1 Variant (com.android.builder.model.Variant)1 ImportedModule (com.android.tools.idea.gradle.ImportedModule)1 GradleFacet (com.android.tools.idea.gradle.project.facet.gradle.GradleFacet)1 AndroidModuleModel (com.android.tools.idea.gradle.project.model.AndroidModuleModel)1 NdkModuleModel (com.android.tools.idea.gradle.project.model.NdkModuleModel)1 Facets.createAndAddGradleFacet (com.android.tools.idea.testing.Facets.createAndAddGradleFacet)1