scala-native / scala-native-bindgen

Scala Native Binding Generator

Home Page:https://scala-native.github.io/scala-native-bindgen/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add tooling project and sbt plugin

jonas opened this issue · comments

Add a tools project to provide an API for build tools to easily use the generator. The API could be based on the builder pattern, e.g. https://docs.rs/bindgen/0.37.0/bindgen/struct.Builder.html

Use the tooling API to create a simple sbt project which can eventually be used by the tests and bindings (#59 )

@jonas, I need help with creating an sbt plugin
I tried to create project:

lazy val plugin = project
  .in(file("plugin"))
  .settings(
    name := "sbt-scala-native-bindgen",
    sbtPlugin := true
  )

But it causes version conflicts:

[warn] Found version conflict(s) in library dependencies; some are suspected to be binary incompatible:
[warn]  * xml-apis:xml-apis:1.3.04 is selected over 2.0.2
[warn]      +- org.apache.xmlgraphics:batik-script:1.8            (depends on 1.3.04)
[warn]      +- org.apache.xmlgraphics:batik-anim:1.8              (depends on 1.3.04)
[warn]      +- org.apache.xmlgraphics:batik-transcoder:1.8        (depends on 1.3.04)
[warn]      +- org.apache.xmlgraphics:batik-bridge:1.8            (depends on 1.3.04)
[warn]      +- org.apache.xmlgraphics:batik-svg-dom:1.8           (depends on 1.3.04)
[warn]      +- org.apache.xmlgraphics:batik-parser:1.8            (depends on 1.3.04)
[warn]      +- org.apache.xmlgraphics:batik-dom:1.8               (depends on 1.3.04)
[warn]      +- org.apache.xmlgraphics:batik-css:1.8               (depends on 1.3.04)
[warn]      +- org.apache.xmlgraphics:batik-ext:1.8               (depends on 1.3.04)
[warn]      +- org.apache.xmlgraphics:batik-extension:1.8         (depends on 1.3.04)
[warn]      +- org.apache.xmlgraphics:batik-svggen:1.8            (depends on 1.3.04)
[warn]      +- xalan:xalan:2.7.0                                  (depends on 2.0.2)

If I refresh project in IntelliJ IDEA it fails with this error (it does not happen in console):

[error] Modules were resolved with conflicting cross-version suffixes in ProjectRef(uri("file:/home/lk/projects/gsoc/scala-native-bindgen/"), "plugin"):
[error]    org.scala-lang.modules:scala-xml _2.11, _2.12
[error]    org.scala-lang.modules:scala-parser-combinators _2.11, _2.12

I don't know how to fix this version conflict

I'll take a look tonight or tomorrow.

Will we publish the plugin before releasing 0.2?

Yes that is my plan. I will make a PR to configure publishing.

I've moved the release date of the 0.2 milestone to 2018-07-16.

Fixed in #130