Skip to content
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

feat: Support graphql-kotlin-bom #2020

Merged
merged 5 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
48 changes: 48 additions & 0 deletions bom/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# GraphQL Kotlin BOM
[![Maven Central](https://img.shields.io/maven-central/v/com.expediagroup/graphql-kotlin-bom.svg?label=Maven%20Central)](https://central.sonatype.com/search?namespace=com.expediagroup&q=name%3Agraphql-kotlin-bom)

`graphql-kotlin-bom` defines the versions of all the modules in `graphql-kotlin`.
This allows the version of the modules imported in your project to be consistent
without needing to specify the version of each module.

## Usage

With Maven, import a dependency on `graphql-kotlin-bom` in `dependencyManagement` section in your project pom,
and add dependencies on `graphql-kotlin` modules with no version.

```xml
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.expediagroup</groupId>
<artifactId>graphql-kotlin-bom</artifactId>
<version>${latestVersion}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>com.expediagroup</groupId>
<artifactId>graphql-kotlin-client</artifactId>
</dependency>
</dependencies>
```

With Gradle, import `graphql-kotlin-bom` using Gradle `platform`,
and add dependencies on `graphql-kotlin` modules with no version.

```kotlin
implementation(platform("com.expediagroup:graphql-kotlin-bom:$latestVersion"))

implementation("com.expediagroup:graphql-kotlin-client")
```

## Documentation

Additional information can be found in our [documentation](https://opensource.expediagroup.com/graphql-kotlin/docs/server/graphql-server)
and the [Javadocs](https://www.javadoc.io/doc/com.expediagroup/graphql-kotlin-server) of all published library versions.

If you have a question about something you can not find in our documentation or javadocs, feel free to [start a new discussion](https://github.com/ExpediaGroup/graphql-kotlin/discussions).
31 changes: 31 additions & 0 deletions bom/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
description = "BOM (Bill Of Materials) for graphql-kotlin"

plugins {
`maven-publish`
`java-platform`
}

javaPlatform {
allowDependencies()
}

dependencies {
project.rootProject.subprojects.forEach { subproject ->
if (subproject.name != "graphql-kotlin-bom") {
api(subproject)
}
}
}

publishing {
publications {
create<MavenPublication>("graphql-kotlin-bom") {
from(components["javaPlatform"])
pom {
description = "BOM (Bill Of Materials) for graphql-kotlin"
name = "graphql-kotlin-bom"
packaging = "pom"
}
}
}
}
6 changes: 6 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ include(":graphql-kotlin-dataloader")
include(":graphql-kotlin-dataloader-instrumentation")
include(":graphql-kotlin-automatic-persisted-queries")

// BOM
include(":graphql-kotlin-bom")

//
// Project mappings so we don't need to create projects that group subprojects
//
Expand Down Expand Up @@ -65,3 +68,6 @@ project(":graphql-kotlin-ktor-server").projectDir = file("servers/graphql-kotlin
project(":graphql-kotlin-dataloader").projectDir = file("executions/graphql-kotlin-dataloader")
project(":graphql-kotlin-dataloader-instrumentation").projectDir = file("executions/graphql-kotlin-dataloader-instrumentation")
project(":graphql-kotlin-automatic-persisted-queries").projectDir = file("executions/graphql-kotlin-automatic-persisted-queries")

// BOM
project(":graphql-kotlin-bom").projectDir = file("bom")
38 changes: 37 additions & 1 deletion website/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ Using a JVM dependency manager, link any `graphql-kotlin-*` library to your proj
defaultValue="gradle"
values={[
{ label: 'Gradle Kotlin', value: 'gradle' },
{ label: 'Maven', value: 'maven' }
{ label: 'Gradle Kotlin with BOM', value: 'gradle-bom' },
{ label: 'Maven', value: 'maven' },
{ label: 'Maven with BOM', value: 'maven-bom' }
]
}>

Expand All @@ -28,6 +30,15 @@ Using a JVM dependency manager, link any `graphql-kotlin-*` library to your proj
implementation("com.expediagroup", "graphql-kotlin-spring-server", latestVersion)
```

</TabItem>
<TabItem value="gradle-bom">

```kotlin
implementation(platform("com.expediagroup:graphql-kotlin-bom:$latestVersion"))

implementation("com.expediagroup", "graphql-kotlin-spring-server")
```

</TabItem>
<TabItem value="maven">

Expand All @@ -39,6 +50,31 @@ implementation("com.expediagroup", "graphql-kotlin-spring-server", latestVersion
</dependency>
```

</TabItem>

<TabItem value="maven-bom">

```xml
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.expediagroup</groupId>
<artifactId>graphql-kotlin-bom</artifactId>
<version>${latestVersion}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>com.expediagroup</groupId>
<artifactId>graphql-kotlin-spring-server</artifactId>
</dependency>
</dependencies>
```

</TabItem>
</Tabs>

Expand Down
Loading