Setting absolute path for Compile target

83 views
Skip to first unread message

virtualeyes

unread,
Apr 19, 2012, 4:45:48 AM4/19/12
to simple-build-tool
Am unable to contact the author of coffeescripted-sbt due to GitHub
"Unicorn is Angry" happening on many project issue trackers.

At any rate, this is likely an SBT issue, so here goes:

(resourceManaged in (Compile, CoffeeKeys.coffee))
<<= (crossTarget in Compile)(_ / "your_preference" / "js")

allows one to write compiled js file to "target/:scala-version/
your_preference/js"

I need to write elsewhere on the file system, to Apache statics
directory at "/absolute/path/to/apache/static/js"

What's the secret sauce to pull this off? The only way I managed to
get it working was with an horrendous hack, path backtracking to
apache statics directory:

(resourceManaged in (Compile, CoffeeKeys.coffee)) <<=
(crossTarget in Compile)(_ / "../../../apache/static" / "js")

If you want some StackOverflow rep, I posted there:
http://stackoverflow.com/questions/10218423/scala-sbt-coffeescripted-correctly-override-compile-target

Thanks!

Mark Harrah

unread,
Apr 20, 2012, 7:03:03 PM4/20/12
to simple-b...@googlegroups.com

If I understand correctly, you just want to set the location to an absolute file. That looks like:

resourceManaged in (Compile, CoffeeKeys.coffee) :=
file("/absolute/path/to/apache/static/js")

( `file(x)` is an alias for `new File(x)`) Because the file is absolute, there is no need to make it relative to another setting/task.

-Mark

> Thanks!
>

virtualeyes

unread,
Apr 21, 2012, 6:15:50 AM4/21/12
to simple-build-tool
That nailed it, thanks Mark!

On Apr 21, 1:03 am, Mark Harrah <dmhar...@gmail.com> wrote:
> On Thu, 19 Apr 2012 01:45:48 -0700 (PDT)
>
>
>
>
>
>
>
>
>
> virtualeyes <sit1...@gmail.com> wrote:
> > Am unable to contact the author of coffeescripted-sbt due to GitHub
> > "Unicorn is Angry" happening on many project issue trackers.
>
> > At any rate, this is likely an SBT issue, so here goes:
>
> > (resourceManaged in (Compile, CoffeeKeys.coffee))
> >   <<= (crossTarget in Compile)(_ / "your_preference" / "js")
>
> > allows one to write compiled js file to "target/:scala-version/
> > your_preference/js"
>
> > I need to write elsewhere on the file system, to Apache statics
> > directory at "/absolute/path/to/apache/static/js"
>
> > What's the secret sauce to pull this off? The only way I managed to
> > get it working was with an horrendous hack, path backtracking to
> > apache statics directory:
>
> > (resourceManaged in (Compile, CoffeeKeys.coffee)) <<=
> >   (crossTarget in Compile)(_ / "../../../apache/static" / "js")
>
> > If you want some StackOverflow rep, I posted there:
> >http://stackoverflow.com/questions/10218423/scala-sbt-coffeescripted-...

Daniel Sobral

unread,
Apr 21, 2012, 12:07:04 PM4/21/12
to simple-b...@googlegroups.com
Now you can answer yourself on Stack Overflow. :-)

> --
> You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
> To post to this group, send email to simple-b...@googlegroups.com.
> To unsubscribe from this group, send email to simple-build-t...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/simple-build-tool?hl=en.
>

--
Daniel C. Sobral

I travel to the future all the time.

Reply all
Reply to author
Forward
0 new messages