Skip to content

Commit

Permalink
chore: update license headers (#21)
Browse files Browse the repository at this point in the history
This PR updates the license headers as defined in
hiero-ledger/hiero#26

It updates:
- The headers in the files in this repository
- The header spotless rules to update the headers in the repositories
  that are going to use these plugins

Signed-off-by: Jendrik Johannes <[email protected]>
  • Loading branch information
jjohannes authored Nov 22, 2024
1 parent 15b7699 commit cf4c33d
Show file tree
Hide file tree
Showing 53 changed files with 64 additions and 955 deletions.
43 changes: 5 additions & 38 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
/*
* Copyright (C) 2022-2024 Hiero a Series of LF Projects, 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
plugins {
`kotlin-dsl`
id("signing")
Expand Down Expand Up @@ -125,35 +110,17 @@ testing {
}

spotless {
val header =
"""
/*
* Copyright (C) ${'$'}YEAR Hiero a Series of LF Projects, 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 top =
val header = "// SPDX-License-Identifier: Apache-2.0\n"
val delimiter =
"(import|package|plugins|pluginManagement|dependencyResolutionManagement|repositories|tasks|allprojects|subprojects|buildCache|version)"

kotlinGradle {
ktfmt().kotlinlangStyle()
licenseHeader(header, top).updateYearWithLatest(true)
licenseHeader(header, delimiter)
}
kotlin {
ktfmt().kotlinlangStyle()
targetExclude("build/**")
licenseHeader(header, top).updateYearWithLatest(true)
licenseHeader(header, delimiter)
}
}
17 changes: 1 addition & 16 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
/*
* Copyright (C) 2024 Hiero a Series of LF Projects, 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
plugins { id("com.gradle.develocity") version "3.18.2" }

rootProject.name = "hiero-gradle-conventions"
Expand Down
17 changes: 1 addition & 16 deletions src/main/kotlin/org.hiero.gradle.base.jpms-modules.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
/*
* Copyright (C) 2016-2024 Hiero a Series of LF Projects, 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
plugins {
id("org.gradlex.jvm-dependency-conflict-resolution")
id("org.gradlex.extra-java-module-info")
Expand Down
17 changes: 1 addition & 16 deletions src/main/kotlin/org.hiero.gradle.base.lifecycle.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
/*
* Copyright (C) 2016-2024 Hiero a Series of LF Projects, 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
plugins { id("base") }

// Convenience for local development: when running './gradlew' without any parameters show the tasks
Expand Down
17 changes: 1 addition & 16 deletions src/main/kotlin/org.hiero.gradle.base.version.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
/*
* Copyright (C) 2016-2024 Hiero a Series of LF Projects, 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
version =
providers
.fileContents(isolated.rootProject.projectDirectory.file("version.txt"))
Expand Down
17 changes: 1 addition & 16 deletions src/main/kotlin/org.hiero.gradle.build.settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
/*
* Copyright (C) 2022-2024 Hiero a Series of LF Projects, 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 org.gradlex.javamodule.dependencies.initialization.JavaModulesExtension
import org.gradlex.javamodule.dependencies.initialization.RootPluginsExtension

Expand Down
17 changes: 1 addition & 16 deletions src/main/kotlin/org.hiero.gradle.check.dependencies.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
/*
* Copyright (C) 2024 Hiero a Series of LF Projects, 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.autonomousapps.DependencyAnalysisExtension
import com.autonomousapps.DependencyAnalysisSubExtension
import org.gradlex.javamodule.dependencies.tasks.ModuleDirectivesOrderingCheck
Expand Down
17 changes: 1 addition & 16 deletions src/main/kotlin/org.hiero.gradle.check.javac-lint.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
/*
* Copyright (C) 2024 Hiero a Series of LF Projects, 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
plugins { id("java") }

val deactivatedCompileLintOptions =
Expand Down
40 changes: 2 additions & 38 deletions src/main/kotlin/org.hiero.gradle.check.spotless-java.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
/*
* Copyright (C) 2022-2024 Hiero a Series of LF Projects, 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 org.hiero.gradle.spotless.RepairDashedCommentsFormatterStep
import org.hiero.gradle.spotless.SortModuleInfoRequiresStep

Expand All @@ -37,27 +22,6 @@ spotless {
// through git history (see "license" section below).
// The delimiter override below is required to support some
// of our test classes which are in the default package.
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(),
"(package|import|module)"
)
.updateYearWithLatest(true)
licenseHeader("// SPDX-License-Identifier: Apache-2.0\n", "(package|import|module)")
}
}
41 changes: 4 additions & 37 deletions src/main/kotlin/org.hiero.gradle.check.spotless-kotlin.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,46 +1,13 @@
/*
* Copyright (C) 2022-2024 Hiero a Series of LF Projects, 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
plugins { id("com.diffplug.spotless") }

spotless {
kotlinGradle {
ktfmt().kotlinlangStyle()

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(),
"(import|plugins|pluginManagement|dependencyResolutionManagement|repositories|tasks|allprojects|subprojects|buildCache|version)"
)
.updateYearWithLatest(true)
"// SPDX-License-Identifier: Apache-2.0\n",
"(import|plugins|pluginManagement|dependencyResolutionManagement|repositories|tasks|allprojects|subprojects|buildCache|version)"
)
}
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
/*
* Copyright (C) 2022-2024 Hiero a Series of LF Projects, 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
plugins { id("com.diffplug.spotless") }

spotless {
Expand Down
17 changes: 1 addition & 16 deletions src/main/kotlin/org.hiero.gradle.check.spotless-misc.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
/*
* Copyright (C) 2022-2024 Hiero a Series of LF Projects, 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
plugins { id("com.diffplug.spotless") }

spotless {
Expand Down
Loading

0 comments on commit cf4c33d

Please sign in to comment.