-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
88 lines (76 loc) · 2.57 KB
/
Copy pathMakefile
File metadata and controls
88 lines (76 loc) · 2.57 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
# ADF Preview Extension Build Script
#
# Usage:
# make build - Build the extension
# make package - Package extension into .vsix file
# make install - Install the packaged extension
# make full - Build, package, and install
# make clean - Clean build artifacts
# make version - Show current version
.PHONY: build package install full clean version help
# Variables
PACKAGE_NAME = adf-preview
VERSION = $(shell node -p "require('./package.json').version")
VSIX_FILE = build/$(PACKAGE_NAME)-$(VERSION).vsix
# Default target
help:
@echo "ADF Preview Extension Build Commands:"
@echo " make build - Build the extension (TypeScript + Webpack)"
@echo " make package - Package extension into .vsix file"
@echo " make install - Install the packaged extension in VS Code"
@echo " make full - Build, package, and install (complete workflow)"
@echo " make clean - Clean build artifacts"
@echo " make version - Show current version"
@echo " make help - Show this help message"
# Show current version
version:
@echo "Current version: $(VERSION)"
@echo "Package file: $(VSIX_FILE)"
# Build the extension
build:
@echo "🔨 Building ADF Preview Extension..."
yarn build
@echo "✅ Build complete!"
# Package the extension into .vsix file
package: build
@echo "📦 Packaging extension v$(VERSION)..."
@mkdir -p build
npx @vscode/vsce package --no-dependencies --no-yarn --out build/
@echo "✅ Package created: $(VSIX_FILE)"
# Install the packaged extension
install:
@echo "🚀 Installing ADF Preview Extension v$(VERSION)..."
@if [ ! -f "$(VSIX_FILE)" ]; then \
echo "❌ Package file not found: $(VSIX_FILE)"; \
echo " Run 'make package' first"; \
exit 1; \
fi
@if command -v cursor > /dev/null; then \
cursor --install-extension $(VSIX_FILE); \
elif command -v code > /dev/null; then \
code --install-extension $(VSIX_FILE); \
else \
echo "❌ Neither 'cursor' nor 'code' command found"; \
echo " Please install the extension manually: $(VSIX_FILE)"; \
exit 1; \
fi
@echo "✅ Extension installed! Reload your editor to activate."
# Full workflow: build, package, install
full: package install
@echo "🎉 Complete! Extension v$(VERSION) built, packaged, and installed."
# Clean build artifacts
clean:
@echo "🧹 Cleaning build artifacts..."
rm -rf dist/
rm -rf build/*.vsix
@echo "✅ Clean complete!"
# Development workflow targets
dev-build:
@echo "🔧 Development build (with watch)..."
yarn watch
lint:
@echo "🔍 Running linter..."
yarn lint
test:
@echo "🧪 Running tests..."
yarn test