2019-08-30 22:11:52 +02:00
|
|
|
// these two imports are needed for sbt syntax to work
|
2021-02-18 20:57:18 +01:00
|
|
|
import com.typesafe.sbt.SbtNativePackager.Docker
|
|
|
|
import com.typesafe.sbt.SbtNativePackager.autoImport.packageName
|
2020-02-17 19:07:04 +01:00
|
|
|
|
2021-02-18 20:57:18 +01:00
|
|
|
import java.nio.file.Paths
|
2022-08-25 21:12:46 +02:00
|
|
|
import com.typesafe.sbt.packager.Keys.{daemonUser, daemonUserUid, dockerAlias, dockerAliases, dockerCommands, dockerExposedVolumes, dockerRepository, dockerUpdateLatest, maintainer}
|
2022-05-05 16:59:05 +02:00
|
|
|
import com.typesafe.sbt.packager.archetypes.jlink.JlinkPlugin.autoImport.JlinkIgnore
|
2022-08-25 18:52:12 +02:00
|
|
|
import com.typesafe.sbt.packager.docker.{Cmd, DockerChmodType}
|
2022-08-17 23:58:37 +02:00
|
|
|
import com.typesafe.sbt.packager.docker.DockerPlugin.autoImport.{dockerAdditionalPermissions, dockerBaseImage}
|
2019-08-30 22:11:52 +02:00
|
|
|
import sbt._
|
|
|
|
import sbt.Keys._
|
2021-05-03 14:11:59 +02:00
|
|
|
import sbtprotoc.ProtocPlugin.autoImport.PB
|
2021-05-19 13:35:31 +02:00
|
|
|
import sbtassembly.AssemblyKeys._
|
2021-09-07 21:09:23 +02:00
|
|
|
|
|
|
|
import scala.sys.process.Process
|
2019-08-30 22:11:52 +02:00
|
|
|
import scala.util.Properties
|
|
|
|
|
|
|
|
object CommonSettings {
|
2020-08-20 21:33:18 +02:00
|
|
|
|
2022-08-23 01:21:07 +02:00
|
|
|
val previousStableVersion: String = "1.9.3"
|
2021-06-18 16:18:54 +02:00
|
|
|
|
Implement caching of bitcoind in the walletTest,nodeTest, and partially bitcoindRpcTest project (#2792)
* Create CachedBitcoind, implement it in FundTransactionHandlingTest
* Add BaseWalletTest, extend it with BitcoinSWalletTest & BitcoinSWalletTestCachedBitcoind, add CachedBitcoinV19 and use it RescanHandlingTest
* Make ProcessBlockTest work with cached bitcoind
* Make trait for CachedBitcoindNewest for the newest version of bitcoind
* Make UTXOLifeCycleTest use cached bitcoind
* Add WalletBloom, WalletSyncTest to use cached bitcoinds
* Add WalletIntegrationTest
* Rework beforeAll() and afterAll() into the super trait like BaseWalletTest
* Add standlone BitcoindFixtures, use it in BitcoindBackendTest
* Use new BitcoindFixtures in BitcoindBlockPollingTest
* Introduce BaseNodeTest, start implementing the usage of cached bitcoinds in the nodeTest project
* Use cached bitcoind's with SpvNodeTest & SpvNodeWithWalletTest
* Fix bug on postgres with reusing database, upsert the genesis header rather than create it
* Get NeutrinoNode tests workign with cached bitcoinds
* Fix NeutrinoNodeWithWallet by destroying wallet state for Postgres
* Add teardown helper method for bitcoind
* Teardown chain project when using node fixtures since node is dependent upon the chain project.
* Turn off parallelExecution again
* Switch the parallelExecution flag to only be set on CI, so we can get better performance when running locally
* Start implementing BitcoindFixtures, use BitcoindFixturesCachedTriple on TestUtilRpcTest
* Fix compiler errors, begin implementing NodePair
* Refactor TestRpcUtilTest to use 2 bitcoinds rather than 2
* Reduce the number of bitcoinds that MultiWalletRpcTest needs from 3 -> 1
* Reduce number of bitcoinds used in WalletRpcTest from 3 -> 2
* Add some documentation
* Try to re-add parallelExecution
* Reduce the number of bitcoinds used in PsbtRpcTest from 3 -> 2
* Disable parallelExecution in Test again
* Make BitcoindV21RpcClientTest & BitcoindV20RpcClientTest reduce bitcoind usage from 2 -> 1
* Make BitcoindV19RpcClienttest reduce bitcoind usage from 2 -> 1
* Rework MempoolRpcTest to use fixtures, add BitcoindVersion to CachedBitcoindCollection
* Make sure clientAccumm has to be specified as a paramter now rather than filling in by default
* Begin parameterizing NodePair/NodeTriple to retain type information for the specific version of bitcoind that was used
* Don't implement version in super trait
* Fix docs
* Fix async issue in V21 test suite
* Append to vectors in CachedBitcoinCollection rather than replace
* Fix rebase issues
* Add scaladocs
* Fix BitcoindV18RpcClient address info test
* Implement fixtures in BitcoindV17RpcClientTest fixtures
* Cleanup v17 PsbtRpcTest
* Reduce bitcoind usage from 3 -> 1 in BitcoindV18RpcClientTest
* Remove abandon transaction test, this allows us to reduce the number of bitcoind's used in MempoolRpcTest from 3 -> 2
* Remove the requirement to inject BitcoinSAsyncFixtureTest, add it in the test traits explicitly to make things easier. Also add explicit afterAll() method to tear down both the CachedBitcoind & BitcoinSAsyncFixtureTest
* Fix missing Await.result() in BitcoindRpcTest.afterAll()
* Rework MultiWalletRpcTest to use a NodePair
* Rework BlockchainRpcTest to use fixtures
* Rework Client start()/stop() methods. Now use an AtomicBoolean to indicate when a user has requested a client to start/stop rather than sending pings to bitcoind that can fail because the conneciton pool has been shutdown in test cases
* Try my luck with turning on parallelExecution in CI again
* Revert parallelExecution, now testes do not run in parallel on CI
* Only turn off parallelExecution for bitcoindRpcTest
* Adjust build to only have bitcoindRpcTest NOT in run parallel on mac, reduce number of blocks used in BitcoindRpcTestUtil.createNodeSequence
* Run less tests in the rpc test suite as that takes the longest, move them over to node/wallet/dlc test suite on mac osx CI
* Don't run eclair tests in parallel either
* Remove CachedBitcoind from BitcoinSWalletTest
* Fix async bug in test case
* Push to github to force re-run of CI
* Push to github to force re-run of CI
* Push to github to force re-run of CI
2021-03-19 12:37:53 +01:00
|
|
|
private def isCI = {
|
|
|
|
Properties
|
|
|
|
.envOrNone("CI")
|
2019-08-30 22:11:52 +02:00
|
|
|
.isDefined
|
|
|
|
}
|
|
|
|
|
2021-03-02 14:05:21 +01:00
|
|
|
lazy val settings: Seq[Setting[_]] = Vector(
|
2019-08-30 22:11:52 +02:00
|
|
|
organization := "org.bitcoin-s",
|
|
|
|
homepage := Some(url("https://bitcoin-s.org")),
|
2020-09-24 00:02:40 +02:00
|
|
|
maintainer := "Chris Stewart <stewart.chris1234@gmail.com>",
|
2019-08-30 22:11:52 +02:00
|
|
|
developers := List(
|
|
|
|
Developer(
|
|
|
|
"christewart",
|
|
|
|
"Chris Stewart",
|
|
|
|
"stewart.chris1234@gmail.com",
|
|
|
|
url("https://twitter.com/Chris_Stewart_5")
|
|
|
|
)
|
|
|
|
),
|
2021-04-06 13:01:11 +02:00
|
|
|
Compile / scalacOptions ++= compilerOpts(scalaVersion = scalaVersion.value),
|
2021-03-03 23:52:03 +01:00
|
|
|
Test / scalacOptions ++= testCompilerOpts(scalaVersion =
|
|
|
|
scalaVersion.value),
|
2019-10-03 16:46:43 +02:00
|
|
|
//remove annoying import unused things in the scala console
|
|
|
|
//https://stackoverflow.com/questions/26940253/in-sbt-how-do-you-override-scalacoptions-for-console-in-all-configurations
|
2021-04-06 13:01:11 +02:00
|
|
|
Compile / console / scalacOptions ~= (_ filterNot (s =>
|
2020-08-19 16:17:39 +02:00
|
|
|
s == "-Ywarn-unused-import"
|
2020-08-20 21:33:18 +02:00
|
|
|
|| s == "-Ywarn-unused"
|
|
|
|
|| s == "-Xfatal-warnings"
|
2021-02-18 20:57:18 +01:00
|
|
|
//for 2.13 -- they use different compiler opts
|
2020-08-19 16:17:39 +02:00
|
|
|
|| s == "-Xlint:unused")),
|
2020-05-29 14:03:18 +02:00
|
|
|
//we don't want -Xfatal-warnings for publishing with publish/publishLocal either
|
2021-04-06 13:01:11 +02:00
|
|
|
Compile / doc / scalacOptions ~= (_ filterNot (s =>
|
2020-05-29 14:03:18 +02:00
|
|
|
s == "-Xfatal-warnings")),
|
2021-06-28 14:14:09 +02:00
|
|
|
//silence all scaladoc warnings generated from invalid syntax
|
|
|
|
//see: https://github.com/bitcoin-s/bitcoin-s/issues/3232
|
|
|
|
Compile / doc / scalacOptions ++= Vector(s"-Wconf:any:ws"),
|
2021-04-06 13:01:11 +02:00
|
|
|
Test / console / scalacOptions ++= (Compile / console / scalacOptions).value,
|
|
|
|
Test / scalacOptions ++= testCompilerOpts(scalaVersion.value),
|
2021-05-03 14:11:59 +02:00
|
|
|
licenses += ("MIT", url("http://opensource.org/licenses/MIT")),
|
2021-05-19 13:35:31 +02:00
|
|
|
assembly / test := {}
|
2021-03-02 14:05:21 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
lazy val jvmSettings: Seq[Setting[_]] = List(
|
|
|
|
////
|
|
|
|
// scaladoc settings
|
|
|
|
Compile / doc / scalacOptions ++= List(
|
|
|
|
"-doc-title",
|
|
|
|
"Bitcoin-S",
|
|
|
|
"-doc-version",
|
|
|
|
version.value
|
|
|
|
),
|
|
|
|
// Set apiURL to define the base URL for the Scaladocs for our library.
|
|
|
|
// This will enable clients of our library to automatically link against
|
|
|
|
// the API documentation using autoAPIMappings.
|
|
|
|
apiURL := homepage.value.map(_.toString + "/api").map(url(_)),
|
|
|
|
// scaladoc settings end
|
|
|
|
////
|
2019-08-30 22:11:52 +02:00
|
|
|
Compile / compile / javacOptions ++= {
|
2021-04-28 14:01:09 +02:00
|
|
|
//https://github.com/eclipse/jetty.project/issues/3244#issuecomment-495322586
|
|
|
|
Seq("--release", "8")
|
2021-03-02 14:05:21 +01:00
|
|
|
}
|
2019-08-30 22:11:52 +02:00
|
|
|
)
|
|
|
|
|
2022-05-05 16:59:05 +02:00
|
|
|
lazy val jlinkModules = Seq(
|
2022-05-05 21:58:46 +02:00
|
|
|
"jdk.crypto.ec"
|
2022-05-05 16:59:05 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
//these are java modules we do not need
|
|
|
|
//our artifacts do not use java.desktop
|
|
|
|
//there may be others we don't need
|
|
|
|
//but this is the most obvious and reduces
|
|
|
|
//artifact size by 15MB
|
|
|
|
//do 'show jlinkModules' in the module
|
|
|
|
//to see what ones are used
|
|
|
|
lazy val rmJlinkModules = Seq(
|
|
|
|
"java.desktop"
|
|
|
|
)
|
|
|
|
|
2022-05-08 01:42:02 +02:00
|
|
|
lazy val rmCliJlinkModules = {
|
|
|
|
rmJlinkModules ++ Vector(
|
|
|
|
"java.logging",
|
|
|
|
"java.naming",
|
|
|
|
"java.sql",
|
|
|
|
"java.xml",
|
|
|
|
"jdk.unsupported"
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-05-05 16:59:05 +02:00
|
|
|
lazy val jlinkOptions = Seq(
|
|
|
|
"--no-header-files",
|
|
|
|
"--no-man-pages",
|
|
|
|
"--compress=2"
|
|
|
|
)
|
|
|
|
|
2019-08-30 22:11:52 +02:00
|
|
|
private val commonCompilerOpts = {
|
|
|
|
List(
|
2021-04-28 14:01:09 +02:00
|
|
|
//https://stackoverflow.com/a/43103038/967713
|
|
|
|
"-release",
|
|
|
|
"8"
|
2019-08-30 22:11:52 +02:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2021-01-03 15:01:26 +01:00
|
|
|
/** Linting options for scalac */
|
|
|
|
private val scala2_13CompilerLinting = {
|
|
|
|
Seq(
|
|
|
|
"-Xlint:unused",
|
|
|
|
"-Xlint:adapted-args",
|
|
|
|
"-Xlint:nullary-unit",
|
|
|
|
"-Xlint:inaccessible",
|
|
|
|
"-Xlint:infer-any",
|
|
|
|
"-Xlint:missing-interpolator",
|
|
|
|
"-Xlint:eta-sam"
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Compiler options for source code */
|
|
|
|
private val scala2_13SourceCompilerOpts = {
|
|
|
|
Seq("-Xfatal-warnings") ++ scala2_13CompilerLinting
|
|
|
|
}
|
2019-08-30 22:11:52 +02:00
|
|
|
|
|
|
|
private val nonScala2_13CompilerOpts = Seq(
|
|
|
|
"-Xmax-classfile-name",
|
2020-08-19 16:17:39 +02:00
|
|
|
"128",
|
|
|
|
"-Ywarn-unused",
|
|
|
|
"-Ywarn-unused-import"
|
2019-08-30 22:11:52 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
//https://docs.scala-lang.org/overviews/compiler-options/index.html
|
2021-01-03 15:01:26 +01:00
|
|
|
def compilerOpts(scalaVersion: String): Seq[String] = {
|
2019-08-30 22:11:52 +02:00
|
|
|
Seq(
|
|
|
|
"-unchecked",
|
|
|
|
"-feature",
|
|
|
|
"-deprecation",
|
2020-08-19 16:17:39 +02:00
|
|
|
"-Ywarn-dead-code",
|
|
|
|
"-Ywarn-value-discard",
|
|
|
|
"-Ywarn-unused",
|
|
|
|
"-unchecked",
|
|
|
|
"-deprecation",
|
2020-11-28 14:36:07 +01:00
|
|
|
"-feature",
|
|
|
|
"-Ypatmat-exhaust-depth",
|
|
|
|
"off"
|
2019-08-30 22:11:52 +02:00
|
|
|
) ++ commonCompilerOpts ++ {
|
2021-01-03 15:01:26 +01:00
|
|
|
if (scalaVersion.startsWith("2.13")) {
|
|
|
|
scala2_13SourceCompilerOpts
|
|
|
|
} else nonScala2_13CompilerOpts
|
2019-08-30 22:11:52 +02:00
|
|
|
}
|
2021-01-03 15:01:26 +01:00
|
|
|
}
|
2019-08-30 22:11:52 +02:00
|
|
|
|
2020-12-20 14:09:07 +01:00
|
|
|
def testCompilerOpts(scalaVersion: String): Seq[String] = {
|
2021-01-05 12:57:56 +01:00
|
|
|
(commonCompilerOpts ++
|
2020-12-20 14:09:07 +01:00
|
|
|
//initialization checks: https://docs.scala-lang.org/tutorials/FAQ/initialization-order.html
|
|
|
|
Vector("-Xcheckinit") ++
|
2021-01-05 12:57:56 +01:00
|
|
|
compilerOpts(scalaVersion))
|
|
|
|
.filterNot(_ == "-Xfatal-warnings")
|
2020-12-20 14:09:07 +01:00
|
|
|
}
|
2019-08-30 22:11:52 +02:00
|
|
|
|
|
|
|
lazy val testSettings: Seq[Setting[_]] = Seq(
|
2020-02-23 17:22:28 +01:00
|
|
|
//show full stack trace (-oF) of failed tests and duration of tests (-oD)
|
2021-04-06 13:01:11 +02:00
|
|
|
Test / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-oDF"),
|
|
|
|
Test / logBuffered := false,
|
|
|
|
skip / publish := true
|
2019-08-30 22:11:52 +02:00
|
|
|
) ++ settings
|
|
|
|
|
|
|
|
lazy val prodSettings: Seq[Setting[_]] = settings
|
2020-02-17 19:07:04 +01:00
|
|
|
|
2021-02-18 20:57:18 +01:00
|
|
|
lazy val appSettings: Seq[Setting[_]] = prodSettings ++ Vector(
|
|
|
|
//gives us the 'universal' directory in build artifacts
|
|
|
|
Compile / unmanagedResourceDirectories += baseDirectory.value / "src" / "universal"
|
|
|
|
)
|
|
|
|
|
|
|
|
lazy val dockerSettings: Seq[Setting[_]] = {
|
|
|
|
Vector(
|
|
|
|
//https://sbt-native-packager.readthedocs.io/en/latest/formats/docker.html
|
2022-06-09 22:10:28 +02:00
|
|
|
dockerBaseImage := "openjdk:17-slim",
|
2021-02-19 17:09:40 +01:00
|
|
|
dockerRepository := Some("bitcoinscala"),
|
2022-08-23 21:36:08 +02:00
|
|
|
Docker / daemonUser := "bitcoin-s",
|
2022-08-25 18:21:29 +02:00
|
|
|
//needed for umbrel environment, container uids and host uids must matchup so we can
|
|
|
|
//properly write to volumes on the host machine
|
|
|
|
//see: https://medium.com/@mccode/understanding-how-uid-and-gid-work-in-docker-containers-c37a01d01cf
|
2022-08-29 17:38:50 +02:00
|
|
|
//Docker / daemonUserUid := Some("1000"),
|
2021-04-06 13:01:11 +02:00
|
|
|
Docker / packageName := packageName.value,
|
|
|
|
Docker / version := version.value,
|
2022-08-25 21:12:46 +02:00
|
|
|
//add a default exposed volume of /bitcoin-s so we can always write data here
|
|
|
|
dockerExposedVolumes += "/bitcoin-s",
|
2021-03-03 20:58:04 +01:00
|
|
|
dockerUpdateLatest := isSnapshot.value
|
2021-02-18 20:57:18 +01:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2021-09-07 21:09:23 +02:00
|
|
|
// See https://softwaremill.com/how-to-build-multi-platform-docker-image-with-sbt-and-docker-buildx/
|
|
|
|
lazy val ensureDockerBuildx =
|
|
|
|
taskKey[Unit]("Ensure that docker buildx configuration exists")
|
|
|
|
|
|
|
|
lazy val dockerBuildWithBuildx =
|
|
|
|
taskKey[Unit]("Build docker images using buildx")
|
|
|
|
|
|
|
|
/** These settings are needed to produce docker images across different chip architectures
|
|
|
|
* such as amd64 and arm64
|
|
|
|
* @see https://softwaremill.com/how-to-build-multi-platform-docker-image-with-sbt-and-docker-buildx/
|
|
|
|
*/
|
|
|
|
lazy val dockerBuildxSettings = {
|
|
|
|
Seq(
|
|
|
|
ensureDockerBuildx := {
|
|
|
|
if (Process("docker buildx inspect multi-arch-builder").! == 1) {
|
|
|
|
Process("docker buildx create --use --name multi-arch-builder",
|
|
|
|
baseDirectory.value).!
|
|
|
|
}
|
|
|
|
},
|
|
|
|
dockerBuildWithBuildx := {
|
|
|
|
streams.value.log("Building and pushing image with Buildx")
|
|
|
|
dockerAliases.value.foreach { alias =>
|
|
|
|
//issue the command below in to the terminal in the same directory that
|
|
|
|
//our sbt plugin generates the docker file.
|
|
|
|
//if you want to reproduce the docker file, run docker:stage
|
|
|
|
//in your sbt terminal and you should find it in target/docker/stage/
|
|
|
|
val cmd =
|
|
|
|
"docker buildx build --platform=linux/amd64,linux/arm64 --push -t " +
|
|
|
|
alias + " ."
|
|
|
|
val dockerFileDir =
|
|
|
|
baseDirectory.value / "target" / "docker" / "stage"
|
|
|
|
Process(cmd, dockerFileDir).!
|
|
|
|
}
|
|
|
|
},
|
|
|
|
Docker / publish := Def
|
|
|
|
.sequential(
|
|
|
|
Docker / publishLocal,
|
|
|
|
ensureDockerBuildx,
|
|
|
|
dockerBuildWithBuildx
|
|
|
|
)
|
|
|
|
.value
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2020-08-20 21:33:18 +02:00
|
|
|
lazy val binariesPath =
|
|
|
|
Paths.get(Properties.userHome, ".bitcoin-s", "binaries")
|
2022-05-05 16:59:05 +02:00
|
|
|
|
2022-05-08 01:42:02 +02:00
|
|
|
lazy val dbCommonsJlinkIgnore = {
|
|
|
|
//we don't use android
|
|
|
|
Vector("org.flywaydb.core.api.android" -> "android.content",
|
|
|
|
"org.flywaydb.core.internal.logging.android" -> "android.util",
|
|
|
|
"org.flywaydb.core.internal.resource.android" -> "android.content.res",
|
|
|
|
"org.flywaydb.core.internal.scanner.android" -> "android.content",
|
|
|
|
"org.flywaydb.core.internal.scanner.android" -> "android.content.pm",
|
|
|
|
"org.flywaydb.core.internal.scanner.android" -> "android.content.res",
|
|
|
|
"org.flywaydb.core.internal.scanner.android" -> "dalvik.system",
|
|
|
|
//we don't use hibernate
|
|
|
|
"com.zaxxer.hikari.hibernate" -> "org.hibernate",
|
|
|
|
|
|
|
|
//we don't ship with support for any aws products
|
|
|
|
"org.flywaydb.core.internal.resource.s3" -> "software.amazon.awssdk.awscore.exception",
|
|
|
|
"org.flywaydb.core.internal.resource.s3" -> "software.amazon.awssdk.core",
|
|
|
|
"org.flywaydb.core.internal.resource.s3" -> "software.amazon.awssdk.services.s3",
|
|
|
|
"org.flywaydb.core.internal.resource.s3" -> "software.amazon.awssdk.services.s3.model",
|
|
|
|
"org.flywaydb.core.internal.scanner.cloud.s3" -> "software.amazon.awssdk.core.exception",
|
|
|
|
"org.flywaydb.core.internal.scanner.cloud.s3" -> "software.amazon.awssdk.services.s3",
|
|
|
|
"org.flywaydb.core.internal.scanner.cloud.s3" -> "software.amazon.awssdk.services.s3.model",
|
|
|
|
"org.flywaydb.core.api.configuration" -> "software.amazon.awssdk.services.s3",
|
|
|
|
|
|
|
|
//we don't use oracle database products
|
|
|
|
"org.flywaydb.core.internal.database.oracle" -> "oracle.jdbc",
|
|
|
|
|
|
|
|
//we don't use jboss
|
|
|
|
"org.flywaydb.core.internal.scanner.classpath.jboss" -> "org.jboss.vfs",
|
|
|
|
|
|
|
|
"org.flywaydb.core.internal.logging.log4j2" -> "org.apache.logging.log4j",
|
|
|
|
|
|
|
|
"com.zaxxer.hikari.metrics.micrometer" -> "io.micrometer.core.instrument",
|
|
|
|
"com.zaxxer.hikari.pool" -> "io.micrometer.core.instrument",
|
|
|
|
|
|
|
|
"slick.jdbc" -> "javax.xml.bind",
|
|
|
|
"com.zaxxer.hikari.metrics.prometheus" -> "io.prometheus.client",
|
|
|
|
"com.zaxxer.hikari.util" -> "javassist",
|
|
|
|
"com.zaxxer.hikari.util" -> "javassist.bytecode",
|
|
|
|
|
|
|
|
//postgres requires this weird waffle dep
|
|
|
|
"waffle.jaas" -> "java.security.acl"
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
lazy val loggingJlinkIgnore = {
|
|
|
|
Vector(
|
2022-05-05 16:59:05 +02:00
|
|
|
"ch.qos.logback.core.net" -> "javax.mail",
|
|
|
|
"ch.qos.logback.core.net" -> "javax.mail.internet",
|
2022-05-08 01:42:02 +02:00
|
|
|
"org.apache.log4j.jmx" -> "com.sun.jdmk.comm",
|
|
|
|
)
|
|
|
|
}
|
2022-05-05 16:59:05 +02:00
|
|
|
|
2022-05-08 01:42:02 +02:00
|
|
|
lazy val oracleServerJlinkIgnore = {
|
|
|
|
val oracleServerIgnore = Vector(
|
|
|
|
"java.xml" -> "java.activation",
|
|
|
|
"com.github.benmanes.caffeine" -> "javax.annotation",
|
|
|
|
"com.github.benmanes.caffeine.cache" -> "javax.annotation",
|
|
|
|
"com.github.benmanes.caffeine.cache.stats" -> "javax.annotation",
|
|
|
|
//optional
|
|
|
|
"org.codehaus.janino" -> "org.apache.tools.ant").++(loggingJlinkIgnore).++(dbCommonsJlinkIgnore)
|
|
|
|
JlinkIgnore.byPackagePrefix(oracleServerIgnore:_*)
|
|
|
|
}
|
2022-05-05 16:59:05 +02:00
|
|
|
|
2022-05-08 01:42:02 +02:00
|
|
|
lazy val appServerJlinkIgnore = {
|
2022-05-05 16:59:05 +02:00
|
|
|
|
2022-05-08 01:42:02 +02:00
|
|
|
val appServerIgnore = loggingJlinkIgnore.++(dbCommonsJlinkIgnore).++(Vector(
|
|
|
|
//https://github.com/janino-compiler/janino/blob/f6bb39d3137ad2e99b41ecc48aaaf8ab2644bd1c/janino/pom.xml#L37
|
|
|
|
"org.codehaus.janino" -> "org.apache.tools.ant",
|
2022-05-05 16:59:05 +02:00
|
|
|
"com.github.benmanes.caffeine" -> "javax.annotation",
|
|
|
|
"com.github.benmanes.caffeine.cache" -> "javax.annotation",
|
|
|
|
"com.github.benmanes.caffeine.cache.stats" -> "javax.annotation",
|
|
|
|
|
2022-05-08 01:42:02 +02:00
|
|
|
"monix.execution.misc" -> "scala.tools.nsc"
|
|
|
|
))
|
|
|
|
JlinkIgnore.byPackagePrefix(appServerIgnore:_*)
|
|
|
|
}
|
2022-05-05 16:59:05 +02:00
|
|
|
|
2022-05-08 01:42:02 +02:00
|
|
|
lazy val cliJlinkIgnore = {
|
|
|
|
val cliIgnore = Vector(
|
|
|
|
"scala.meta.internal.svm_subs" -> "com.oracle.svm.core.annotate",
|
|
|
|
"org.slf4j" -> "org.slf4j.impl"
|
2022-05-05 16:59:05 +02:00
|
|
|
)
|
2022-05-08 01:42:02 +02:00
|
|
|
|
|
|
|
JlinkIgnore.byPackagePrefix(cliIgnore:_*)
|
2022-05-05 16:59:05 +02:00
|
|
|
}
|
2022-06-17 00:08:06 +02:00
|
|
|
|
|
|
|
def buildPackageName(packageName: String): String = {
|
|
|
|
//bitcoin-s-server-1.9.2-1-59aaf330-20220616-1614-SNAPSHOT -> bitcoin-s-server-linux-1.9.2-1-59aaf330-20220616-1614-SNAPSHOT
|
|
|
|
//bitcoin-s-cli-1.9.2-1-59aaf330-20220616-1614-SNAPSHOT.zip -> bitcoin-s-cli-linux-1.9.2-1-59aaf330-20220616-1614-SNAPSHOT.zip
|
|
|
|
|
2022-06-21 19:41:01 +02:00
|
|
|
val osName = System.getProperty("os.name").toLowerCase().split('.').head.replaceAll("\\s", "")
|
2022-06-17 00:08:06 +02:00
|
|
|
val split = packageName.split("-")
|
|
|
|
val versionIdx = split.zipWithIndex.find(_._1.count(_ =='.') > 1).get._2
|
|
|
|
val insertedOSName = split.take(versionIdx) ++ Vector(osName) ++ split.drop(versionIdx)
|
|
|
|
insertedOSName.mkString("-")
|
|
|
|
}
|
2019-08-30 22:11:52 +02:00
|
|
|
}
|