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?
Please sign in to leave a comment.
Yes, and/or
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
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.