【问题标题】:Is it possible to skip code generation for included thrift files in Scrooge?是否可以跳过 Scrooge 中包含的 thrift 文件的代码生成?
【发布时间】:2014-12-01 17:19:15
【问题描述】:

Scrooge SBT 插件可以选择从库依赖项(jar 文件)中包含 Thrift IDL 文件。通常这些 jar 文件已经包含生成的源。如果我包含 Thrift IDL,我不想再次生成这些源。否则它们将被复制。

shared.thift

namespace java me.shared

struct Foo {
  1: string id
}

shared.jar

me
  shared
    Foo.scala
shared.thrift

所以当我的项目依赖于 shared.jar 并且我在另一个 Thrift IDL 文件中包含 shared.thrift 时,我不希望 Scrooge 再次生成 Foo.scala。最直接的存档方式是什么?

【问题讨论】:

    标签: sbt thrift scrooge


    【解决方案1】:

    实际上是直截了当的。

    scroogeThriftSources in Compile ~= { sources: Seq[File] =>
      sources filter { case file =>
        !file.getName.contains("shared.thrift")
      }
    }
    

    【讨论】:

      猜你喜欢
      • 2013-10-21
      • 2018-01-14
      • 1970-01-01
      • 2015-09-02
      • 1970-01-01
      • 1970-01-01
      • 2019-10-22
      • 2015-01-23
      • 1970-01-01
      相关资源
      最近更新 更多