Skip to content

Commit a58d32e

Browse files
authored
Merge pull request #49 from Shopify/monorepo-support
Support monorepo builds by forking the build.gradle into two files
2 parents ce1e7c8 + 0e53a96 commit a58d32e

2 files changed

Lines changed: 125 additions & 118 deletions

File tree

support/build.gradle

Lines changed: 1 addition & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
def VERSION_NAME = '0.2.1'
2-
31
buildscript {
42
repositories {
53
jcenter()
@@ -9,119 +7,4 @@ buildscript {
97
}
108
}
119

12-
repositories {
13-
jcenter()
14-
}
15-
16-
apply plugin: 'java'
17-
apply plugin: 'maven'
18-
apply plugin: 'com.jfrog.bintray'
19-
20-
dependencies {
21-
implementation 'com.google.code.gson:gson:2.8.5'
22-
testImplementation 'junit:junit:4.12'
23-
}
24-
25-
compileJava {
26-
sourceCompatibility = '1.7'
27-
targetCompatibility = '1.7'
28-
}
29-
30-
compileTestJava {
31-
sourceCompatibility = '1.8'
32-
targetCompatibility = '1.8'
33-
}
34-
35-
test {
36-
testLogging {
37-
exceptionFormat = 'full'
38-
}
39-
}
40-
41-
version = VERSION_NAME
42-
43-
task sourcesJar(type: Jar) {
44-
from sourceSets.main.allSource
45-
classifier = 'sources'
46-
}
47-
48-
task javadocJar(type: Jar, dependsOn: javadoc) {
49-
classifier = 'javadoc'
50-
from javadoc.destinationDir
51-
}
52-
53-
artifacts {
54-
archives javadocJar
55-
archives sourcesJar
56-
}
57-
58-
ext {
59-
publishedGroupId = 'com.shopify.graphql.support'
60-
artifact = 'support'
61-
libraryName = 'graphql-support'
62-
63-
libraryDescription = 'GraphQL support package generated client code'
64-
65-
siteUrl = 'https://github.com/Shopify/graphql_java_gen'
66-
gitUrl = 'https://github.com/Shopify/graphql_java_gen.git'
67-
68-
licenseName = 'The MIT License'
69-
licenseUrl = 'https://opensource.org/licenses/MIT'
70-
allLicenses = ["MIT"]
71-
}
72-
73-
group = publishedGroupId
74-
75-
install {
76-
repositories.mavenInstaller {
77-
// Generates POM.xml with proper parameters
78-
pom {
79-
project {
80-
groupId publishedGroupId
81-
artifactId artifact
82-
83-
name libraryName
84-
description libraryDescription
85-
url siteUrl
86-
87-
licenses {
88-
license {
89-
name licenseName
90-
url licenseUrl
91-
}
92-
}
93-
94-
scm {
95-
connection gitUrl
96-
developerConnection gitUrl
97-
url siteUrl
98-
}
99-
}
100-
}
101-
}
102-
}
103-
104-
bintray {
105-
/*
106-
These values can be found on https://bintray.com/profile/edit
107-
BINTRAY_USER : your personal profile name (from "Your Profile")
108-
BINTRAY_KEY : found on the left menu, under "API Key"
109-
*/
110-
user = System.getenv('BINTRAY_USER')
111-
key = System.getenv('BINTRAY_KEY')
112-
113-
configurations = ['archives']
114-
publish = true
115-
pkg {
116-
userOrg = 'shopify'
117-
repo = 'shopify-java'
118-
name = libraryName
119-
desc = libraryDescription
120-
websiteUrl = siteUrl
121-
vcsUrl = gitUrl
122-
licenses = allLicenses
123-
version {
124-
name = VERSION_NAME
125-
}
126-
}
127-
}
10+
apply from: 'graphql.java.gen.build.gradle'
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
def VERSION_NAME = '0.2.1'
2+
3+
buildscript {
4+
repositories {
5+
jcenter()
6+
}
7+
}
8+
9+
repositories {
10+
jcenter()
11+
}
12+
13+
apply plugin: 'java'
14+
apply plugin: 'maven'
15+
apply plugin: 'com.jfrog.bintray'
16+
17+
dependencies {
18+
implementation 'com.google.code.gson:gson:2.8.5'
19+
testImplementation 'junit:junit:4.12'
20+
}
21+
22+
compileJava {
23+
sourceCompatibility = '1.7'
24+
targetCompatibility = '1.7'
25+
}
26+
27+
compileTestJava {
28+
sourceCompatibility = '1.8'
29+
targetCompatibility = '1.8'
30+
}
31+
32+
test {
33+
testLogging {
34+
exceptionFormat = 'full'
35+
}
36+
}
37+
38+
version = VERSION_NAME
39+
40+
task sourcesJar(type: Jar) {
41+
from sourceSets.main.allSource
42+
classifier = 'sources'
43+
}
44+
45+
task javadocJar(type: Jar, dependsOn: javadoc) {
46+
classifier = 'javadoc'
47+
from javadoc.destinationDir
48+
}
49+
50+
artifacts {
51+
archives javadocJar
52+
archives sourcesJar
53+
}
54+
55+
ext {
56+
publishedGroupId = 'com.shopify.graphql.support'
57+
artifact = 'support'
58+
libraryName = 'graphql-support'
59+
60+
libraryDescription = 'GraphQL support package generated client code'
61+
62+
siteUrl = 'https://github.com/Shopify/graphql_java_gen'
63+
gitUrl = 'https://github.com/Shopify/graphql_java_gen.git'
64+
65+
licenseName = 'The MIT License'
66+
licenseUrl = 'https://opensource.org/licenses/MIT'
67+
allLicenses = ["MIT"]
68+
}
69+
70+
group = publishedGroupId
71+
72+
install {
73+
repositories.mavenInstaller {
74+
// Generates POM.xml with proper parameters
75+
pom {
76+
project {
77+
groupId publishedGroupId
78+
artifactId artifact
79+
80+
name libraryName
81+
description libraryDescription
82+
url siteUrl
83+
84+
licenses {
85+
license {
86+
name licenseName
87+
url licenseUrl
88+
}
89+
}
90+
91+
scm {
92+
connection gitUrl
93+
developerConnection gitUrl
94+
url siteUrl
95+
}
96+
}
97+
}
98+
}
99+
}
100+
101+
bintray {
102+
/*
103+
These values can be found on https://bintray.com/profile/edit
104+
BINTRAY_USER : your personal profile name (from "Your Profile")
105+
BINTRAY_KEY : found on the left menu, under "API Key"
106+
*/
107+
user = System.getenv('BINTRAY_USER')
108+
key = System.getenv('BINTRAY_KEY')
109+
110+
configurations = ['archives']
111+
publish = true
112+
pkg {
113+
userOrg = 'shopify'
114+
repo = 'shopify-java'
115+
name = libraryName
116+
desc = libraryDescription
117+
websiteUrl = siteUrl
118+
vcsUrl = gitUrl
119+
licenses = allLicenses
120+
version {
121+
name = VERSION_NAME
122+
}
123+
}
124+
}

0 commit comments

Comments
 (0)