How to support multiple projects in multiple languages (Java and Scala) in Gradle?

后端 未结 1 756
伪装坚强ぢ
伪装坚强ぢ 2021-02-06 13:23

I am trying to convert our antiquated Ant build to Gradle. The project contains about Java 50 sub-projects and 10 Scala sub-projects. The Java projects only contain Java and t

相关标签:
1条回答
  • 2021-02-06 13:49

    How about something like this:

    configure(subprojects.findAll {project  ->
        file('src/main/java').exists()
    }) {
        apply plugin: 'java'
    }
    

    configure(subprojects.findAll {project  ->
        file('src/main/scala').exists()
    }) {
        apply plugin: 'scala'
    }
    

    Because your source directory is src, some other discriminator mechanism inside the closures is needed.

    0 讨论(0)
提交回复
热议问题