如何在Gradle中重命名项目而不是使用文件夹名称?

如何在Gradle中重命名项目而不是使用文件夹名称?

问题描述:

我们希望有各子项目被称为SDI-xxx和SDI-YYY所以当我们运行gradle这个日食它的.project正确生成Eclipse项目的名称,当我们建立它创建了一个名为SDI-XXXX一个jar文件。 jar和sid-yyyy.jar。我已经看到了这个地方,但在我的生活中,我无法在文档中找到它(文档非常庞大,我知道我在那里看到了它)。

We would like to have all subprojects be called sdi-xxx and sdi-yyy so when we run gradle eclipse it generates eclipse project names correctly in .project and when we build it creates a jar file with the name sdi-xxxx.jar and sid-yyyy.jar. I have seen this somewhere but for the life of me, I can't find it in the doc(that doc is huge and I know I saw it there somewhere).

感谢,
院长

settings.gradle:

settings.gradle:

prefixProjectName(rootProject, "sdi-")

def prefixProjectName(project, prefix) {
  project.name = prefix + project.name
  project.children.each { prefixProjectName(it, prefix) }
}