From c38e944bcf36f745959845706ed6a8ba896c442d Mon Sep 17 00:00:00 2001
From: Dennis Reimann <mail@dennisreimann.de>
Date: Wed, 22 Jan 2025 11:12:04 +0100
Subject: [PATCH] Update submodule to use master

Removes the need for mobile-working-branch. Closes btcpayserver/btcpayserver#5968.
---
 README.md               | 26 ++------------------------
 setup.sh                | 22 ++++++++++++++++++++++
 submodules/btcpayserver |  2 +-
 3 files changed, 25 insertions(+), 25 deletions(-)
 create mode 100755 setup.sh

diff --git a/README.md b/README.md
index a62adb50..5e1c5eae 100644
--- a/README.md
+++ b/README.md
@@ -11,21 +11,12 @@ git clone git@github.com:btcpayserver/app.git
 # Switch to it
 cd app
 
-# Initialize the server submodule
-git submodule init && git submodule update --recursive
-
-# Install the workloads
-dotnet workload restore
+# Run the setup script
+./setup.sh
 
 # Go to the server submodule
 cd submodules/btcpayserver/BTCPayServer.Tests
 
-# Verify you are on the `mobile-working-branch` branch
-git branch --show current
-
-# If not, check it out
-git checkout mobile-working-branch
-
 # Run the server
 docker-compose up dev
 ```
@@ -40,19 +31,6 @@ Click the Connect button, use `http://localhost:14142` as the server URL and an
 After the first run of `DEV ALL` on a Linux machine with a new .NET setup, you may run into the [dotnet dev-certs - Untrusted Root](https://github.com/dotnet/aspnetcore/issues/41503)
 error, and you may find a solution at the [following link](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-dev-certs)
 
-## Missing dependencies in development environment
-
-If BTCPay Server does not start up with the app and its dependencies, run this:
-
-```bash
-cd BTCPayApp.Core
-dotnet publish -c Debug -o ../BTCPayServer.Plugins.App/bin/Debug/net8.0
-cd -
-cd BTCPayServer.Plugins.App
-dotnet publish -c Debug -o bin/Debug/net8.0
-cd -
-```
-
 ## Lightning Channels
 
 To establish channels for local testing, you can use the Docker Lightning CLI scripts like this:
diff --git a/setup.sh b/setup.sh
new file mode 100755
index 00000000..c10775b3
--- /dev/null
+++ b/setup.sh
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+
+# Initialize the server submodule
+git submodule init && git submodule update --recursive
+
+# Install the workloads
+dotnet workload restore
+
+# Create appsettings file to include app plugin when running the server
+appsettings="submodules/btcpayserver/BTCPayServer/appsettings.dev.json"
+if [ ! -f $appsettings ]; then
+    echo '{ "DEBUG_PLUGINS": "../../../BTCPayServer.Plugins.App/bin/Debug/net8.0/BTCPayServer.Plugins.App.dll" }' > $appsettings
+fi
+
+# Build the core and plugin to share their dependencies with the server
+cd BTCPayApp.Core
+dotnet publish -c Debug -o ../BTCPayServer.Plugins.App/bin/Debug/net8.0
+cd -
+
+cd BTCPayServer.Plugins.App
+dotnet publish -c Debug -o bin/Debug/net8.0
+cd -
diff --git a/submodules/btcpayserver b/submodules/btcpayserver
index a82a58af..ba8feedd 160000
--- a/submodules/btcpayserver
+++ b/submodules/btcpayserver
@@ -1 +1 @@
-Subproject commit a82a58af1581f1078b8c27fa229b5152776cd0ce
+Subproject commit ba8feeddd990cb2e66b028709e0d5f9159437826