forked from Enigmatis/graphql-java-annotations
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
136 lines (118 loc) · 4.25 KB
/
build.gradle
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
import aQute.bnd.gradle.Bundle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:6.4.0'
}
}
plugins {
id 'java'
id 'idea'
id 'maven-publish'
id 'com.github.hierynomus.license' version '0.16.1'
id "biz.aQute.bnd.builder" version "6.4.0"
}
// custom tasks for creating source/javadoc jars
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
repositories {
mavenCentral()
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
doLast {
options.compilerArgs += "-parameters"
}
}
}
dependencies {
implementation 'javax.validation:validation-api:2.0.1.Final'
// @see https://mvnrepository.com/artifact/com.graphql-java/graphql-java
implementation 'com.graphql-java:graphql-java:21.3'
// @see https://mvnrepository.com/artifact/com.graphql-java/graphql-java-extended-scalars
implementation 'com.graphql-java:graphql-java-extended-scalars:21.0'
implementation 'javax.xml.bind:jaxb-api:2.3.1'
// OSGi
compileOnly 'org.osgi:osgi.core:8.0.0'
compileOnly 'org.osgi:org.osgi.service.cm:1.6.0'
compileOnly 'org.osgi:org.osgi.service.component:1.5.1'
compileOnly 'biz.aQute.bnd:biz.aQute.bndlib:3.5.0'
testImplementation 'org.testng:testng:7.8.0'
// @see https://mvnrepository.com/artifact/org.hamcrest/hamcrest-all
testImplementation 'org.hamcrest:hamcrest-all:1.3'
testImplementation 'org.mockito:mockito-core:5.6.0'
}
test.useTestNG()
publishing {
publications {
maven(MavenPublication) {
from components.java
groupId 'io.github.graphql-java'
artifactId project.name
version project.version
artifact sourcesJar
// FIXME: does no longer work (most probably gradle 8 related)
// artifact javadocJar
pom.withXml {
asNode().children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
name 'graphql-java-annotations'
description 'Annotations-based syntax for GraphQL schema definition'
url 'https://github.com/KontextWork/graphql-java-annotations'
inceptionYear '2022'
scm {
url 'https://github.com/KontextWork/graphql-java-annotations'
connection 'scm:https://github.com/KontextWork/graphql-java-annotations.git'
developerConnection 'scm:git://github.com/KontextWork/graphql-java-annotations.git'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
developers {
developer {
id 'tm'
name 'Thomas M.'
email '[email protected]'
}
developer {
id 'em'
name 'Eugen Mayer'
email '[email protected]'
}
}
}
}
}
}
}
publishing {
repositories {
maven {
def releasesRepoUrl = "https://nexus.kw.kontextwork.com/repository/kw-maven-release"
def snapshotsRepoUrl = "https://nexus.kw.kontextwork.com/repository/kw-maven-snapshots"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
if(project.hasProperty("ourNexusAuthorUser")) {
credentials(PasswordCredentials) {
username "$ourNexusAuthorUser"
password "$ourNexusAuthorPassword"
}
}
}
}
}
task bundle(type: Bundle) {
from sourceSets.main.output
bndfile = file('bundle.bnd')
}