Skip to content

Commit

Permalink
Apply Spotless check for build-logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Goooler committed Sep 23, 2024
1 parent f54eb0f commit c800ddd
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 53 deletions.
14 changes: 7 additions & 7 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
plugins {
`kotlin-dsl`
`kotlin-dsl`
}

repositories {
mavenCentral()
gradlePluginPortal()
mavenCentral()
gradlePluginPortal()
}

dependencies {
implementation("com.gradle.publish:plugin-publish-plugin:1.3.0")
implementation("com.vanniktech:gradle-maven-publish-plugin:0.29.0")
implementation("org.ajoberstar.git-publish:gradle-git-publish:4.2.2")
implementation("com.github.node-gradle:gradle-node-plugin:7.0.2")
implementation("com.gradle.publish:plugin-publish-plugin:1.3.0")
implementation("com.vanniktech:gradle-maven-publish-plugin:0.29.0")
implementation("org.ajoberstar.git-publish:gradle-git-publish:4.2.2")
implementation("com.github.node-gradle:gradle-node-plugin:7.0.2")
}
40 changes: 20 additions & 20 deletions build-logic/src/main/kotlin/shadow.convention.deploy.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
import org.apache.tools.ant.filters.ReplaceTokens

plugins {
id("org.ajoberstar.git-publish")
id("com.github.node-gradle.node")
id("org.ajoberstar.git-publish")
id("com.github.node-gradle.node")
}

gitPublish {
repoUri = "https://github.com/GradleUp/shadow.git"
branch = "gh-pages"
contents {
from("build/site")
into("api") {
from(tasks.named("groovydoc"))
}
filter<ReplaceTokens>(
"tokens" to mapOf(
"version" to version,
"snapshot-version" to "$version-SNAPSHOT",
)
)
repoUri = "https://github.com/GradleUp/shadow.git"
branch = "gh-pages"
contents {
from("build/site")
into("api") {
from(tasks.named("groovydoc"))
}
filter<ReplaceTokens>(
"tokens" to mapOf(
"version" to version,
"snapshot-version" to "$version-SNAPSHOT",
),
)
}
}

node {
yarnVersion = "1.5.1"
yarnVersion = "1.5.1"
}

val yarnBuild = tasks.named("yarn_build") {
inputs.files(fileTree("src/docs"))
outputs.dir(file("build/site"))
dependsOn(tasks.yarn)
inputs.files(fileTree("src/docs"))
outputs.dir(file("build/site"))
dependsOn(tasks.yarn)
}

tasks.gitPublishCopy {
dependsOn(yarnBuild, tasks.named("groovydoc"))
dependsOn(yarnBuild, tasks.named("groovydoc"))
}
52 changes: 26 additions & 26 deletions build-logic/src/main/kotlin/shadow.convention.publish.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
plugins {
id("com.gradle.plugin-publish")
id("com.vanniktech.maven.publish")
id("com.gradle.plugin-publish")
id("com.vanniktech.maven.publish")
}

version = providers.gradleProperty("VERSION_NAME").get()
group = providers.gradleProperty("GROUP").get()
description = providers.gradleProperty("POM_DESCRIPTION").get()

java {
withSourcesJar()
withJavadocJar()
withSourcesJar()
withJavadocJar()
}

gradlePlugin {
website = providers.gradleProperty("POM_URL")
vcsUrl = providers.gradleProperty("POM_URL")
website = providers.gradleProperty("POM_URL")
vcsUrl = providers.gradleProperty("POM_URL")

plugins {
create("shadowPlugin") {
id = "com.gradleup.shadow"
implementationClass = "com.github.jengelman.gradle.plugins.shadow.ShadowPlugin"
displayName = providers.gradleProperty("POM_NAME").get()
description = providers.gradleProperty("POM_DESCRIPTION").get()
tags = listOf("onejar", "shade", "fatjar", "uberjar")
}
plugins {
create("shadowPlugin") {
id = "com.gradleup.shadow"
implementationClass = "com.github.jengelman.gradle.plugins.shadow.ShadowPlugin"
displayName = providers.gradleProperty("POM_NAME").get()
description = providers.gradleProperty("POM_DESCRIPTION").get()
tags = listOf("onejar", "shade", "fatjar", "uberjar")
}
}
}

tasks.publishPlugins {
doFirst {
if (version.toString().endsWith("SNAPSHOT")) {
error("Cannot publish SNAPSHOT versions to Plugin Portal!")
}
doFirst {
if (version.toString().endsWith("SNAPSHOT")) {
error("Cannot publish SNAPSHOT versions to Plugin Portal!")
}
notCompatibleWithConfigurationCache("https://github.com/gradle/gradle/issues/21283")
}
notCompatibleWithConfigurationCache("https://github.com/gradle/gradle/issues/21283")
}

tasks.withType<Javadoc>().configureEach {
(options as? StandardJavadocDocletOptions)?.let {
it.links(
"https://docs.oracle.com/en/java/javase/17/docs/api/",
"https://docs.groovy-lang.org/2.4.7/html/gapi/"
)
it.addStringOption("Xdoclint:none", "-quiet")
}
(options as? StandardJavadocDocletOptions)?.let {
it.links(
"https://docs.oracle.com/en/java/javase/17/docs/api/",
"https://docs.groovy-lang.org/2.4.7/html/gapi/",
)
it.addStringOption("Xdoclint:none", "-quiet")
}
}
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ java {
spotless {
kotlinGradle {
ktlint()
target("**/*.kts")
targetExclude("build-logic/build/**")
}
}

Expand Down

0 comments on commit c800ddd

Please sign in to comment.