Skip to content
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
7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ jobs:
with:
ref: "master"
fetch-depth: 0
# com.gradle.plugin-publish 2.x (used by publishPlugins in post-release.sh) requires a Java 17+ runtime
- name: Set up Java 17
if: env.RELEASE_OK == 'yes'
uses: actions/setup-java@v5
with:
java-version: 17
distribution: temurin
- name: Run post release script
id: postRelease
if: env.RELEASE_OK == 'yes'
Expand Down
59 changes: 37 additions & 22 deletions modules/swagger-gradle-plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
// * * * * * * * * * * * *
// Plugins
// * * * * * * * * * * * *
// com.gradle.plugin-publish 2.x requires a Java 17+ runtime; it is only needed for publishPlugins,
// so it's applied only when Gradle runs on Java 17+ and the build keeps working on Java 11
buildscript {
repositories {
gradlePluginPortal()
}
dependencies {
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) {
classpath 'com.gradle.publish:plugin-publish-plugin:2.2.1'
}
}
}

plugins {
id 'java-gradle-plugin'
// Publishing publicly
id 'com.gradle.plugin-publish' version '0.21.0'
// Publishing to maven
id 'maven-publish'
}

def pluginPublishSupported = JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)
if (pluginPublishSupported) {
// Publishing publicly
apply plugin: 'com.gradle.plugin-publish'
}

// * * * * * * * * * * * *
// Dependencies
// * * * * * * * * * * * *
Expand Down Expand Up @@ -76,35 +93,33 @@ project.ext.pluginId = 'io.swagger.core.v3.swagger-gradle-plugin'
project.ext.scm = 'https://github.com/swagger-api/swagger-core.git'
project.ext.url = 'https://github.com/swagger-api/swagger-core/tree/master/modules/swagger-gradle-plugin'

// Configuration for: java-gradle-plugin
// Configuration for: java-gradle-plugin + com.gradle.plugin-publish
gradlePlugin {
website = project.url
vcsUrl = project.scm
plugins {
swagger {
id = project.pluginId
implementationClass = 'io.swagger.v3.plugins.gradle.SwaggerPlugin'
displayName = 'Swagger Gradle Plugin'
description = project.description
tags.set(['swagger', 'openapi', 'api'])
}
}
}

// * * * * * * * * * * * *
// Publishing
// * * * * * * * * * * * *


// Publishing to plugins.gradle.org
// --------------------------------

// Configuration for: com.gradle.plugin-publish
pluginBundle {
website = project.url
vcsUrl = project.scm
tags = ['swagger', 'openapi', 'api']

plugins {
swagger {
displayName = 'Swagger Gradle Plugin '
description = project.description
id = project.pluginId
if (pluginPublishSupported) {
gradlePlugin {
plugins {
swagger {
// Groovy DSL requires passing `it` as the receiver
compatibility(it) {
features {
configurationCache = true
isolatedProjects = true
}
}
}
}
}
}
Expand Down
Loading