Skip to content

Commit cff826a

Browse files
authored
Merge pull request #16 from 2m/wip-keep-api-url-2m
Keep mappings from apiURL
2 parents 3334070 + 8225e4b commit cff826a

File tree

6 files changed

+19
-2
lines changed

6 files changed

+19
-2
lines changed

src/main/scala/com/thoughtworks/sbtApiMappings/ApiMappings.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ object ApiMappings extends AutoPlugin {
4848
}
4949
val rules = apiMappingRules.value
5050
dependencyClasspath.value.collect {
51-
case jar @ getModuleID.extract(rules.extract(url)) =>
51+
case jar @ getModuleID.extract(rules.extract(url)) if !apiMappings.value.exists(_._1 == jar.data) =>
5252
jar.data -> url
5353
}(collection.breakOut(Map.canBuildFrom))
5454
}

src/sbt-test/sbt-api-mappings/all-libraries-2.12/project/build.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
scalaVersion := "2.12.4"
2+
libraryDependencies += "com.typesafe.akka" %% "akka-actor" % "2.5.11"
3+
4+
val check = TaskKey[Unit]("check")
5+
check := {
6+
val result = (Compile / doc / apiMappings).value.collectFirst {
7+
case (file, url) if (file.getAbsolutePath.contains("akka-actor")) => url.getHost
8+
}
9+
10+
result match {
11+
case Some(host) if host.contains("akka.io") => // ok
12+
case Some(host) => sys.error(s"API URL in akka-actor has been changed. Found: [$host]")
13+
case None => sys.error("No API URL found for akka-actor")
14+
}
15+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
libraryDependencies += Defaults.sbtPluginExtra("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % (version in ThisBuild).value, (sbtBinaryVersion in update).value, (scalaBinaryVersion in update).value)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../../version.sbt
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
> check

0 commit comments

Comments
 (0)