diff --git a/Harmony/Harmony.csproj b/Harmony/Harmony.csproj
index 09d3f0e5..5d7fdb29 100644
--- a/Harmony/Harmony.csproj
+++ b/Harmony/Harmony.csproj
@@ -35,7 +35,9 @@
DebugThin;DebugFat;ReleaseThin;ReleaseFat
true
true
+ $(SolutionDir)ILRepack.targets
$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb
+ True
@@ -62,16 +64,12 @@
true
portable
true
- $(SolutionDir)ILRepack.targets
- True
true
portable
true
- $(SolutionDir)ILRepack.targets
- True
true
diff --git a/pack.ps1 b/pack.ps1
new file mode 100644
index 00000000..dbfd0a45
--- /dev/null
+++ b/pack.ps1
@@ -0,0 +1,26 @@
+# Ensure the script is executed in the root of the Harmony project
+if (-not (Test-Path .git) -or -not (Test-Path Harmony.sln)) {
+ Write-Host "This script must be run from the root of the Harmony project."
+ exit
+}
+
+# Clear out old pack results from Harmony\bin and clean the project once for all configurations
+Write-Host "Cleaning Harmony\bin directory and project..."
+if (Test-Path Harmony\bin) {
+ Remove-Item Harmony\bin -Recurse
+}
+New-Item -ItemType Directory -Path Harmony\bin | Out-Null
+
+# Clean the project
+dotnet clean --nologo --verbosity minimal
+
+# Define configurations
+$configurations = @('ReleaseFat', 'ReleaseThin', 'DebugFat', 'DebugThin')
+
+# Loop through each configuration for building and packing
+foreach ($config in $configurations) {
+ Write-Host "Processing configuration: $config"
+ # Building the project for the specific configuration
+ dotnet build --nologo --configuration $config --verbosity minimal
+ dotnet pack --nologo --configuration $config --verbosity minimal
+}