orrsella / sbt-sublime Goto Github PK
View Code? Open in Web Editor NEWAn sbt plugin for generating Sublime Text projects with library dependencies sources
License: Other
An sbt plugin for generating Sublime Text projects with library dependencies sources
License: Other
All the standard SBT commands can be specified as hyphenated-words or as camelCase. For example, run-main can be used or runMain can be used. The gen-sublime command is not currently available as genSublime ... but I think it should be in order to be consistent. :)
Is there a version for Scala 2.11 planned, or a workaround to make the existing version work with Scala 2.11.1?
I tried installing your plugin in my ~/.sbt/0.12.1/plugins/build.sbt:
✦ cat ~/.sbt/0.12.1/plugins/build.sbt
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.7.0")
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.1.0")
addSbtPlugin("org.ensime" % "ensime-sbt-cmd" % "0.1.0")
addSbtPlugin("com.orrsella" %% "sbt-sublime" % "1.0")
However, when I try gen-sublime, I get this:
> gen-sublime
[error] Not a valid command: gen-sublime (similar: ensime, gen-idea)
Any ideas?
This plugin is awesome, especially in combination with ST3, thanks for creating it!
It would be great if I could configure the plugin to not remove the external libraries sources every time I run sbt clean
. I hardly ever update my dependencies but I do run sbt clean
once in a while and it makes no sense to me why that should break my Sublime project.
I used the sublimeExternalSourceDirectoryParent
settings to get the library sources out of the target directory in the assumption that that would fix it but then I found that the plugin explicitly adds the sources folder to the SBT clean targets.
Thanks
I have my plugin configured as a global plugin in the following way:
~/.sbt/0.13/plugins/build.sbt
contains addSbtPlugin("com.orrsella" % "sbt-sublime" % "1.1.0")
.
I have ~/.sbt/0.13/global.sbt
containing sublimeTransitive := true
.
When I had this setup under 1.0.x everything worked great. After upgrading to 1.1.x I get the following error.
/home/cfrederickson/.sbt/0.13/global.sbt:1: error: not found: value sublimeTransitive
sublimeTransitive := true
^
I'm using sbt 0.13.11
.
This plugin is one of the last ones on my list of essential plugins before I can move all our projects to SBT 1.0. It would be great if you could release a version built against Scala 2.12 and SBT 1.0.
Hello - and thanks for this super-useful plugin.
I've noticed a problem when running gen-sublime
using SBT 0.13.8:
[info] Writing project to file: /Users/richard/tmp/sublime-scalap/sublime-scalap.sublime-project
java.lang.NoClassDefFoundError: scala/tools/scalap/scalax/rules/scalasig/ScalaSigSymbol
I've put full details in a minimal project: https://github.com/d6y/sublime-scalap
The work-around is to use 0.13.7 instead.
I wonder, if it is possible to make this sbt-plugin globally configurable, and add some settings defining how .sublime-project
file will look. For example, I want to generate with this plugin such projects:
{
"folders":[{
"path":"."
,"folder_exclude_patterns": [".*", "target"]
,"file_exclude_patterns": [".*"]
},{
"path":"src/main/scala"
,"name":"Sources"
},{
"path":"src/test/scala"
,"name":"Tests"
},{
"path":"target/External Libraries"
}]
}
On version 1.0.11 you introduced the use of spray-json library, but this library has conflicted with a transitive dependency from sbt-coffeescript (sbt-coffeescript:1.0.0 -> sbt-js-engine:1.0.0 -> jse:1.0.0 -> spray-json:1.2.5).
With that we've ended up with 2 versions of spray-json (1.3.2 from sbt-sublime and 1.2.5 from sbt-coffeescript), which causes an error on ./activator ~run task when compiling coffeescript:
[info] CoffeeScript compiling on 1 source(s) java.lang.NoSuchMethodError: spray.json.JsArray.<init>(Lscala/collection/immutable/List;)V at com.typesafe.sbt.jse.SbtJsTask$.com$typesafe$sbt$jse$SbtJsTask$$executeSourceFilesJs(SbtJsTask.scala:215) at com.typesafe.sbt.jse.SbtJsTask$$anonfun$jsSourceFileTask$1$$anonfun$9$$anonfun$10$$anonfun$apply$4.apply(SbtJsTask.scala:289) at com.typesafe.sbt.jse.SbtJsTask$$anonfun$jsSourceFileTask$1$$anonfun$9$$anonfun$10$$anonfun$apply$4.apply(SbtJsTask.scala:286) at com.typesafe.sbt.web.SbtWeb$.withActorRefFactory(SbtWeb.scala:441) at com.typesafe.sbt.jse.SbtJsTask$$anonfun$jsSourceFileTask$1$$anonfun$9$$anonfun$10.apply(SbtJsTask.scala:285) at com.typesafe.sbt.jse.SbtJsTask$$anonfun$jsSourceFileTask$1$$anonfun$9$$anonfun$10.apply(SbtJsTask.scala:284) at scala.collection.immutable.Stream.map(Stream.scala:376) at com.typesafe.sbt.jse.SbtJsTask$$anonfun$jsSourceFileTask$1$$anonfun$9.apply(SbtJsTask.scala:283) at com.typesafe.sbt.jse.SbtJsTask$$anonfun$jsSourceFileTask$1$$anonfun$9.apply(SbtJsTask.scala:272) at com.typesafe.sbt.web.incremental.package$.syncIncremental(package.scala:228) at com.typesafe.sbt.jse.SbtJsTask$$anonfun$jsSourceFileTask$1.apply(SbtJsTask.scala:271) at com.typesafe.sbt.jse.SbtJsTask$$anonfun$jsSourceFileTask$1.apply(SbtJsTask.scala:257) at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47) at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40) at sbt.std.Transform$$anon$4.work(System.scala:63) at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226) at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226) at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17) at sbt.Execute.work(Execute.scala:235) at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226) at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226) at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159) at sbt.CompletionService$$anon$2.call(CompletionService.scala:28) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) java.lang.NoSuchMethodError: spray.json.JsArray.<init>(Lscala/collection/immutable/List;)V at com.typesafe.sbt.less.SbtLess$$anonfun$2.apply(SbtLess.scala:70) at com.typesafe.sbt.less.SbtLess$$anonfun$2.apply(SbtLess.scala:56) at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47) at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40) at sbt.std.Transform$$anon$4.work(System.scala:63) at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226) at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226) at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17) at sbt.Execute.work(Execute.scala:235) at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226) at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226) at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159) at sbt.CompletionService$$anon$2.call(CompletionService.scala:28) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) [error] (web-assets:coffeescript) java.lang.NoSuchMethodError: spray.json.JsArray.<init>(Lscala/collection/immutable/List;)V [error] (web-assets:less::jstaskJsOptions) java.lang.NoSuchMethodError: spray.json.JsArray.<init>(Lscala/collection/immutable/List;)V [error] application -
As a workaround I'm using sbt 0.13.7 and sbt-sublime 1.0.9.
I couldnt find any way to exclude plugins dependencies, is it possible?
Thanks for this great plugin!
When I add the addSbtPlugin
line from the Readme to plugins.sbt, I get an unresolved dependencies error.
Do I need a special resolver to use this plugin? Where are the Maven files for sbt-sublime?
If I run gen-sublime
twice I have sometimes found two External Libraries
folders shown in Sublime Text 2.
I frequently get the following when I run gen-sublime.
It resolves and downloads all the source directories but blows up just as it's writing the project.
info] Adding the following to external libraries:
....
[info] Extracting jars to external sources directory
[info] Marking all files in sources directory as read-only
[info] Writing project to file: /Users/mhughes/monitoring.sublime-project
java.lang.NoClassDefFoundError: scala/tools/scalap/scalax/rules/scalasig/ScalaSigSymbol
at org.json4s.reflect.Reflector$ClassDescriptorBuilder$$anonfun$constructorsAndCompanion$3$$anonfun$13.apply(Reflector.scala:123)
at org.json4s.reflect.Reflector$ClassDescriptorBuilder$$anonfun$constructorsAndCompanion$3$$anonfun$13.apply(Reflector.scala:122)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.AbstractTraversable.map(Traversable.scala:105)
at org.json4s.reflect.Reflector$ClassDescriptorBuilder$$anonfun$constructorsAndCompanion$3.apply(Reflector.scala:122)
at org.json4s.reflect.Reflector$ClassDescriptorBuilder$$anonfun$constructorsAndCompanion$3.apply(Reflector.scala:116)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:34)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.AbstractTraversable.map(Traversable.scala:105)
at org.json4s.reflect.Reflector$ClassDescriptorBuilder.constructorsAndCompanion(Reflector.scala:116)
at org.json4s.reflect.Reflector$ClassDescriptorBuilder.result(Reflector.scala:156)
at org.json4s.reflect.Reflector$.createDescriptor(Reflector.scala:50)
at org.json4s.reflect.Reflector$$anonfun$describe$1.apply(Reflector.scala:44)
at org.json4s.reflect.Reflector$$anonfun$describe$1.apply(Reflector.scala:44)
at org.json4s.reflect.package$Memo.apply(package.scala:39)
at org.json4s.reflect.Reflector$.describe(Reflector.scala:44)
at org.json4s.Extraction$.decomposeObject$1(Extraction.scala:91)
at org.json4s.Extraction$.internalDecomposeWithBuilder(Extraction.scala:180)
at org.json4s.Extraction$.decomposeWithBuilder(Extraction.scala:67)
at org.json4s.Extraction$.decompose(Extraction.scala:194)
at com.orrsella.sbtsublime.SublimeProject.toFile(SublimeProject.scala:37)
at com.orrsella.sbtsublime.SublimePlugin$.doCommand(SublimePlugin.scala:116)
at com.orrsella.sbtsublime.SublimePlugin$$anonfun$sublimeCommand$1.apply(SublimePlugin.scala:52)
at com.orrsella.sbtsublime.SublimePlugin$$anonfun$sublimeCommand$1.apply(SublimePlugin.scala:52)
at sbt.Command$$anonfun$command$1$$anonfun$apply$1.apply(Command.scala:29)
at sbt.Command$$anonfun$command$1$$anonfun$apply$1.apply(Command.scala:29)
at sbt.Command$.process(Command.scala:92)
at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:98)
at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:98)
at sbt.State$$anon$1.process(State.scala:184)
at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:98)
at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:98)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.MainLoop$.next(MainLoop.scala:98)
at sbt.MainLoop$.run(MainLoop.scala:91)
at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:70)
at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:65)
at sbt.Using.apply(Using.scala:24)
at sbt.MainLoop$.runWithNewLog(MainLoop.scala:65)
at sbt.MainLoop$.runAndClearLast(MainLoop.scala:48)
at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:32)
at sbt.MainLoop$.runLogged(MainLoop.scala:24)
at sbt.StandardMain$.runManaged(Main.scala:53)
at sbt.xMain.run(Main.scala:28)
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)
Caused by: java.lang.ClassNotFoundException: scala.tools.scalap.scalax.rules.scalasig.ScalaSigSymbol
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.json4s.reflect.Reflector$ClassDescriptorBuilder$$anonfun$constructorsAndCompanion$3$$anonfun$13.apply(Reflector.scala:123)
at org.json4s.reflect.Reflector$ClassDescriptorBuilder$$anonfun$constructorsAndCompanion$3$$anonfun$13.apply(Reflector.scala:122)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.AbstractTraversable.map(Traversable.scala:105)
at org.json4s.reflect.Reflector$ClassDescriptorBuilder$$anonfun$constructorsAndCompanion$3.apply(Reflector.scala:122)
at org.json4s.reflect.Reflector$ClassDescriptorBuilder$$anonfun$constructorsAndCompanion$3.apply(Reflector.scala:116)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:34)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.AbstractTraversable.map(Traversable.scala:105)
at org.json4s.reflect.Reflector$ClassDescriptorBuilder.constructorsAndCompanion(Reflector.scala:116)
at org.json4s.reflect.Reflector$ClassDescriptorBuilder.result(Reflector.scala:156)
at org.json4s.reflect.Reflector$.createDescriptor(Reflector.scala:50)
at org.json4s.reflect.Reflector$$anonfun$describe$1.apply(Reflector.scala:44)
at org.json4s.reflect.Reflector$$anonfun$describe$1.apply(Reflector.scala:44)
at org.json4s.reflect.package$Memo.apply(package.scala:39)
at org.json4s.reflect.Reflector$.describe(Reflector.scala:44)
at org.json4s.Extraction$.decomposeObject$1(Extraction.scala:91)
at org.json4s.Extraction$.internalDecomposeWithBuilder(Extraction.scala:180)
at org.json4s.Extraction$.decomposeWithBuilder(Extraction.scala:67)
at org.json4s.Extraction$.decompose(Extraction.scala:194)
at com.orrsella.sbtsublime.SublimeProject.toFile(SublimeProject.scala:37)
at com.orrsella.sbtsublime.SublimePlugin$.doCommand(SublimePlugin.scala:116)
at com.orrsella.sbtsublime.SublimePlugin$$anonfun$sublimeCommand$1.apply(SublimePlugin.scala:52)
at com.orrsella.sbtsublime.SublimePlugin$$anonfun$sublimeCommand$1.apply(SublimePlugin.scala:52)
at sbt.Command$$anonfun$command$1$$anonfun$apply$1.apply(Command.scala:29)
at sbt.Command$$anonfun$command$1$$anonfun$apply$1.apply(Command.scala:29)
at sbt.Command$.process(Command.scala:92)
at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:98)
at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:98)
at sbt.State$$anon$1.process(State.scala:184)
at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:98)
at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:98)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.MainLoop$.next(MainLoop.scala:98)
at sbt.MainLoop$.run(MainLoop.scala:91)
at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:70)
at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:65)
at sbt.Using.apply(Using.scala:24)
at sbt.MainLoop$.runWithNewLog(MainLoop.scala:65)
at sbt.MainLoop$.runAndClearLast(MainLoop.scala:48)
at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:32)
at sbt.MainLoop$.runLogged(MainLoop.scala:24)
at sbt.StandardMain$.runManaged(Main.scala:53)
at sbt.xMain.run(Main.scala:28)
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] java.lang.NoClassDefFoundError: scala/tools/scalap/scalax/rules/scalasig/ScalaSigSymbol
In the repo headline:
An sbt pluign for generating Sublime Text projects with library dependencies sources
(pluign -> plugin)
Thanks for a great plugin BTW have been using it for years :-)
Steps:
See:
java.lang.NoSuchMethodError: spray.json.DefaultJsonProtocol$.optionFormat(Lspray/json/JsonFormat;)Lspray/json/StandardFormats$OptionFormat;
http://pastebin.com/fRBDQe4c
Thank you, Orr! If it works for me, sbt-sublime might boost my productivity lost to IntelliJ sbt slowness.
Hi,
I'm using a SBT full configuration for my project and would like to be able to configure the plugin sublimeExternalSourceDirectoryName and sublimeExternalSourceDirectoryParent settings.
I've tried putting the settings in several places but they don't seem to be taken into account.
Could you please provide a simple full configuration example with the plugin settings in it?
Cheers and thanks again for this plugin ;)
It would be great to be able to add sources for unmanaged dependencies under $projectroor/lib folder.
If I run gen-sublime
twice, it only shows one of my dependencies in External Libraries
. Manually deleting External Libraries
and running again gen-sublime
fixes the issue.
Steps to reproduce the issue:
External Libraries
does not exist;gen-sublime
: all the dependencies are listed in External Libraries
;gen-sublime
a second time: only one dependency is listed;External Libraries
;gen-sublime
: all dependencies are listed again.A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.