@@ -35,22 +35,23 @@ Global / onLoad := (Global / onLoad).value.andThen { s =>
3535}
3636
3737val javacSettings = Seq (
38- " -source" , " 1.8" ,
39- " -target" , " 1.8" ,
38+ " -source" ,
39+ " 1.8" ,
40+ " -target" ,
41+ " 1.8" ,
4042 " -Xlint:deprecation" ,
4143 " -Xlint:unchecked"
4244)
4345
4446def scalacOpts : Seq [String ] = Seq (
4547 " -target:jvm-1.8" ,
4648 " -deprecation" ,
47- " -encoding" , " UTF-8" ,
49+ " -encoding" ,
50+ " UTF-8" ,
4851 " -feature" ,
4952 " -unchecked" ,
50-
5153 " -Ywarn-unused:imports" ,
5254 " -Xlint:nullary-unit" ,
53-
5455 " -Xlint" ,
5556 " -Ywarn-dead-code" ,
5657)
@@ -62,7 +63,6 @@ ThisBuild / mimaFailOnNoPrevious := false
6263
6364lazy val mimaSettings = mimaDefaultSettings ++ Seq (
6465 mimaPreviousArtifacts := previousVersion.map(organization.value %% name.value % _).toSet,
65-
6666 // these exclusions are only for master branch and are targeting 2.2.x
6767 mimaBinaryIssueFilters ++= Seq (
6868 ProblemFilters .exclude[MissingTypesProblem ](" play.api.libs.ws.ahc.AhcWSClientConfig$" ),
@@ -88,12 +88,10 @@ lazy val commonSettings = Def.settings(
8888 scalacOptions ++= scalacOpts,
8989 scalacOptions in (Compile , doc) ++= Seq (
9090 " -Xfatal-warnings" ,
91-
9291 // Work around 2.12 bug which prevents javadoc in nested java classes from compiling.
9392 " -no-java-comments" ,
9493 ),
95- pomExtra := (
96- <url >https:// github.com/ playframework/ play- ws</url >
94+ pomExtra := (<url >https:// github.com/ playframework/ play- ws</url >
9795 <licenses >
9896 <license >
9997 <name >Apache License , Version 2.0 </name >
@@ -115,9 +113,11 @@ lazy val commonSettings = Def.settings(
115113 javacOptions in Compile ++= javacSettings,
116114 javacOptions in Test ++= javacSettings,
117115 headerLicense := {
118- Some (HeaderLicense .Custom (
119- s " Copyright (C) Lightbend Inc. <https://www.lightbend.com> "
120- ))
116+ Some (
117+ HeaderLicense .Custom (
118+ s " Copyright (C) Lightbend Inc. <https://www.lightbend.com> "
119+ )
120+ )
121121 }
122122)
123123
@@ -134,7 +134,6 @@ val disablePublishing = Seq[Setting[_]](
134134lazy val shadedCommonSettings = Seq (
135135 scalaVersion := scala213,
136136 crossScalaVersions := Seq (scala213),
137-
138137 // No need to cross publish the shaded libraries
139138 crossPaths := false ,
140139)
@@ -166,7 +165,7 @@ lazy val shadeAssemblySettings = commonSettings ++ shadedCommonSettings ++ Seq(
166165val ahcMerge : MergeStrategy = new MergeStrategy {
167166 def apply (tempDir : File , path : String , files : Seq [File ]): Either [String , Seq [(File , String )]] = {
168167 import scala .collection .JavaConverters ._
169- val file = MergeStrategy .createMergeTarget(tempDir, path)
168+ val file = MergeStrategy .createMergeTarget(tempDir, path)
170169 val lines = java.nio.file.Files .readAllLines(files.head.toPath).asScala
171170 lines.foreach { line =>
172171 // In AsyncHttpClientConfigDefaults.java, the shading renames the resource keys
@@ -183,21 +182,26 @@ val ahcMerge: MergeStrategy = new MergeStrategy {
183182 override val name : String = " ahcMerge"
184183}
185184
186- import scala .xml .transform .{RewriteRule , RuleTransformer }
187- import scala .xml .{Elem , NodeSeq , Node => XNode }
188-
189- def dependenciesFilter (n : XNode ) = new RuleTransformer (new RewriteRule {
190- override def transform (n : XNode ): NodeSeq = n match {
191- case e : Elem if e.label == " dependencies" => NodeSeq .Empty
192- case other => other
193- }
194- }).transform(n).head
185+ import scala .xml .transform .RewriteRule
186+ import scala .xml .transform .RuleTransformer
187+ import scala .xml .Elem
188+ import scala .xml .NodeSeq
189+ import scala .xml .{ Node => XNode }
190+
191+ def dependenciesFilter (n : XNode ) =
192+ new RuleTransformer (new RewriteRule {
193+ override def transform (n : XNode ): NodeSeq = n match {
194+ case e : Elem if e.label == " dependencies" => NodeSeq .Empty
195+ case other => other
196+ }
197+ }).transform(n).head
195198
196199// ---------------------------------------------------------------
197200// Shaded AsyncHttpClient implementation
198201// ---------------------------------------------------------------
199202
200- lazy val `shaded-asynchttpclient` = project.in(file(" shaded/asynchttpclient" ))
203+ lazy val `shaded-asynchttpclient` = project
204+ .in(file(" shaded/asynchttpclient" ))
201205 .settings(commonSettings)
202206 .settings(shadeAssemblySettings)
203207 .settings(
@@ -219,22 +223,20 @@ lazy val `shaded-asynchttpclient` = project.in(file("shaded/asynchttpclient"))
219223 // logLevel in assembly := Level.Debug,
220224 assemblyShadeRules in assembly := Seq (
221225 ShadeRule .rename(" org.asynchttpclient.**" -> " play.shaded.ahc.@0" ).inAll,
222- ShadeRule .rename(" io.netty.**" -> " play.shaded.ahc.@0" ).inAll,
223- ShadeRule .rename(" javassist.**" -> " play.shaded.ahc.@0" ).inAll,
224- ShadeRule .rename(" com.typesafe.netty.**" -> " play.shaded.ahc.@0" ).inAll,
225- ShadeRule .rename(" javax.activation.**" -> " play.shaded.ahc.@0" ).inAll,
226- ShadeRule .rename(" com.sun.activation.**" -> " play.shaded.ahc.@0" ).inAll,
226+ ShadeRule .rename(" io.netty.**" -> " play.shaded.ahc.@0" ).inAll,
227+ ShadeRule .rename(" javassist.**" -> " play.shaded.ahc.@0" ).inAll,
228+ ShadeRule .rename(" com.typesafe.netty.**" -> " play.shaded.ahc.@0" ).inAll,
229+ ShadeRule .rename(" javax.activation.**" -> " play.shaded.ahc.@0" ).inAll,
230+ ShadeRule .rename(" com.sun.activation.**" -> " play.shaded.ahc.@0" ).inAll,
227231 ShadeRule .zap(" org.reactivestreams.**" ).inAll,
228232 ShadeRule .zap(" org.slf4j.**" ).inAll
229233 ),
230-
231234 // https://stackoverflow.com/questions/24807875/how-to-remove-projectdependencies-from-pom
232235 // Remove dependencies from the POM because we have a FAT jar here.
233236 makePomConfiguration := makePomConfiguration.value.withProcess(process = dependenciesFilter),
234237 // ivyXML := <dependencies></dependencies>,
235238 // ivyLoggingLevel := UpdateLogging.Full,
236239 // logLevel := Level.Debug,
237-
238240 assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeBin = false , includeScala = false ),
239241 packageBin in Compile := assembly.value
240242 )
@@ -243,22 +245,21 @@ lazy val `shaded-asynchttpclient` = project.in(file("shaded/asynchttpclient"))
243245// Shaded oauth
244246// ---------------------------------------------------------------
245247
246- lazy val `shaded-oauth` = project.in(file(" shaded/oauth" ))
248+ lazy val `shaded-oauth` = project
249+ .in(file(" shaded/oauth" ))
247250 .settings(commonSettings)
248251 .settings(shadeAssemblySettings)
249252 .settings(
250253 libraryDependencies ++= oauth,
251254 name := " shaded-oauth" ,
252255 // logLevel in assembly := Level.Debug,
253256 assemblyShadeRules in assembly := Seq (
254- ShadeRule .rename(" oauth.**" -> " play.shaded.oauth.@0" ).inAll,
257+ ShadeRule .rename(" oauth.**" -> " play.shaded.oauth.@0" ).inAll,
255258 ShadeRule .rename(" org.apache.commons.**" -> " play.shaded.oauth.@0" ).inAll
256259 ),
257-
258260 // https://stackoverflow.com/questions/24807875/how-to-remove-projectdependencies-from-pom
259261 // Remove dependencies from the POM because we have a FAT jar here.
260262 makePomConfiguration := makePomConfiguration.value.withProcess(process = dependenciesFilter),
261-
262263 assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeBin = false , includeScala = false ),
263264 packageBin in Compile := assembly.value
264265 )
@@ -276,11 +277,12 @@ val shadedOAuthSettings = Seq(
276277// Shaded aggregate project
277278// ---------------------------------------------------------------
278279
279- lazy val shaded = Project (id = " shaded" , base = file(" shaded" ) )
280+ lazy val shaded = Project (id = " shaded" , base = file(" shaded" ))
280281 .aggregate(
281282 `shaded-asynchttpclient`,
282283 `shaded-oauth`
283- ).disablePlugins(sbtassembly.AssemblyPlugin , HeaderPlugin )
284+ )
285+ .disablePlugins(sbtassembly.AssemblyPlugin , HeaderPlugin )
284286 .settings(
285287 disableDocs,
286288 disablePublishing,
@@ -320,31 +322,36 @@ def addShadedDeps(deps: Seq[xml.Node], node: xml.Node): xml.Node = {
320322// Standalone implementation using AsyncHttpClient
321323lazy val `play-ahc-ws-standalone` = project
322324 .in(file(" play-ahc-ws-standalone" ))
323- .settings(commonSettings ++ shadedAhcSettings ++ shadedOAuthSettings ++ Seq (
324- fork in Test := true ,
325- testOptions in Test := Seq (
326- Tests .Argument (TestFrameworks .JUnit , " -a" , " -v" )),
327- libraryDependencies ++= standaloneAhcWSDependencies,
328- // This will not work if you do a publishLocal, because that uses ivy...
329- pomPostProcess := {
330- (node : xml.Node ) => addShadedDeps(List (
331- <dependency >
325+ .settings(
326+ commonSettings ++ shadedAhcSettings ++ shadedOAuthSettings ++ Seq (
327+ fork in Test := true ,
328+ testOptions in Test := Seq (Tests .Argument (TestFrameworks .JUnit , " -a" , " -v" )),
329+ libraryDependencies ++= standaloneAhcWSDependencies,
330+ // This will not work if you do a publishLocal, because that uses ivy...
331+ pomPostProcess := { (node : xml.Node ) =>
332+ addShadedDeps(
333+ List (
334+ <dependency >
332335 <groupId >com.typesafe.play</groupId >
333336 <artifactId >shaded- asynchttpclient</artifactId >
334337 <version >{version.value}</version >
335338 </dependency >,
336- <dependency >
339+ <dependency >
337340 <groupId >com.typesafe.play</groupId >
338341 <artifactId >shaded- oauth</artifactId >
339342 <version >{version.value}</version >
340343 </dependency >
341- ), node)
342- }
343- ))
344+ ),
345+ node
346+ )
347+ }
348+ )
349+ )
344350 .settings(mimaSettings)
345351 .dependsOn(
346352 `play-ws-standalone`
347- ).disablePlugins(sbtassembly.AssemblyPlugin )
353+ )
354+ .disablePlugins(sbtassembly.AssemblyPlugin )
348355
349356// ---------------------------------------------------------------
350357// JSON Readables and Writables
@@ -361,7 +368,8 @@ lazy val `play-ws-standalone-json` = project
361368 )
362369 .dependsOn(
363370 `play-ws-standalone`
364- ).disablePlugins(sbtassembly.AssemblyPlugin )
371+ )
372+ .disablePlugins(sbtassembly.AssemblyPlugin )
365373
366374// ---------------------------------------------------------------
367375// XML Readables and Writables
@@ -378,13 +386,15 @@ lazy val `play-ws-standalone-xml` = project
378386 )
379387 .dependsOn(
380388 `play-ws-standalone`
381- ).disablePlugins(sbtassembly.AssemblyPlugin )
389+ )
390+ .disablePlugins(sbtassembly.AssemblyPlugin )
382391
383392// ---------------------------------------------------------------
384393// Integration Tests
385394// ---------------------------------------------------------------
386395
387- lazy val `integration-tests` = project.in(file(" integration-tests" ))
396+ lazy val `integration-tests` = project
397+ .in(file(" integration-tests" ))
388398 .settings(commonSettings)
389399 .settings(disableDocs)
390400 .settings(disablePublishing)
@@ -476,8 +486,12 @@ checkCodeFormat := {
476486 |ERROR: Scalariform check failed, see differences above.
477487 |To fix, format your sources using sbt scalariformFormat test:scalariformFormat before submitting a pull request.
478488 |Additionally, please squash your commits (eg, use git commit --amend) if you're going to update this pull request.
479- """ .stripMargin)
489+ """ .stripMargin
490+ )
480491 }
481492}
482493
483- addCommandAlias(" validateCode" , " ;scalariformFormat;test:scalariformFormat;headerCheck;test:headerCheck;checkCodeFormat" )
494+ addCommandAlias(
495+ " validateCode" ,
496+ " ;scalariformFormat;test:scalariformFormat;headerCheck;test:headerCheck;checkCodeFormat"
497+ )
0 commit comments