Giter VIP home page Giter VIP logo

play-auto-refresh's Introduction

Play Auto Refresh

This is an SBT plugin for Play Framework (or sbt-web) apps which works with a Chrome Extension to auto-refresh your browser when you make changes to your app.

Setup

  1. Add the SBT plugin to your project/plugins.sbt file (make sure to add an empty line before this one):
addSbtPlugin("com.jamesward" % "play-auto-refresh" % "0.0.20")
  1. The plugin bootstraps itself automatically as soon as you enable Play in your project.

  2. Add the Play Framework Tools Chrome Extension

  3. Start your Play app in file watch mode:

sbt ~run
  1. The browser window should open automatically. If you don't want this add the following to your build.sbt:
shouldOpenBrowser := false
  1. Make a change to the code for your application and watch your changes magically appear in your browser!

Release Info

  • 0.0.1 - Push changes on compile with default watches
  • 0.0.2 - Add /public and /app/assets to default watches
  • 0.0.3 - Fix botched release
  • 0.0.4 - Fix failure due to multiple instances trying to use the same port
  • 0.0.5 - Bumps for Play 2.2.0 / sbt 0.13.0 and publish the sbt community repo
  • 0.0.6 - Avoid overriding settings: #8
  • 0.0.7 - Fix incompatibility with Play 2.2.x
  • 0.0.8 - Fix incompatibility with Play 2.3.x
  • 0.0.9 - Migrate to an sbt 0.13.5 auto-plugin
  • 0.0.10 - Use the configured Play port to tell the Chrome plugin which URL to reload
  • 0.0.11 - Automatically open the browser window when you run your app
  • 0.0.12 - Prevent plugin from failing when running in a headless environment
  • 0.0.13 - Fix incompatibility with Play 2.4.x
  • 0.0.14 - Bump to sbt 0.13.11
  • 0.0.15 - Bump to Play 2.5
  • 0.0.16 - Bump to Play 2.6 and sbt 1.0
  • 0.0.17 - Bump to Play 2.7
  • 0.0.18 - Bump to Play 2.8
  • 0.0.19 - Bump to Play 2.9
  • 0.0.20 - Bump to Play 3.0

Developer Info

Chrome Extension

The source code of the extension can be found here: https://github.com/jamesward/play-framework-chrome-tools

Test Project

  1. cd test-project
  2. sbt ~run
  3. Install the Play Framework Tools Chrome Extension
  4. Check out the app: http://localhost:9000
  5. Change a asset and watch your browser magically reload the changes!

Release

  1. Update the version and "Release Info" in README.md
  2. Git Tag: git tag -s v0.0.xx
  3. Push tag
  4. Watch workflow doing the magic: https://github.com/jamesward/play-auto-refresh/actions/workflows/publish.yml
  5. Wait (sometimes 15 minutes, sometimes 2 hours): https://repo1.maven.org/maven2/com/jamesward/play-auto-refresh_2.12_1.0
  6. Enjoy!

play-auto-refresh's People

Contributors

aholland avatar gpoulet avatar inetfuture avatar jamesward avatar juliender avatar lykathia avatar mariussoutier avatar masseguillaume avatar mkurz avatar scala-steward avatar xuwei-k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

play-auto-refresh's Issues

Please publish for Scala 2.10.x/sbt 0.13

The latest version on oss.sonatype is for 2.9.2/0.12. Maybe future releases could live in the Typesafe repo instead?

edit: ... and right after I posted this I realized I could find the publish-path in build.sbt ;)
Sometimes all you need is a metaphorical rubber-duck.

sbt 0.13

hey James

can you publish for sbt 0.13 ? You just need to bump scalaVersion to 2.10.2.

Thanks

Reference to undefined setting error

I've added the plugin to my gobal plugins file, but when I run the app, I get the following error:

[error] Reference to undefined setting: 
[error] 
[error]   *:play-assets-directories from *:watch-sources
[error]  

I'm using Play 2.1.1.

Custom port as parameter is ignored

When executing ~run 8080 from the Sbt console,
Then the plugin open the browser on "http://localhost:9000". Instead of "http://localhost:8080"

From the sources, the plugin get the port from the system properties or default to "9000". But here the port is passed as parameter to the run command.

It can be nice to try to retrieve this parameter this option before returning the default port.

The auto-refresh doesn't happen with a port different from 9000

I did try to run my app on port 9002 with sbt "~run 9002". Despite seeing in my console that it has recompiled, my browser doesn't refresh itself. I switch it to port 9000 with a sbt ~run and it did work. Is there something missing in my understanding, or is it a bug/feature ?

Error after adding the SBT plugin

After adding the sbt plugin to my plugins file (leaving an empty line) I find this error below.

My build.sbt file have:
resolvers += Resolver.jcenterRepo,

build.properties have:
sbt.version=1.3.10

Really looking forward to using this, so can you please help out. Thanks

[warn]
[warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.
[warn] com.jamesward:play-auto-refresh:0.0.18 (sbtVersion=1.0, scalaVersion=2.12)
[warn]
[warn] Note: Unresolved dependencies path:
[error] sbt.librarymanagement.ResolveException: Error downloading com.jamesward:play-auto-refresh;sbtVersion=1.0;scalaVersion=2.12:0.0.18
[error] Not found
[error] Not found
[error] not found: https://repo1.maven.org/maven2/com/jamesward/play-auto-refresh_2.12_1.0/0.0.18/play-auto-refresh-0.0.18.pom
[error] not found: /Users/hannesnel/.ivy2/local/com.jamesward/play-auto-refresh/scala_2.12/sbt_1.0/0.0.18/ivys/ivy.xml
[error] download error: Caught java.io.IOException: Server returned HTTP response code: 502 for URL: https://dl.bintray.com/sbt/sbt-plugin-releases/com.jamesward/play-auto-refresh/scala_2.12/sbt_1.0/0.0.18/ivys/ivy.xml (Server returned HTTP response code: 502 for URL: https://dl.bintray.com/sbt/sbt-plugin-releases/com.jamesward/play-auto-refresh/scala_2.12/sbt_1.0/0.0.18/ivys/ivy.xml) while downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.jamesward/play-auto-refresh/scala_2.12/sbt_1.0/0.0.18/ivys/ivy.xml
[error] download error: Caught java.io.IOException: Server returned HTTP response code: 502 for URL: https://dl.bintray.com/typesafe/ivy-releases/com.jamesward/play-auto-refresh/scala_2.12/sbt_1.0/0.0.18/ivys/ivy.xml (Server returned HTTP response code: 502 for URL: https://dl.bintray.com/typesafe/ivy-releases/com.jamesward/play-auto-refresh/scala_2.12/sbt_1.0/0.0.18/ivys/ivy.xml) while downloading https://repo.typesafe.com/typesafe/ivy-releases/com.jamesward/play-auto-refresh/scala_2.12/sbt_1.0/0.0.18/ivys/ivy.xml
[error] at lmcoursier.CoursierDependencyResolution.unresolvedWarningOrThrow(CoursierDependencyResolution.scala:247)
[error] at lmcoursier.CoursierDependencyResolution.$anonfun$update$35(CoursierDependencyResolution.scala:216)
[error] at scala.util.Either$LeftProjection.map(Either.scala:573)
[error] at lmcoursier.CoursierDependencyResolution.update(CoursierDependencyResolution.scala:216)
[error] at sbt.librarymanagement.DependencyResolution.update(DependencyResolution.scala:60)
[error] at sbt.internal.LibraryManagement$.resolve$1(LibraryManagement.scala:52)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$12(LibraryManagement.scala:102)
[error] at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:69)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$20(LibraryManagement.scala:115)
[error] at scala.util.control.Exception$Catch.apply(Exception.scala:228)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11(LibraryManagement.scala:115)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11$adapted(LibraryManagement.scala:96)
[error] at sbt.util.Tracked$.$anonfun$inputChanged$1(Tracked.scala:150)
[error] at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:129)
[error] at sbt.Classpaths$.$anonfun$updateTask0$5(Defaults.scala:2950)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error] at sbt.std.Transform$$anon$4.work(Transform.scala:67)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:281)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:19)
[error] at sbt.Execute.work(Execute.scala:290)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:281)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[error] at java.lang.Thread.run(Thread.java:748)
[error] (update) sbt.librarymanagement.ResolveException: Error downloading com.jamesward:play-auto-refresh;sbtVersion=1.0;scalaVersion=2.12:0.0.18
[error] Not found
[error] Not found
[error] not found: https://repo1.maven.org/maven2/com/jamesward/play-auto-refresh_2.12_1.0/0.0.18/play-auto-refresh-0.0.18.pom
[error] not found: /Users/hannesnel/.ivy2/local/com.jamesward/play-auto-refresh/scala_2.12/sbt_1.0/0.0.18/ivys/ivy.xml
[error] download error: Caught java.io.IOException: Server returned HTTP response code: 502 for URL: https://dl.bintray.com/sbt/sbt-plugin-releases/com.jamesward/play-auto-refresh/scala_2.12/sbt_1.0/0.0.18/ivys/ivy.xml (Server returned HTTP response code: 502 for URL: https://dl.bintray.com/sbt/sbt-plugin-releases/com.jamesward/play-auto-refresh/scala_2.12/sbt_1.0/0.0.18/ivys/ivy.xml) while downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.jamesward/play-auto-refresh/scala_2.12/sbt_1.0/0.0.18/ivys/ivy.xml
[error] download error: Caught java.io.IOException: Server returned HTTP response code: 502 for URL: https://dl.bintray.com/typesafe/ivy-releases/com.jamesward/play-auto-refresh/scala_2.12/sbt_1.0/0.0.18/ivys/ivy.xml (Server returned HTTP response code: 502 for URL: https://dl.bintray.com/typesafe/ivy-releases/com.jamesward/play-auto-refresh/scala_2.12/sbt_1.0/0.0.18/ivys/ivy.xml) while downloading https://repo.typesafe.com/typesafe/ivy-releases/com.jamesward/play-auto-refresh/scala_2.12/sbt_1.0/0.0.18/ivys/ivy.xml
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?

ClosedChannelException

Hi James,

running into the following exception with Play 2.2.1:

[success] Compiled in 101ms
null
java.nio.channels.ClosedChannelException
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.cleanUpWriteBuffer(AbstractNioWorker.java:409)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.writeFromUserCode(AbstractNioWorker.java:127)
at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleAcceptedSocket(NioServerSocketPipelineSink.java:99)
at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:36)
at org.jboss.netty.channel.Channels.write(Channels.java:725)
at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.doEncode(OneToOneEncoder.java:71)
at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:59)
at org.jboss.netty.channel.Channels.write(Channels.java:704)
at org.jboss.netty.channel.Channels.write(Channels.java:671)
at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:248)
at unfiltered.netty.websockets.WebSocket.send(websockets.scala:21)
at com.jamesward.play.BrowserNotifierPlugin$$anonfun$2$$anonfun$apply$1.apply(BrowserNotifierPlugin.scala:26)
at com.jamesward.play.BrowserNotifierPlugin$$anonfun$2$$anonfun$apply$1.apply(BrowserNotifierPlugin.scala:26)
at scala.collection.immutable.List.foreach(List.scala:318)
at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:32)
at scala.collection.mutable.ListBuffer.foreach(ListBuffer.scala:45)
at com.jamesward.play.BrowserNotifierPlugin$$anonfun$2.apply(BrowserNotifierPlugin.scala:26)
at com.jamesward.play.BrowserNotifierPlugin$$anonfun$2.apply(BrowserNotifierPlugin.scala:25)
at scala.Function3$$anonfun$tupled$1.apply(Function3.scala:35)
at scala.Function3$$anonfun$tupled$1.apply(Function3.scala:34)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42)
at sbt.std.Transform$$anon$4.work(System.scala:64)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
at sbt.Execute.work(Execute.scala:244)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)

As well as this one when provoking an exception:

[error] /Users/manu/workspace/hello-play/app/controllers/Application.scala:8: not found: value defd
[error]   defd index = Action {
[error]   ^
[error] one error found
unsupported message type: class org.jboss.netty.handler.codec.http.websocketx.TextWebSocketFrame
java.lang.IllegalArgumentException: unsupported message type: class org.jboss.netty.handler.codec.http.websocketx.TextWebSocketFrame
at org.jboss.netty.channel.socket.nio.SocketSendBufferPool.acquire(SocketSendBufferPool.java:52)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.write0(AbstractNioWorker.java:190)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.writeFromTaskLoop(AbstractNioWorker.java:150)
at org.jboss.netty.channel.socket.nio.AbstractNioChannel$WriteTask.run(AbstractNioChannel.java:335)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.processTaskQueue(AbstractNioSelector.java:366)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:290)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:88)
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
[error] (hello-play/compile:compile) Compilation failed

Have you seen this or heard about it before? Maybe a change in Netty version?

akka-http

It would be nice to get the description about setting it up in akka-http projects.

Error in application with multiple assets url mapping

If an application defines multiple assets mapping outside default /public directory, executing play ~run will complain about playAssetsDirectories ambiguous reference because it's imported twice in the same scope of build.sbt.

Error (I'm using activator but i think it'll also complain about the same error using play console):

$ ./activator ~run
[info] Loading project definition from /home/me/hello-play/project
[warn] Multiple resolvers having different access mechanism configured with same name 'typesafe-ivy-releases'. To avoid conflict, Remove duplicate project resolvers (`resolvers`) or rename publishing resolver (`publishTo`).
/home/me/hello-play/build.sbt:33: error: reference to playAssetsDirectories is ambiguous;
it is imported twice in the same scope by
import play.Project._
and import _root_.com.jamesward.play.BrowserNotifierPlugin._
playAssetsDirectories <+= baseDirectory / "showdash"
^
[error] Type error in expression
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? i
[warn] Ignoring load failure: no project loaded.
[error] Continuous execution not configured.

My build.sbt file:

import play.Project._

name := """hello-play"""

version := "1.0-SNAPSHOT"

libraryDependencies ++= Seq(
  "org.webjars"   %%  "webjars-play"      % "2.2.0",
  "org.webjars"   %   "jquery"            % "1.10.2",
  "org.webjars"   %   "jquery-ui"         % "1.10.3",
  "org.webjars"   %   "font-awesome"      % "4.0.3",
  "org.webjars"   %   "bootstrap"         % "3.0.3",
  "be.objectify"  %%  "deadbolt-java"     % "2.2.1-RC2",
  "com.feth"      %%  "play-authenticate" % "0.5.2-SNAPSHOT",
  "net.vz.mongodb.jackson" %% "play-mongo-jackson-mapper" % "1.1.0")

resolvers += Resolver.url("Objectify Play Repository (release)", url("http://schaloner.github.com/releases/"))(Resolver.ivyStylePatterns)

resolvers += Resolver.url("Objectify Play Repository (snapshot)", url("http://schaloner.github.com/snapshots/"))(Resolver.ivyStylePatterns)

resolvers += Resolver.url("play-easymail (release)", url("http://joscha.github.com/play-easymail/repo/releases/"))(Resolver.ivyStylePatterns)

resolvers += Resolver.url("play-easymail (snapshot)", url("http://joscha.github.com/play-easymail/repo/snapshots/"))(Resolver.ivyStylePatterns)

resolvers += Resolver.url("play-authenticate (release)", url("http://joscha.github.com/play-authenticate/repo/releases/"))(Resolver.ivyStylePatterns)

resolvers += Resolver.url("play-authenticate (snapshot)", url("http://joscha.github.com/play-authenticate/repo/snapshots/"))(Resolver.ivyStylePatterns)

playJavaSettings

com.jamesward.play.BrowserNotifierPlugin.livereload

playAssetsDirectories <+= baseDirectory / "public2"

Plugin does not work on submodules

I have a project composed of 3 submodules

root
    persistance
    test
    web

I added plugin in root/project/plugins.sbt
When I ~run in root plugin is starting, but I don't have any routes in root, main project is in web.
How can I activate plugin for web module?
I tried to add it with addPlugin to web module as BrowserNotifierPlugin but no change.
How it should be added on submodule?
Reload server is starting only when ~run on root.
Is there any way I can start it on submodule?
Thanks!

How to configure: Open in editor URL

Hi!

I want to configure the "Open in editor URL" so that it opens the github atom editor on windows. I could not find any documentation on how to configure the "Open in editor URL".

Where do i have to look? What would i have to search for in the atom community?

Thanks!

Add documentation on how to configure the 'Open in editor URL'

I want to use play-auto-refresh in with Intellij.
It used to work, but now on my new machine I have to set it up anew. I cannot find the information what to use as 'Open in editor URL' when using Intellij on Windows.

It would be nice to have the most common URLs (linux/windows-eclipse/intellij/atom) as part of the readme + part of the form where the user enters the url, so that people can get started with the plugin easily.

I would be happy to provide a pull request, but first I would need the content.

Broken on Play 2.3

When running with the newly released Play Framework 2.3 via activator, everything seems to work (or rather parse) except for the line added to build.sbt. I get the following error:

Reference to undefined setting: 

  *:playAssetsDirectories from *:watchSources (/home/dcode/Projects/PlayStartApp/build.sbt:27)

    at sbt.Init$class.Uninitialized(Settings.scala:260)
    at sbt.Def$.Uninitialized(Def.scala:10)
    at sbt.Init$class.delegate(Settings.scala:184)
    at sbt.Def$.delegate(Def.scala:10)
    at sbt.Init$class.compiled(Settings.scala:135)
    at sbt.Def$.compiled(Def.scala:10)
    at sbt.Init$class.make(Settings.scala:141)
    at sbt.Def$.make(Def.scala:10)
    at sbt.Load$.apply(Load.scala:139)
    at sbt.Load$.defaultLoad(Load.scala:37)
    at sbt.BuiltinCommands$.doLoadProject(Main.scala:473)
    at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:467)
    at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:467)
    at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:60)
    at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:60)
    at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:62)
    at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:62)
    at sbt.Command$.process(Command.scala:95)
    at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:100)
    at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:100)
    at sbt.State$$anon$1.process(State.scala:179)
    at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:100)
    at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:100)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
    at sbt.MainLoop$.next(MainLoop.scala:100)
    at sbt.MainLoop$.run(MainLoop.scala:93)
    at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:71)
    at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:66)
    at sbt.Using.apply(Using.scala:25)
    at sbt.MainLoop$.runWithNewLog(MainLoop.scala:66)
    at sbt.MainLoop$.runAndClearLast(MainLoop.scala:49)
    at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:33)
    at sbt.MainLoop$.runLogged(MainLoop.scala:25)
    at sbt.StandardMain$.runManaged(Main.scala:57)
    at sbt.xMain.run(Main.scala:29)
    at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
    at xsbt.boot.Launch$.withContextLoader(Launch.scala:129)
    at xsbt.boot.Launch$.run(Launch.scala:109)
    at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:36)
    at xsbt.boot.Launch$.launch(Launch.scala:117)
    at xsbt.boot.Launch$.apply(Launch.scala:19)
    at xsbt.boot.Boot$.runImpl(Boot.scala:44)
    at xsbt.boot.Boot$.main(Boot.scala:20)
    at xsbt.boot.Boot.main(Boot.scala)
[error] Reference to undefined setting: 
[error] 
[error]   *:playAssetsDirectories from *:watchSources (/home/dcode/Projects/PlayStartApp/build.sbt:27)
[error]  
[error] Use 'last' for the full log.
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? q

Multiple projects using play-auto-refresh in parallel

What do you think of the following idea:

Instead of fixing the port to 9001, we could just use Play's current port and add 10000 to it. The browser extensions could do just the same, so communication between multiple browser windows and auto-refresh projects would work in parallel.

Using Maven/SBT file structure not default Play layout

Is there a way to specify a different location for the basedirectory, im using Maven layout in my Play project so the directory structure is /src/main/assets /src/main/public /src/main/scala /src/main/twirl.

Plugin seems to be expecting all files to watch to be in standard /app structure.

Any advice?

unresolved dependency

I have scalaVersion := "2.12.2" and sbt.version=0.13.17 and addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.6.17")
I keep getting this error. Is this plugin supported for 2.6.x? Do I need to add a resolver in plugins.sbt?

[error] (*:update) sbt.ResolveException: unresolved dependency: com.jamesward#play-auto-refresh;0.0.16: not found

Firefox ?

Is there a way to avoid Botnet Chrome on my machine ?

There must be something ... could I connect to it without the Play dev tools ? maybe with the Firefox LiveReload Plugin ?

Thanks

Publish to Maven central using sbt-ci-release

The artifacts of play-auto-refresh are only available on repo.scala-sbt.org currently which had a multiple hours outage in April.

@jamesward I see you already published packages to Maven Central so this shouldn't be too hard: https://repo1.maven.org/maven2/com/jamesward/

Can you add the secrets for com.jamesward to this repo like you did for webjars-play/?
webjars/webjars-play#101 (comment)
If so, I might come up with a PR to add sbt-ci-release.

Thanks!

Play restarts App after each request

I just tried to integrate the auto-refresher in a bigger project with some submodules, and noticed that the Play app reloads after each request (reloading all the database plugins and restarting the default akka system, etc.) , even if no changes are made. Is this behavior intended?

If not, any hints on what could cause this behavior?

The SBT BrowserNotifierPlugin settings are only included in the main project, and the Play app works fine when I exclude them (without unnecessary reloads).

Version 0.0.6: Page doesn't reload after change/save

It works for versions 0.0.5 both tried with a simple Play app 2.2.0 ->

version 0.0.6:

$ ~/dev/play220/play ~run
[info] Loading project definition from /private/tmp/test/myapp/project
[info] Set current project to myapp (in build file:/private/tmp/test/myapp/)

--- (Running the application from SBT, auto-reloading is enabled) ---

[info] play - Listening for HTTP on /0:0:0:0:0:0:0:0%0:9000

(Server started, use Ctrl+D to stop and go back to the console...)

<change/save something in main.scala.html>

[success] Compiled in 923ms
[info] Compiling 1 Scala source to /private/tmp/test/myapp/target/scala-2.10/classes...
[success] Compiled in 8s

version 0.0.5.:

$ ~/dev/play220/play ~run
[info] Loading project definition from /private/tmp/test/myapp/project
[info] Set current project to myapp (in build file:/private/tmp/test/myapp/)

--- (Running the application from SBT, auto-reloading is enabled) ---

[info] play - Listening for HTTP on /0:0:0:0:0:0:0:0%0:9000

(Server started, use Ctrl+D to stop and go back to the console...)

[success] Compiled in 1s
[info] play - Application started (Dev)

<change/save something in main.scala.html>

[info] Compiling 1 Scala source to /private/tmp/test/myapp/target/scala-2.10/classes...
[success] Compiled in 8s

--- (RELOAD) ---

[info] play - Application started (Dev)

Can this be used with activator Play projects?

Hi James

I Would really love to get the reload feature to work with our new play (Activator based) project.

It complains in build.scala about the livereload setting:

Build.scala:20: no `: __' annotation allowed here
[error](such annotations are only allowed in arguments to *-parameters)
[error] com.jamesward.play.BrowserNotifierPlugin.livereload: __,
[error] ^
[error] one error found
error Compilation failed
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?

Configuration file is:

import com.ketalo.play.plugins.emberjs.EmberJsKeys
import sbt._

object ApplicationBuild extends Build with EmberJsKeys {

val appName = "???"
val appVersion = "0.1-SNAPSHOT"

val appDependencies = Seq(
"com.google.inject" % "guice" % "3.0",
"javax.inject" % "javax.inject" % "1",
"org.reactivemongo" %% "reactivemongo" % "0.10.0",
"org.reactivemongo" %% "play2-reactivemongo" % "0.10.2",

"org.mockito" % "mockito-core" % "1.9.5" % "test"

)

val main = play.Project(appName, appVersion, appDependencies).settings(
com.jamesward.play.BrowserNotifierPlugin.livereload: _*,
emberJsVersion := "1.5.1"
)

}

Hope that you are able to help, that auto reload increases my productivity!

Kind regards
Steffen

Bump to play 2.8

Hi, this doesn't seem to work as it should on play 2.8, could the problem be something with it not being version 2.8.x of play?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.