From 98c24fd03fdb862494662f253f306c79fd32926b Mon Sep 17 00:00:00 2001 From: Zac Sweers Date: Thu, 4 Jan 2024 12:58:18 -0500 Subject: [PATCH] Run spotless on build files too (#702) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- agp-handlers/agp-handler-82/build.gradle.kts | 15 +++++++++++ agp-handlers/agp-handler-83/build.gradle.kts | 15 +++++++++++ agp-handlers/agp-handler-api/build.gradle.kts | 15 +++++++++++ build.gradle.kts | 25 +++++++++++-------- .../build.gradle.kts | 15 +++++++++++ skate-plugin/build.gradle.kts | 21 +++++++++++++++- slack-plugin/build.gradle.kts | 15 +++++++++++ tracing/build.gradle.kts | 15 +++++++++++ 8 files changed, 125 insertions(+), 11 deletions(-) diff --git a/agp-handlers/agp-handler-82/build.gradle.kts b/agp-handlers/agp-handler-82/build.gradle.kts index 658868fa2..762b014b2 100644 --- a/agp-handlers/agp-handler-82/build.gradle.kts +++ b/agp-handlers/agp-handler-82/build.gradle.kts @@ -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) diff --git a/agp-handlers/agp-handler-83/build.gradle.kts b/agp-handlers/agp-handler-83/build.gradle.kts index 5e81dbf58..9287ba0bf 100644 --- a/agp-handlers/agp-handler-83/build.gradle.kts +++ b/agp-handlers/agp-handler-83/build.gradle.kts @@ -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) diff --git a/agp-handlers/agp-handler-api/build.gradle.kts b/agp-handlers/agp-handler-api/build.gradle.kts index 4e96f8f5c..95a432372 100644 --- a/agp-handlers/agp-handler-api/build.gradle.kts +++ b/agp-handlers/agp-handler-api/build.gradle.kts @@ -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) diff --git a/build.gradle.kts b/build.gradle.kts index d6879aca1..d7a219230 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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)" ) } } @@ -190,10 +190,16 @@ subprojects { configure { buildConfigField("String", "KOTLIN_VERSION", "\"$kotlinVersion\"") // Using Any here due to https://github.com/gmazzo/gradle-buildconfig-plugin/issues/9 - buildConfigField("kotlin.collections.List", "KOTLIN_COMPILER_ARGS", - "listOf(${kotlinBuildConfig.kotlinCompilerArgs.joinToString(", ") { "\"$it\"" }})") - buildConfigField("kotlin.collections.List", "KOTLIN_JVM_COMPILER_ARGS", - "listOf(${kotlinBuildConfig.kotlinJvmCompilerArgs.joinToString(", ") { "\"$it\"" }})") + buildConfigField( + "kotlin.collections.List", + "KOTLIN_COMPILER_ARGS", + "listOf(${kotlinBuildConfig.kotlinCompilerArgs.joinToString(", ") { "\"$it\"" }})" + ) + buildConfigField( + "kotlin.collections.List", + "KOTLIN_JVM_COMPILER_ARGS", + "listOf(${kotlinBuildConfig.kotlinJvmCompilerArgs.joinToString(", ") { "\"$it\"" }})" + ) } } } @@ -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") } diff --git a/skate-plugin/artifactory-authenticator/build.gradle.kts b/skate-plugin/artifactory-authenticator/build.gradle.kts index a245c88e4..e25bebe59 100644 --- a/skate-plugin/artifactory-authenticator/build.gradle.kts +++ b/skate-plugin/artifactory-authenticator/build.gradle.kts @@ -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) diff --git a/skate-plugin/build.gradle.kts b/skate-plugin/build.gradle.kts index 42391ccda..f0656d6ed 100644 --- a/skate-plugin/build.gradle.kts +++ b/skate-plugin/build.gradle.kts @@ -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 @@ -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 diff --git a/slack-plugin/build.gradle.kts b/slack-plugin/build.gradle.kts index bbdd5ae3a..ab113fd97 100644 --- a/slack-plugin/build.gradle.kts +++ b/slack-plugin/build.gradle.kts @@ -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 { diff --git a/tracing/build.gradle.kts b/tracing/build.gradle.kts index bab538db7..1f36fc75d 100644 --- a/tracing/build.gradle.kts +++ b/tracing/build.gradle.kts @@ -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)