help with sbt and lift to publish 3.0.1

45 views
Skip to first unread message

Diego Medina

unread,
Dec 13, 2016, 1:39:36 AM12/13/16
to lift-co...@googlegroups.com, Lift
Hi,

Hoping someone here has the sbt magic syntax to make this work.


We have a branch for lift that can be built using scala 2.12.1, it's lift-3.0
the lift-actor sbt project is triggering this scaladoc bug :


the work around is to add this to project/Build.scala:

+      .settings(scalacOptions in (Compile, doc) += "-no-java-comments")

problem is, this does not compile under 2.11.7, giving:

[info] Packaging /home/diego/work/lift/framework/persistence/squeryl-record/target/scala-2.11/lift-squeryl-record_2.11-3.0.1.jar ...
[info] Main Scala API documentation to /home/diego/work/lift/framework/persistence/squeryl-record/target/scala-2.11/api...
[info] Packaging /home/diego/work/lift/framework/persistence/mapper/target/scala-2.11/lift-mapper_2.11-3.0.1.jar ...
[error] bad option: '-no-java-comments'


so, does anyone know how to tell sbt to use that option only for 2.12.1 but not for any other version?

Thanks

Diego



--
Diego Medina
Lift/Scala Consultant
di...@fmpwizard.com
https://blog.fmpwizard.com/

Rike-Benjamin Schuppner

unread,
Dec 13, 2016, 2:58:42 AM12/13/16
to Lift, lift-co...@googlegroups.com
Hi,

simply using the .value macro might work with newer sbt versions (compiles with 0.13.13 at least) and avoids the deprecated <+= operators:

    .settings(
          scalacOptions in (Compile, doc) += {
            scalaVersion.value match {
              case "2.12.1" => "-no-java-comments"
              case _ => ""
            }
          }
        )

Cheers
/rike

Rike-Benjamin Schuppner

unread,
Dec 13, 2016, 3:25:32 AM12/13/16
to Lift, lift-co...@googlegroups.com
Sorry, that should of course be

          scalacOptions in (Compile, doc) ++= {
            scalaVersion.value match {
              case "2.12.1" => "-no-java-comments" :: Nil
              case _ => Nil

ti com

unread,
Dec 13, 2016, 4:35:13 AM12/13/16
to Lift, lift-co...@googlegroups.com
You might want to do if(scalaVersion.value.startsWith("2.12")) ... instead

--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code

---
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Antonio Salazar Cardozo

unread,
Dec 13, 2016, 7:38:09 AM12/13/16
to lift-co...@googlegroups.com, Lift
Can we do something like:

.settings(scalacOptions in (Compile, doc) += scalaVersion { sv => if (sv.startsWith(“2.12”)) "-no-java-comments” else “”) }

 Perhaps?
Thanks,

--
Antonio Salazar Cardozo
On twitter @lightfiend

--
You received this message because you are subscribed to the Google Groups "Lift-committers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lift-committe...@googlegroups.com.
To post to this group, send email to lift-co...@googlegroups.com.
Visit this group at https://groups.google.com/group/lift-committers.

Rike-Benjamin Schuppner

unread,
Dec 13, 2016, 10:23:38 AM12/13/16
to Lift, lift-co...@googlegroups.com


Am Dienstag, 13. Dezember 2016 13:38:09 UTC+1 schrieb Antonio Salazar Cardozo:
Can we do something like:

.settings(scalacOptions in (Compile, doc) += scalaVersion { sv => if (sv.startsWith(“2.12”)) "-no-java-comments” else “”) }


I believe the

    <+= setting apply (oldValue ⇒ ... )

approach has been deprecated in recent sbt versions. It is all done with the .value macro now.

Cheers
/rike

Joe Barnes

unread,
Dec 13, 2016, 11:15:51 AM12/13/16
to lift-co...@googlegroups.com, Lift
Yeah, that should work if in the right context, LOL

Joe


To unsubscribe from this group and stop receiving emails from it, send an email to lift-committers+unsubscribe@googlegroups.com.
To post to this group, send email to lift-committers@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Lift-committers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lift-committers+unsubscribe@googlegroups.com.
To post to this group, send email to lift-committers@googlegroups.com.

Diego Medina

unread,
Dec 13, 2016, 12:43:34 PM12/13/16
to lift-co...@googlegroups.com, Lift
Thanks everyone for the help!

I ended up using 

      .settings(
        scalacOptions in (Compile, doc) ++= {
          scalaVersion.value match {
            case "2.12.1" => "-no-java-comments" :: Nil
            case _ => Nil
          }
        }
      )


and it works. Now back to publishing 3.0.1!

Regards,

Diego

Joe Barnes

unread,
Dec 13, 2016, 1:35:56 PM12/13/16
to lift-co...@googlegroups.com, Lift
Will it only be for 2.12.1? You can use scalaBinaryVersion and it will simply be "2.12"

Joe

Diego Medina

unread,
Dec 13, 2016, 4:24:46 PM12/13/16
to lift-co...@googlegroups.com, Lift
we'll  make it better for next releases :)


Joe Barnes

unread,
Dec 13, 2016, 4:45:05 PM12/13/16
to lift-co...@googlegroups.com, Lift
*high fives*

Joe

Reply all
Reply to author
Forward
0 new messages