kknd22
(Chris L)
November 12, 2015, 4:32am
1
Continuing the discussion from How do I include buildscript block from external gradle script? :
I have a feeling the Immo’s second solution will have the same issue as the OP’s; the project properties will not be available. I’d really like to separate the buildscript block into a reusable file.
Better yet I’d like an easy way to reuse gradle scripts over different projects as we have many builds that are basically just copy after copy of the same or very similar gradle files… I prefer scripts to plugins as the DSL is familiar and more clear to me.
I’ve packaged up scripts into a commonBuild.jar and then the buildscript grabs that file from an enterprise Ivy repo and then I can apply files from the commonBuild.jar, but it still feels harder / messier than it should be.
I used the above strategy and made it work - HOWEVER, if you use the init.gradle approach, then you are unable to import the project into intellij ! During importing project into intellij, it hijack the init.gradle and override it with its own init.gradle!!! woops