Skip to content

Commit

Permalink
Merge pull request #1415 from MikeEdgar/issue-1300
Browse files Browse the repository at this point in the history
Update Gradle Plugin build for publishing
  • Loading branch information
phillip-kruger authored Mar 23, 2023
2 parents 9a2013f + a5fa01f commit bc8fc30
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 66 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,12 @@ jobs:
git push
git push --tags
# TODO requires the GRADLE_PUBLISH_KEY + GRADLE_PUBLISH_SECRET secrets - via https://plugins.gradle.org/user/login (IIRC)
#- name: gradle release ${{steps.metadata.outputs.current-version}}
# uses: gradle/gradle-build-action@v2
# with:
# build-root-directory: ./tools/gradle-plugin
# cache-read-only: true
# arguments: publishPlugins -Pgradle.publish.key=${{secrets.GRADLE_PUBLISH_KEY}} -Pgradle.publish.secret=${{secrets.GRADLE_PUBLISH_SECRET}}
- name: Gradle plugin release ${{steps.metadata.outputs.current-version}}
uses: gradle/gradle-build-action@v2
with:
build-root-directory: ./tools/gradle-plugin
cache-read-only: true
arguments: publishPlugins -Pgradle.publish.key=${{secrets.GRADLE_PUBLISH_KEY}} -Pgradle.publish.secret=${{secrets.GRADLE_PUBLISH_SECRET}}

- uses: actions/upload-artifact@v3
name: tck-report
Expand Down
73 changes: 73 additions & 0 deletions tools/gradle-plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
plugins {
id 'java-gradle-plugin'
id("com.gradle.plugin-publish") version "1.1.0"
id("com.github.vlsi.jandex") version "1.87"
}

group = "io.smallrye"

if (JavaVersion.current().isJava9Compatible()) {
compileJava.options.compilerArgs.addAll(['--release', '8'])
}

compileJava {
options.encoding = 'UTF-8'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}

compileTestJava {
options.encoding = 'UTF-8'
}

repositories {
mavenLocal()
mavenCentral()
maven {
url = uri("file:./target/dependencies")
}
}

dependencies {
implementation("io.smallrye:smallrye-open-api-core:${version}")
implementation("io.smallrye:smallrye-open-api-jaxrs:${version}")
implementation("io.smallrye:smallrye-open-api-spring:${version}")
implementation("io.smallrye:smallrye-open-api-vertx:${version}")
implementation("io.smallrye.config:smallrye-config:${versionConfig}")

testImplementation("org.junit.jupiter:junit-jupiter:${versionJunit5}")
testImplementation(gradleTestKit())
testImplementation("org.assertj:assertj-core:3.24.2")
testImplementation("com.fasterxml.jackson.core:jackson-databind:${versionJackson}")
}

test {
testLogging {
events "passed", "skipped", "failed"
}
useJUnitPlatform()
// multiple Gradle invocations executed from the same testing JVM cause problems, so fork
// for each test, and make sure we only run one Gradle execution in each test
forkEvery 1
}

gradlePlugin {
website = 'https://github.com/smallrye/smallrye-open-api/'
vcsUrl = 'https://github.com/smallrye/smallrye-open-api/'
plugins {
smallryeOpenAPIPlugin {
id = 'io.smallrye.openapi'
implementationClass = 'io.smallrye.openapi.gradleplugin.SmallryeOpenApiPlugin'
description = 'SmallRye: MicroProfile OpenAPI Gradle Plugin'
displayName = 'SmallRye: MicroProfile OpenAPI Gradle Plugin'
description = 'SmallRye: MicroProfile GraphQL Gradle Plugin'
tags.set([ 'smallrye', 'openapi', 'microprofile' ])
}
}
}

wrapper {
distributionType = Wrapper.DistributionType.ALL
}

tasks.pluginUnderTestMetadata.dependsOn(processJandexIndex)
58 changes: 0 additions & 58 deletions tools/gradle-plugin/build.gradle.kts

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion tools/gradle-plugin/src/maven-build/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# DO ONLY MODIFY THE FILE IN src/maven-build !
#
version=${project.version}
configVersion=${version.io.smallrye.smallrye-config}
versionConfig=${version.io.smallrye.smallrye-config}
versionJackson=${jackson-bom.version}
versionJunit5=${version.junit5}

0 comments on commit bc8fc30

Please sign in to comment.