From 1d52e4027b842712241accd4f0065e16e218a032 Mon Sep 17 00:00:00 2001 From: Ben Carman Date: Mon, 31 May 2021 12:39:32 -0500 Subject: [PATCH 01/10] Windows packaging --- .github/workflows/release.yml | 36 ++++++++++++++++--- app/bundle/bundle.sbt | 26 ++++++++++++++ .../org/bitcoins/bundle/gui/BundleGUI.scala | 5 +++ .../server/routes/BitcoinSRunner.scala | 4 +++ 4 files changed, 66 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3edcb039eab7..d9fdd639a1e7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,7 @@ name: Release on: push: - branches: [master, main, adaptor-dlc] + branches: [master, main, windows-packaging] tags: ["*"] env: @@ -58,15 +58,15 @@ jobs: pkg-version: ${{steps.previoustag.outputs.tag}} MACOS_CERTIFICATE_PWD: ${{ secrets.CERTIFICATES_P12_PASSWORD }} MAC_NOTARIZATION_PW: ${{secrets.MAC_NOTARIZATION_PW}} - # Steps to build a fully signed and notarized krystal bull dmg + # Steps to build a fully signed and notarized bitcoin-s dmg # 1. Unlock the OS x keychain so we don't have to input passwords via GUI prompts - # 2. Build krystalbull.app that is recursively signed with jpackage --mac-sign - # 3. Build an unsigned dmg that contains krystalbull.app inside of it (no idea why --mac-sign doesn't work with --type dmg) + # 2. Build bitcoin-s.app that is recursively signed with jpackage --mac-sign + # 3. Build an unsigned dmg that contains bitcoin-s.app inside of it (no idea why --mac-sign doesn't work with --type dmg) # 4. Sign the dmg with codesign (jpackage dmg signing is broken for some reason) # 5. Submit the dmg to apple's notarization service so can get it whitelisted for installation (see: https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution) # 6. Sleep until apple notorization is done # 7. Retrieve the signature and staple it to the dmg to so network requests do not need to be made to open the dmg - # 8. Check all signatures on krystalbull.app (see: https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087735) + # 8. Check all signatures on bitcoin-s.app (see: https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087735) # 9. Check all dmg signatures # 10. Display information about signed dmg run: | @@ -139,4 +139,30 @@ jobs: with: name: "bitcoin-s-deb-${{steps.previoustag.outputs.tag}}-${{github.sha}}" path: "${{ env.pkg-name }}_${{ steps.previoustag.outputs.tag }}-1_amd64.deb" + windows: + runs-on: [windows-latest] + steps: + - name: Checkout repo + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Setup Scala + uses: olafurpg/setup-scala@v10 + with: + java-version: adopt@1.11.0-1 + - name: 'Get Previous tag' + id: previoustag + uses: "WyriHaximus/github-action-get-previous-tag@v1" + with: + fallback: 1.0.0 # Optional fallback tag to use when no tag can be found + - name: Build msi + shell: bash + run: sbt bundle/windows:packageBin + - name: View artifacts + run: ls -R . + - name: Upload installer + uses: actions/upload-artifact@v1 + with: + name: bitcoin-s-msi-${{steps.previoustag.outputs.tag}}-${{github.sha}} + path: "D:\\a\\bitcoin-s\\bitcoin-s\\target\\windows\\bitcoin-s.msi" diff --git a/app/bundle/bundle.sbt b/app/bundle/bundle.sbt index 82ea31896482..44cfb6d55054 100644 --- a/app/bundle/bundle.sbt +++ b/app/bundle/bundle.sbt @@ -1,5 +1,9 @@ +import com.typesafe.sbt.packager.windows._ + name := "bitcoin-s-bundle" +enablePlugins(WindowsPlugin) + mainClass := Some("org.bitcoins.bundle.gui.BundleGUI") publish / skip := true @@ -16,3 +20,25 @@ assembly / assemblyMergeStrategy := { case PathList("reference.conf", _ @_*) => MergeStrategy.concat case _ => MergeStrategy.first } + +Compile / doc := (target.value / "none") +// general package information (can be scoped to Windows) +maintainer := "Chris Stewart " +// Will say "Welcome to the Setup Wizard" +packageSummary := "Bitcoin-S" +// Will be used for drop down menu in setup wizard +packageDescription := "Bitcoin-S" + +// wix build information +wixProductId := java.util.UUID.randomUUID().toString +wixProductUpgradeId := java.util.UUID.randomUUID().toString + +// Adding the wanted wixFeature: +wixFeatures += WindowsFeature( + id = "shortcuts", + title = "Shortcuts in start menu", + desc = "Add shortcuts for execution and uninstall in start menu", + components = Seq( + AddShortCuts(Seq("bin/bitcoin-s-bundle.bat")) + ) +) diff --git a/app/bundle/src/main/scala/org/bitcoins/bundle/gui/BundleGUI.scala b/app/bundle/src/main/scala/org/bitcoins/bundle/gui/BundleGUI.scala index 62354dfa0755..4400265839c2 100644 --- a/app/bundle/src/main/scala/org/bitcoins/bundle/gui/BundleGUI.scala +++ b/app/bundle/src/main/scala/org/bitcoins/bundle/gui/BundleGUI.scala @@ -15,6 +15,7 @@ import scalafx.scene.control._ import scalafx.scene.layout.VBox import java.nio.file.{Path, Paths} +import scala.util.Properties object BundleGUI extends WalletGUI with JFXApp { @@ -43,6 +44,10 @@ object BundleGUI extends WalletGUI with JFXApp { val usedDir = DatadirUtil.getFinalDatadir(datadir, baseConfig, None) System.setProperty("bitcoins.log.location", usedDir.toAbsolutePath.toString) + + if (Properties.isWin) { + System.setProperty("HOME", datadir.getParent.toAbsolutePath.toString) + } } implicit lazy val system: ActorSystem = ActorSystem( diff --git a/app/server-routes/src/main/scala/org/bitcoins/server/routes/BitcoinSRunner.scala b/app/server-routes/src/main/scala/org/bitcoins/server/routes/BitcoinSRunner.scala index 91bea8249842..18b81da26af0 100644 --- a/app/server-routes/src/main/scala/org/bitcoins/server/routes/BitcoinSRunner.scala +++ b/app/server-routes/src/main/scala/org/bitcoins/server/routes/BitcoinSRunner.scala @@ -95,6 +95,10 @@ trait BitcoinSRunner extends StartStopAsync[Unit] with Logging { val usedDir: Path = DatadirUtil.getFinalDatadir(datadir, baseConfig, customFinalDirOpt) + if (Properties.isWin) { + System.setProperty("HOME", datadir.getParent.toAbsolutePath.toString) + } + //We need to set the system property before any logger instances //are in instantiated. If we don't do this, we will not log to //the correct location From 387277584ec2087e1df1c6613dec616820b6fbc7 Mon Sep 17 00:00:00 2001 From: Ben Carman Date: Mon, 31 May 2021 13:24:00 -0500 Subject: [PATCH 02/10] fix? --- .github/workflows/release.yml | 2 +- .jvmopts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 .jvmopts diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d9fdd639a1e7..36fde84b0b6c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -149,7 +149,7 @@ jobs: - name: Setup Scala uses: olafurpg/setup-scala@v10 with: - java-version: adopt@1.11.0-1 + java-version: adopt@1.16.0-1 - name: 'Get Previous tag' id: previoustag diff --git a/.jvmopts b/.jvmopts deleted file mode 100644 index 1b3bd90ff93d..000000000000 --- a/.jvmopts +++ /dev/null @@ -1 +0,0 @@ --Xmx4g From d21e561bffb355fdfcd79c236d7fc8604f3de692 Mon Sep 17 00:00:00 2001 From: Ben Carman Date: Mon, 31 May 2021 13:55:55 -0500 Subject: [PATCH 03/10] Set version --- app/bundle/bundle.sbt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/bundle/bundle.sbt b/app/bundle/bundle.sbt index 44cfb6d55054..bd2686319626 100644 --- a/app/bundle/bundle.sbt +++ b/app/bundle/bundle.sbt @@ -1,5 +1,7 @@ import com.typesafe.sbt.packager.windows._ +import scala.util.Properties + name := "bitcoin-s-bundle" enablePlugins(WindowsPlugin) @@ -21,6 +23,8 @@ assembly / assemblyMergeStrategy := { case _ => MergeStrategy.first } +version := "0.6.1" + Compile / doc := (target.value / "none") // general package information (can be scoped to Windows) maintainer := "Chris Stewart " From 2baa2584e3cc2fd7ce6d99621eecb528ce6b025f Mon Sep 17 00:00:00 2001 From: Chris Stewart Date: Mon, 31 May 2021 15:29:56 -0500 Subject: [PATCH 04/10] Make windows version be compatible with microsoft requirements --- app/bundle/bundle.sbt | 6 +++++- inThisBuild.sbt | 4 ++++ project/CommonSettings.scala | 14 ++++---------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/app/bundle/bundle.sbt b/app/bundle/bundle.sbt index bd2686319626..a8b70fd41b0d 100644 --- a/app/bundle/bundle.sbt +++ b/app/bundle/bundle.sbt @@ -1,6 +1,6 @@ import com.typesafe.sbt.packager.windows._ - import scala.util.Properties +import com.typesafe.sbt.SbtNativePackager.Windows name := "bitcoin-s-bundle" @@ -17,6 +17,10 @@ assembly / mainClass := Some("org.bitcoins.bundle.gui.BundleGUI") assembly / assemblyJarName := s"${name.value}.jar" +//need compatability with windows versioning scheme which is +//w.x.y.z +Windows / version := previousStableVersion.value.get + assembly / assemblyMergeStrategy := { case PathList("META-INF", _ @_*) => MergeStrategy.discard case PathList("reference.conf", _ @_*) => MergeStrategy.concat diff --git a/inThisBuild.sbt b/inThisBuild.sbt index db0f68c07fdc..5875fc637c94 100644 --- a/inThisBuild.sbt +++ b/inThisBuild.sbt @@ -23,3 +23,7 @@ Global / excludeLintKeys ++= Set( //see: https://github.com/dwijnand/sbt-dynver#portable-version-strings //https://github.com/bitcoin-s/bitcoin-s/issues/2672 ThisBuild / dynverSeparator := "-" + +//don't require the leading 'v' on dynver versioning +//as that doesn't work with windows or mac versioning +ThisBuild / dynverVTagPrefix := false diff --git a/project/CommonSettings.scala b/project/CommonSettings.scala index 27c9476c1ffe..1b853e9a6429 100644 --- a/project/CommonSettings.scala +++ b/project/CommonSettings.scala @@ -1,22 +1,16 @@ // these two imports are needed for sbt syntax to work -import com.typesafe.sbt.SbtNativePackager.Docker +import com.typesafe.sbt.SbtNativePackager.{Docker, Windows} import com.typesafe.sbt.SbtNativePackager.autoImport.packageName import java.nio.file.Paths -import com.typesafe.sbt.packager.Keys.{ - daemonUser, - daemonUserUid, - dockerAlias, - dockerAliases, - dockerRepository, - dockerUpdateLatest, - maintainer -} +import com.typesafe.sbt.packager.Keys.{daemonUser, daemonUserUid, dockerAlias, dockerAliases, dockerRepository, dockerUpdateLatest, maintainer} import com.typesafe.sbt.packager.docker.DockerPlugin.autoImport.dockerBaseImage import sbt._ import sbt.Keys._ import sbtprotoc.ProtocPlugin.autoImport.PB import sbtassembly.AssemblyKeys._ +import sbtdynver.DynVerPlugin.autoImport.previousStableVersion + import scala.util.Properties object CommonSettings { From 23b9aeb1ef55fc76cb4e99924ebf0c2b0a17d279 Mon Sep 17 00:00:00 2001 From: Chris Stewart Date: Mon, 31 May 2021 15:41:05 -0500 Subject: [PATCH 05/10] remove hard coded version --- app/bundle/bundle.sbt | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/bundle/bundle.sbt b/app/bundle/bundle.sbt index a8b70fd41b0d..b3aba2a17a59 100644 --- a/app/bundle/bundle.sbt +++ b/app/bundle/bundle.sbt @@ -1,5 +1,4 @@ import com.typesafe.sbt.packager.windows._ -import scala.util.Properties import com.typesafe.sbt.SbtNativePackager.Windows name := "bitcoin-s-bundle" @@ -27,8 +26,6 @@ assembly / assemblyMergeStrategy := { case _ => MergeStrategy.first } -version := "0.6.1" - Compile / doc := (target.value / "none") // general package information (can be scoped to Windows) maintainer := "Chris Stewart " From 4df78f105eff7539286e31970c5464511f45fcb3 Mon Sep 17 00:00:00 2001 From: Chris Stewart Date: Mon, 31 May 2021 15:48:59 -0500 Subject: [PATCH 06/10] Downgrade linux jdk to openjdk@1.15.0-2 to avoid cannot find jvmci error on CI --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 36fde84b0b6c..88e7598dc052 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -116,7 +116,7 @@ jobs: - name: Setup Scala uses: olafurpg/setup-scala@v10 with: - java-version: openjdk@1.16.0-1 + java-version: openjdk@1.15.0-2 - name: 'Get Previous tag' id: previoustag uses: "WyriHaximus/github-action-get-previous-tag@v1" From 346104037c05cf59f2eaba01f3984e9fc77924e9 Mon Sep 17 00:00:00 2001 From: Chris Stewart Date: Mon, 31 May 2021 16:00:59 -0500 Subject: [PATCH 07/10] Try to fix windows path to artifact --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 88e7598dc052..110b1c582678 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -165,4 +165,4 @@ jobs: uses: actions/upload-artifact@v1 with: name: bitcoin-s-msi-${{steps.previoustag.outputs.tag}}-${{github.sha}} - path: "D:\\a\\bitcoin-s\\bitcoin-s\\target\\windows\\bitcoin-s.msi" + path: "D:\\a\\bitcoin-s\\bitcoin-s\\app\\bundle\\target\\windows\\bitcoin-s-bundle.msi" From b367b2dfebbbe9f420e623c1b086b2855ee22f9f Mon Sep 17 00:00:00 2001 From: Ben Carman Date: Mon, 31 May 2021 16:39:55 -0500 Subject: [PATCH 08/10] rm sys.exit --- .../src/main/scala/org/bitcoins/bundle/gui/BundleGUI.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/bundle/src/main/scala/org/bitcoins/bundle/gui/BundleGUI.scala b/app/bundle/src/main/scala/org/bitcoins/bundle/gui/BundleGUI.scala index 4400265839c2..41a7a88b616b 100644 --- a/app/bundle/src/main/scala/org/bitcoins/bundle/gui/BundleGUI.scala +++ b/app/bundle/src/main/scala/org/bitcoins/bundle/gui/BundleGUI.scala @@ -89,6 +89,6 @@ object BundleGUI extends WalletGUI with JFXApp { override def stopApp(): Unit = { super.stopApp() - sys.exit() +// sys.exit() } } From 4fe038d281eeaf8b17ae3306ed741cbc78ddfa99 Mon Sep 17 00:00:00 2001 From: Ben Carman Date: Mon, 31 May 2021 20:15:54 -0500 Subject: [PATCH 09/10] Set whole bitcoin-s config --- .../src/main/resources/application.conf | 209 +++++++++++++++++- 1 file changed, 205 insertions(+), 4 deletions(-) diff --git a/app/bundle/src/main/resources/application.conf b/app/bundle/src/main/resources/application.conf index e0d31a206954..334016200573 100644 --- a/app/bundle/src/main/resources/application.conf +++ b/app/bundle/src/main/resources/application.conf @@ -1,8 +1,209 @@ bitcoin-s { - network = mainnet + network = mainnet # regtest, testnet3, mainnet, signet + datadir = ${HOME}/.bitcoin-s - node { - mode = neutrino # neutrino, spv, bitcoind - peers = ["neutrino.suredbits.com:8333"] + dbDefault = { + dataSourceClass = slick.jdbc.DatabaseUrlDataSource + profile = "slick.jdbc.SQLiteProfile$" + + db { + # for information on parameters available here see + # https://scala-slick.org/doc/3.3.1/api/index.html#slick.jdbc.JdbcBackend$DatabaseFactoryDef@forConfig(String,Config,Driver,ClassLoader):Database + path = ${bitcoin-s.datadir}/${bitcoin-s.network}/ + driver = org.sqlite.JDBC + user = "" + password = "" + host = localhost + port = 5432 + + # this needs to be set to 1 for SQLITE as it does not support concurrent database operations + # see: https://github.com/bitcoin-s/bitcoin-s/pull/1840 + numThreads = 1 + queueSize=5000 + connectionPool = "HikariCP" + registerMbeans = true + } + hikari-logging = false + hikari-logging-interval = 10 minute + } + + node = ${bitcoin-s.dbDefault} + + node { + peers = ["neutrino.suredbits.com:8333"] # a list of peer addresses in form "hostname:portnumber" + # (e.g. "neutrino.testnet3.suredbits.com:18333") + # Port number is optional, the default value is 8333 for mainnet, + # 18333 for testnet and 18444 for regtest. + mode = neutrino # neutrino, spv + # this config key is read by Slick + db { + name = nodedb + poolName = "bitcoin-s-node-db" + } + # PostgreSQL example: + # db { + # name = node + # driver = org.postgresql.Driver + # user = postgres + # password = "" + # } + } + + + chain = ${bitcoin-s.dbDefault} + chain { + neutrino { + filter-header-batch-size.default = 2000 + filter-header-batch-size.regtest = 10 + # You can set a network specific filter-header-batch-size + # by adding a trailing `.networkId` (main, test, regtest) + # It is recommended to keep the main and test batch size high + # to keep the sync time fast, however, for regtest it should be small + # so it does not exceed the chain size. + + filter-batch-size = 1000 + } + # this config key is read by Slick + db { + name = chaindb + poolName = "bitcoin-s-chain-db" + } + # PostgreSQL example: + # db { + # name = chain + # driver = org.postgresql.Driver + # user = postgres + # password = "" + # } + } + + wallet = ${bitcoin-s.dbDefault} + # settings for wallet module + wallet { + defaultAccountType = segwit # legacy, segwit, nested-segwit + + bloomFalsePositiveRate = 0.0001 # percentage + + addressGapLimit = 20 + + discoveryBatchSize = 100 + + requiredConfirmations = 6 + # How big the address queue size is before we throw an exception + # because of an overflow + addressQueueSize = 10 + + # How long we attempt to generate an address for + # before we timeout + addressQueueTimeout = 5 seconds + + # this config key is read by Slick + db { + name = walletdb + poolName = "bitcoin-s-wallet-db" + } + # PostgreSQL example: + # db { + # name = wallet + # driver = org.postgresql.Driver + # user = postgres + # password = "" + # } + } + + server { + # The port we bind our rpc server on + rpcport = 9999 + rpcbind = "127.0.0.1" + } + + dlc = ${bitcoin-s.dbDefault} + dlc { + # this config key is read by Slick + db { + name = dlcdb + url = "jdbc:sqlite:"${bitcoin-s.dlc.db.path}${bitcoin-s.dlc.db.name} + } + # PostgreSQL example: + # db { + # name = dlcdb + # driver = org.postgresql.Driver + # username = postgres + # password = "" + # } + } + + oracle = ${bitcoin-s.dbDefault} + oracle { + # this config key is read by Slick + db { + name = oracle + path = ${bitcoin-s.datadir}/oracle/ + poolName = "bitcoin-s-oracle-db" + } + # PostgreSQL example: + # db { + # name = oracle + # driver = org.postgresql.Driver + # user = postgres + # password = "" + # } + } + + test = ${bitcoin-s.dbDefault} + test { + # this config key is read by Slick + db { + name = testdb + } + } +} + +akka { + + # Let Cli commands take 30 seconds + http.server.request-timeout = 30s + + # Can parse 20MBs + http.server.parsing.max-content-length = 20m + http.client.parsing.max-content-length = 20m + + # Loggers to register at boot time (akka.event.Logging$DefaultLogger logs + # to STDOUT) + loggers = ["akka.event.slf4j.Slf4jLogger"] + + # Log level used by the configured loggers (see "loggers") as soon + # as they have been started; before that, see "stdout-loglevel" + # Options: OFF, ERROR, WARNING, INFO, DEBUG + loglevel = "DEBUG" + + # Log level for the very basic logger activated during ActorSystem startup. + # This logger prints the log messages to stdout (System.out). + # Options: OFF, ERROR, WARNING, INFO, DEBUG + stdout-loglevel = "DEBUG" + + # Filter of log events that is used by the LoggingAdapter before + # publishing log events to the eventStream. + logging-filter = "akka.event.slf4j.Slf4jLoggingFilter" + + use-slf4j = on + + log-config-on-start = off + + actor { + debug { + # enable DEBUG logging of all AutoReceiveMessages (Kill, PoisonPill etc.) + autoreceive= off + # enable function of LoggingReceive, which is to log any received message at + # DEBUG level + receive = on + # enable DEBUG logging of unhandled messages + unhandled = off + + # enable DEBUG logging of actor lifecycle changes + lifecycle = off + + event-stream=off + } } } From 72f1b38c9306e572206db93921581fba613dd0fb Mon Sep 17 00:00:00 2001 From: Ben Carman Date: Mon, 31 May 2021 23:51:20 -0500 Subject: [PATCH 10/10] pls --- .github/workflows/release.yml | 18 +++++++++--------- app/bundle/bundle.sbt | 18 +++++++++++++++++- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 110b1c582678..fc9df51092de 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,15 +19,15 @@ jobs: - uses: olafurpg/setup-scala@v10 with: java-version: zulu@1.11 - - uses: olafurpg/setup-gpg@v3 - - run: sbt ci-release docs/publishWebsite - env: - PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} - PGP_SECRET: ${{ secrets.PGP_SECRET }} - SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} - SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} - GITHUB_DEPLOY_KEY: ${{ secrets.GITHUB_TOKEN }} - GIT_DEPLOY_KEY: ${{ secrets.GIT_DEPLOY_KEY }} +# - uses: olafurpg/setup-gpg@v3 +# - run: sbt ci-release docs/publishWebsite +# env: +# PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} +# PGP_SECRET: ${{ secrets.PGP_SECRET }} +# SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} +# SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} +# GITHUB_DEPLOY_KEY: ${{ secrets.GITHUB_TOKEN }} +# GIT_DEPLOY_KEY: ${{ secrets.GIT_DEPLOY_KEY }} osx: runs-on: [ macos-latest ] steps: diff --git a/app/bundle/bundle.sbt b/app/bundle/bundle.sbt index b3aba2a17a59..d34707bea887 100644 --- a/app/bundle/bundle.sbt +++ b/app/bundle/bundle.sbt @@ -16,7 +16,7 @@ assembly / mainClass := Some("org.bitcoins.bundle.gui.BundleGUI") assembly / assemblyJarName := s"${name.value}.jar" -//need compatability with windows versioning scheme which is +//need compatibility with windows versioning scheme which is //w.x.y.z Windows / version := previousStableVersion.value.get @@ -47,3 +47,19 @@ wixFeatures += WindowsFeature( AddShortCuts(Seq("bin/bitcoin-s-bundle.bat")) ) ) + +// for windows class paths being too long +scriptClasspath := Seq("*") + +Universal / mappings += { + // we are using the reference.conf as default application.conf + // the user can override settings here + val conf = (Compile / resourceDirectory).value / "application.conf" + conf -> "conf/application.conf" +} + +scriptClasspath += "../conf/application.conf" + +// add jvm parameter for typesafe config +bashScriptExtraDefines += """addJava "-Dconfig.file=${app_home}/../conf/application.conf"""" +batScriptExtraDefines += """call :add_java "-Dconfig.file=%APP_HOME%\conf\application.conf""""