Skip to content

Feature/183 refactor abstract http servlet #217

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 28 commits into from
Nov 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4380611
Extracted http request handler
oliemansm Nov 15, 2019
088e5e5
Fix unit tests
oliemansm Nov 15, 2019
26cdad4
Fix unit tests
oliemansm Nov 15, 2019
039176c
Fix unit tests
oliemansm Nov 15, 2019
5b1047f
refactor servlert fix #182
oliemansm Nov 15, 2019
44cef3f
Add content length when writing response
oliemansm Nov 15, 2019
c0b22ac
Rethrow caught exceptions to allow listeners to adjust response
oliemansm Nov 16, 2019
7dfbd15
Split based on servlet and websocket dependencies
oliemansm Nov 17, 2019
37c62fc
Extract core functionality into its own module
oliemansm Nov 17, 2019
f17ad46
Extract core functionality into its own module
oliemansm Nov 17, 2019
80236b4
Introduced GraphQLInvoker to allow invocation from webflux version
oliemansm Nov 18, 2019
2cf964b
Moved subject proxy out of the core logic
oliemansm Nov 19, 2019
3dbad11
Fix build error
oliemansm Nov 20, 2019
e0fa40b
Refactor subscriptions
oliemansm Nov 24, 2019
9a47e63
Refactor subscriptions
oliemansm Nov 24, 2019
8bac91a
Refactor subscriptions
oliemansm Nov 24, 2019
f589fa5
Refactor subscriptions
oliemansm Nov 24, 2019
eebc9af
Fix build deprecations
oliemansm Nov 24, 2019
2dee089
Upgrade gradle to 6.0.1
oliemansm Nov 25, 2019
16071f6
Upgrade gradle to 6.0.1
oliemansm Nov 25, 2019
6465fa8
Upgrade gradle to 6.0.1
oliemansm Nov 25, 2019
a0c0f49
Build GraphQL on the fly after all
oliemansm Nov 25, 2019
497adf0
Build GraphQL on the fly after all
oliemansm Nov 25, 2019
f2bb4e0
Limit use of GraphQLQueryInvoker
oliemansm Nov 26, 2019
d9e14f6
Merge branch 'master' into feature/183-refactor-abstract-http-servlet
oliemansm Nov 28, 2019
eae8120
Use gradle 5.6.4 instead of 6.0.1
oliemansm Nov 28, 2019
ddc29bd
Merge remote-tracking branch 'origin/feature/183-refactor-abstract-ht…
oliemansm Nov 28, 2019
1dd834e
Fix batching query
oliemansm Nov 28, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
349 changes: 179 additions & 170 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,212 +1,221 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 oEmbedler Inc. and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

buildscript {
repositories {
jcenter()
mavenLocal()
mavenCentral()
jcenter()
maven { url "https://dl.bintray.com/graphql-java-kickstart/releases" }
maven { url "https://plugins.gradle.org/m2/" }
maven { url 'https://repo.spring.io/plugins-release' }
}
dependencies {
classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:3.1.0'
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.+"
classpath 'net.researchgate:gradle-release:2.7.0'
}
}

plugins {
id "com.jfrog.bintray" version "1.8.4"
id "com.jfrog.artifactory" version "4.8.1"
id 'net.researchgate.release' version '2.7.0'
id 'io.franzbecker.gradle-lombok' version '3.2.0' apply false
id "com.jfrog.artifactory" version "4.11.0" apply false
id "biz.aQute.bnd" version "4.3.1" apply false
}

apply plugin: 'java'
sourceCompatibility = 1.8
targetCompatibility = 1.8
subprojects {
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: "com.jfrog.bintray"
apply plugin: 'io.franzbecker.gradle-lombok'
apply plugin: 'com.jfrog.artifactory'

// Tests
apply plugin: 'groovy'
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url "https://dl.bintray.com/graphql-java-kickstart/releases" }
maven { url "https://oss.jfrog.org/artifactory/oss-snapshot-local" }
maven { url "https://repo.spring.io/libs-milestone" }
}

repositories {
mavenLocal()
mavenCentral()
}
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}

configurations.all {
exclude group:"org.projectlombok", module: "lombok"
}
compileJava {
sourceCompatibility = SOURCE_COMPATIBILITY
targetCompatibility = TARGET_COMPATIBILITY
}

dependencies {
compile 'org.slf4j:slf4j-api:1.7.21'

// Useful utilities
compile 'com.google.guava:guava:24.1.1-jre'

// Unit testing
testCompile "org.codehaus.groovy:groovy-all:2.4.1"
testCompile "org.spockframework:spock-core:1.1-groovy-2.4-rc-3"
testRuntime "cglib:cglib-nodep:3.2.4"
testRuntime "org.objenesis:objenesis:2.5.1"
testCompile 'org.slf4j:slf4j-simple:1.7.24'
testCompile 'org.springframework:spring-test:4.3.7.RELEASE'
testRuntime 'org.springframework:spring-web:4.3.7.RELEASE'

// OSGi
compileOnly 'org.osgi:org.osgi.core:6.0.0'
compileOnly 'org.osgi:org.osgi.service.cm:1.5.0'
compileOnly 'org.osgi:org.osgi.service.component:1.3.0'
compileOnly 'biz.aQute.bnd:biz.aQute.bndlib:3.1.0'

// Servlet
compile 'javax.servlet:javax.servlet-api:3.1.0'
compile 'javax.websocket:javax.websocket-api:1.1'

// GraphQL
compile "com.graphql-java:graphql-java:$LIB_GRAPHQL_JAVA_VER"

testCompile 'io.github.graphql-java:graphql-java-annotations:5.2'

// JSON
compile "com.fasterxml.jackson.core:jackson-core:$LIB_JACKSON_VER"
compile "com.fasterxml.jackson.core:jackson-annotations:$LIB_JACKSON_VER"
compile "com.fasterxml.jackson.core:jackson-databind:$LIB_JACKSON_VER"
compile "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:$LIB_JACKSON_VER"
}
compileJava.dependsOn(processResources)

apply plugin: 'osgi'
apply plugin: 'java-library-distribution'
apply plugin: 'biz.aQute.bnd.builder'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'
apply plugin: 'idea'
apply plugin: 'maven'

jar {
manifest {
instruction 'Require-Capability', 'osgi.extender'
lombok {
version = "1.18.4"
sha256 = ""
}
}

// custom tasks for creating source/javadoc jars
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
if (!it.name.startsWith('example')) {

publishing {
publications {
maven(MavenPublication) {
from components.java
groupId 'com.graphql-java-kickstart'
artifactId project.name
version project.version

artifact sourcesJar
artifact javadocJar

pom.withXml {
asNode().children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
name 'graphql-java-servlet'
description 'relay.js-compatible GraphQL servlet'
url 'https://github.com/graphql-java-kickstart/graphql-java-servlet'
inceptionYear '2016'

scm {
url 'https://github.com/graphql-java-kickstart/graphql-java-servlet'
connection 'scm:https://github.com/graphql-java-kickstart/graphql-java-servlet.git'
developerConnection 'scm:git://github.com/graphql-java-kickstart/graphql-java-servlet.git'
}
jar {
from "LICENSE.md"
}

licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
task sourcesJar(type: Jar) {
dependsOn classes
classifier 'sources'
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives sourcesJar
archives javadocJar
}

publishing {
publications {
mainProjectPublication(MavenPublication) {
version version
from components.java

artifact sourcesJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}

developers {
developer {
id 'yrashk'
name 'Yurii Rashkovskii'
email '[email protected]'
}
developer {
id 'apottere'
name 'Andrew Potter'
email '[email protected]'
pom.withXml {
asNode().children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
name 'graphql-java-servlet'
description 'relay.js-compatible GraphQL servlet'
url 'https://github.com/graphql-java-kickstart/graphql-java-servlet'
inceptionYear '2016'

scm {
url 'https://github.com/graphql-java-kickstart/graphql-java-servlet'
connection 'scm:https://github.com/graphql-java-kickstart/graphql-java-servlet.git'
developerConnection 'scm:git://github.com/graphql-java-kickstart/graphql-java-servlet.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 'yrashk'
name 'Yurii Rashkovskii'
email '[email protected]'
}
developer {
id 'apottere'
name 'Andrew Potter'
email '[email protected]'
}
}
}
// https://discuss.gradle.org/t/maven-publish-plugin-generated-pom-making-dependency-scope-runtime/7494/10
asNode().dependencies.'*'.findAll() {
it.scope.text() == 'runtime' && project.configurations.compile.allDependencies.find { dep ->
dep.name == it.artifactId.text()
}
}.each { it.scope*.value = 'compile'}
}
}
// https://discuss.gradle.org/t/maven-publish-plugin-generated-pom-making-dependency-scope-runtime/7494/10
asNode().dependencies.'*'.findAll() {
it.scope.text() == 'runtime' && project.configurations.compile.allDependencies.find { dep ->
dep.name == it.artifactId.text()
}
}.each { it.scope*.value = 'compile'}
}
}
}
}

release {
tagTemplate = 'v${version}'
failOnPublishNeeded = false
ignoredSnapshotDependencies = ['com.graphql-java-kickstart:graphql-java-servlet']
}

afterReleaseBuild.dependsOn bintrayUpload

bintray {
user = System.env.BINTRAY_USER ?: project.findProperty('BINTRAY_USER') ?: ''
key = System.env.BINTRAY_PASS ?: project.findProperty('BINTRAY_PASS') ?: ''
publications = ['maven']
publish = true
pkg {
repo = 'releases'
name = project.name
licenses = ['Apache-2.0']
vcsUrl = 'https://github.com/graphql-java-kickstart/graphql-java-servlet'
userOrg = 'graphql-java-kickstart'
version {
name = project.version
mavenCentralSync {
close = '1'
bintray {
user = System.env.BINTRAY_USER ?: project.findProperty('BINTRAY_USER') ?: ''
key = System.env.BINTRAY_PASS ?: project.findProperty('BINTRAY_PASS') ?: ''
publications = ['mainProjectPublication']
publish = true
pkg {
repo = 'releases'
name = PROJECT_NAME
desc = PROJECT_DESC
licenses = [PROJECT_LICENSE]
vcsUrl = PROJECT_GIT_REPO_URL
userOrg = 'graphql-java-kickstart'
version {
name = project.version
mavenCentralSync {
close = '1'
}
}
}
}
}
}

artifactory {
contextUrl = 'https://oss.jfrog.org'
publish {
repository {
repoKey = 'oss-snapshot-local'
artifactory {
contextUrl = 'https://oss.jfrog.org'
publish {
repository {
repoKey = 'oss-snapshot-local'

username = System.env.BINTRAY_USER ?: System.getProperty('BINTRAY_USER')
password = System.env.BINTRAY_PASS ?: System.getProperty('BINTRAY_PASS')
username = System.env.BINTRAY_USER ?: System.getProperty('BINTRAY_USER')
password = System.env.BINTRAY_PASS ?: System.getProperty('BINTRAY_PASS')

maven = true
}
defaults {
publications 'maven'
publishArtifacts = true
publishPom = true
}
}
resolve {
repository {
repoKey = 'jcenter'
maven = true
}
defaults {
publications 'maven'
publishArtifacts = true
publishPom = true
}
}
resolve {
repository {
repoKey = 'jcenter'
}
}
}
}
}

idea {
project {
languageLevel = '11'
vcs = 'Git'
}
release {
tagTemplate = 'v${version}'
failOnPublishNeeded = false
ignoredSnapshotDependencies = ['com.graphql-java-kickstart:graphql-java-servlet']
}

task build {
dependsOn subprojects.findResults { it.tasks.findByName('assemble') }
dependsOn subprojects.findResults { it.tasks.findByName('check') }
dependsOn subprojects.findResults { it.tasks.findByName('bintray') }
}

wrapper {
gradleVersion = '4.10.3'
gradleVersion = "${GRADLE_WRAPPER_VER}"
}
Loading