A modular Scala 3 application built with sbt, developed as part of the DIBS course (DiseΓ±o e ImplementaciΓ³n de Bibliotecas de Software).
This project demonstrates the evolution of a basic Scala console application into a multi-module architecture, separating a reusable library (lib
) from the main executable application (app
). It's ideal for exploring best practices in modularization, dependency management, and scalable project structure with sbt.
π£ Although the course materials are in Spanish, this repository and its code are written in English to make the project more accessible to a wider audience.
This repository supports two lessons from the DIBS course:
- Learn how to install and use
sbt
- Generate a basic Scala 3 project using the official Giter8 template
- Understand the standard
src/main
andsrc/test
directory structure - Run a small console app using Scala 3's
@main
annotation
- Convert the basic project into a multi-module layout
- Define
lib
andapp
subprojects inbuild.sbt
- Share settings across modules with
commonSettings
- Call a function defined in the library from the main application
From the root of the project, you can run the main module with:
sbt "app/run Alex Dim Nah Dim"
Expected output:
Alex
Dim
Nah
Dim
echo-app-sbt/
βββ build.sbt # Defines common settings and declares modules
βββ project/
β βββ build.properties # sbt version
βββ lib/ # Reusable library module
β βββ src/
β βββ main/
β βββ scala/
β βββ cl/ravenhill/echo/echoMessage.scala
βββ app/ # Application module
β βββ src/
β βββ main/
β βββ scala/
β βββ cl/ravenhill/echo/app.scala
βββ README.md
- Scala 3.x
- sbt 1.10+
- Java 17 or later (tested with Java 23)
This repository is part of the official examples used in the DiseΓ±o e ImplementaciΓ³n de Bibliotecas de Software (DIBS) course.
To explore more lessons and materials, visit dibs.pages.dev.