Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is there a build.gradle and a build.sbt in play framework?

I'm starting to develop a web app with scala. What I don't understand is why we have a build.gradle file and a build.sbt file. There are dependencies defined in both files.

Which one should I use in what case?

like image 625
Marcos Avatar asked Jan 13 '18 00:01

Marcos


People also ask

What is sbt and Gradle?

Gradle and SBT can be primarily classified as "Java Build" tools. Gradle is an open source tool with 9.23K GitHub stars and 2.7K GitHub forks. Here's a link to Gradle's open source repository on GitHub.

Why do we need build Gradle?

It is popular for its ability to build automation in languages like Java, Scala, Android, C/C++, and Groovy. The tool supports groovy based Domain Specific Language over XML. Gradle provides building, testing, and deploying software on several platforms. The tool is popular for building any software and large projects.

What is sbt in play framework?

sbt : The sbt settings that describe building your application. /conf : Configuration files for your application. /project : Further build description information. /public : Where static, public assets for your application are stored. /test : Where your application's test code will be stored.

What does sbt build do?

sbt is a popular tool for compiling, running, and testing Scala projects of any size. Using a build tool such as sbt (or Maven/Gradle) becomes essential once you create projects with dependencies or more than one code file.


1 Answers

The files are equivalent, and that is why they both declare (almost) the same dependencies.

So you can use Gradle or sbt, but you won't need to use both. If you want to use Gradle, just remove build.sbt. If you want to use sbt, just remove build.gradle. They are both present in samples and seeds so that users can choose and see how to configure Gradle/sbt for that kind of project.

like image 170
marcospereira Avatar answered Oct 19 '22 12:10

marcospereira