Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change to SPDX license header in Gradle #10445

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
9 changes: 0 additions & 9 deletions application.yml

This file was deleted.

105 changes: 57 additions & 48 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
/*
* Copyright (C) 2022-2025 Hedera Hashgraph, 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
*
* http://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.
*/
// SPDX-License-Identifier: Apache-2.0

import com.github.gradle.node.npm.task.NpmSetupTask
import java.nio.file.Paths
Expand Down Expand Up @@ -163,25 +149,7 @@
}

spotless {
val licenseHeader =
"""
/*
* Copyright (C) ${'$'}YEAR Hedera Hashgraph, 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
*
* http://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.
*/${"\n\n"}
"""
.trimIndent()
val licenseHeader = "// SPDX-License-Identifier: Apache-2.0\n\n"

val npmExec =
when (System.getProperty("os.name").lowercase().contains("windows")) {
Expand All @@ -199,73 +167,114 @@

format("go") {
endWithNewline()
licenseHeader(licenseHeader, "package").updateYearWithLatest(true)
licenseHeader(licenseHeader, "package")

Check warning on line 170 in build.gradle.kts

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

build.gradle.kts#L170

Multiple occurrences of the same string literal within a single file detected. Prefer extracting the string literal into a property or constant.
target("hedera-mirror-rosetta/**/*.go")
targetExclude("build/**")
targetExclude("**/build/**")

Check warning on line 172 in build.gradle.kts

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

build.gradle.kts#L172

Multiple occurrences of the same string literal within a single file detected. Prefer extracting the string literal into a property or constant.
trimTrailingWhitespace()
}
format("helm") {
endWithNewline()
leadingTabsToSpaces(2)
licenseHeader(licenseHeader.replaceFirst("//", "#"), "^[a-zA-Z0-9{]+")
target("charts/**/*.yaml", "charts/**/*.yml")
trimTrailingWhitespace()
}
format("javascript") {
endWithNewline()
leadingTabsToSpaces(2)
licenseHeader(licenseHeader, "$").updateYearWithLatest(true)
licenseHeader(licenseHeader, "$")
prettier()
.npmExecutable(npmExecutable)
.npmInstallCache(Paths.get("${rootProject.rootDir}", ".gradle", "spotless"))
.config(mapOf("bracketSpacing" to false, "printWidth" to 120, "singleQuote" to true))
target("hedera-mirror-rest/**/*.js", "hedera-mirror-test/**/*.js")
target("hedera-mirror-rest/**/*.js", "hedera-mirror-test/k6/**/*.js", "tools/**/*.js")
targetExclude("**/build/**", "**/node_modules/**", "**/__tests__/integration/*.test.js")
}
java {
endWithNewline()
licenseHeader(licenseHeader, "package")
palantirJavaFormat()
licenseHeader(licenseHeader, "package").updateYearWithLatest(true)
removeUnusedImports()
target("**/*.java")
targetExclude(
"**/build/**",
"hedera-mirror-rest/**",
"hedera-mirror-rosetta/**",
// Known issue with Java 21: https://github.com/palantir/palantir-java-format/issues/933
"hedera-mirror-rest-java/**/EntityServiceImpl.java",
"tools/**",
)
toggleOffOn()
trimTrailingWhitespace()
}
kotlin {
endWithNewline()
ktfmt().kotlinlangStyle()
licenseHeader(licenseHeader, "package").updateYearWithLatest(true)
licenseHeader(licenseHeader, "package")
target("buildSrc/**/*.kt")
targetExclude("**/build/**")
}
kotlinGradle {
endWithNewline()
ktfmt().kotlinlangStyle()
licenseHeader(licenseHeader, "(description|import|plugins)").updateYearWithLatest(true)
licenseHeader(licenseHeader, "(description|import|plugins)")
target("*.kts", "*/*.kts", "buildSrc/**/*.kts", "hedera-mirror-rest/*/*.kts")
targetExclude("**/build/**")
targetExclude("**/build/**", "**/node_modules/**")
trimTrailingWhitespace()
}
format("miscellaneous") {
endWithNewline()
leadingTabsToSpaces(2)
prettier().npmExecutable(npmExecutable)
target("**/*.json", "**/*.md", "**/*.yml", "**/*.yaml")
targetExclude("**/build/**", "**/charts/**", "**/node_modules/**", "**/package-lock.json")
prettier()
.npmExecutable(npmExecutable)
.npmInstallCache(Paths.get("${rootProject.rootDir}", ".gradle", "spotless"))
target("**/*.json", "**/*.md")
targetExclude(
"**/build/**",
"**/charts/**/dashboards/**",
"**/node_modules/**",
"**/package-lock.json",
)
trimTrailingWhitespace()
}
format("proto") {
endWithNewline()
leadingTabsToSpaces(4)
licenseHeader(licenseHeader, "(package|syntax)").updateYearWithLatest(true)
licenseHeader(licenseHeader, "(package|syntax)")
target("hedera-mirror-protobuf/**/*.proto")
targetExclude("build/**")
targetExclude("**/build/**")
trimTrailingWhitespace()
}
format("shell") {
endWithNewline()
leadingTabsToSpaces(2)
licenseHeader(licenseHeader.replaceFirst("//", "#"), "^#!")
target("**/*.sh")
targetExclude("**/build/**", "**/node_modules/**")
trimTrailingWhitespace()
}
sql {
endWithNewline()
leadingTabsToSpaces()
target("hedera-mirror-(common|importer|rest)/**/*.sql")
target(
"hedera-mirror-common/**/*.sql",
"hedera-mirror-importer/**/*.sql",
"hedera-mirror-rest/**/*.sql",
)
targetExclude("**/build/**", "**/node_modules/**")
trimTrailingWhitespace()
}
format("yaml") {
endWithNewline()
leadingTabsToSpaces(2)
prettier()
.npmExecutable(npmExecutable)
.npmInstallCache(Paths.get("${rootProject.rootDir}", ".gradle", "spotless"))
licenseHeader(licenseHeader.replaceFirst("//", "#"), "^[a-zA-Z0-9{]+")
target("**/*.yaml", "**/*.yml")
targetExclude("**/build/**", "charts/**", "**/node_modules/**")
trimTrailingWhitespace()
}
}

fun replaceVersion(files: String, match: String) {
Expand Down
1 change: 1 addition & 0 deletions charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ a [Standalone NEG](https://cloud.google.com/kubernetes-engine/docs/how-to/standa
1. Create a Kubernetes cluster utilizing a custom subnet.

This can be done by setting a unique name for the subnet in the UI or through the console with the following command

```shell script
gcloud container clusters create mirror-node \
--enable-ip-alias \
Expand Down
Loading
Loading