Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Nicolas Rinaudo
@nrinaudo
@julien-truffaut if you've managed to make mdoc work with remark.js, can you let me know?
Julien Truffaut
@julien-truffaut
Sure but I wouldn't hold my breath if I were you ;)
Loránd Szakács
@lorandszakacs

folks, so I'm having some trouble understanding exactly how tut does stuff. I'm working on this PR — fairly common use of tut, I assume:
ChristopherDavenport/cormorant#137

And for some reason docs/compile task fails with:
io.chrisdavenport#cormorant-X;0.2.1-SNAPSHOT:

Why is it looking for jars when there's an explicit sbt project dependency defined?

all other modules compile just fine
Loránd Szakács
@lorandszakacs

after setting crossScalaVersions to Nil https://github.com/ChristopherDavenport/cormorant/pull/137/commits/2cc0129cc88c9373d8b4acff88e78c803f2c201a

It seems that +docs/compile works after a clean, while docs/compile still doesn't :joy: even though it technically uses one single version. The beauties of sbt incantations :smile:

Loránd Szakács
@lorandszakacs

ok, found the ultimate problem.
Basically:
Wanted the docs module to compile only in scala 2.12.x since it depended on github4s which isn't available yet for 2.13.

All other projects had the "main" scala version set to 2.13.x. So when I change the default version to 2.12.x, docs/compile could properly resolve its dependencies to scala 2.12.x things. +docs/compile worked because it forced scala 2.12 on everybody.

Hopefully this little escapade helps other people out in the same situation.

TL;DR would be: if you have a module that should be compiled with an older version of scala compared to the rest of your project, make sure that the default scala version of all other sbt modules are that version. And cross compilation should bring in newer versions.

Rob Norris
@tpolecat
never a dull moment with sbt!
Paulo "JCranky" Siqueira
@jcranky
Hi. I'm trying to compile some docs with tut, but it is not working for dependencies. Is there any specific config I need for that to work properly?
If I do console from inside sbt and manually try the same code I'm trying to compile with tut, it works fine.
Rob Norris
@tpolecat
The Tut config extends the Compile config so they should see the same dependencies.
Are your tut sources in the same project?
I usually have a docs project that dependsOn(core) or whatever so it inherits all the depencencies.
Paulo "JCranky" Siqueira
@jcranky
Yes, everything is in the same project, my main source is on src/main/scala and tut is on src/main/tut
I changed one config: tutTargetDirectory := file("docs")
And have enablePlugins(TutPlugin) on the top level of the build.sbt file - maybe it is something related to that?

Just tried:

lazy val root = (project in file("."))
  .enablePlugins(TutPlugin)

Still same problem.

Rob Norris
@tpolecat
How strange.
Can you try with a minimal project? I know it's a pain, sorry, but there's something weird about your setup that's causing it not to work.
Do Compile/libraryDependencies and Tut/libraryDependencies tell you different things at the sbt prompt?
Paulo "JCranky" Siqueira
@jcranky
No, they are exactly the same.
Wait a sec, I might have a clue
Há! This is the culprit: "-Xfatal-warnings" :/
Rob Norris
@tpolecat
D'oh! Yeah you need to filter that out in Tut
Doesn't work in the REPL
Paulo "JCranky" Siqueira
@jcranky
For the REPL I have this already: scalacOptions in (Compile, console) ~= (_.filterNot(Set("-Ywarn-unused-import", "-Xfatal-warnings"))), // make REPL usable
Rob Norris
@tpolecat
Yeah you need it explicitly in Tut
Which maybe should inherit from Compile/console but it doesn't. Just Compile
Paulo "JCranky" Siqueira
@jcranky
thanks :D
Anthony Garo
@agaro1121
Hi
Does tut evaluate a block of code similar to the repl’s :paste command?
Rob Norris
@tpolecat
No, it evaluates code line by line.
Anthony Garo
@agaro1121
thank you
Anthony Garo
@agaro1121
@tpolecat I have a multi-module project
My markdown files are in the root of each module. I was able to successfully add them to tut
The problem I’m having is the repl instance needs to run from inside those modules for the code to successfully compile
Is tut able to do that?
Rob Norris
@tpolecat
tut can see the same stuff you see in console. It extends that configuration.
So if you do project blah in sbt and then do console anything that's visible there will also be visible if you do tut in that project.
Assuming the planets are properly in alignment.
Anthony Garo
@agaro1121
lol
i understand what you’re saying
I’m still trying to wrap my head around it. Because in my case i’d be calling console from the root project but it doesn’t have access to the other module’s stuff
that’s why tut is failing for me
i’d need tut to somehow call project blah for each markdown i copy over.
Is something like that possible?
Rob Norris
@tpolecat
well if your root project aggregates the others you can say tut and it will run in all projects
Anthony Garo
@agaro1121
ah ok. I was copying over the files using micrositeExtraMdFiles (i’m using the set-microsites plugin)
and yes it does aggregate the other projects
Anthony Garo
@agaro1121
i think i figured it out. Thank you for your help
Julien Truffaut
@julien-truffaut
Hi all, I started to see this warning in sbt
[warn] insecure HTTP request is deprecated 'http://dl.bintray.com/tpolecat/maven'; switch to HTTPS or opt-in as ("tpolecat" at "http://dl.bintray.com/tpolecat/maven").withAllowInsecureProtocol(true)
However, I can't see any config to bintray in my project
Rob Norris
@tpolecat
@julien-truffaut yeah that's due to a change in sbt 1.3
there's a pr to fix it, i just need to release a new version