Determine if a project is a Gradle Project

Answered

The framework my plugin supports recently changed from using Ant to Gradle. For a while I need to support legacy projects. So I want to detect if the project is a Gradle project or not. I found this snippet in org/jetbrains/plugins/gradle/execution/GradleConsoleFilterProvider.java:59

boolean isGradleProject() {
return !GradleSettings.getInstance(project).getLinkedProjectsSettings().isEmpty();
}

Is that the best methodology for determining if a project is a gradle based project?

3 comments
Comment actions Permalink

Yes, and/or

ExternalSystemApiUtil.isExternalSystemAwareModule(GradleConstants.SYSTEM_ID, module)
2
Comment actions Permalink

Hi Yann Cebron, this didn't work for me. My Gradle project returns true when I check for the module using the code you provided. I have used the following project - https://github.com/jitpack/gradle-simple

0
Comment actions Permalink

Please create a new thread and provide the actual code you're using, ideally a link to your plugin's full sources and not snippets. Thanks.

0

Please sign in to leave a comment.