This is an automated email from the ASF dual-hosted git repository.

toulmean pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tuweni.git


The following commit(s) were added to refs/heads/master by this push:
     new 448590b  apply spotless fixes
448590b is described below

commit 448590b70527a360803f24213e6c6827f69ee38e
Author: Antoine Toulme <[email protected]>
AuthorDate: Mon Jun 3 10:27:29 2019 -0700

    apply spotless fixes
---
 build.gradle      |  46 ++++++++---------
 gradle/rat.gradle | 152 ++++++++++++++++++++++++++----------------------------
 2 files changed, 94 insertions(+), 104 deletions(-)

diff --git a/build.gradle b/build.gradle
index eeb13c8..8506601 100644
--- a/build.gradle
+++ b/build.gradle
@@ -22,9 +22,7 @@ buildscript {
   repositories { jcenter() // jcenter
   }
 
-  dependencies {
-    classpath "org.ajoberstar.grgit:grgit-core:3.1.1"
-  }
+  dependencies { classpath "org.ajoberstar.grgit:grgit-core:3.1.1" }
 }
 
 plugins {
@@ -102,27 +100,27 @@ if (file('.git').exists()) {
     excludes = new ArrayList<String>(repo.clean(ignore: false, directories: 
true, dryRun: true))
     // And some of the files that we have checked in should also be excluded 
from this check
     excludes.addAll([
-            '.*\\.asc',
-            '\\w+/out/.*',
-            'eth-reference-tests/**',
-            'build',
-            '.circleci/*',
-            '.editorconfig',
-            '.idea/**',
-            'gradlew.bat',
-            'gradlew',
-            'io/src/test/resources/org/apache/tuweni/io/file/**',
-            'toml/src/test/resources/**',
-            '.gitattributes',
-            'test1.txt',
-            'test2.txt',
-            'test3.yaml',
-            '.*\\.kotlin_module',
-            'example-v0.4.0.toml',
-            'hard_example.toml',
-            'toml-v0.5.0-spec-example.toml',
-            'test.txt',
-            'resourceresolver-test.jar'
+      '.*\\.asc',
+      '\\w+/out/.*',
+      'eth-reference-tests/**',
+      'build',
+      '.circleci/*',
+      '.editorconfig',
+      '.idea/**',
+      'gradlew.bat',
+      'gradlew',
+      'io/src/test/resources/org/apache/tuweni/io/file/**',
+      'toml/src/test/resources/**',
+      '.gitattributes',
+      'test1.txt',
+      'test2.txt',
+      'test3.yaml',
+      '.*\\.kotlin_module',
+      'example-v0.4.0.toml',
+      'hard_example.toml',
+      'toml-v0.5.0-spec-example.toml',
+      'test.txt',
+      'resourceresolver-test.jar'
     ])
   }
 }
diff --git a/gradle/rat.gradle b/gradle/rat.gradle
index f55daba..8679584 100644
--- a/gradle/rat.gradle
+++ b/gradle/rat.gradle
@@ -26,97 +26,89 @@ import org.gradle.api.internal.project.IsolatedAntBuilder
 apply plugin: RatPlugin
 
 class RatTask extends DefaultTask {
-    @Input
-    List<String> excludes
+  @Input
+  List<String> excludes
 
-    def reportDir = project.file('build/rat')
-    def stylesheet = 
project.file('gradle/resources/rat-output-to-html.xsl').getAbsolutePath()
-    def xmlReport = new File(reportDir, 'rat-report.xml')
-    def htmlReport = new File(reportDir, 'rat-report.html')
+  def reportDir = project.file('build/rat')
+  def stylesheet = 
project.file('gradle/resources/rat-output-to-html.xsl').getAbsolutePath()
+  def xmlReport = new File(reportDir, 'rat-report.xml')
+  def htmlReport = new File(reportDir, 'rat-report.html')
 
-    def generateXmlReport(File reportDir) {
-        def antBuilder = services.get(IsolatedAntBuilder)
-        def ratClasspath = project.configurations.rat
-        def projectPath = project.getRootDir().getAbsolutePath()
-        antBuilder.withClasspath(ratClasspath).execute {
-            ant.taskdef(resource: 'org/apache/rat/anttasks/antlib.xml')
-            ant.report(format: 'xml', reportFile: xmlReport) {
-                fileset(dir: projectPath) {
-                    patternset {
-                        excludes.each {
-                            exclude(name: it)
-                        }
-                    }
-                }
-            }
+  def generateXmlReport(File reportDir) {
+    def antBuilder = services.get(IsolatedAntBuilder)
+    def ratClasspath = project.configurations.rat
+    def projectPath = project.getRootDir().getAbsolutePath()
+    antBuilder.withClasspath(ratClasspath).execute {
+      ant.taskdef(resource: 'org/apache/rat/anttasks/antlib.xml')
+      ant.report(format: 'xml', reportFile: xmlReport) {
+        fileset(dir: projectPath) {
+          patternset {
+            excludes.each { exclude(name: it) }
+          }
         }
+      }
     }
+  }
 
-    def printUnknownFiles() {
-        def ratXml = new XmlParser().parse(xmlReport)
-        def unknownLicenses = 0
-        ratXml.resource.each { resource ->
-            if (resource.'license-approval'.@name[0] == "false") {
-                println('Unknown license: ' + resource.@name)
-                unknownLicenses++
-            }
-        }
-        if (unknownLicenses > 0) {
-            throw new GradleException("Found " + unknownLicenses + " files 
with " +
-                    "unknown licenses.")
-        }
+  def printUnknownFiles() {
+    def ratXml = new XmlParser().parse(xmlReport)
+    def unknownLicenses = 0
+    ratXml.resource.each { resource ->
+      if (resource.'license-approval'.@name[0] == "false") {
+        println('Unknown license: ' + resource.@name)
+        unknownLicenses++
+      }
     }
+    if (unknownLicenses > 0) {
+      throw new GradleException("Found " + unknownLicenses + " files with " +
+      "unknown licenses.")
+    }
+  }
 
-    def generateHtmlReport() {
-        def antBuilder = services.get(IsolatedAntBuilder)
-        def ratClasspath = project.configurations.rat
-        antBuilder.withClasspath(ratClasspath).execute {
-            ant.xslt(
-                    in: xmlReport,
-                    style: stylesheet,
-                    out: htmlReport,
-                    classpath: ratClasspath)
-        }
-        println('Rat report: ' + htmlReport)
+  def generateHtmlReport() {
+    def antBuilder = services.get(IsolatedAntBuilder)
+    def ratClasspath = project.configurations.rat
+    antBuilder.withClasspath(ratClasspath).execute {
+      ant.xslt(
+        in: xmlReport,
+        style: stylesheet,
+        out: htmlReport,
+        classpath: ratClasspath)
     }
+    println('Rat report: ' + htmlReport)
+  }
 
-    @TaskAction
-    def rat() {
-        if (!reportDir.exists()) {
-            reportDir.mkdirs()
-        }
-        def origEncoding = System.getProperty("file.encoding")
-        try {
-            System.setProperty("file.encoding", "UTF-8") //affects the output 
of the ant rat task
-            generateXmlReport(reportDir)
-            printUnknownFiles()
-            generateHtmlReport()
-        } finally {
-            System.setProperty("file.encoding", origEncoding)
-        }
+  @TaskAction
+  def rat() {
+    if (!reportDir.exists()) {
+      reportDir.mkdirs()
+    }
+    def origEncoding = System.getProperty("file.encoding")
+    try {
+      System.setProperty("file.encoding", "UTF-8") //affects the output of the 
ant rat task
+      generateXmlReport(reportDir)
+      printUnknownFiles()
+      generateHtmlReport()
+    } finally {
+      System.setProperty("file.encoding", origEncoding)
     }
+  }
 }
 
 class RatPlugin implements Plugin<Project> {
-    void apply(Project project) {
-        configureDependencies(project)
-        project.plugins.apply(JavaPlugin);
-        Task ratTask = project.task("rat",
-                type: RatTask,
-                group: 'Build',
-                description: 'Runs Apache Rat checks.')
-        project.tasks[JavaPlugin.TEST_TASK_NAME].dependsOn ratTask
-    }
+  void apply(Project project) {
+    configureDependencies(project)
+    project.plugins.apply(JavaPlugin);
+    Task ratTask = project.task("rat",
+    type: RatTask,
+    group: 'Build',
+    description: 'Runs Apache Rat checks.')
+    project.tasks[JavaPlugin.TEST_TASK_NAME].dependsOn ratTask
+  }
 
-    void configureDependencies(final Project project) {
-        project.configurations {
-            rat
-        }
-        project.repositories {
-            mavenCentral()
-        }
-        project.dependencies {
-            rat 'org.apache.rat:apache-rat-tasks:0.13'
-        }
-    }
-}
\ No newline at end of file
+  void configureDependencies(final Project project) {
+    project.configurations { rat }
+    project.repositories { mavenCentral() }
+    project.dependencies { rat 'org.apache.rat:apache-rat-tasks:0.13' }
+  }
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to