djspiewak / parseback

A Scala implementation of parsing with derivatives
http://parseback.io
Apache License 2.0
197 stars 22 forks source link

Added scala.js support, fixes #14 #33

Closed m-sp closed 7 years ago

djspiewak commented 7 years ago

Thanks for the contribution! Quick question though… Why does this necessitate removing the project-specific build.sbt files?

m-sp commented 7 years ago

as far as i understand it, sbt only uses *.sbt files in (sub-) project folders. but because of the scalajs sbt plugin the actual project folder for e.g. core is not core but core/.js and core/.jvm respectively and therefore the additional configuration in the sub folder is not used

djspiewak commented 7 years ago

Hrm. Let me poke around with this a bit. I would hate to lose the ability to organize subproject builds independently. Scala.js support is more important than build organization, so that wins in the end, but maybe we can have both with a bit of trickery.

m-sp commented 7 years ago

one possibility would be to explicitly add the build.sbt to the project. e.g. something like:

lazy val core = crossProject
     .crossType(CrossType.Pure)
     .in(file("core"))
     .settings(
       name := "parseback-core",
       coursierSettings,
       bintraySettings,
       mimaSettings)
 .settingSets(AddSettings.sbtFiles(file("../build.sbt")))

the one thing that bothers me is the relative reference to the build.sbt file starting from core/.jvm and core/.js

djspiewak commented 7 years ago

@m-sp I tried a number of different tricks to try to get this to work (including the one you suggested). Nothing worked. :-( So we're going with your implementation for now (everything in project.sbt) while I plead my case to Sébastien.

Thanks much for the contribution!