diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index d148220531f..25698ca6107 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -136,7 +136,7 @@ Enhancement suggestions are tracked as [GitHub issues](https://github.com/apache
#### Environment Setup
##### 1. Forking the Code
-One of the benefits of [GitHub](http://github.com) is the way that you can easily contribute to a project by [forking the repository](https://help.github.com/articles/fork-a-repo/) and [sending pull requests](https://help.github.com/articles/creating-a-pull-request/) with your changes. Please see GitHub's guides on how to create a fork and submit that fork. For easier illustration, the remainder of this document will use the `grails` repositories, but when working locally you should use your own fork.
+One of the benefits of [GitHub](https://github.com) is the way that you can easily contribute to a project by [forking the repository](https://help.github.com/articles/fork-a-repo/) and [sending pull requests](https://help.github.com/articles/creating-a-pull-request/) with your changes. Please see GitHub's guides on how to create a fork and submit that fork. For easier illustration, the remainder of this document will use the `grails` repositories, but when working locally you should use your own fork.
##### 2. Tool Setup
@@ -148,7 +148,7 @@ If you're interested in contributing fixes and features to any part of grails, y
* A container runtime
Once you have the pre-requisite packages installed, the next step is to download the Apache Grails source code, which is
-hosted at [GitHub](http://github.com/apache/grails-core). This is a simple case of cloning the repository you're
+hosted at [GitHub](https://github.com/apache/grails-core). This is a simple case of cloning the repository you're
interested in. For example, to get the core framework run:
git clone http://github.com/apache/grails-core.git
@@ -202,7 +202,7 @@ There are many aspects to [Grail's documentation](https://docs.grails.org/)
#### Improving the User Guide
-The user guide is written using [Asciidoctor](http://asciidoctor.org/docs/user-manual/). The simplest way to contribute fixes is to simply click on the "Improve this doc" link that is to the right of each section of the documentation.
+The user guide is written using [Asciidoctor](https://asciidoctor.org/docs/user-manual/). The simplest way to contribute fixes is to simply click on the "Improve this doc" link that is to the right of each section of the documentation.
This will link to the GitHub edit screen where you can make changes, preview them and create a pull request.
diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle
index 993f2b8cfb9..f22cb0e8015 100644
--- a/buildSrc/build.gradle
+++ b/buildSrc/build.gradle
@@ -52,6 +52,8 @@ dependencies {
implementation 'io.github.gradle-nexus:publish-plugin'
implementation 'org.apache.grails:grails-docs-core'
implementation 'org.apache.grails:grails-gradle-plugins'
+ implementation "com.diffplug.spotless:spotless-plugin-gradle:${gradleProperties.spotlessVersion}"
+ implementation "io.spring.nohttp:nohttp-gradle:${gradleProperties.nohttpGradleVersion}"
implementation 'org.asciidoctor:asciidoctor-gradle-jvm'
implementation 'org.springframework.boot:spring-boot-gradle-plugin'
implementation 'org.nosphere.apache.rat:org.nosphere.apache.rat.gradle.plugin:0.8.1'
diff --git a/etc/bin/Dockerfile b/etc/bin/Dockerfile
index cd3e9696cd8..7ac7be67ece 100644
--- a/etc/bin/Dockerfile
+++ b/etc/bin/Dockerfile
@@ -5,7 +5,7 @@
# (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
+# 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,
diff --git a/grails-forge/config/checkstyle/checkstyle.xml b/etc/config/checkstyle/checkstyle.xml
similarity index 96%
rename from grails-forge/config/checkstyle/checkstyle.xml
rename to etc/config/checkstyle/checkstyle.xml
index 3e2e1ab9c38..3002c30d4d8 100644
--- a/grails-forge/config/checkstyle/checkstyle.xml
+++ b/etc/config/checkstyle/checkstyle.xml
@@ -103,6 +103,7 @@
+
@@ -114,6 +115,8 @@
+
+
@@ -175,7 +178,9 @@
-
+
+
+
@@ -226,6 +231,8 @@
+
+
diff --git a/etc/config/checkstyle/suppressions.xml b/etc/config/checkstyle/suppressions.xml
new file mode 100644
index 00000000000..5da56d946f9
--- /dev/null
+++ b/etc/config/checkstyle/suppressions.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/grails-forge/config/spotless.license.java b/etc/config/spotless/license.java
similarity index 100%
rename from grails-forge/config/spotless.license.java
rename to etc/config/spotless/license.java
diff --git a/gradle.properties b/gradle.properties
index 84a4d121d3e..504142de855 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -5,7 +5,7 @@
# (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
+# 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,
@@ -40,6 +40,8 @@ yakworksHibernateGroovyProxyVersion=1.1
picocliVersion=4.7.6
liquibaseHibernate5Version=4.27.0
hibernate5Version=5.6.15.Final
+spotlessVersion=6.25.0
+nohttpGradleVersion=0.0.11
githubSlug=apache/grails-core
githubBranch=7.0.x
diff --git a/gradle/style-enforcement-config.gradle b/gradle/style-enforcement-config.gradle
new file mode 100644
index 00000000000..f099e69f954
--- /dev/null
+++ b/gradle/style-enforcement-config.gradle
@@ -0,0 +1,88 @@
+import com.diffplug.gradle.spotless.SpotlessExtension
+import io.spring.nohttp.gradle.NoHttpExtension
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+apply plugin: 'checkstyle'
+apply plugin: 'com.diffplug.spotless'
+apply plugin: 'io.spring.nohttp' // enforce https everywhere
+
+extensions.configure(SpotlessExtension) {
+ // Explicit `it` required in extension configuration
+ it.java {
+ licenseHeaderFile(rootProject.layout.projectDirectory.file('etc/config/spotless/license.java'))
+ target(
+ 'grails-app/**/*.java',
+ 'src/main/groovy/**/*.java',
+ 'src/main/java/**/*.java'
+ )
+ }
+ it.groovy {
+ licenseHeaderFile(rootProject.layout.projectDirectory.file('etc/config/spotless/license.java'))
+ target(
+ 'grails-app/**/*.groovy',
+ 'src/main/groovy/**/*.groovy'
+ )
+ }
+ it.format('javaMisc') {
+ licenseHeaderFile(rootProject.layout.projectDirectory.file('etc/config/spotless/license.java'), '\\/\\*\\*')
+ target(
+ 'src/main/**/module-info.java',
+ 'src/main/**/package-info.java'
+ )
+ }
+}
+
+extensions.configure(CheckstyleExtension) {
+ // Explicit `it` required in extension configuration
+ it.configFile = rootProject.layout.projectDirectory.file('etc/config/checkstyle/checkstyle.xml').asFile
+ it.configDirectory = project.rootProject.layout.projectDirectory.dir('etc/config/checkstyle').asFile
+ it.maxErrors = 1
+ it.maxWarnings = 10
+ it.showViolations = true
+}
+
+extensions.configure(NoHttpExtension) {
+ // Explicit `it` required in extension configuration
+ // TODO: xsd, xml, & doc files need looked at; this will at least make sure our POMs are correct
+ it.source.exclude(
+ 'build/**',
+ 'src/test/**',
+ 'LICENSE', '**/LICENSE', 'NOTICE', '**/NOTICE', 'licenses/**', 'INSTALL',
+ '**/*.xsd', '**/*.xml', '**/*.dtd',
+ '**/test/**',
+ '**/@grails.codegen.projectClassName@GrailsPlugin.groovy',
+ '**/grails-doc/**' // TODO: the grails doc still has a lot of work to do to remove https
+ )
+}
+
+if (tasks.names.contains('checkstyleTest')) {
+ tasks.named('checkstyleTest').configure {
+ it.group = 'verification'
+ it.enabled = false
+ }
+}
+
+if (tasks.names.contains('checkstyleMain')) {
+ tasks.named('checkstyleMain').configure {
+ it.group = 'verification'
+ it.dependsOn('spotlessCheck')
+ }
+}
diff --git a/grails-async/core/build.gradle b/grails-async/core/build.gradle
index 6a4f2b96791..bdeb790cb07 100644
--- a/grails-async/core/build.gradle
+++ b/grails-async/core/build.gradle
@@ -50,4 +50,5 @@ apply {
from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle')
from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle')
from rootProject.layout.projectDirectory.file('gradle/test-config.gradle')
+ from rootProject.layout.projectDirectory.file('gradle/style-enforcement-config.gradle')
}
\ No newline at end of file
diff --git a/grails-async/core/src/main/groovy/grails/async/DelegateAsync.groovy b/grails-async/core/src/main/groovy/grails/async/DelegateAsync.groovy
index 7fb5615fbea..bc5d80edd34 100644
--- a/grails-async/core/src/main/groovy/grails/async/DelegateAsync.groovy
+++ b/grails-async/core/src/main/groovy/grails/async/DelegateAsync.groovy
@@ -18,14 +18,14 @@
*/
package grails.async
+import org.codehaus.groovy.transform.GroovyASTTransformationClass
+
import java.lang.annotation.Documented
import java.lang.annotation.ElementType
import java.lang.annotation.Retention
import java.lang.annotation.RetentionPolicy
import java.lang.annotation.Target
-import org.codehaus.groovy.transform.GroovyASTTransformationClass
-
/**
* An AST transformation that takes each method in the given class and adds a delegate method that returns a {@link grails.async.Promise} and executes the method asynchronously.
* For example given the following class:
@@ -65,5 +65,6 @@ import org.codehaus.groovy.transform.GroovyASTTransformationClass
@Target([ElementType.TYPE, ElementType.FIELD])
@GroovyASTTransformationClass("org.grails.async.transform.internal.DelegateAsyncTransformation")
@interface DelegateAsync {
+
Class value() default DelegateAsync
}
diff --git a/grails-async/core/src/main/groovy/grails/async/PromiseFactory.groovy b/grails-async/core/src/main/groovy/grails/async/PromiseFactory.groovy
index c6691ef95c7..1e1dcb4bca2 100644
--- a/grails-async/core/src/main/groovy/grails/async/PromiseFactory.groovy
+++ b/grails-async/core/src/main/groovy/grails/async/PromiseFactory.groovy
@@ -50,7 +50,7 @@ interface PromiseFactory {
/**
* Creates a promise with a value pre-bound to it
* @param value The value
- * @param The type of the value
+ * @param The type of the value
* @return A Promise
*/
Promise createBoundPromise(T value)
@@ -58,7 +58,7 @@ interface PromiseFactory {
/**
* Creates an unfulfilled promise that returns the given type
* @param returnType The return type
- * @param The type of the class
+ * @param The type of the class
* @return The unfulfilled promise
*/
Promise createPromise(Class returnType)
@@ -76,7 +76,7 @@ interface PromiseFactory {
* @param map The map
* @return A promise
*/
- Promise