Skip to content

Commit

Permalink
feat: Support graphql-kotlin-bom (#2020)
Browse files Browse the repository at this point in the history
### 📝 Description

Adding a support on `graphql-kotlin-bom`

Generated BOM looks like this:

```
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <!-- This module was also published with a richer model, Gradle metadata,  -->
  <!-- which should be used instead. Do not delete the following line which  -->
  <!-- is to indicate to Gradle or any Gradle module metadata file consumer  -->
  <!-- that they should prefer consuming it instead. -->
  <!-- do_not_remove: published-with-gradle-metadata -->
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.expediagroup</groupId>
  <artifactId>graphql-kotlin-bom</artifactId>
  <version>8.0.0-SNAPSHOT</version>
  <packaging>pom</packaging>
  <name>graphql-kotlin-bom</name>
  <description>BOM (Bill Of Materials) for graphql-kotlin</description>
  <dependencies>
    <dependency>
      <groupId>com.expediagroup</groupId>
      <artifactId>graphql-kotlin-automatic-persisted-queries</artifactId>
      <version>8.0.0-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.expediagroup</groupId>
      <artifactId>graphql-kotlin-client</artifactId>
      <version>8.0.0-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.expediagroup</groupId>
      <artifactId>graphql-kotlin-client-generator</artifactId>
      <version>8.0.0-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.expediagroup</groupId>
      <artifactId>graphql-kotlin-client-jackson</artifactId>
      <version>8.0.0-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.expediagroup</groupId>
      <artifactId>graphql-kotlin-client-serialization</artifactId>
      <version>8.0.0-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.expediagroup</groupId>
      <artifactId>graphql-kotlin-dataloader</artifactId>
      <version>8.0.0-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.expediagroup</groupId>
      <artifactId>graphql-kotlin-dataloader-instrumentation</artifactId>
      <version>8.0.0-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.expediagroup</groupId>
      <artifactId>graphql-kotlin-federated-hooks-provider</artifactId>
      <version>8.0.0-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.expediagroup</groupId>
      <artifactId>graphql-kotlin-federation</artifactId>
      <version>8.0.0-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.expediagroup</groupId>
      <artifactId>graphql-kotlin-graalvm-metadata-generator</artifactId>
      <version>8.0.0-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.expediagroup</groupId>
      <artifactId>graphql-kotlin-gradle-plugin</artifactId>
      <version>8.0.0-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.expediagroup</groupId>
      <artifactId>graphql-kotlin-hooks-provider</artifactId>
      <version>8.0.0-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.expediagroup</groupId>
      <artifactId>graphql-kotlin-ktor-client</artifactId>
      <version>8.0.0-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.expediagroup</groupId>
      <artifactId>graphql-kotlin-ktor-server</artifactId>
      <version>8.0.0-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.expediagroup</groupId>
      <artifactId>graphql-kotlin-maven-plugin</artifactId>
      <version>8.0.0-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.expediagroup</groupId>
      <artifactId>graphql-kotlin-schema-generator</artifactId>
      <version>8.0.0-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.expediagroup</groupId>
      <artifactId>graphql-kotlin-sdl-generator</artifactId>
      <version>8.0.0-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.expediagroup</groupId>
      <artifactId>graphql-kotlin-server</artifactId>
      <version>8.0.0-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.expediagroup</groupId>
      <artifactId>graphql-kotlin-spring-client</artifactId>
      <version>8.0.0-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.expediagroup</groupId>
      <artifactId>graphql-kotlin-spring-server</artifactId>
      <version>8.0.0-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>
</project>
```

### 🔗 Related Issues

---------

Co-authored-by: Kevin Jung <kjung@expediagroup.com>
  • Loading branch information
mykevinjung and Kevin Jung committed Jul 23, 2024
1 parent c6c2782 commit 778e776
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 1 deletion.
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

0 comments on commit 778e776

Please sign in to comment.