Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SBT - What is the difference between name and id?

Tags:

I was wondering if there is a difference in SBT between a project's name and id.

I noticed example build.sbt files with the following key:

name := "My Project"

And I noticed Build.scala files with:

Project(id = "My Project", base = file("."))

Is there a difference? Should the two be the same or is it irrelevant? What are they used for?

Thanks!

like image 298
user510159 Avatar asked Dec 10 '12 20:12

user510159


2 Answers

Project name should be used for the name of your project, the visible title for any documentation.

Id is used to refer to the project to modify settings or in terms of dependancy management, i.e to connect a subproject to a root project you can say subproject.dependsOn(rootProjectId)

like image 105
Faruk Sahin Avatar answered Nov 03 '22 20:11

Faruk Sahin


In your build.sbt file you have a single project definition. You can also pass a name attribute to the settings of a Project in your build.scala. As you can have several sub projects in a build file, you have to provide an id for each of them, while the project name remains the same.

like image 28
drexin Avatar answered Nov 03 '22 20:11

drexin