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?
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With