xsbt-web-plugin and sbt 1.0.0

已查看 94 次
跳至第一个未读帖子

Andrew Bucknell

未读,
2017年8月2日 09:06:402017/8/2
收件人 Lift
I know its not strictly a lift question, but I'm trying ti figure out how to use xsbt-web-plugin with sbt 1.0.0 and was wondering if anyone had any pointers to working examples? Currently all I have is confusion and a broken build so any pointers appreciated.

Matt Farmer

未读,
2017年8月2日 09:48:102017/8/2
收件人 Lift
@Joe: Didn't you get this working recently?

On Wed, Aug 2, 2017 at 9:06 AM Andrew Bucknell <andrew....@gmail.com> wrote:
I know its not strictly a lift question, but I'm trying ti figure out how to use xsbt-web-plugin with sbt 1.0.0 and was wondering if anyone had any pointers to working examples? Currently all I have is confusion and a broken build so any pointers appreciated.

--
--
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.
已删除帖子

Andrew Bucknell

未读,
2017年8月3日 07:24:452017/8/3
收件人 lif...@googlegroups.com
Thanks for sharing Dave. Did you have to include the plugin in project/plugins.sbt?

On Thu, Aug 3, 2017 at 3:56 AM, Dave Price <david...@outlook.com> wrote:
Hi Andrew:

I believe 3.X is the current version of xsbt-web-plugin.  However, if I correctly recall, 1.0.0 was when the major changes happened.  Here is part of my build.sbt that is using xsbt-web-plugin 3.0.0:

name := "webapp"

organization := "com.myorg"

version := "0.4.5"

scalaVersion := "2.11.11"

scalacOptions ++= Seq(
  "-target:jvm-1.8",
  "-encoding", "UTF-8",
  "-feature",
  "-unchecked",
  "-deprecation",
  "-Xfuture",
  "-Yno-adapted-args",
  "-Ywarn-dead-code",
  "-Ywarn-numeric-widen",
  "-Ywarn-unused",
  "-Ywarn-unused-import"
)

libraryDependencies ++= Dependencies.webApp

// enable Jetty for xsbt-web-plugin
enablePlugins(JettyPlugin)

// Control version of Jetty used by xsbt-web-plugin
containerLibs in Jetty := Seq(Library.jettyRunner intransitive())

containerMain in Jetty := "org.eclipse.jetty.runner.Runner"

// xsbt-web-plugin - copy css and js assets to Web App Directory
webappPostProcess := {
	webAppDir =>
		IO.copyFile(
      target.value / "web" / "less" / "main" / "public" /"css" / "styles.min.css",
      webAppDir / "public" / "css" / "styles.min.css"
    )
}


https://gist.github.com/davenatx/580d64684dde7a89a3dbea9fa94eaa28


Dave


On Wednesday, August 2, 2017 at 8:06:40 AM UTC-5, Andrew Bucknell wrote:
I know its not strictly a lift question, but I'm trying ti figure out how to use xsbt-web-plugin with sbt 1.0.0 and was wondering if anyone had any pointers to working examples? Currently all I have is confusion and a broken build so any pointers appreciated.

--
--
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 a topic in the Google Groups "Lift" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/liftweb/9EiF74X0TBA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to liftweb+unsubscribe@googlegroups.com.

Dave Price

未读,
2017年8月3日 07:53:582017/8/3
收件人 Lift
Hi Andrew:

I apologize. I misread your post and saw xsbt-web-plugin and thought you were asking about the 0.X to 1.0 version of that.  As soon as I replied on the group I realized my mistake and removed my response.  However, it obviously went out via email ;).   Unfortunately, I have not had the pleasure of moving my projects to SBT 1.0 yet.  Sorry about the confusion.

Dave
To unsubscribe from this group and all its topics, send an email to liftweb+u...@googlegroups.com.

Andrew Bucknell

未读,
2017年8月3日 08:56:352017/8/3
收件人 lif...@googlegroups.com
Thanks Dave. I suspect most of my problems are actually related to xsbt-web-plugin 0.x -> 1.0 issues as I was still on 0.9.0. What you shared was useful so im glad it made it  out :) 

To unsubscribe from this group and all its topics, send an email to liftweb+unsubscribe@googlegroups.com.

j...@joescii.com

未读,
2017年8月21日 09:58:552017/8/21
收件人 Lift
Andrew,

Did you get everything figured out? I'm pretty sure this project uses a modern version of xsbt-web-plugin. I just can't tell because the eclipse brought on some issues at github it seems.

Joe

Matt Farmer

未读,
2017年8月21日 10:28:582017/8/21
收件人 Lift
FYI I also modernized our xsbt-web-plugin usage in the giter8 templates when I released them too. :)

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.

Henrik Härkönen

未读,
2017年9月7日 05:09:212017/9/7
收件人 Lift
Hi Joe!

Very nice example of using the native packager, I like it!

Just one question, how do you implicate for the plugin to find the bootstrap.liftweb.Start as the main entry point? Or is it automatic through the signature, "extends App"?

-Henrik

j...@joescii.com

未读,
2017年9月14日 08:07:252017/9/14
收件人 Lift
Henrik,

Have you figured out your question? In my experience with native packager, it will dump a launch script for every entry point it finds in the source. So extending App with Start should be sufficient.

You can tip sbt to know what your primary main class is, but it doesn't change native packager's behavior: 
mainClass in Compile := Some("bootstrap.liftweb.Start")

Also make sure you are configuring native packager to set the run mode for your app:
com.typesafe.sbt.packager.Keys.bashScriptExtraDefines += """addJava "-Drun.mode=development""""


Joe

Henrik Härkönen

未读,
2017年9月14日 08:17:432017/9/14
收件人 lif...@googlegroups.com
Hi Joe!

Yes, I kind of assumed so, because when I tried it, it just magically worked. :) But good to know that if I would have more such entry points, there will be separate startup scripts for them as well! Thanks!

-Henrik


回复全部
回复作者
转发
0 个新帖子