Skip to content

Commit

Permalink
Merge branch 'master' into refactor/make-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota committed Jan 5, 2024
2 parents be8c127 + f2a18f7 commit abcfeab
Show file tree
Hide file tree
Showing 7 changed files with 227 additions and 121 deletions.
303 changes: 208 additions & 95 deletions CHANGELOG.md

Large diffs are not rendered by default.

22 changes: 9 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,45 +54,39 @@ all: build

include docs.mk

.PHONY: build
build: bin/shards
build: ## Build shards
build: phony bin/shards

.PHONY: clean
clean: ## Remove build artifacts
clean: clean_docs
clean: phony clean_docs
rm -f bin/shards

bin/shards: $(SOURCES) $(TEMPLATES) lib
@mkdir -p bin
$(EXPORTS) $(CRYSTAL) build $(FLAGS) src/shards.cr -o bin/shards

.PHONY: install
install: ## Install shards
install: bin/shards man/shards.1.gz man/shard.yml.5.gz
install: bin/shards man/shards.1.gz man/shard.yml.5.gz phony
$(INSTALL) -m 0755 -d "$(BINDIR)" "$(MANDIR)/man1" "$(MANDIR)/man5"
$(INSTALL) -m 0755 bin/shards "$(BINDIR)"
$(INSTALL) -m 0644 man/shards.1.gz "$(MANDIR)/man1"
$(INSTALL) -m 0644 man/shard.yml.5.gz "$(MANDIR)/man5"

.PHONY: uninstall
uninstall: ## Uninstall shards
uninstall:
uninstall: phony
rm -f "$(BINDIR)/shards"
rm -f "$(MANDIR)/man1/shards.1.gz"
rm -f "$(MANDIR)/man5/shard.yml.5.gz"

.PHONY: test
test: ## Run all tests
test: test_unit test_integration

.PHONY: test_unit
test_unit: ## Run unit tests
test_unit: lib
test_unit: phony lib
$(CRYSTAL) spec ./spec/unit/ $(if $(skip_fossil),--tag ~fossil) $(if $(skip_git),--tag ~git) $(if $(skip_hg),--tag ~hg)

.PHONY: test_integration
test_integration: ## Run integration tests
test_integration: bin/shards
test_integration: bin/shards phony
$(CRYSTAL) spec ./spec/integration/

lib: shard.lock
Expand All @@ -105,6 +99,8 @@ shard.lock: shard.yml
man/%.gz: man/%
gzip -c -9 $< > $@

phony:

.PHONY: help
help: ## Show this help
@echo
Expand Down
5 changes: 1 addition & 4 deletions docs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@ HTML_FILES := docs/shards.html docs/shard.yml.html
SHARDS_VERSION := $(shell cat VERSION)
SOURCE_DATE_EPOCH := $(shell (git show -s --format=%ct HEAD || stat -c "%Y" Makefile || stat -f "%m" Makefile) 2> /dev/null)

.PHONY: docs
docs: ## Build documentation
docs: manpages

.PHONY: manpages
manpages: ## Generate manpages from adoc
manpages: $(MAN_FILES)

.PHONY: htmlpages
htmlpages: ## Generate HTML files from adoc
htmlpages: $(HTML_FILES)

Expand All @@ -26,7 +23,7 @@ man/%.1 man/%.5: docs/%.adoc
docs/%.html: docs/%.adoc
SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) $(ASCIIDOC) $(ASCIIDOC_OPTIONS) $< -b html5 -o $@

.PHONY: clean_docs
clean_docs: ## Remove documentation data
clean_docs: phony
rm -f $(MAN_FILES)
rm -rf docs/*.html
4 changes: 2 additions & 2 deletions docs/shards.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ after a command.
--local::
Do not update remote repository cache. Instead, Shards will use the local copies
already present in the cache (see *SHARDS_CACHE_PATH*).
The command will fail if a depedency is unavailable in the cache.
The command will fail if a dependency is unavailable in the cache.

-q, --quiet::
Decreases the log verbosity, printing only warnings and errors.
Expand Down Expand Up @@ -157,7 +157,7 @@ Defaults to _.cache/shards_ in the home directory (_$XDG_CACHE_HOME_ or _$HOME_)
or the current directory.

SHARDS_INSTALL_PATH::
Defines the location where dependecies are installed.
Defines the location where dependencies are installed.
Defaults to _lib_.

SHARDS_BIN_PATH::
Expand Down
4 changes: 2 additions & 2 deletions man/shard.yml.5
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
.\" Title: shard.yml
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.20
.\" Date: 2023-12-22
.\" Date: 2023-12-28
.\" Manual: File Formats
.\" Source: shards 0.17.4
.\" Language: English
.\"
.TH "SHARD.YML" "5" "2023-12-22" "shards 0.17.4" "File Formats"
.TH "SHARD.YML" "5" "2023-12-28" "shards 0.17.4" "File Formats"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
Expand Down
8 changes: 4 additions & 4 deletions man/shards.1
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
.\" Title: shards
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.20
.\" Date: 2023-12-22
.\" Date: 2023-12-28
.\" Manual: Shards Manual
.\" Source: shards 0.17.4
.\" Language: English
.\"
.TH "SHARDS" "1" "2023-12-22" "shards 0.17.4" "Shards Manual"
.TH "SHARDS" "1" "2023-12-28" "shards 0.17.4" "Shards Manual"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
Expand Down Expand Up @@ -202,7 +202,7 @@ Disables colored output.
.RS 4
Do not update remote repository cache. Instead, Shards will use the local copies
already present in the cache (see \fBSHARDS_CACHE_PATH\fP).
The command will fail if a depedency is unavailable in the cache.
The command will fail if a dependency is unavailable in the cache.
.RE
.sp
\-q, \-\-quiet
Expand Down Expand Up @@ -242,7 +242,7 @@ or the current directory.
.sp
SHARDS_INSTALL_PATH
.RS 4
Defines the location where dependecies are installed.
Defines the location where dependencies are installed.
Defaults to \fIlib\fP.
.RE
.sp
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/outdated_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ describe "outdated" do
end

describe "non-release" do
describe "without relases" do
describe "without releases" do
it "latest any" do
with_shard({dependencies: {missing: "*"}}, {missing: "0.1.0+git.commit.#{git_commits("missing").first}"}) do
run "shards install"
Expand Down

0 comments on commit abcfeab

Please sign in to comment.