This repository has been archived by the owner on Oct 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
115 lines (99 loc) · 2.82 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
import com.google.protobuf.gradle.protobuf
import com.google.protobuf.gradle.protoc
group = "io.gqljf"
// todo set up plugin
version = "0.1.16"
plugins {
`java-library`
`maven-publish`
idea
id("com.google.protobuf")
id("com.jfrog.bintray")
}
val graphqlJavaVersion: String by project
val protobufVersion: String by project
val junitVersion: String by project
val hamcrestVersion: String by project
repositories {
jcenter()
}
dependencies {
implementation("com.graphql-java:graphql-java:$graphqlJavaVersion")
implementation("com.google.protobuf:protobuf-java:$protobufVersion")
testImplementation("org.junit.jupiter:junit-jupiter:$junitVersion")
testImplementation("org.hamcrest:hamcrest:$hamcrestVersion")
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:$protobufVersion"
}
}
tasks {
test {
useJUnitPlatform()
}
jar {
manifest {
attributes(
mapOf(
"Implementation-Title" to project.name,
"Implementation-Version" to project.version
)
)
}
}
}
val sourcesJar by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}
val projectUrl = "https://github.com/rkudryashov/graphql-java-federation.git"
publishing {
publications {
create<MavenPublication>("lib") {
groupId = project.group.toString()
artifactId = project.name
// todo setup plugin
version = project.version.toString()
from(components["java"])
artifact(sourcesJar.get())
pom.withXml {
asNode().apply {
appendNode(
"description",
"The library provides an ability to graphql-java service to work as Apollo Server downstream service implementing Apollo Federation spec"
)
appendNode("name", rootProject.name)
appendNode("licenses").appendNode("license").apply {
appendNode("name", "MIT")
}
appendNode("scm").apply {
appendNode("url", projectUrl)
}
}
}
}
}
}
bintray {
user = System.getenv("BINTRAY_USER")
key = System.getenv("BINTRAY_KEY")
publish = true
setPublications("lib")
pkg.apply {
userOrg = "gqljf"
repo = "maven"
name = "graphql-java-federation"
setLicenses("MIT")
vcsUrl = projectUrl
githubRepo = githubRepo
version.apply {
name = project.version.toString()
}
}
}
idea {
module {
sourceDirs.add(file("${projectDir}/src/generated/main/java"))
}
}