orrsella / sbt-sublime

An sbt plugin for generating Sublime Text projects with library dependencies sources
Other
137 stars 9 forks source link

Configuration of .sublime-project #2

Open laughedelic opened 11 years ago

laughedelic commented 11 years ago

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"
  }]
}
orrsella commented 11 years ago

Interesting idea!

The example you give would be problematic for multi-project builds (many src/main/scala folders), but the general concept can still be used to add global Sublime project settings you always want.

The current version of the plugin doesn't seem to load settings globally – settings defined in ~/.sbt/build.sbt aren't used for some reason. This works for other non-sbt-sublime settings. I will investigate to see why this doesn't happen.

What do you think would be nice to globally configure? File/folder excludes, additional paths, anything else?

laughedelic commented 11 years ago

You can configure any sublime settings and add build systems in a project. I don't use it, so don't know, if it could be useful or not.

I think, you could use an external template file for generating project with several placeholders like $project_name$, $project_folder$, etc. So that user can change template, without any need to configure sbt-cublime plugin.

miguelbaldi commented 9 years ago

@laughedelic excellent idea! Config that would be good to globalize:

sublimeExternalSourceDirectoryParent sublimeFolderExcludePatterns

agemooij commented 9 years ago

+1

The fact that you can't globally configure this plugin has been frustrating me for a long time and I should have created an issue for it.

I copy a sublime.sbt file containing the following config to every single project I work on (and I work with micro services so that's a lot of projects) and then I have to modify the .gitignore file to exclude that file.

sublimeExternalSourceDirectoryParent <<= baseDirectory { base =>
  base / ".sublime"
}

sublimeTransitive := true

So a very big +1 for making these features globally configurable.

orrsella commented 9 years ago

Global configuration sounds like a cool feature. My quick search didn't find anything about support for global configuration (like via ~/.sbt/0.13/build.sbt or the likes) out of the box, but I might be missing something.

Any idea? Also, pull requests would be more then welcome ;)