1
1
val intsTask = taskKey[Seq [Int ]](" A seq of ints task" )
2
2
val intsSetting = settingKey[Seq [Int ]](" A seq of ints setting" )
3
3
val intsFromScalaV = settingKey[Seq [Int ]](" a seq of ints from scalaVersion" )
4
+ val intsSetSetting = settingKey[Set [Int ]](" A set of ints setting" )
5
+ val stringIntMapSetting = settingKey[Map [String , Int ]](" A map of string to int setting" )
4
6
5
7
scalaVersion := " 2.11.6"
6
8
@@ -22,9 +24,19 @@ intsFromScalaV --= { if (scalaVersion.value == "2.11.6") Seq(1, 2) else Seq(4) }
22
24
intsFromScalaV -= { if (scalaVersion.value == " 2.11.6" ) Option (6 ) else None }
23
25
intsFromScalaV --= { if (scalaVersion.value == " 2.11.6" ) Option (7 ) else None }
24
26
27
+ intsSetSetting := Set (1 , 2 , 3 , 4 , 5 , 6 , 7 )
28
+ intsSetSetting -= 3
29
+ intsSetSetting --= Set (1 , 2 )
30
+
31
+ stringIntMapSetting := Map (" a" -> 1 , " b" -> 2 , " c" -> 3 , " d" -> 4 , " e" -> 5 )
32
+ stringIntMapSetting -= " c"
33
+ stringIntMapSetting --= Seq (" a" , " b" )
34
+
25
35
val check = taskKey[Unit ](" Runs the check" )
26
36
check := {
27
37
assert(intsTask.value == Seq (4 , 5 ), s " intsTask should be Seq(4, 5) but is ${intsTask.value}" )
28
38
assert(intsSetting.value == Seq (4 , 5 ), s " intsSetting should be Seq(4, 5) but is ${intsSetting.value}" )
29
39
assert(intsFromScalaV.value == Seq (4 , 5 ), s " intsFromScalaV should be Seq(4, 5) but is ${intsFromScalaV.value}" )
40
+ assert(intsSetSetting.value == Set (4 , 5 , 6 , 7 ), s " intsSetSetting should be Set(4, 5, 6, 7) but is ${intsSetSetting.value}" )
41
+ assert(stringIntMapSetting.value == Map (" d" -> 4 , " e" -> 5 ), s " stringIntMapSetting should be Map(d -> 4, e -> 5) but is ${stringIntMapSetting.value}" )
30
42
}
0 commit comments