How do they affect the scope of keys in an assembly? What is the axis of a sphere?

I am trying to understand what the axis of the SBT sphere is and how they affect the sliding keys on the assembly map.

There are three axes axes: project, configurationand task.

  • Is the following set of root key for assembly card?

    (project axis value, configuration axis value, task axis value, insecure key value)

  • Or is it a scope (conceptually) of a couple that has one of the following three forms?

    (project axis value, insecure key value)

    (configuration axis value, unsigned key value)

    (task axis value, unsigned key value)

  • Or is the copied key something else, if so, how does it look (conceptually)?

So, the question may be, what is (conceptually) key code?

  • Are these four tuples?
  • Is this a couple?
  • Is this something else, if so, how does it look (conceptually)?
+4
source share
1 answer

From user settings and tasks :

Keys are one of three types: SettingKey, TaskKey, and InputKey.

An example of a key might be:

val scalaVersion = settingKey[String]("The version of Scala used for building.")

It is available by default in sbt and asks for the value you are executing show:

> show scalaVersion
[info] 2.10.4

Run inspectto find out about the details of the key (this is not entirely about the key, but about tuning, as you will soon know):

> inspect scalaVersion
[info] Setting: java.lang.String = 2.10.4
[info] Description:
[info]  The version of Scala used for building.
[info] Provided by:
[info]  */*:scalaVersion
[info] Defined at:
[info]  (sbt.Defaults) Defaults.scala:236
[info] Reverse dependencies:
[info]  *:libraryDependencies
[info]  *:scalaInstance
[info]  *:evicted
[info]  *:dependencyUpdatesData
[info]  *:update
[info]  *:allDependencies
[info] Delegates:
[info]  *:scalaVersion
[info]  {.}/*:scalaVersion
[info]  */*:scalaVersion
[info] Related:
[info]  */*:scalaVersion

You can define your own key using a macro SettingKey:

lazy val abc: sbt.SettingKey[String] = settingKey[String]("My own setting key")

According to scaladoc sbt.SettingKey :

. : , , . ​​ Scope. AttributeKey [T]. .

scaladoc, SettingKey def scope: Scope, . .

, ( ). Initialize[T] T SettingKey[T] :=, += ++= ( ) <++=, <+= <<= ( Scala , scaladoc sbt.SettingKey).

abc := "my value"

( ):

abc.:=("my value")

:=:

final def :=(v: T): Def.Setting[T]

Setting[T].

, (SettingKey[T], Initialize[T]) (SettingKey[T], T) Setting[T].

Setting[T], T - , , . , .

, , .

, . final def in(scope: Scope): SettingKey[T].

inspect, .

> inspect abc
[info] Setting: java.lang.String = my value
[info] Description:
[info]  My new setting key
[info] Provided by:
[info]  {file:/Users/jacek/sandbox/sbt-theory/}sbt-theory/*:abc
[info] Defined at:
[info]  /Users/jacek/sandbox/sbt-theory/build.sbt:3
[info] Delegates:
[info]  *:abc
[info]  {.}/*:abc
[info]  */*:abc

, ( Delegates) *:abc, {.}/*:abc */*:abc. , A/B:K, A - , B - K ( sbt attibutes, ::).

, *:abc. inspect it.

> inspect *:abc
[info] Setting: java.lang.String = my value
[info] Description:
[info]  My new setting key
[info] Provided by:
[info]  {file:/Users/jacek/sandbox/sbt-theory/}sbt-theory/*:abc
[info] Defined at:
[info]  /Users/jacek/sandbox/sbt-theory/build.sbt:3
[info] Delegates:
[info]  *:abc
[info]  {.}/*:abc
[info]  */*:abc

, {.}/*:abc , {.} *. inspect it.

> inspect {.}/*:abc
[info] No entry for key.
[info] Description:
[info]  My new setting key
[info] Delegates:
[info]  {.}/*:abc
[info]  */*:abc
[info] Related:
[info]  *:abc

abc ThisBuild (aka ThisBuild). build.sbt, :

abc in ThisBuild := "abc in ThisBuild"

inspect ( reload, ):

> inspect {.}/*:abc
[info] Setting: java.lang.String = abc in ThisBuild
[info] Description:
[info]  My new setting key
[info] Provided by:
[info]  {file:/Users/jacek/sandbox/sbt-theory/}/*:abc
[info] Defined at:
[info]  /Users/jacek/sandbox/sbt-theory/build.sbt:5
[info] Delegates:
[info]  {.}/*:abc
[info]  */*:abc
[info] Related:
[info]  *:abc

build.sbt :

lazy val abc: sbt.SettingKey[String] = settingKey[String]("My new setting key")

abc := "my value"

abc in ThisBuild := "abc in ThisBuild"

, abc, - ThisBuild Global. ? !

+5

All Articles