1
- // to release, bump major/minor/micro as appropriate,
2
- // update NEWS, update version in README.md, tag, then
3
- // publishSigned.
4
- // Release tags should follow: http://semver.org/
5
- import scalariform .formatter .preferences ._
6
-
7
1
ThisBuild / git.baseVersion := " 1.4.0"
8
2
ThisBuild / organization := " com.typesafe"
9
3
ThisBuild / Compile / scalacOptions := List (" -unchecked" , " -deprecation" , " -feature" )
@@ -40,49 +34,39 @@ lazy val root = (project in file("."))
40
34
simpleLibJava, simpleAppJava, complexAppJava
41
35
)
42
36
.settings(commonSettings)
43
- .settings(nocomma {
44
- name := " config-root"
45
- git.baseVersion := (ThisBuild / git.baseVersion).value
46
- doc / aggregate := false
47
- doc := (configLib / Compile / doc).value
48
- packageDoc / aggregate := false
37
+ .settings(
38
+ name := " config-root" ,
39
+ git.baseVersion := (ThisBuild / git.baseVersion).value,
40
+ doc / aggregate := false ,
41
+ doc := (configLib / Compile / doc).value,
42
+ packageDoc / aggregate := false ,
49
43
packageDoc := (configLib / Compile / packageDoc).value
50
- checkstyle / aggregate := false
51
- checkstyle := (configLib / Compile / checkstyle).value
52
- useGpg := true
53
- PgpKeys .publishSigned / aggregate := false
54
- PgpKeys .publishSigned := (PgpKeys .publishSigned in configLib).value
55
- PgpKeys .publishLocalSigned / aggregate := false
56
- PgpKeys .publishLocalSigned := (PgpKeys .publishLocalSigned in configLib).value
57
- })
44
+ )
58
45
59
46
lazy val configLib = Project (" config" , file(" config" ))
60
47
.enablePlugins(SbtOsgi )
61
48
.dependsOn(testLib % " test->test" )
62
49
.settings(osgiSettings)
63
- .settings(nocomma {
64
- autoScalaLibrary := false
65
- crossPaths := false
66
- libraryDependencies += " net.liftweb" %% " lift-json" % " 3.3.0" % Test
67
- libraryDependencies += " com.novocode" % " junit-interface" % " 0.11" % Test
50
+ .settings(
51
+ autoScalaLibrary := false ,
52
+ crossPaths := false ,
53
+ libraryDependencies += " net.liftweb" %% " lift-json" % " 3.3.0" % Test ,
54
+ libraryDependencies += " com.novocode" % " junit-interface" % " 0.11" % Test ,
68
55
69
56
Compile / compile / javacOptions ++= Seq (" -source" , " 1.8" , " -target" , " 1.8" ,
70
- " -g" , " -Xlint:unchecked" )
57
+ " -g" , " -Xlint:unchecked" ),
71
58
72
59
Compile / doc / javacOptions ++= Seq (" -group" , s " Public API (version ${version.value}) " , " com.typesafe.config:com.typesafe.config.parser" ,
73
- " -group" , " Internal Implementation - Not ABI Stable" , " com.typesafe.config.impl" )
74
- javadocSourceBaseUrl := {
75
- for (gitHead <- com.typesafe.sbt.SbtGit .GitKeys .gitHeadCommit.value)
76
- yield s " https://github.com/lightbend/config/blob/ $gitHead/config/src/main/java "
77
- }
60
+ " -group" , " Internal Implementation - Not ABI Stable" , " com.typesafe.config.impl" ),
61
+ javadocSourceBaseUrl := Some (" https://github.com/lightbend/config/tree/main/config/src/main/java" ),
78
62
// because we test some global state such as singleton caches,
79
63
// we have to run tests in serial.
80
- Test / parallelExecution := false
64
+ Test / parallelExecution := false ,
81
65
82
- test / fork := true
83
- Test / fork := true
84
- run / fork := true
85
- Test / run / fork := true
66
+ test / fork := true ,
67
+ Test / fork := true ,
68
+ run / fork := true ,
69
+ Test / run / fork := true ,
86
70
87
71
// env vars for tests
88
72
Test / envVars ++= Map (" testList.0" -> " 0" ,
@@ -99,63 +83,17 @@ lazy val configLib = Project("config", file("config"))
99
83
" SECRET_A" -> " A" , // ConfigTest.renderShowEnvVariableValues
100
84
" SECRET_B" -> " B" , // ConfigTest.renderShowEnvVariableValues
101
85
" SECRET_C" -> " C" // ConfigTest.renderShowEnvVariableValues
102
- )
86
+ ),
103
87
104
- OsgiKeys .exportPackage := Seq (" com.typesafe.config" , " com.typesafe.config.impl" )
105
- publish := sys.error(" use publishSigned instead of plain publish" )
106
- publishLocal := sys.error(" use publishLocalSigned instead of plain publishLocal" )
88
+ OsgiKeys .exportPackage := Seq (" com.typesafe.config" , " com.typesafe.config.impl" ),
89
+ publish := sys.error(" use publishSigned instead of plain publish" ),
90
+ publishLocal := sys.error(" use publishLocalSigned instead of plain publishLocal" ),
107
91
Compile / packageBin / packageOptions +=
108
92
Package .ManifestAttributes (" Automatic-Module-Name" -> " typesafe.config" )
109
- scalariformPreferences := scalariformPreferences.value
110
- .setPreference(IndentSpaces , 4 )
111
- .setPreference(FirstArgumentOnNewline , Preserve )
112
-
113
- checkstyleConfigLocation := CheckstyleConfigLocation .File ((baseDirectory.value / " checkstyle-config.xml" ).toString)
114
-
115
- Compile / checkstyle := {
116
- val log = streams.value.log
117
- (Compile / checkstyle).value
118
- val resultFile = (Compile / checkstyleOutputFile).value
119
- val results = scala.xml.XML .loadFile(resultFile)
120
- val errorFiles = results \\ " checkstyle" \\ " file"
121
-
122
- def errorFromXml (node : scala.xml.NodeSeq ): (String , String , String ) = {
123
- val line : String = (node \ " @line" text)
124
- val msg : String = (node \ " @message" text)
125
- val source : String = (node \ " @source" text)
126
- (line, msg, source)
127
- }
128
- def errorsFromXml (fileNode : scala.xml.NodeSeq ): Seq [(String , String , String , String )] = {
129
- val name : String = (fileNode \ " @name" text)
130
- val errors = (fileNode \\ " error" ) map { e => errorFromXml(e) }
131
- errors map { case (line, error, source) => (name, line, error, source) }
132
- }
133
-
134
- val errors = errorFiles flatMap { f => errorsFromXml(f) }
135
-
136
- if (errors.nonEmpty) {
137
- for (e <- errors) {
138
- log.error(s " ${e._1}: ${e._2}: ${e._3} (from ${e._4}) " )
139
- }
140
- throw new RuntimeException (s " Checkstyle failed with ${errors.size} errors " )
141
- }
142
- log.info(" No errors from checkstyle" )
143
- }
144
-
145
- // add checkstyle as a dependency of doc
146
- Compile / doc := ((Compile / doc).dependsOn(Compile / checkstyle)).value
147
-
148
- findbugsReportType := Some (FindbugsReport .Html )
149
- findbugsReportPath := Some (crossTarget.value / " findbugs.html" )
150
- findbugsEffort := FindbugsEffort .Maximum
151
- findbugsMaxMemory := 2000
152
- })
93
+ )
153
94
154
95
lazy val commonSettings : Seq [Setting [_]] = Def .settings(
155
96
unpublished,
156
- scalariformPreferences := scalariformPreferences.value
157
- .setPreference(IndentSpaces , 4 )
158
- .setPreference(FirstArgumentOnNewline , Preserve ),
159
97
Compile / compile / javacOptions ++= Seq (" -source" , " 1.8" , " -target" , " 1.8" ),
160
98
)
161
99
0 commit comments