<commit_before>VERSION=$(shell cat VERSION)
NAME=vocab-$(VERSION)
JAR=target/$(NAME).jar
RES=src/test/resources
HTML=html
DIST=target/vocab

help:
	@echo
	@echo "Available goals are:"
	@echo
	@echo "      clean : Removes all artifacts from previous builds."
	@echo "        jar : Creates the vocab-$(VERSION).jar file."
	@echo "    release : Creates and zips the startup script and jar file."
	@echo "    install : Copies the jar and startup script to the user's bin directory."
	@echo "     upload : Uploads the zip files to the ANC web server."
	@echo "       help : Displays this help message."
	@echo

jar:
	mvn package

clean:
	mvn clean

install:
	cp $(JAR) $(HOME)/bin
	cat $(RES)/vocab | sed 's|__JAR__|vocab-$(VERSION).jar|' > $(HOME)/bin/vocab
	if [ -d ../../Lappsgrid/vocab ]; then cp $(JAR) ../../Lappsgrid/vocab/bin; fi
	if [ -d ../../Lappsgrid/vocab ]; then cp $(HOME)/bin/vocab ../../Lappsgrid/vocab/bin; fi

debug:
	@echo "Current version is $(VERSION)"

release:
	if [ ! -f $(JAR) ] ; then mvn clean package ; fi
	if [ -d $(DIST) ] ; then rm -rf $(DIST) ; fi
	if [ -f target/$(NAME).zip ] ; then rm target/$(NAME).zip ; fi
	if [ -f target/vocab-latest.zip ] ; then rm target/vocab-latest.zip ; fi
	mkdir $(DIST)
	cat $(RES)/vocab | sed 's|__JAR__|vocab-$(VERSION).jar|' > $(DIST)/vocab
	chmod u+x $(DIST)/vocab
#	cp $(RES)/lapps.vocab $(DIST)
#	cp $(RES)/*.groovy $(DIST)
#	cp -r $(HTML) $(DIST)
	cp $(JAR) $(DIST)
	cd target ; zip -r vocab vocab ; cp vocab.zip $(NAME).zip ; mv vocab.zip vocab-latest.zip
	echo "Release ready."

upload:
	if [ -e target/$(NAME).zip ] ; then scp -P 22022 target/$(NAME).zip <EMAIL>:/home/www/anc/downloads ; fi
	if [ -e target/vocab-latest.zip ] ; then scp -P 22022 target/vocab-latest.zip <EMAIL>:/home/www/anc/downloads ; fi
	echo "Upload complete."
<commit_msg>Enable GitHub PR during a release.<commit_after>VERSION=$(shell cat VERSION)
NAME=vocab-$(VERSION)
JAR=target/$(NAME).jar
RES=src/test/resources
HTML=html
DIST=target/vocab

help:
	@echo
	@echo "Available goals are:"
	@echo
	@echo "      clean : Removes all artifacts from previous builds."
	@echo "        jar : Creates the vocab-$(VERSION).jar file."
	@echo "    release : Creates and zips the startup script and jar file."
	@echo "    install : Copies the jar and startup script to the user's bin directory."
	@echo "     upload : Uploads the zip files to the ANC web server."
	@echo "       help : Displays this help message."
	@echo

jar:
	mvn package

clean:
	mvn clean

install:
	cp $(JAR) $(HOME)/bin
	cat $(RES)/vocab | sed 's|__JAR__|vocab-$(VERSION).jar|' > $(HOME)/bin/vocab
	#if [ -d ../../Lappsgrid/vocab ]; then cp $(JAR) ../../Lappsgrid/vocab/bin; fi
	#if [ -d ../../Lappsgrid/vocab ]; then cp $(HOME)/bin/vocab ../../Lappsgrid/vocab/bin; fi

debug:
	@echo "Current version is $(VERSION)"

ifeq ($(TOKEN),)
release:
	@echo "Please set TOKEN with your GitHub token."
else
release:
	if [ ! -f $(JAR) ] ; then mvn clean package ; fi
	if [ -d $(DIST) ] ; then rm -rf $(DIST) ; fi
	if [ -f target/$(NAME).zip ] ; then rm target/$(NAME).zip ; fi
	if [ -f target/vocab-latest.zip ] ; then rm target/vocab-latest.zip ; fi
	mkdir $(DIST)
	cat $(RES)/vocab | sed 's|__JAR__|vocab-$(VERSION).jar|' > $(DIST)/vocab
	chmod u+x $(DIST)/vocab
	cp $(JAR) $(DIST)
	cd target ; zip -r vocab vocab ; cp vocab.zip $(NAME).zip ; mv vocab.zip vocab-latest.zip
	ghc -f vocabulary.commit -t $(TOKEN)
	echo "Release ready."
endif

upload:
	if [ -e target/$(NAME).zip ] ; then scp -P 22022 target/$(NAME).zip anc.org:/home/www/anc/downloads ; fi
	if [ -e target/vocab-latest.zip ] ; then scp -P 22022 target/vocab-latest.zip anc.org:/home/www/anc/downloads ; fi
	echo "Upload complete."

{'fraction_non_alphanumeric': 0.17312381468436738, 'fraction_numerical': 0.00541858574911948, 'mean_word_length': 3.2583621683967703, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7067116', 'n_tokens_mistral': 1457, 'n_tokens_neox': 1398, 'n_words': 415}