dweiss commented on a change in pull request #1806:
URL: https://github.com/apache/lucene-solr/pull/1806#discussion_r480031302
##########
File path: gradle/validation/validate-source-patterns.gradle
##########
@@ -15,27 +15,233 @@
* limitations under the License.
*/
-// This should be eventually rewritten in plain gradle. For now, delegate to
-// the ant/groovy script we already have.
+import org.apache.rat.Defaults;
+import org.apache.rat.document.impl.FileDocument;
+import org.apache.rat.api.MetaData;
-configure(rootProject) {
- configurations {
- checkSourceDeps
+buildscript {
+ repositories {
+ mavenCentral()
}
dependencies {
- checkSourceDeps "org.codehaus.groovy:groovy-all:2.4.17"
- checkSourceDeps
"org.apache.rat:apache-rat:${scriptDepVersions['apache-rat']}"
+ classpath "org.apache.rat:apache-rat:${scriptDepVersions['apache-rat']}"
+ }
+}
+
+configure(rootProject) {
+ task("validateSourcePatterns", type: ValidateSourcePatternsTask) {
+ group = 'Verification'
+ description = 'Validate Source Patterns'
+
+ // this task has no outputs, so it's always uptodate (if inputs don't
change).
+ outputs.upToDateWhen { true }
}
+}
+
+class ValidateSourcePatternsTask extends DefaultTask {
+
+ @InputFiles
+ final ConfigurableFileTree sourceFiles = project.fileTree(project.rootDir) {
+ [
Review comment:
And this I'd move to the task declaration block (so that it's not
hardcoded but configured :)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]