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(plugin): new GraalVm metadata Gradle task #1743

Merged
merged 3 commits into from
Apr 11, 2023

Conversation

dariuszkuc
Copy link
Collaborator

📝 Description

Create new Gradle task that automatically generates GraalVm reachability metadata for GraphQL Kotlin servers.

Following metadata files are generated:

  • native-image.properties
  • reflect-config.json
  • resource-config.json

Usage:

plugins {
  kotlin("jvm") version "1.7.21"
  application
  id("org.graalvm.buildtools.native") version "0.9.20"
  id("com.expediagroup.graphql") version $graphQLKotlinVersion
}

// other build configuration goes here

graphql {
  graalVm {
    packages = listOf("com.example")
  }
}

🔗 Related Issues

Create new Gradle task that automatically generates GraalVm reachability metadata for GraphQL Kotlin servers.

Following metadata files are generated:
* `native-image.properties`
* `reflect-config.json`
* `resource-config.json`

Usage:

```
plugins {
  kotlin("jvm") version "1.7.21"
  application
  id("org.graalvm.buildtools.native") version "0.9.20"
  id("com.expediagroup.graphql") version $graphQLKotlinVersion
}

// other build configuration goes here

graphql {
  graalVm {
    packages = listOf("com.example")
  }
}
```
@dariuszkuc dariuszkuc added changes: minor Changes require a minor version module: plugin Issue affects the plugins code labels Apr 10, 2023
@dariuszkuc
Copy link
Collaborator Author

To keep PR sizes manageable, I'll add the example integration project in subsequent PR.

@dariuszkuc dariuszkuc merged commit f4ba9b4 into ExpediaGroup:master Apr 11, 2023
@dariuszkuc dariuszkuc deleted the graalvm_gradle_plugin branch April 11, 2023 13:47
dariuszkuc added a commit that referenced this pull request Apr 29, 2023
### 📝 Description

Create new `GenerateGraalVmMetadataMojo` that introduces new `generate-graalvm-metadata` goal. New goal generates GraalVM reachability metadata for `graphql-kotlin` servers.

Usage (this only generates metadata, in order to generate native image you will also need to configure `org.graalvm.buildtools:native-maven-plugin`, see example integration)

```xml
<plugin>
    <groupId>com.expediagroup</groupId>
    <artifactId>graphql-kotlin-maven-plugin</artifactId>
    <version>${graphql-kotlin.version}</version>
    <executions>
        <execution>
            <goals>
                <goal>generate-graalvm-metadata</goal>
            </goals>
            <configuration>
                <!-- list of packages that can contain our GraphQL schema -->
                <packages>com.expediagroup.graalvm</packages>
                <!-- application main class name -->
                <mainClassName>com.example.ApplicationKt</mainClassName>
            </configuration>
        </execution>
    </executions>
</plugin>
```

### 🔗 Related Issues

Corresponding Gradle plugin PR -> #1743
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes: minor Changes require a minor version module: plugin Issue affects the plugins code
Development

Successfully merging this pull request may close these issues.

2 participants