Skip to content

Instantly share code, notes, and snippets.

@dylemma
Created April 29, 2024 20:01
Show Gist options
  • Save dylemma/088c202fb83a08c994004915fd2e8ed2 to your computer and use it in GitHub Desktop.
Save dylemma/088c202fb83a08c994004915fd2e8ed2 to your computer and use it in GitHub Desktop.
SBT build with optional dependency between subprojects, for IntelliJ bug report
ThisBuild / scalaVersion := "2.13.12"
ThisBuild / version := "1.0"
ThisBuild / organization := "com.example"
lazy val root = (project in file("."))
.aggregate(libA, libB)
lazy val libA = (project in file("libA"))
.settings(name := "libA")
lazy val libB = (project in file("libB"))
.dependsOn(libA % Optional)
.settings(name := "libB")
package com.example.liba
class UtilityA {
}
package com.example.libb
import com.example.liba.UtilityA
object UtilityB {
def normalMethod = println("normal")
def helperMethod(utilA: UtilityA) = println(s"utility: $utilA")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment