Skip to content

Commit

Permalink
add LICENSE.txt to all packaged jars.
Browse files Browse the repository at this point in the history
update license year

(cherry picked from commit b23c54a)
  • Loading branch information
hrhino authored and xuwei-k committed May 19, 2018
1 parent edc1272 commit 11cbe13
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion LICENSE.txt
@@ -1,4 +1,4 @@
Copyright (c) 2009-2014 Tony Morris, Runar Bjarnason, Tom Adams, Kristian Domagala, Brad Clow, Ricky Clarkson, Paul Chiusano, Trygve Laugstøl, Nick Partridge, Jason Zaugg, Sam Halliday
Copyright (c) 2009-2018 Tony Morris, Runar Bjarnason, Tom Adams, Kristian Domagala, Brad Clow, Ricky Clarkson, Paul Chiusano, Trygve Laugstøl, Nick Partridge, Jason Zaugg, Sam Halliday
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
13 changes: 12 additions & 1 deletion project/build.scala
Expand Up @@ -275,11 +275,20 @@ object build {
}
</developers>
),

licenseFile := {
val LICENSE_txt = (baseDirectory in ThisBuild).value / "LICENSE.txt"
if (!LICENSE_txt.exists()) sys.error(s"cannot find license file at $LICENSE_txt")
LICENSE_txt
},
// kind-projector plugin
resolvers += Resolver.sonatypeRepo("releases"),
kindProjectorVersion := "0.9.7",
libraryDependencies += compilerPlugin("org.spire-math" % "kind-projector" % kindProjectorVersion.value cross CrossVersion.binary)
) ++ SbtOsgi.projectSettings ++ Seq[Sett](
) ++ Seq(packageBin, packageDoc, packageSrc).flatMap {
// include LICENSE.txt in all packaged artifacts
inTask(_)(Seq(mappings in Compile += licenseFile.value -> "LICENSE"))
} ++ SbtOsgi.projectSettings ++ Seq[Sett](
OsgiKeys.additionalHeaders := Map("-removeheaders" -> "Include-Resource,Private-Package")
)

Expand Down Expand Up @@ -379,6 +388,8 @@ object build {
}
}

lazy val licenseFile = settingKey[File]("The license file to include in packaged artifacts")

lazy val genTypeClasses = taskKey[Seq[(FileStatus, File)]]("")

lazy val typeClasses = taskKey[Seq[TypeClass]]("")
Expand Down

0 comments on commit 11cbe13

Please sign in to comment.