-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CAT-109] Kotlin GraphQL Rewrite (#30)
- Loading branch information
Showing
138 changed files
with
46,774 additions
and
23,893 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
kind: pipeline | ||
type: kubernetes | ||
name: default | ||
|
||
steps: | ||
- name: build | ||
image: gradle:jdk8 | ||
commands: | ||
- ./gradlew build | ||
|
||
- name: stage | ||
image: gradle:jdk8 | ||
commands: | ||
- echo "signing.keyId=$${sonatype_gpg_keyid}" > gradle.properties | ||
- echo "signing.password=$${sonatype_gpg_password}" >> gradle.properties | ||
- echo "signing.secretKeyRingFile=${HOME}/.gradle/secring.gpg" >> gradle.properties | ||
- echo "sonatypeUsername=$${sonatype_username}" >> gradle.properties | ||
- echo "sonatypePassword=$${sonatype_password}" >> gradle.properties | ||
- echo ${sonatype_gpg_key} | base64 -d > ~/.gradle/secring.gpg | ||
- ./gradlew publishToSonatype | ||
|
||
- name: deploy | ||
image: gradle:jdk8 | ||
when: | ||
event: | ||
- promote | ||
target: | ||
- production | ||
commands: | ||
- echo "signing.keyId=$${sonatype_gpg_keyid}" > gradle.properties | ||
- echo "signing.password=$${sonatype_gpg_password}" >> gradle.properties | ||
- echo "signing.secretKeyRingFile=${HOME}/.gradle/secring.gpg" >> gradle.properties | ||
- echo "sonatypeUsername=$${sonatype_username}" >> gradle.properties | ||
- echo "sonatypePassword=$${sonatype_password}" >> gradle.properties | ||
|
||
- ./gradlew closeAndReleaseStagingRepository | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,3 +54,5 @@ gradle-app.setting | |
|
||
# Ignore Gradle Peoperties | ||
gradle.properties | ||
|
||
indico_api_token.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,109 +1,153 @@ | ||
buildscript { | ||
repositories { | ||
jcenter() | ||
} | ||
dependencies { | ||
classpath("com.apollographql.apollo:apollo-gradle-plugin:1.2.2") | ||
} | ||
} | ||
import com.expediagroup.graphql.plugin.gradle.config.GraphQLScalar | ||
import com.expediagroup.graphql.plugin.gradle.config.GraphQLSerializer | ||
|
||
plugins { | ||
id 'java-library' | ||
id 'maven' | ||
id 'signing' | ||
id 'eclipse' | ||
id 'idea' | ||
id "java" | ||
id 'org.jetbrains.kotlin.jvm' version '1.5.31' | ||
id "signing" | ||
id "maven-publish" | ||
id "io.github.gradle-nexus.publish-plugin" version "1.0.0" | ||
id 'com.expediagroup.graphql' version '5.2.0' | ||
|
||
} | ||
|
||
apply plugin: 'com.apollographql.android' | ||
group 'com.indico' | ||
|
||
repositories { | ||
jcenter() | ||
mavenCentral() | ||
} | ||
|
||
task javadocJar(type: Jar) { | ||
classifier = 'javadoc' | ||
from javadoc | ||
archivesBaseName = "indico-client-java" | ||
version = "4.12.0" | ||
|
||
|
||
task sourceJar(type: Jar) { | ||
classifier "sources" | ||
from sourceSets.main.allJava | ||
} | ||
|
||
task sourcesJar(type: Jar) { | ||
classifier = 'sources' | ||
from sourceSets.main.allSource | ||
task javadocJar(type: Jar, dependsOn: javadoc) { | ||
classifier "javadoc" | ||
from javadoc.destinationDir | ||
} | ||
|
||
artifacts { | ||
archives javadocJar, sourcesJar | ||
publishing { | ||
publications { | ||
maven(MavenPublication) { | ||
from(components.java) | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
sign configurations.archives | ||
|
||
dependencies { | ||
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.5.31" | ||
implementation "org.jetbrains.kotlin:kotlin-reflect:1.5.31" | ||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0' | ||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0' | ||
implementation("io.ktor:ktor-client-okhttp:1.6.1") | ||
testImplementation('org.junit.jupiter:junit-jupiter:5.5.2') | ||
implementation("com.expediagroup:graphql-kotlin-ktor-client:5.2.0") | ||
implementation("com.expediagroup:graphql-kotlin-client-jackson:5.2.0") | ||
implementation("com.squareup.okhttp3:okhttp:4.9.0") | ||
implementation('org.apache.logging.log4j:log4j-1.2-api:2.14.1') | ||
api('org.json:json:20190722') | ||
compileOnly("org.jetbrains:annotations:13.0") | ||
testCompileOnly("org.jetbrains:annotations:13.0") | ||
} | ||
|
||
group = "com.indico" | ||
archivesBaseName = "indico-client-java" | ||
version = "4.11.3" | ||
|
||
uploadArchives { | ||
repositories { | ||
mavenDeployer { | ||
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } | ||
//use with update-schema.sh to refresh graphql schema | ||
graphqlIntrospectSchema { | ||
outputFile = file("${project.projectDir}/src/main/graphql/schema.graphql") | ||
endpoint = "https://app.indico.io/graph/api/graphql" | ||
headers = ["Authorization" : "Bearer " + project.getProperties().getOrDefault('graphQlToken', "")] | ||
} | ||
|
||
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { | ||
authentication(userName: ossrhUsername, password: ossrhPassword) | ||
} | ||
graphqlGenerateClient { | ||
// Boolean flag indicating whether or not selection of deprecated fields is allowed. | ||
allowDeprecatedFields = true | ||
packageName = "com.indico.graphql" | ||
schemaFile = file("${project.projectDir}/src/main/resources/schema.graphql") | ||
serializer = GraphQLSerializer.JACKSON | ||
useOptionalInputWrapper = true | ||
|
||
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { | ||
authentication(userName: ossrhUsername, password: ossrhPassword) | ||
} | ||
} | ||
|
||
pom.project { | ||
name 'Indico IPA Client' | ||
packaging 'jar' | ||
description 'Java client to the Indico IPA platform' | ||
url 'http://indico.com' | ||
scm { | ||
connection 'scm:github.com:IndicoDataSolutions/indico-client-java.git' | ||
developerConnection 'scm:github.com:IndicoDataSolutions/indico-client-java.git' | ||
url 'https://github.com/IndicoDataSolutions/indico-client-java' | ||
} | ||
licenses { | ||
license { | ||
name 'MIT' | ||
url 'https://github.com/IndicoDataSolutions/indico-client-java/blob/master/LICENSE' | ||
} | ||
compileKotlin { | ||
kotlinOptions.jvmTarget = "1.8" | ||
} | ||
|
||
|
||
// ossrh requires javadoc and sources https://central.sonatype.org/pages/requirements.html | ||
java { | ||
withJavadocJar() | ||
withSourcesJar() | ||
} | ||
|
||
|
||
void sign(Project project) { | ||
project.signing { | ||
required { project.gradle.taskGraph.hasTask("publish") } | ||
def signingKeyId = project.findProperty("signingKeyId") | ||
def signingKey = project.findProperty("signingKey") | ||
def signingPassword = project.findProperty("signingPassword") | ||
if (signingKeyId) { | ||
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword) | ||
} else if (signingKey) { | ||
useInMemoryPgpKeys(signingKey, signingPassword) | ||
} | ||
sign publishing.publications.maven | ||
} | ||
} | ||
|
||
project.plugins.withType(MavenPublishPlugin).all { | ||
PublishingExtension publishing = project.extensions.getByType(PublishingExtension) | ||
publishing.publications.withType(MavenPublication).all { mavenPublication -> | ||
mavenPublication.pom { | ||
name = "${project.group}:${project.name}" | ||
description = name | ||
url = "https://github.com/indico/indico-client-java" | ||
licenses { | ||
license { | ||
name = "MIT" | ||
url = "https://github.com/IndicoDataSolutions/indico-client-java/blob/master/LICENSE" | ||
} | ||
developers { | ||
developer { | ||
id 'Indico' | ||
name 'Indico Engineering' | ||
email '[email protected]' | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = "indico" | ||
name = "Indico Engineering" | ||
email = "[email protected]" | ||
} | ||
} | ||
scm { | ||
connection = "scm:git:https://github.com/indico/indico-client-java.git" | ||
developerConnection = "scm:git:ssh://github.com/indico/indico-client-java.git" | ||
url = "https://github.com/indico/indico-client-java" | ||
} | ||
sign(project) | ||
} | ||
} | ||
} | ||
|
||
gradle.projectsEvaluated { | ||
tasks.withType(JavaCompile) { | ||
options.compilerArgs << "-Xlint:unchecked" | ||
nexusPublishing { | ||
repositories { | ||
sonatype() | ||
} | ||
connectTimeout = Duration.ofMinutes(3) | ||
clientTimeout = Duration.ofMinutes(3) | ||
} | ||
|
||
dependencies { | ||
testImplementation('org.junit.jupiter:junit-jupiter:5.5.2') | ||
testImplementation('org.mock-server:mockserver-netty:5.8.0') | ||
implementation('com.apollographql.apollo:apollo-runtime:1.2.2') | ||
implementation('org.apache.logging.log4j:log4j-1.2-api:2.14.1') | ||
api('org.json:json:20190722') | ||
compileOnly("org.jetbrains:annotations:13.0") | ||
testCompileOnly("org.jetbrains:annotations:13.0") | ||
} | ||
|
||
apollo { | ||
outputPackageName = "com.indico" | ||
} | ||
publishing { | ||
|
||
test { | ||
useJUnitPlatform() | ||
repositories { | ||
maven { | ||
name = "local" | ||
def releasesRepoUrl = "$buildDir/repos/releases" | ||
def snapshotsRepoUrl = "$buildDir/repos/snapshots" | ||
url = version.endsWith("SNAPSHOT") ? snapshotsRepoUrl : releasesRepoUrl | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.