Skip to content

Commit

Permalink
chore: Update Makefile to use release corpus tarballs.
Browse files Browse the repository at this point in the history
  • Loading branch information
reiniscirpons committed May 26, 2024
1 parent f56a710 commit 6d441c7
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
CORPUS_VERSION=v4.13.0
EXAMPLES_DIR=./examples
RELEASE_PREFIX=https://github.com/gap-system/tree-sitter-gap/releases/download

.PHONY: compile format corpus test_quick test_gap test_pkg test_all clean distclean

Expand All @@ -14,15 +15,17 @@ corpus:
mv ./temp_extract_corpus/corpus_gap.tar.gz $(EXAMPLES_DIR)/corpus_gap_$(CORPUS_VERSION).tar.gz
mv ./temp_extract_corpus/corpus_pkg.tar.gz $(EXAMPLES_DIR)/corpus_pkg_$(CORPUS_VERSION).tar.gz

# TODO: Eventually change this to download the tarball from a github release
$(EXAMPLES_DIR)/corpus_gap_$(CORPUS_VERSION).tar.gz: corpus
$(EXAMPLES_DIR)/corpus_pkg_$(CORPUS_VERSION).tar.gz: corpus
$(EXAMPLES_DIR)/corpus_gap_$(CORPUS_VERSION).tar.gz:
curl -L $(RELEASE_PREFIX)/v0.2.0/corpus_gap_$(CORPUS_VERSION).tar.gz > $(EXAMPLES_DIR)/corpus_gap_$(CORPUS_VERSION).tar.gz

$(EXAMPLES_DIR)/temp_corpus_gap_$(CORPUS_VERSION):
$(EXAMPLES_DIR)/corpus_pkg_$(CORPUS_VERSION).tar.gz:
curl -L $(RELEASE_PREFIX)/v0.2.0/corpus_pkg_$(CORPUS_VERSION).tar.gz > $(EXAMPLES_DIR)/corpus_pkg_$(CORPUS_VERSION).tar.gz

$(EXAMPLES_DIR)/temp_corpus_gap_$(CORPUS_VERSION): $(EXAMPLES_DIR)/corpus_gap_$(CORPUS_VERSION).tar.gz
mkdir -p $(EXAMPLES_DIR)/temp_corpus_gap_$(CORPUS_VERSION)
tar -xzf $(EXAMPLES_DIR)/corpus_gap_$(CORPUS_VERSION).tar.gz -C $(EXAMPLES_DIR)/temp_corpus_gap_$(CORPUS_VERSION)

$(EXAMPLES_DIR)/temp_corpus_pkg_$(CORPUS_VERSION):
$(EXAMPLES_DIR)/temp_corpus_pkg_$(CORPUS_VERSION): $(EXAMPLES_DIR)/corpus_pkg_$(CORPUS_VERSION).tar.gz
mkdir -p $(EXAMPLES_DIR)/temp_corpus_pkg_$(CORPUS_VERSION)
tar -xzf $(EXAMPLES_DIR)/corpus_pkg_$(CORPUS_VERSION).tar.gz -C $(EXAMPLES_DIR)/temp_corpus_pkg_$(CORPUS_VERSION)

Expand All @@ -45,6 +48,6 @@ clean:
rm -rf $(EXAMPLES_DIR)/temp_*

distclean: clean
rm $(EXAMPLES_DIR)/corpus_gap_*.tar.gz
rm $(EXAMPLES_DIR)/corpus_pkg_*.tar.gz
rm -f $(EXAMPLES_DIR)/corpus_gap_*.tar.gz
rm -f $(EXAMPLES_DIR)/corpus_pkg_*.tar.gz
rm -rf ./temp_*

0 comments on commit 6d441c7

Please sign in to comment.