2023-02-12 14:14:49 +01:00
|
|
|
/*
|
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
|
* license agreements; and to You under the Apache License, version 2.0:
|
|
|
|
|
*
|
|
|
|
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
*
|
2023-02-17 10:49:40 +01:00
|
|
|
* This file is part of the Apache Pekko project, derived from Akka.
|
2023-02-12 14:14:49 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import sbt.Keys._
|
|
|
|
|
import sbt._
|
2023-05-20 11:11:40 +02:00
|
|
|
import org.mdedetrich.apache.sonatype.ApacheSonatypePlugin
|
|
|
|
|
import org.mdedetrich.apache.sonatype.ApacheSonatypePlugin.autoImport._
|
2023-02-12 14:14:49 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Copies LICENSE and NOTICE files into jar META-INF dir
|
|
|
|
|
*/
|
|
|
|
|
object AddMetaInfLicenseFiles extends AutoPlugin {
|
|
|
|
|
|
|
|
|
|
private lazy val baseDir = LocalRootProject / baseDirectory
|
|
|
|
|
|
|
|
|
|
override lazy val projectSettings = Seq(
|
|
|
|
|
apacheSonatypeLicenseFile := baseDir.value / "legal" / "StandardLicense.txt",
|
2023-03-15 13:42:37 +01:00
|
|
|
apacheSonatypeNoticeFile := baseDir.value / "legal" / "PekkoNotice.txt",
|
2023-02-12 14:14:49 +01:00
|
|
|
apacheSonatypeDisclaimerFile := Some(baseDir.value / "DISCLAIMER"))
|
|
|
|
|
|
|
|
|
|
/**
|
2023-02-22 16:10:24 +01:00
|
|
|
* Settings specific for Pekko actor subproject which requires a different license file.
|
|
|
|
|
*/
|
|
|
|
|
lazy val actorSettings = Seq(
|
2023-03-06 15:04:59 +01:00
|
|
|
apacheSonatypeLicenseFile := baseDir.value / "legal" / "pekko-actor-jar-license.txt",
|
|
|
|
|
apacheSonatypeNoticeFile := baseDir.value / "legal" / "pekko-actor-jar-notice.txt")
|
|
|
|
|
|
2023-03-25 13:03:29 +01:00
|
|
|
/**
|
|
|
|
|
* Settings specific for Pekko actor subproject which requires a different license file.
|
|
|
|
|
*/
|
|
|
|
|
lazy val clusterSettings = Seq(
|
|
|
|
|
apacheSonatypeLicenseFile := baseDir.value / "legal" / "pekko-cluster-jar-license.txt")
|
|
|
|
|
|
2023-06-21 09:30:25 +01:00
|
|
|
/**
|
|
|
|
|
* Settings specific for Pekko distributed-data subproject which requires a different license file.
|
|
|
|
|
*/
|
|
|
|
|
lazy val distributedDataSettings = Seq(
|
|
|
|
|
apacheSonatypeLicenseFile := baseDir.value / "legal" / "pekko-distributed-data-jar-license.txt")
|
|
|
|
|
|
2023-03-06 15:04:59 +01:00
|
|
|
/**
|
|
|
|
|
* Settings specific for Pekko remote subproject which requires a different license file.
|
|
|
|
|
*/
|
|
|
|
|
lazy val remoteSettings = Seq(
|
|
|
|
|
apacheSonatypeLicenseFile := baseDir.value / "legal" / "pekko-remote-jar-license.txt",
|
|
|
|
|
apacheSonatypeNoticeFile := baseDir.value / "legal" / "pekko-remote-jar-notice.txt")
|
2023-02-22 16:10:24 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Settings specific for Pekko protobuf subproject which requires a different license file
|
2023-02-12 14:14:49 +01:00
|
|
|
* as well as an additional "COPYING.protobuf" file.
|
|
|
|
|
*/
|
|
|
|
|
lazy val protobufSettings = Seq(
|
2023-02-22 16:10:24 +01:00
|
|
|
apacheSonatypeLicenseFile := baseDir.value / "legal" / "pekko-protobuf-jar-license.txt") ++ inConfig(Compile)(Seq(
|
2023-02-12 14:14:49 +01:00
|
|
|
resourceGenerators += {
|
|
|
|
|
Def.task {
|
|
|
|
|
List(
|
2023-05-20 11:11:40 +02:00
|
|
|
ApacheSonatypePlugin.addFileToMetaInf(resourceManaged.value, baseDir.value / "COPYING.protobuf"))
|
2023-02-12 14:14:49 +01:00
|
|
|
}
|
|
|
|
|
}))
|
|
|
|
|
|
2023-02-22 16:10:24 +01:00
|
|
|
/**
|
|
|
|
|
* Settings specific for Pekko protobuf-v3 subproject which requires a different license file
|
|
|
|
|
* as well as an additional "COPYING.protobuf" file.
|
|
|
|
|
*/
|
|
|
|
|
lazy val protobufV3Settings = Seq(
|
|
|
|
|
apacheSonatypeLicenseFile := baseDir.value / "legal" / "pekko-protobuf-v3-jar-license.txt") ++ inConfig(Compile)(
|
|
|
|
|
Seq(
|
|
|
|
|
resourceGenerators += {
|
|
|
|
|
Def.task {
|
|
|
|
|
List(
|
2023-05-20 11:11:40 +02:00
|
|
|
ApacheSonatypePlugin.addFileToMetaInf(resourceManaged.value, baseDir.value / "COPYING.protobuf"))
|
2023-02-22 16:10:24 +01:00
|
|
|
}
|
|
|
|
|
}))
|
|
|
|
|
|
2023-02-12 14:14:49 +01:00
|
|
|
override def trigger = allRequirements
|
|
|
|
|
|
2023-05-20 11:11:40 +02:00
|
|
|
override def requires = ApacheSonatypePlugin
|
2023-02-12 14:14:49 +01:00
|
|
|
}
|