Skip to content

Commit

Permalink
Enable License Header check for Gradle Plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ihostage committed Jun 23, 2023
1 parent ef4681b commit 0dcb2e8
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 23 deletions.
22 changes: 15 additions & 7 deletions gradle-twirl/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Gradle plugin project to get you started.
* For more details take a look at the Writing Custom Plugins chapter in the Gradle
* User Manual available at https://docs.gradle.org/8.1.1/userguide/custom_plugins.html
* This project uses @Incubating APIs which are subject to change.
*/
* Copyright (C) from 2022 The Play Framework Contributors <https://github.com/playframework>, 2011-2021 Lightbend Inc. <https://www.lightbend.com>
*/

plugins {
// Apply the Java Gradle plugin development plugin to add support for developing Gradle plugins
Expand Down Expand Up @@ -53,9 +48,22 @@ gradlePlugin {

gradlePlugin.testSourceSets.add(sourceSets["functionalTest"])

val headerLicense = "Copyright (C) from 2022 The Play Framework Contributors <https://github.com/playframework>, 2011-2021 Lightbend Inc. <https://www.lightbend.com>"
val headerLicenseHash = "# $headerLicense"
val headerLicenseJava = "/*\n* $headerLicense\n*/"

spotless {
java {
googleJavaFormat()
licenseHeader(headerLicenseJava)
}
kotlinGradle {
licenseHeader(headerLicenseJava, "[^/*]")
}
format("properties") {
target("**/*.properties")
targetExclude("gradle/**")
licenseHeader(headerLicenseHash, "[^#]")
}
}

Expand Down
3 changes: 1 addition & 2 deletions gradle-twirl/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# This file was generated by the Gradle 'init' task.
# https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties
# Copyright (C) from 2022 The Play Framework Contributors <https://github.com/playframework>, 2011-2021 Lightbend Inc. <https://www.lightbend.com>

org.gradle.parallel=true
org.gradle.caching=true
Expand Down
10 changes: 2 additions & 8 deletions gradle-twirl/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
/*
* This file was generated by the Gradle 'init' task.
*
* The settings file is used to specify which projects to include in your build.
*
* Detailed information about configuring a multi-project build in Gradle can be found
* in the user manual at https://docs.gradle.org/8.1.1/userguide/multi_project_builds.html
* This project uses @Incubating APIs which are subject to change.
*/
* Copyright (C) from 2022 The Play Framework Contributors <https://github.com/playframework>, 2011-2021 Lightbend Inc. <https://www.lightbend.com>
*/

rootProject.name = "gradle-twirl"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This Java source file was generated by the Gradle 'init' task.
*/
* Copyright (C) from 2022 The Play Framework Contributors <https://github.com/playframework>, 2011-2021 Lightbend Inc. <https://www.lightbend.com>
*/
package play.twirl.gradle;

import static org.junit.jupiter.api.Assertions.assertTrue;
Expand Down
4 changes: 2 additions & 2 deletions gradle-twirl/src/main/java/play/twirl/gradle/TwirlPlugin.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This Java source file was generated by the Gradle 'init' task.
*/
* Copyright (C) from 2022 The Play Framework Contributors <https://github.com/playframework>, 2011-2021 Lightbend Inc. <https://www.lightbend.com>
*/
package play.twirl.gradle;

import org.gradle.api.Plugin;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This Java source file was generated by the Gradle 'init' task.
*/
* Copyright (C) from 2022 The Play Framework Contributors <https://github.com/playframework>, 2011-2021 Lightbend Inc. <https://www.lightbend.com>
*/
package play.twirl.gradle;

import static org.junit.jupiter.api.Assertions.assertNotNull;
Expand Down

0 comments on commit 0dcb2e8

Please sign in to comment.