【问题标题】:ScalaStyle using grade return an errorScalaStyle 使用等级返回错误
【发布时间】:2017-10-15 14:29:52
【问题描述】:

我正在使用 gradle 寻找 scalaStyle。你能解释一下怎么做吗?

我尝试了this 链接,但出现错误:

错误:(110, 0) 找不到参数的方法 scalaStyle() [build_5ig236mubh10t6rxyt8apdkfi$_run_closure4@46b9e954] 在根 项目.....

【问题讨论】:

    标签: gradle scalastyle


    【解决方案1】:

    这是一个使用 scalaStyle 插件的示例 build.gradle

    buildscript {
      repositories {
        maven {
          url 'http://jcenter.bintray.com/'
        }
      }
      dependencies {
        classpath 'org.github.ngbinh.scalastyle:gradle-scalastyle-plugin_2.11:0.9.0' //version 1.0.0 is not published yet.
      }
    }
    
    apply plugin: 'scalaStyle'
    
    scalaStyle {
      configLocation = '/path/to/scalaStyle.xml'
      includeTestSourceDirectory = true
      source = 'src/main/scala'
      testSource = 'src/test/scala'
    }
    

    您需要定义buildscript 块来声明脚本本身的依赖关系。完成后,需要应用插件。最后,您可以使用scalaStyle 块来配置插件的行为。

    【讨论】:

    • @kevinjoeiy,不知道。您需要阅读文档或提出其他问题。
    猜你喜欢
    • 1970-01-01
    • 2011-10-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-13
    • 2019-09-29
    • 2019-08-02
    • 2018-02-15
    相关资源
    最近更新 更多