Skip to content

Commit 6822535

Browse files
authored
Merge pull request #8 from Nosto/feature/add-internal-publish-task-and-add-fork-info-to-readme
Update readme to describe the fork and add gradle task for Nosto internal publishing
2 parents 66fc6c1 + 28cfb86 commit 6822535

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Nosto Fork of GraphQL-Java Annotations adds support for partial updates and publishToNostoRepo gradle task for internal use
2+
3+
Adds support for binding to `java.util.Optional` parameters. Binding to Optional parameters allows implementing partial updates. With a partial update the mutate call can update only some of the Optional fields without needing to repeat all the existing values of an object.
4+
5+
The mapping from an optional field in GraphQL schema that binds to `java.util.Optional` is the following:
6+
1. value given to the field in GraphQL call is mapped into `java.util.Optional` of the underlying type
7+
2. null given to the field in GraphQL call is mapped into `Optional.empty` to signal the removal of a possibly existing value of the field
8+
3. field not included in the GraphQL call is mapped into null to signal `undefined` so any possibly existing value(s) should not be modified
9+
10+
## Internal publishing to Nosto repository
11+
12+
Update the version in the `gradle.properties` file and run `./gradlew publishToNostoRepo` to publish the library to the Nosto repository.
13+
14+
115
![logo](graphql-annotations.png?raw=true)
216
# GraphQL-Java Annotations
317
![build](https://github.com/Enigmatis/graphql-java-annotations/actions/workflows/build.yml/badge.svg)

build.gradle

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ apply plugin: 'biz.aQute.bnd.builder'
2424
apply plugin: 'maven-publish'
2525

2626

27+
// The upstream project build releases seem to be compiled with Java 11 so keeping compatibility so that our changes can be applied to the upstream project
28+
compileJava {
29+
options.release = 11
30+
}
31+
compileTestJava {
32+
options.release = 11
33+
}
34+
2735
// custom tasks for creating source/javadoc jars
2836
tasks.register('sourcesJar', Jar) {
2937
dependsOn classes
@@ -143,7 +151,29 @@ publishing {
143151
}
144152
}
145153
}
154+
155+
repositories {
156+
maven {
157+
url 'https://repo.nos.to/content/repositories/NostoDependencies/'
158+
credentials {
159+
username = project.hasProperty('mavenUser') ? project.mavenUser : ""
160+
password = project.hasProperty('mavenPassword') ? project.mavenPassword : ""
161+
}
162+
}
163+
}
164+
}
165+
166+
tasks.register('publishToNostoRepo') {
167+
dependsOn 'publishMavenPublicationToMavenRepository'
146168
}
169+
gradle.taskGraph.whenReady { taskGraph ->
170+
if (taskGraph.hasTask(':publishToNostoRepo')) {
171+
if (!project.hasProperty('mavenUser') || !project.hasProperty('mavenPassword')) {
172+
throw new GradleException("mavenUser and mavenPassword must be defined for publishToNostoRepo task")
173+
}
174+
}
175+
}
176+
147177

148178
afterReleaseBuild.dependsOn nexusPublishing
149179

@@ -158,6 +188,7 @@ nexusPublishing {
158188

159189
// to publish to local maven repo skip signing: ./gradlew publishToMavenLocal -x signGraphqlJavaPublication
160190
signing {
191+
required = { !version.endsWith("nosto") }
161192
def signingKey = System.getenv("MAVEN_CENTRAL_PGP_KEY")
162193
useInMemoryPgpKeys(signingKey, "")
163194
sign publishing.publications

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ org.gradle.daemon=true
55
org.gradle.parallel=true
66
org.gradle.jvmargs=-Dfile.encoding=UTF-8
77

8-
version = 21.5
8+
version = 21.5-nosto

0 commit comments

Comments
 (0)