-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (58 loc) · 2.52 KB
/
Copy pathMakefile
File metadata and controls
76 lines (58 loc) · 2.52 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
################################################################################
# Configuration and Variables
################################################################################
GRADLE := ./gradlew
GRADLE_OPTS ?=
PLUGIN_NAME := mojo-plugin-jetbrains
DIST_DIR := build/distributions
REPORTS_DIR := build/reports
ARGS ?=
SHELL := /usr/bin/env bash
.SHELLFLAGS := -eu -o pipefail -c
################################################################################
# Targets
################################################################################
.PHONY: all build rebuild run test coverage lint format clean release help setup-hooks test-hooks verify
.DEFAULT_GOAL := help
help: ## Show the help messages for all targets
@grep -E '^[a-zA-Z0-9_-]+:.*?## ' Makefile | awk 'BEGIN {FS = ":.*?## "}; {printf " %-14s %s\n", $$1, $$2}'
all: build test lint ## build, test, and lint
build: ## Build the plugin (compile, instrument, and jar)
@echo "Building plugin..."
$(GRADLE) build -x test $(GRADLE_OPTS)
rebuild: clean build ## clean and build
run: ## Launch a sandbox IDE with the plugin installed
@echo "Launching sandbox IDE..."
$(GRADLE) runIde $(GRADLE_OPTS)
test: ## Run all tests
@echo "Running tests..."
$(GRADLE) test $(GRADLE_OPTS)
coverage: ## Run tests with coverage report (build/reports/kover/)
@echo "Running tests with coverage..."
$(GRADLE) test koverXmlReport koverHtmlReport $(GRADLE_OPTS)
@echo "HTML report: build/reports/kover/html/index.html"
verify: ## Run plugin verification against target IDE versions
@echo "Running plugin verification..."
$(GRADLE) verifyPlugin $(GRADLE_OPTS)
lint: ## Check code style (ktlint + Kotlin compiler warnings)
@echo "Running lint checks..."
$(GRADLE) ktlintCheck $(GRADLE_OPTS)
format: ## Format Kotlin source files
@echo "Formatting Kotlin files..."
$(GRADLE) ktlintFormat $(GRADLE_OPTS)
clean: ## Remove build artifacts and caches
@echo "Removing build artifacts..."
$(GRADLE) clean $(GRADLE_OPTS)
rm -rf .gradle/configuration-cache
release: ## Build distributable plugin file (ZIP)
@echo "Building distributable plugin..."
$(GRADLE) buildPlugin $(GRADLE_OPTS)
@echo "Plugin zip: $(DIST_DIR)/$(PLUGIN_NAME)-*.zip"
setup-hooks: ## Install Git hooks (pre-commit and pre-push)
@echo "Installing Git hooks..."
@pre-commit install --hook-type pre-commit
@pre-commit install --hook-type pre-push
@pre-commit install-hooks
test-hooks: ## Run Git hooks on all files manually
@echo "Running Git hooks..."
@pre-commit run --all-files