Skip to content
This repository has been archived by the owner on Oct 24, 2022. It is now read-only.

Latest commit

 

History

History
43 lines (30 loc) · 1.39 KB

core-settings.md

File metadata and controls

43 lines (30 loc) · 1.39 KB

allenai-sbt-core-settings

Requires: VersionInjectorPlugin

Note: CoreSettingsPlugin is implicitly applied to all projects via its trigger setting. This means you do not need to explicitly enable this plugin.

The CoreSettingsPlugin provides core settings to projects including:

  • Setting conflictManager := ConflictManager.strict
  • Adds slf4j dependencies and resolves common slf4j conflicts
  • Provides CoreSettings.Dependencies object with many common (and versioned) dependencies
  • Enables VersionInjectorPlugin

See sbt-core-settings-tester/build.sbt and sbt-core-settings-tester/project/plugins.sbt for usage.

Tip: define a project/Dependencies.scala file

The CoreSettingsPlugin provides your build classpath with org.allenai.plugins.CoreDependencies. If your project will have additional depdencies (most likely), you should define your own Dependencies build object that extends the CoreDependencies trait:

// in project/Dependencies.scala
import org.allenai.plugins.CoreDependencies

import sbt._
import sbt.Keys._

object Dependencies extends CoreDependencies {
  val foo = "org.foo" % "foo" % "1.0.0"
  ...
}

Then you can access your dependencies (core and project-specific) within your .sbt files like so:

// in build.sbt
import Dependencies._

libraryDependencies ++= Seq(
  scopt, // from CoreDependencies
  foo // from Dependencies
)