Skip to content

Commit

Permalink
added sxr + scaladoc for the complete project (not just part of it)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahoy-jon committed Jun 26, 2012
1 parent 5be7e09 commit d33fd67
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
Binary file added full/lib/sxr_2.9.0-0.2.7.jar
Binary file not shown.
41 changes: 40 additions & 1 deletion project/build.scala
Expand Up @@ -57,6 +57,9 @@ object BuildSettings {
)





val jenaTestWIPFilter = Seq (
testOptions in Test += Tests.Argument("-l", "org.w3.banana.jenaWIP")
)
Expand All @@ -67,7 +70,7 @@ object BuildSettings {

}

object YourProjectBuild extends Build {
object BananaRdfBuild extends Build {

import BuildSettings._

Expand Down Expand Up @@ -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",
Expand All @@ -137,6 +175,7 @@ object YourProjectBuild extends Build {
// n3TestSuite,
jena,
sesame,
full,
linkedData))

lazy val rdf = Project(
Expand Down

0 comments on commit d33fd67

Please sign in to comment.