Permalink
Browse files

added sxr + scaladoc for the complete project (not just part of it)

  • Loading branch information...
1 parent 5be7e09 commit d33fd675640a56e85cb6f84fca133643bd2120c7 @ahoy-jon ahoy-jon committed Jun 26, 2012
Showing with 40 additions and 1 deletion.
  1. BIN full/lib/sxr_2.9.0-0.2.7.jar
  2. +40 −1 project/build.scala
Binary file not shown.
View
@@ -57,6 +57,9 @@ object BuildSettings {
)
+
+
+
val jenaTestWIPFilter = Seq (
testOptions in Test += Tests.Argument("-l", "org.w3.banana.jenaWIP")
)
@@ -67,7 +70,7 @@ object BuildSettings {
}
-object YourProjectBuild extends Build {
+object BananaRdfBuild extends Build {
import BuildSettings._
@@ -122,6 +125,41 @@ object YourProjectBuild extends Build {
Seq( libraryDependencies += "org.apache.abdera" % "abdera-i18n" % "1.1.2" )
val pub = TaskKey[Unit]("pub")
+
+ lazy val full = {
+ def sxrOptions(baseDir: File, sourceDirs: Seq[Seq[File]]): Seq[String] = {
+ val xplugin = "-Xplugin:" + (baseDir / "lib" / "sxr_2.9.0-0.2.7.jar").asFile.getAbsolutePath
+ val baseDirs = sourceDirs.flatten
+ val sxrBaseDir = "-P:sxr:base-directory:" + baseDirs.mkString(":")
+ Seq(xplugin, sxrBaseDir)
+ }
+
+ val projects = Seq(rdf, jena, sesame, n3)
+ val allSources = TaskKey[Seq[Seq[File]]]("all-sources")
+ val allSourceDirectories = SettingKey[Seq[Seq[File]]]("all-source-directories")
+
+ Project(
+ id = "full",
+ base = file("full"),
+ dependencies = Seq(rdf, jena, sesame, n3),
+ settings = buildSettings ++ Seq(
+ allSources <<= projects.map(sources in Compile in _).join, // join: Seq[Task[A]] => Task[Seq[A]]
+ allSourceDirectories <<= projects.map(sourceDirectories in Compile in _).join,
+
+ // Combine the sources of other modules to generate Scaladoc and SXR annotated sources
+ (sources in Compile) <<= (allSources).map(_.flatten),
+
+ // Avoid compiling the sources here; we just are after scaladoc.
+ (compile in Compile) := inc.Analysis.Empty,
+
+ // Include SXR in the Scaladoc Build to generated HTML annotated sources.
+ scalacOptions in (Compile, doc) <++= (baseDirectory, allSourceDirectories).map {
+ (bd, asd) => sxrOptions(bd, asd)
+ }
+ )
+ )
+ }
+
lazy val banana = Project(
id = "banana",
@@ -137,6 +175,7 @@ object YourProjectBuild extends Build {
// n3TestSuite,
jena,
sesame,
+ full,
linkedData))
lazy val rdf = Project(

0 comments on commit d33fd67

Please sign in to comment.