Permalink
Browse files

closes #67: Split into core and plugin

  • Loading branch information...
1 parent 5a9cfa8 commit 2c815ed92612e90e311832e51f322c09ef7131ba Heiko Seeberger committed Dec 23, 2011
Showing with 337 additions and 72 deletions.
  1. +0 −57 build.sbt
  2. +92 −0 project/Build.scala
  3. +1 −1 project/plugins.sbt
  4. 0 { → sbteclipse-core}/src/main/resources/LICENSE-2.0.txt
  5. +1 −1 .../typesafe/sbteclipse → sbteclipse-core/src/main/scala/com/typesafe/sbteclipse/core}/Eclipse.scala
  6. +1 −1 ...esafe/sbteclipse → sbteclipse-core/src/main/scala/com/typesafe/sbteclipse/core}/EclipseOpts.scala
  7. +5 −3 ...afe/sbteclipse → sbteclipse-core/src/main/scala/com/typesafe/sbteclipse/core}/EclipsePlugin.scala
  8. +2 −2 .../typesafe/sbteclipse → sbteclipse-core/src/main/scala/com/typesafe/sbteclipse/core}/package.scala
  9. +202 −0 sbteclipse-plugin/src/main/resources/LICENSE-2.0.txt
  10. +26 −0 sbteclipse-plugin/src/main/scala/com/typesafe/sbteclipse/plugin/EclipsePlugin.scala
  11. 0 { → sbteclipse-plugin}/src/sbt-test/sbteclipse/00-defaults/build.sbt
  12. +2 −0 sbteclipse-plugin/src/sbt-test/sbteclipse/00-defaults/project/plugins.sbt
  13. 0 { → sbteclipse-plugin}/src/sbt-test/sbteclipse/00-defaults/test
  14. 0 { → sbteclipse-plugin}/src/sbt-test/sbteclipse/01-structure/build.sbt
  15. 0 { → sbteclipse-plugin}/src/sbt-test/sbteclipse/01-structure/project/Build.scala
  16. +2 −0 sbteclipse-plugin/src/sbt-test/sbteclipse/01-structure/project/plugins.sbt
  17. 0 { → sbteclipse-plugin}/src/sbt-test/sbteclipse/01-structure/test
  18. 0 { → sbteclipse-plugin}/src/sbt-test/sbteclipse/02-contents/build.sbt
  19. +1 −1 { → sbteclipse-plugin}/src/sbt-test/sbteclipse/02-contents/project/Build.scala
  20. +2 −0 sbteclipse-plugin/src/sbt-test/sbteclipse/02-contents/project/plugins.sbt
  21. 0 { → sbteclipse-plugin}/src/sbt-test/sbteclipse/02-contents/src/main/java/JavaRoot.java
  22. 0 { → sbteclipse-plugin}/src/sbt-test/sbteclipse/02-contents/src/main/scala/Root.scala
  23. 0 { → sbteclipse-plugin}/src/sbt-test/sbteclipse/02-contents/src/test/scala/RootSpec.scala
  24. 0 { → sbteclipse-plugin}/src/sbt-test/sbteclipse/02-contents/sub/src/main/scala/Sub.scala
  25. 0 { → sbteclipse-plugin}/src/sbt-test/sbteclipse/02-contents/sub/suba/src/main/scala/SubA.scala
  26. 0 { → sbteclipse-plugin}/src/sbt-test/sbteclipse/02-contents/sub/subb/src/it/scala/RootIt.scala
  27. 0 { → sbteclipse-plugin}/src/sbt-test/sbteclipse/02-contents/sub/subb/src/main/scala/SubB.scala
  28. 0 { → sbteclipse-plugin}/src/sbt-test/sbteclipse/02-contents/sub/subc/src/main/scala/SubC.scala
  29. 0 { → sbteclipse-plugin}/src/sbt-test/sbteclipse/02-contents/test
  30. +0 −2 src/sbt-test/sbteclipse/00-defaults/project/plugins.sbt
  31. +0 −2 src/sbt-test/sbteclipse/01-structure/project/plugins.sbt
  32. +0 −2 src/sbt-test/sbteclipse/02-contents/project/plugins.sbt
View
@@ -1,57 +0,0 @@
-
-import sbtrelease._
-
-organization := "com.typesafe.sbteclipse"
-
-name := "sbteclipse"
-
-// version is defined in version.sbt in order to support sbt-release
-
-sbtPlugin := true
-
-scalacOptions ++= Seq("-unchecked", "-deprecation")
-
-libraryDependencies ++= Seq("org.scalaz" %% "scalaz-core" % "6.0.3")
-
-publishTo <<= (version) { version =>
- val (name, url) =
- if (version endsWith "SNAPSHOT")
- "ivy-snapshots" -> "http://repo.typesafe.com/typesafe/ivy-snapshots/"
- else
- "ivy-releases" -> "http://repo.typesafe.com/typesafe/ivy-releases/"
- Some(Resolver.url(name, new URL(url))(Resolver.ivyStylePatterns))
-}
-
-publishMavenStyle := false
-
-seq(posterousSettings: _*)
-
-(email in Posterous) <<= PropertiesKeys.properties(_ get "posterous.email")
-
-(password in Posterous) <<= PropertiesKeys.properties(_ get "posterous.password")
-
-seq(propertiesSettings: _*)
-
-seq(Release.releaseSettings: _*)
-
-ReleaseKeys.releaseProcess <<= thisProjectRef { ref =>
- import ReleaseStateTransformations._
- Seq[ReleasePart](
- initialGitChecks,
- checkSnapshotDependencies,
- releaseTask(check in Posterous in ref),
- inquireVersions,
- runTest,
- setReleaseVersion,
- commitReleaseVersion,
- tagRelease,
- releaseTask(publish in Global in ref),
- releaseTask(publish in Posterous in ref),
- setNextVersion,
- commitNextVersion
- )
-}
-
-seq(scalariformSettings: _*)
-
-seq(scriptedSettings: _*)
View
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2011 Typesafe Inc.
+ *
+ * This work is based on the original contribution of WeigleWilczek.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import com.typesafe.sbtscalariform.ScalariformPlugin._
+import name.heikoseeberger.sbtproperties.PropertiesPlugin._
+import posterous.Publish._
+import sbtrelease._
+import sbt._
+import sbt.Keys._
+import sbt.ScriptedPlugin._
+
+object Build extends Build {
+
+ lazy val root = Project(
+ "sbteclipse",
+ file("."),
+ aggregate = Seq(sbteclipseCore, sbteclipsePlugin),
+ settings = commonSettings ++ Seq(
+ publishArtifact := false
+ )
+ )
+
+ lazy val sbteclipseCore = Project(
+ "sbteclipse-core",
+ file("sbteclipse-core"),
+ settings = commonSettings ++ Seq(
+ sbtPlugin := true,
+ libraryDependencies ++= Seq("org.scalaz" %% "scalaz-core" % "6.0.3")
+ )
+ )
+
+ lazy val sbteclipsePlugin = Project(
+ "sbteclipse-plugin",
+ file("sbteclipse-plugin"),
+ dependencies = Seq(sbteclipseCore),
+ settings = commonSettings ++ Seq(
+ sbtPlugin := true
+ )
+ )
+
+ def commonSettings = Defaults.defaultSettings ++
+ Seq(
+ organization := "com.typesafe.sbteclipse",
+ // version is defined in version.sbt in order to support sbt-release
+ scalacOptions ++= Seq("-unchecked", "-deprecation"),
+ publishTo <<= (version)(version =>
+ Some(if (version endsWith "SNAPSHOT") Classpaths.typesafeSnapshots else Classpaths.typesafeResolver)
+ ),
+ publishMavenStyle := false
+ ) ++
+ posterousSettings ++ Seq(
+ (email in Posterous) <<= PropertiesKeys.properties(_ get "posterous.email"),
+ (password in Posterous) <<= PropertiesKeys.properties(_ get "posterous.password")
+ ) ++
+ propertiesSettings ++
+ Release.releaseSettings ++ Seq(
+ ReleaseKeys.releaseProcess <<= thisProjectRef { ref =>
+ import ReleaseStateTransformations._
+ Seq[ReleasePart](
+ initialGitChecks,
+ checkSnapshotDependencies,
+ releaseTask(check in Posterous in ref),
+ inquireVersions,
+ runTest,
+ setReleaseVersion,
+ commitReleaseVersion,
+ tagRelease,
+ releaseTask(publish in Global in ref),
+ releaseTask(publish in Posterous in ref),
+ setNextVersion,
+ commitNextVersion
+ )
+ }
+ ) ++
+ scalariformSettings ++
+ scriptedSettings
+}
View
@@ -8,7 +8,7 @@ addSbtPlugin("com.github.gseitz" % "sbt-release" % "0.4")
addSbtPlugin("com.typesafe.sbtscalariform" % "sbtscalariform" % "0.3.1")
-addSbtPlugin("name.heikoseeberger.sbtproperties" % "sbtproperties" % "1.0.0")
+addSbtPlugin("name.heikoseeberger.sbtproperties" % "sbtproperties" % "1.0.1")
addSbtPlugin("net.databinder" % "posterous-sbt" % "0.3.2")
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package com.typesafe.sbteclipse
+package com.typesafe.sbteclipse.core
import EclipsePlugin.{
EclipseClasspathEntry,
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package com.typesafe.sbteclipse
+package com.typesafe.sbteclipse.core
private object EclipseOpts {
@@ -16,15 +16,17 @@
* limitations under the License.
*/
-package com.typesafe.sbteclipse
+package com.typesafe.sbteclipse.core
import sbt.{ Configuration, Configurations, File, Plugin, Setting, SettingKey }
import sbt.Keys.{ baseDirectory, commands }
import scala.xml.Elem
-object EclipsePlugin extends Plugin {
+object EclipsePlugin extends EclipsePlugin
- override def settings: Seq[Setting[_]] = {
+trait EclipsePlugin {
+
+ def eclipseSettings: Seq[Setting[_]] = {
import EclipseKeys._
Seq(
commandName := "eclipse",
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package com.typesafe
+package com.typesafe.sbteclipse
import java.util.Properties
import sbt.{
@@ -42,7 +42,7 @@ import sbt.complete.Parser
import scalaz.{ NonEmptyList, Validation }
import scalaz.Scalaz._
-package object sbteclipse {
+package object core {
def id[A](a: A): A = a
Oops, something went wrong.

0 comments on commit 2c815ed

Please sign in to comment.