forked from imdj360/VSCodeXsltDebugger
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage-all.sh
More file actions
executable file
·187 lines (159 loc) · 7.12 KB
/
package-all.sh
File metadata and controls
executable file
·187 lines (159 loc) · 7.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
#!/bin/bash
# Package both macOS and Windows versions
set -e # Exit on error
echo "========================================"
echo "=== Building ALL Platform Packages ==="
echo "========================================"
echo ""
# Step 1: Compile TypeScript (once for both)
echo "1. Compiling TypeScript extension..."
npm run compile
# ========================================
# MACOS PACKAGE
# ========================================
echo ""
echo "========================================"
echo "=== Building macOS Package ==="
echo "========================================"
echo ""
# Step 2: Clean, restore, and rebuild .NET Debug Adapter
echo "2. Cleaning previous build..."
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/*
echo ""
echo "3. Restoring .NET packages (all platforms)..."
dotnet restore XsltDebugger.DebugAdapter/XsltDebugger.DebugAdapter.csproj
echo ""
echo "4. Building .NET Debug Adapter..."
dotnet build XsltDebugger.DebugAdapter/XsltDebugger.DebugAdapter.csproj --no-restore
echo ""
echo "5. Running unit tests..."
dotnet test XsltDebugger.Tests/XsltDebugger.Tests.csproj -v minimal
# Step 5: Backup original package.json
echo ""
echo "6. Updating package.json for macOS..."
cp package.json package.json.backup
sed -i '' 's/"name": "xsltdebugger"/"name": "xsltdebugger-darwin"/' package.json
sed -i '' 's/"displayName": "XSLT Debugger"/"displayName": "XSLT Debugger for macOS-arm64"/' package.json
# Step 6: Remove all IKVM platforms except osx-arm64
echo ""
echo "7. Cleaning IKVM platforms (keeping only osx-arm64)..."
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/ikvm/android-*
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/ikvm/linux-*
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/ikvm/osx-x64
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/ikvm/win-*
# Step 7: Remove all runtimes except osx and osx-arm64
echo ""
echo "8. Cleaning runtimes (keeping only osx/osx-arm64)..."
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/runtimes/android-*
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/runtimes/linux-*
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/runtimes/linux
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/runtimes/osx-x64
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/runtimes/win-*
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/runtimes/win
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/runtimes/freebsd*
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/runtimes/illumos*
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/runtimes/ios*
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/runtimes/solaris*
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/runtimes/tvos*
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/runtimes/tizen*
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/runtimes/unix
# Step 8: Verify cleanup
echo ""
echo "9. Verifying platform cleanup..."
IKVM_COUNT=$(find XsltDebugger.DebugAdapter/bin/Debug/net8.0/ikvm -mindepth 1 -maxdepth 1 -type d | wc -l)
echo " IKVM platforms remaining: $IKVM_COUNT (should be 1)"
# Step 9: Package with --no-dependencies to skip prepublish
echo ""
echo "10. Packaging macOS extension (darwin-arm64)..."
npx @vscode/vsce package --target darwin-arm64 --no-dependencies
# Step 10: Restore original package.json
echo ""
echo "11. Restoring original package.json..."
mv package.json.backup package.json
echo ""
echo "✓ macOS package created successfully!"
echo " Package name: xsltdebugger-darwin"
echo " Target: darwin-arm64"
echo ""
# ========================================
# WINDOWS PACKAGE
# ========================================
echo ""
echo "========================================"
echo "=== Building Windows Package ==="
echo "========================================"
echo ""
# Step 11: Clean and rebuild .NET Debug Adapter for Windows
echo "11. Cleaning previous build..."
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/*
echo ""
echo "12. Restoring .NET packages (all platforms)..."
dotnet restore XsltDebugger.DebugAdapter/XsltDebugger.DebugAdapter.csproj
echo ""
echo "13. Building .NET Debug Adapter..."
dotnet build XsltDebugger.DebugAdapter/XsltDebugger.DebugAdapter.csproj --no-restore
# Step 14: Backup original package.json and update for Windows
echo ""
echo "14. Running unit tests..."
dotnet test XsltDebugger.Tests/XsltDebugger.Tests.csproj -v minimal
echo ""
echo "15. Updating package.json for Windows..."
cp package.json package.json.backup
sed -i '' 's/"name": "xsltdebugger"/"name": "xsltdebugger-windows"/' package.json
sed -i '' 's/"displayName": "XSLT Debugger"/"displayName": "XSLT Debugger (Windows)"/' package.json
# Step 15: Remove all IKVM platforms except win-x64
echo ""
echo "16. Cleaning IKVM platforms (keeping only win-x64)..."
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/ikvm/android-*
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/ikvm/linux-*
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/ikvm/osx-*
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/ikvm/win-arm64
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/ikvm/win-x86
# Step 16: Remove all runtimes except win and win-x64
echo ""
echo "16. Cleaning runtimes (keeping only win/win-x64)..."
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/runtimes/android-*
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/runtimes/linux-*
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/runtimes/linux
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/runtimes/osx-*
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/runtimes/osx
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/runtimes/win-arm64
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/runtimes/win-x86
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/runtimes/freebsd*
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/runtimes/illumos*
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/runtimes/ios*
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/runtimes/solaris*
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/runtimes/tvos*
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/runtimes/tizen*
rm -rf XsltDebugger.DebugAdapter/bin/Debug/net8.0/runtimes/unix
# Step 17: Verify cleanup
echo ""
echo "18. Verifying platform cleanup..."
IKVM_COUNT=$(find XsltDebugger.DebugAdapter/bin/Debug/net8.0/ikvm -mindepth 1 -maxdepth 1 -type d | wc -l)
echo " IKVM platforms remaining: $IKVM_COUNT (should be 1)"
# Step 18: Package with --no-dependencies to skip prepublish
echo ""
echo "19. Packaging Windows extension (win32-x64)..."
npx @vscode/vsce package --target win32-x64 --no-dependencies
# Step 19: Restore original package.json
echo ""
echo "20. Restoring original package.json..."
mv package.json.backup package.json
echo ""
echo "✓ Windows package created successfully!"
echo " Package name: xsltdebugger-windows"
echo " Target: win32-x64"
echo ""
# ========================================
# SUMMARY
# ========================================
echo "========================================"
echo "=== ALL PACKAGES COMPLETED ==="
echo "========================================"
echo ""
echo "✓ macOS package: xsltdebugger-darwin (darwin-arm64)"
echo "✓ Windows package: xsltdebugger-windows (win32-x64)"
echo ""
echo "Package files:"
ls -lh *.vsix 2>/dev/null || echo "No .vsix files found in current directory"
echo ""