-
Notifications
You must be signed in to change notification settings - Fork 40
Support monorepo builds by forking the build.gradle into two files #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| def VERSION_NAME = '0.2.1' | ||
|
|
||
| buildscript { | ||
| repositories { | ||
| jcenter() | ||
| } | ||
| } | ||
|
|
||
| repositories { | ||
| jcenter() | ||
| } | ||
|
|
||
| apply plugin: 'java' | ||
| apply plugin: 'maven' | ||
| apply plugin: 'com.jfrog.bintray' | ||
|
|
||
| dependencies { | ||
| implementation 'com.google.code.gson:gson:2.8.5' | ||
| testImplementation 'junit:junit:4.12' | ||
| } | ||
|
|
||
| compileJava { | ||
| sourceCompatibility = '1.7' | ||
| targetCompatibility = '1.7' | ||
| } | ||
|
|
||
| compileTestJava { | ||
| sourceCompatibility = '1.8' | ||
| targetCompatibility = '1.8' | ||
| } | ||
|
|
||
| test { | ||
| testLogging { | ||
| exceptionFormat = 'full' | ||
| } | ||
| } | ||
|
|
||
| version = VERSION_NAME | ||
|
|
||
| task sourcesJar(type: Jar) { | ||
| from sourceSets.main.allSource | ||
| classifier = 'sources' | ||
| } | ||
|
|
||
| task javadocJar(type: Jar, dependsOn: javadoc) { | ||
| classifier = 'javadoc' | ||
| from javadoc.destinationDir | ||
| } | ||
|
|
||
| artifacts { | ||
| archives javadocJar | ||
| archives sourcesJar | ||
| } | ||
|
|
||
| ext { | ||
| publishedGroupId = 'com.shopify.graphql.support' | ||
| artifact = 'support' | ||
| libraryName = 'graphql-support' | ||
|
|
||
| libraryDescription = 'GraphQL support package generated client code' | ||
|
|
||
| siteUrl = 'https://github.com/Shopify/graphql_java_gen' | ||
| gitUrl = 'https://github.com/Shopify/graphql_java_gen.git' | ||
|
|
||
| licenseName = 'The MIT License' | ||
| licenseUrl = 'https://opensource.org/licenses/MIT' | ||
| allLicenses = ["MIT"] | ||
| } | ||
|
|
||
| group = publishedGroupId | ||
|
|
||
| install { | ||
| repositories.mavenInstaller { | ||
| // Generates POM.xml with proper parameters | ||
| pom { | ||
| project { | ||
| groupId publishedGroupId | ||
| artifactId artifact | ||
|
|
||
| name libraryName | ||
| description libraryDescription | ||
| url siteUrl | ||
|
|
||
| licenses { | ||
| license { | ||
| name licenseName | ||
| url licenseUrl | ||
| } | ||
| } | ||
|
|
||
| scm { | ||
| connection gitUrl | ||
| developerConnection gitUrl | ||
| url siteUrl | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| bintray { | ||
| /* | ||
| These values can be found on https://bintray.com/profile/edit | ||
| BINTRAY_USER : your personal profile name (from "Your Profile") | ||
| BINTRAY_KEY : found on the left menu, under "API Key" | ||
| */ | ||
| user = System.getenv('BINTRAY_USER') | ||
| key = System.getenv('BINTRAY_KEY') | ||
|
|
||
| configurations = ['archives'] | ||
| publish = true | ||
| pkg { | ||
| userOrg = 'shopify' | ||
| repo = 'shopify-java' | ||
| name = libraryName | ||
| desc = libraryDescription | ||
| websiteUrl = siteUrl | ||
| vcsUrl = gitUrl | ||
| licenses = allLicenses | ||
| version { | ||
| name = VERSION_NAME | ||
| } | ||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this and the bintray block below be moved to the original
build.gradlefile?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 setup. Probably not a real issue given that no one has posted an issue about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.