Is it possible to set up a gradle project with more than 2 levels?

前端 未结 4 962
青春惊慌失措
青春惊慌失措 2020-12-14 06:19

We have been using gradle for about a year and have been somewhat successful with it. A number of features are still a little opaque, but we are getting there. I am not sure

4条回答
  •  抹茶落季
    2020-12-14 06:48

    Kotlin version of settings.gradle.kts

    fileTree(".") {
        include("**/build.gradle")
        include("**/build.gradle.kts")
        exclude("buildSrc/**")
        exclude("build.gradle.kts")
    }.map {
        relativePath(it.parent)
            .replace(File.separator, ":")
    }.forEach {
        include(it)
    }
    

    Instead of adding it manually like this (like Intellij Idea suggests):

    include("modules:core")
    findProject(":modules:core")?.name = "core"
    

提交回复
热议问题