Support monorepo builds by forking the build.gradle into two files#49
Support monorepo builds by forking the build.gradle into two files#49DanielJette merged 1 commit intomasterfrom
Conversation
|
|
||
| apply plugin: 'java' | ||
| apply plugin: 'maven' | ||
| apply plugin: 'com.jfrog.bintray' |
There was a problem hiding this comment.
Should this and the bintray block below be moved to the original build.gradle file?
There was a problem hiding this comment.
No, not necessary. We have the bintray artifacts already defined in the monorepo classpath. https://github.com/Shopify/android/blob/master/build.gradle#L447
Leaving this here allows us to publish from the monorepo, if we desire
There was a problem hiding this comment.
I'm more thinking for third party users of this lib? More like thinking if some other random project pulls this in as a submodule and doesn't have bintray 8000 setup. Probably not a real issue given that no one has posted an issue about this.
There was a problem hiding this comment.
Well, if you don't do anything special, you'd never know there were two files. This is only valuable to us, in our monorepo configuration, because of the way we support custom gradle file names. For us to even use this, I'll have to open a PR pointing to the new file.
Shopify in the android repo will soon be split into two modules (app and core) but the
graphql_java_gensupport module is not compatible with this configurationWe are getting the following error:
The reason for this is the
dependenciesblock in thebuild.gradle. When building the support library on its own, this is a valid construct. However, when part of the monorepo, the supportbuild.gradlefile is included as a submodule and the dependency resolution strategy on modern gradle versions does not allow for submodules to modify the classpath.So, my solution is simple. Remove the unsupported
dependencystatement and move the remaining contents of the build.gradle file into a newgraphql.java.gen.build.gradlefile. This new file will be referenced by the monorepo. Then, create a simple stubbuild.gradlethat continues to reference thebintraydependency and then includes the new file.