Skip to content

Commit

Permalink
ci: update makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
gbassisp committed Nov 28, 2023
1 parent 9ea7cd9 commit c1cdf85
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
# check if fvm command exists, otherwise use empty string
FVM_CMD := $(shell command -v fvm 2> /dev/null)
DART_CMD=$(FVM_CMD) dart
DART_CMD := $(FVM_CMD) dart

export PATH := $(HOME)/.pub-cache/bin:$(PATH)


.PHONY: all
all: version get test analyze doc dry-run
all: version get analyze doc dry-run test

.PHONY: kill
kill:
@echo "Killing service..."
@kill -9 $(shell lsof -t -i:8181) || echo "Port 8181 is not in use"

.PHONY: publish
publish: all
@echo "Publishing package..."
$(DART_CMD) pub publish --force

.PHONY: dry-run
dry-run: kill
@echo "Running dry-run..."
$(DART_CMD) pub publish --dry-run

.PHONY: test
test:
@echo "Running tests..."
$(DART_CMD) test --test-randomize-ordering-seed=random

.PHONY: coverage
coverage:
@echo "Running tests..."
$(DART_CMD) pub global activate coverage
$(DART_CMD) run coverage:test_with_coverage
Expand All @@ -30,16 +40,26 @@ get:
@echo "Getting dependencies..."
$(DART_CMD) pub get

.PHONY: upgrade
upgrade:
@echo "Upgrading dependencies..."
$(DART_CMD) pub upgrade

.PHONY: downgrade
downgrade:
@echo "Downgrading dependencies..."
$(DART_CMD) pub downgrade


.PHONY: doc
doc:
@echo "Generating documentation..."
$(DART_CMD) doc
@$(DART_CMD) doc || echo "Failed to generate documentation - maybe it's dart 2.12?"

.PHONY: analyze
analyze:
@echo "Analyzing..."
$(DART_CMD) analyze
$(DART_CMD) analyze --fatal-infos --fatal-warnings
$(DART_CMD) format --set-exit-if-changed .

.PHONY: version
Expand All @@ -56,11 +76,10 @@ FILES := $(shell find coverage/*.info -type f ! -path "$(CWD)")

.PHONY: format_lcov
format_lcov:
@mkdir -p coverage
@echo "Formatting lcov.info..."
@echo "CWD: $(CWD)"
@echo "FILES: $(FILES)"
@for file in $(FILES); do \
sed -i'' -e 's|$(CWD)/||g' $$file ; \
done


0 comments on commit c1cdf85

Please sign in to comment.