Skip to content

Commit

Permalink
Run spotless on build files too (#702)
Browse files Browse the repository at this point in the history
<!--
  ⬆ Put your description above this! ⬆

  Please be descriptive and detailed.
  
Please read our [Contributing
Guidelines](https://github.com/tinyspeck/slack-gradle-plugin/blob/main/.github/CONTRIBUTING.md)
and [Code of Conduct](https://slackhq.github.io/code-of-conduct).

Don't worry about deleting this, it's not visible in the PR!
-->
  • Loading branch information
ZacSweers authored Jan 4, 2024
1 parent 7236f5b commit 98c24fd
Show file tree
Hide file tree
Showing 8 changed files with 125 additions and 11 deletions.
15 changes: 15 additions & 0 deletions agp-handlers/agp-handler-82/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (C) 2023 Slack Technologies, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
kotlin("jvm")
alias(libs.plugins.ksp)
Expand Down
15 changes: 15 additions & 0 deletions agp-handlers/agp-handler-83/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (C) 2023 Slack Technologies, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
kotlin("jvm")
alias(libs.plugins.ksp)
Expand Down
15 changes: 15 additions & 0 deletions agp-handlers/agp-handler-api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (C) 2023 Slack Technologies, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
kotlin("jvm")
alias(libs.plugins.mavenPublish)
Expand Down
25 changes: 15 additions & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ allprojects {
targetExclude("**/spotless.kt", "**/Aliases.kt")
}
kotlinGradle {
target("src/**/*.kts")
target("*.kts", "src/**/*.kts")
ktfmt(ktfmtVersion).googleStyle()
trimTrailingWhitespace()
endWithNewline()
licenseHeaderFile(
rootProject.file("spotless/spotless.kt"),
"(import|plugins|buildscript|dependencies|pluginManagement)"
"(import|plugins|buildscript|dependencies|pluginManagement|dependencyResolutionManagement)"
)
}
}
Expand Down Expand Up @@ -190,10 +190,16 @@ subprojects {
configure<BuildConfigExtension> {
buildConfigField("String", "KOTLIN_VERSION", "\"$kotlinVersion\"")
// Using Any here due to https://github.com/gmazzo/gradle-buildconfig-plugin/issues/9
buildConfigField("kotlin.collections.List<String>", "KOTLIN_COMPILER_ARGS",
"listOf(${kotlinBuildConfig.kotlinCompilerArgs.joinToString(", ") { "\"$it\"" }})")
buildConfigField("kotlin.collections.List<String>", "KOTLIN_JVM_COMPILER_ARGS",
"listOf(${kotlinBuildConfig.kotlinJvmCompilerArgs.joinToString(", ") { "\"$it\"" }})")
buildConfigField(
"kotlin.collections.List<String>",
"KOTLIN_COMPILER_ARGS",
"listOf(${kotlinBuildConfig.kotlinCompilerArgs.joinToString(", ") { "\"$it\"" }})"
)
buildConfigField(
"kotlin.collections.List<String>",
"KOTLIN_JVM_COMPILER_ARGS",
"listOf(${kotlinBuildConfig.kotlinJvmCompilerArgs.joinToString(", ") { "\"$it\"" }})"
)
}
}
}
Expand Down Expand Up @@ -288,10 +294,9 @@ subprojects {
localDirectory.set(layout.projectDirectory.dir("src").asFile)
val relPath = rootProject.projectDir.toPath().relativize(projectDir.toPath())
remoteUrl.set(
providers.gradleProperty("POM_SCM_URL")
.map { scmUrl ->
URI("$scmUrl/tree/main/$relPath/src").toURL()
}
providers.gradleProperty("POM_SCM_URL").map { scmUrl ->
URI("$scmUrl/tree/main/$relPath/src").toURL()
}
)
remoteLineSuffix.set("#L")
}
Expand Down
15 changes: 15 additions & 0 deletions skate-plugin/artifactory-authenticator/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (C) 2023 Slack Technologies, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
java
alias(libs.plugins.kotlin.jvm)
Expand Down
21 changes: 20 additions & 1 deletion skate-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (C) 2023 Slack Technologies, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import com.jetbrains.plugin.structure.base.utils.exists
import java.nio.file.Paths
import java.util.Locale
Expand Down Expand Up @@ -64,7 +79,11 @@ fun readGitRepoCommit(): String? {
buildConfig {
packageName("com.slack.sgp.intellij")
buildConfigField("String", "VERSION", "\"${project.property("VERSION_NAME")}\"")
buildConfigField("String", "BUGSNAG_KEY", "\"${project.findProperty("SgpIntellijBugsnagKey")?.toString().orEmpty()}\"")
buildConfigField(
"String",
"BUGSNAG_KEY",
"\"${project.findProperty("SgpIntellijBugsnagKey")?.toString().orEmpty()}\""
)
buildConfigField("String", "GIT_SHA", provider { "\"${readGitRepoCommit().orEmpty()}\"" })
useKotlinOutput {
topLevelConstants = true
Expand Down
15 changes: 15 additions & 0 deletions slack-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (C) 2023 Slack Technologies, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType

plugins {
Expand Down
15 changes: 15 additions & 0 deletions tracing/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (C) 2023 Slack Technologies, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
kotlin("jvm")
alias(libs.plugins.wire)
Expand Down

0 comments on commit 98c24fd

Please sign in to comment.