Import a Gradle script from the root into subprojects

后端 未结 1 1419
不知归路
不知归路 2021-02-19 13:12

I want to do an \'apply from: ./gradle/script/common.gradle\' in my root build.gradle and have it be available to all of my subprojects.

I\'ve tried putting the apply i

相关标签:
1条回答
  • 2021-02-19 13:30

    In your root build.gradle.:

    allprojects { // or: subprojects { ... }
        apply from: "gradle/script/common.gradle"
    }
    

    Should you ever need an absolute path to such a script, you can always do "$rootProject.projectDir/gradle/script/common.gradle".

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