Permalink
Browse files

add default scala lib dependency for scala based modules

  • Loading branch information...
Louis Botterill
Louis Botterill committed May 2, 2012
1 parent 621470c commit 8825b2ad8e0ffd00f2f4f42cc7f2d8070f76275d
Showing with 9 additions and 1 deletion.
  1. +9 −1 maker/src/maker/project/Project.scala
@@ -256,13 +256,21 @@ case class Project(
}
}
+ def hasScala = findFilesWithExtension("scala", srcDirs : _*).size > 0
+
// maven / ivy integration
import maker.utils.maven._
def moduleDef : ModuleDef = {
val deps : List[DependencyLib] = readIvyDependencies()
val repos : List[MavenRepository] = readIvyResolvers()
val moduleLibDef = DependencyLib(name, props.GroupId() % name % props.Version(), "compile", None)
- val moduleDeps = children.map(c => DependencyLib(name, props.Organisation() % c.name % props.Version(), "compile", None))
+ val moduleDeps = {
+ val childLibs = children.map(c => DependencyLib(name, props.GroupId() % c.name % props.Version(), "compile", None))
+ if (hasScala)
+ DependencyLib(name, "org.scala-lang" % "scala-library" % props.ScalaVersion(), "compile", None) :: childLibs
+ else
+ childLibs
+ }
val projectDef = ProjectDef(description.getOrElse("Module " + name + " definition (generated by Maker)"), moduleLibDef, moduleDeps)
ModuleDef(projectDef, deps, repos, ScmDef(props.ScmUrl(), props.ScmConnection()), props.Licenses(), props.Developers())
}

0 comments on commit 8825b2a

Please sign in to comment.