Skip to content

Latest commit

 

History

History
54 lines (39 loc) · 2.7 KB

README.textile

File metadata and controls

54 lines (39 loc) · 2.7 KB

sbteclipse

This project is a plugin for SBT 0.10.x providing a command to create Eclipse project files from a SBT project (possibly containing subprojects).

Changes in latest version

  • #22: Use test configuration for UpdateReport from updateClassifiers (improvement)
  • #21: Duplicate project dependency in Eclipse if normal and test dependency (bug)
  • #20: Multi-module library dependencies support broken (bug)
  • #10: Pretty print Eclipse XML files (feature)
  • #19: Added option for same target directory (feature)

Installing sbteclipse as a SBT plugin

  • To “install” the plugin, either use a local or the globel plugin definition (for details about SBT plugins please see the SBT documentation):
    • The local plugin is just a build.sbt file in the project/plugins folder of your project
    • The global plugin is defined via a build.sbt file in the directory ~/.sbt/plugins.
  • Just add the below lines to your build.sbt file, paying attention to the blank line between the two blocks:
resolvers += {
  val typesafeRepoUrl = new java.net.URL("http://repo.typesafe.com/typesafe/releases")
  val pattern = Patterns(false, "[organisation]/[module]/[sbtversion]/[revision]/[type]s/[module](-[classifier])-[revision].[ext]")
  Resolver.url("Typesafe Repository", typesafeRepoUrl)(pattern)
}

libraryDependencies <<= (libraryDependencies, sbtVersion) { (deps, version) => 
  deps :+ ("com.typesafe.sbteclipse" %% "sbteclipse" % "1.3-RC3" extra("sbtversion" -> version))
}

Using sbteclipse to create Eclipse project files

  • As soon as sbteclipse is properly set up as a plugin, you can use the command eclipse in an SBT session to create Eclipse project files
  • After having created the Eclipse project files you can import the project in Eclipse using the “Import Wizard” to import “Existing Projects into Workspace”

Options

  • create-src to create the common source directories, e.g. src/main/scala, src/main/test, etc.
  • same-targets to make sbt and Eclipse compile into the same target directories; by default the Eclipse directories will be different, e.g. .target
  • skip-root to skip project creation for the root project
  • with-sources to create source attachments for the library dependencies

Example

tmp$ mkdir test
tmp$ cd test
test$ sbt
> eclipse create-src
[info] Successfully created Eclipse project files. Please select the appropriate Eclipse plugin for Scala 2.8.1!

License

sbteclipse is open source software licensed under the Apache 2.0 License. If you like it, feel free to use it!