Skip to content

Commit

Permalink
add default scala lib dependency for scala based modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis Botterill committed May 2, 2012
1 parent 621470c commit 8825b2a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion maker/src/maker/project/Project.scala
Expand Up @@ -256,13 +256,21 @@ case class Project(
} }
} }


def hasScala = findFilesWithExtension("scala", srcDirs : _*).size > 0

// maven / ivy integration // maven / ivy integration
import maker.utils.maven._ import maker.utils.maven._
def moduleDef : ModuleDef = { def moduleDef : ModuleDef = {
val deps : List[DependencyLib] = readIvyDependencies() val deps : List[DependencyLib] = readIvyDependencies()
val repos : List[MavenRepository] = readIvyResolvers() val repos : List[MavenRepository] = readIvyResolvers()
val moduleLibDef = DependencyLib(name, props.GroupId() % name % props.Version(), "compile", None) 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) 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()) ModuleDef(projectDef, deps, repos, ScmDef(props.ScmUrl(), props.ScmConnection()), props.Licenses(), props.Developers())
} }
Expand Down

0 comments on commit 8825b2a

Please sign in to comment.