使用 Gradle 在 IDE 之间切换

发布于 2025-01-13 15:33:21 字数 357 浏览 4 评论 0原文

假设我有以下顶级 Gradle 构建文件:

plugins {
   id "idea"
   //id "eclipse"
}

apply from: "${rootDir}/gradleInclude/intellij.gradle"
//apply from: "${rootDir}/gradleInclude/eclipse.gradle"

subprojects {
  apply plugin: "idea"
  //apply from: "${rootDir}/gradleInclude/eclipse.gradle"
}

可以使用单行/变量在 idea/intellij 和 eclipse 条目之间切换吗?

Say I have the following top-level Gradle build file:

plugins {
   id "idea"
   //id "eclipse"
}

apply from: "${rootDir}/gradleInclude/intellij.gradle"
//apply from: "${rootDir}/gradleInclude/eclipse.gradle"

subprojects {
  apply plugin: "idea"
  //apply from: "${rootDir}/gradleInclude/eclipse.gradle"
}

It is possible to use a single line/variable to toggle between the idea/intellij and eclipse entries?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

镜花水月 2025-01-20 15:33:21

刚刚做了以下事情:

def ide = 'eclipse'
def ideBuildFile = 'eclipse.gradle'
//def ide = 'idea'
//def ideBuildFile = 'intellij.gradle'

plugins {
   id "${ide}"
}

apply from: "${rootDir}/gradleInclude/${ideBuildFile}"

subprojects {
   apply plugin: "${ide}"
}

Just did the following:

def ide = 'eclipse'
def ideBuildFile = 'eclipse.gradle'
//def ide = 'idea'
//def ideBuildFile = 'intellij.gradle'

plugins {
   id "${ide}"
}

apply from: "${rootDir}/gradleInclude/${ideBuildFile}"

subprojects {
   apply plugin: "${ide}"
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文