Created
April 29, 2024 20:01
-
-
Save dylemma/088c202fb83a08c994004915fd2e8ed2 to your computer and use it in GitHub Desktop.
SBT build with optional dependency between subprojects, for IntelliJ bug report
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.liba | |
class UtilityA { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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