Play framework 2 with sass and compass config file - scala

I am testing stuff with scala, play framework 2.1.1 and I wanted to add sass with compass stylesheets using the compass plugin "compass-normalizer". For the sass part I am using the jlitola plugin.
I already got play working with sass and compass but using compass plugins has proven to be a nightmare for me. I have tried adding it as a ruby requirement:
SassPlugin.sassOptions := Seq("--compass","-r","compass-normalizer")
This was just a try and obviously didn't work because normalizer needs compass to be already initialized, however I can make it work from the terminal if I have the contrib.rb compass config file where I call sass #sassfile# --compass.
In that way of thinking I tried adding the contrib.rb file in the play project with no luck. I tried to add it to the app, conf and project folders with the same luck in all of them.
Can someone tell me what am I doing wrong?

It looks like it's just using the "current working directory" when running (see: https://github.com/jlitola/play-sass/blob/master/src/main/scala/SassCompiler.scala#L16). This is using a shady implicit to convert the Seq[String] => ProcessBuilder.
So, you may be able to put the contrib.rb file in the default directory (should be where you're running sbt from) and have the work. If not, according to the JVM docs:
The default value is the current working directory of the current process, usually the directory named by the system property user.dir.
So you could make a task that prints this in sbt to see what it is:
TaskKey[Unit]("show-user-dir") := println(sys.props("user.dir")

Related

Problem while trying to execute ant file in java

I'm trying to compile a service using a java ant file as appears below:
and my buid-jar.xml looks like this:
the problem i have is that eclipse is not recognizing the enviroment variables and it takes the names literally causing an error on building time:
Both, paths and ant files does exists in these routes in my user folder, but i don't know why this error is happening. I'm using jdk 1.8.0_45.
Any idea? Sorry i had to attach screenshots instead code, but the proxy of the company network that i work for doesn't allow me to navigate on stackoverflow.

Play (Scala) auto-reload settings

I am building a web application with Play 2.2 for Scala. I have one issue with the auto-reload feature:
I am adding some settings when running the server like this play "run -Dtwitter.consumerSecret=mykey -Dtwitter.tokenSecret=mysecret". When the application re-compile on change, it does not take into account the parameters. I have to re-start the server. How to tell sbt to take into account the settings on reload.
Thanks for you help.
We add the following line to the bottom our application.conf
include "overrides.conf"
We make sure it's in the ignore file of our version control system.
The overrides.conf file allows us to tweak (and add) settings that should remain local.
Note that the include statement is ignored if the file can not be found.

Can't get prebuild hooks to work in Trigger.io

I'm keen to use coffeescript within Trigger.io and to do so I am following the details as described at http://docs.trigger.io/en/latest/tools/hooks.html
I've placed my coffeescript.js file in the hooks/prebuild directory as required but the build now fails. I've commented out everything in the coffeescript.js file to ensure it's not the file's contents.
It detects the coffeescript.js file in the prebuild directory as shown in the log output but then it can't find some file. Anyone else have this problem? I'm using version 1.4 of the Trigger Toolkit.
[INFO] Running (node) hook: coffeescript.js
[DEBUG] Running: 'node' '/Users/Will/forge-workspace/alpha-timing/hooks/prebuild/coffeescript.js' 'ios'
[ERROR] [Errno 2] No such file or directory
A slight tangent... but you might want to have a look at Brunch.io
I've recently started using it for building the JS for my trigger.io app and it works great. It can compile your coffeescript, js, css and more automatically. Comes with a watcher and auto-reload, so when you are developing and testing in browser it's very fast.
We use Node.js to transform the coffeescript into JS at the prebuild stage - it looks like you don't have it installed: go to http://nodejs.org/ to grab it.
Note you'll also need coffee-script to run that hook!

Load a file a Lift boot?

I have a CSV file I want to load at boot of my Lift app, but I can't figure out where to place this file. I've tried putting it under src\main\resources and then using LiftRules.getResource/doWithResource, but no dice (I get a MalformedURLException).
What's the standard way to do this in Lift?
Answered on the Lift mailing list. Turns out that sbt does not copy resources over when issuing compile or container:start commands, but only when executing the package command. This may be an sbt bug.

I can't get qml to use my custom plugin

I'm working in QtQuick and right now struggling with a weird problem: I can't get my custom plugin to work in Qml. There's a simple demo in the SDK (Examples/4.7/declarative/tutorials/extending/chapter6-plugins) and this doesn't work on my computer either. I don't get any error messages except that it doesn't recognize my custom items. Has anybody seen this problem? Any suggestions?
My setup:
Win 7 Home Premium, Qt Creator 2.1.0, Qt 4.7.3 (MinGW 4.4)
Thanks
Beside the qmldir issue already mentioned by blakharaz, also make sure to set QML_IMPORT_PATH in your pro file or setting the path via QDeclarativeEngine::addImportPath() so the module can be found on your development environment (if you don't install them systemwide before using).
And when using subfolders, make sure they are part of the import (see http://doc.qt.nokia.com/4.7-snapshot/qdeclarativemodules.html)
It would be nice to have some code. One possible issue could be the directory structure or the qmldir file. If you want to have a plugin called Foo you basically need a directory Foo which contains the Foo.dll (or libFoo.so) and a qmldir file (content is at least "plugin Foo")
If you have that "import Foo 1.0" should load the library.
I just had the exact same problem.
Build your .dlls as release instead of debug, that fixed it for me.