<commit_before>####
#### Testing and release procedures for AmiGO JS.
####
#### A report-mistakes-only testing run can be done as:
####   make test | grep -i fail
####

TESTS = $(wildcard javascript/lib/amigo/*.js.tests) \
 $(wildcard javascript/lib/amigo/data/*.js.tests) \
 $(wildcard javascript/lib/amigo/ui/*.js.tests) \
 $(wildcard javascript/lib/amigo/handler/*.js.tests)
#BENCHMARKS = $(wildcard _benchmark/*.js)
METADATA = $(wildcard metadata/*.yaml)
JS = rhino # or smjs
JSFLAGS = -opt -1
#JSENGINES = node smjs rhino
BBOP_JS = ../bbop-js/

all:
	@echo "Default JS engine: $(JS)"
	@echo "See: http://wiki.geneontology.org/index.php/AmiGO_Manual:_Installation_2.0"
	@echo "for more details."
#	@echo "All JS engines: $(JSENGINES)"
#	@echo "Try make: 'test', 'docs', 'install', 'bundle', 'data', or 'release'"

###
### Tests.
###

.PHONY: test $(TESTS)
test: $(TESTS)
$(TESTS): bundle
	echo "trying: $@"
	cd $(@D) && $(JS) $(JSFLAGS) -f $(@F)

###
### Check the metadata using kwalify.
###

.PHONY: check_metadata $(METADATA)
check_metadata: $(METADATA)
$(METADATA):
	kwalify -f ./scripts/schema.yaml $@

###
### Just the exit code results of the tests.
###

.PHONY: pass
pass: check_metadata
	make test | grep -i fail; test $$? -ne 0

###
### Documentation for JavaScript and Perl modules.
###

.PHONY: docs
docs:
	naturaldocs --rebuild-output --input ./javascript/lib/amigo --project javascript/docs/.naturaldocs_project/ --output html javascript/docs/
	naturaldocs --rebuild-output --input ./perl/lib/ --project perl/docs/.naturaldocs_project/ --output html perl/docs

###
### Create exportable JS bundle. Only captures the statistics data if
### it has been generated separately.
###

.PHONY: bundle
bundle:
	./install -b

.PHONY: bundle-uncompressed
bundle-uncompressed:
	./install -b -u

###
### Produce static statistics data files for landing page.
###

.PHONY: data

data:
	cd ./javascript/bin/; rhino -opt -1 ./generate_static_data.js --ann-source >../../staging/ann-source.dat; rhino -opt -1 ./generate_static_data.js --ann-evidence >../../staging/ann-evidence.dat; rhino -opt -1 ./generate_static_data.js --ann-overview >../../staging/ann-overview.dat

###
### Installation.
###

.PHONY: install
install: test docs
	./install -v -e -g

## This target skips testing.
.PHONY: install-uncompressed
install-uncompressed: docs
	./install -v -e -g -u

###
### Copy in some dummy values for use with testing.
###

.PHONY: dummy

dummy:
	cp conf/.dummy_values.yaml conf/amigo.yaml

###
### Release: docs and bundle; then to an upload.
###

.PHONY: release
release: bundle docs
	s3cmd -P put javascript/staging/amigo*.js s3://bbop/jsapi/

###
### Ctags file for development.
###

.PHONY: tags
tags:
	@echo "Using BBOP-JS at: $(BBOP_JS)"
	rm -f TAGS
	find ./perl/lib ./javascript/lib/amigo $(BBOP_JS)/lib/bbop | grep ".*\.\(js\|pm\)$$" | xargs ctags -e -a

###
### Refresh the bundle in BBOP JS and install.
### Copy the bundle over for easy use by our tests.
###

.PHONY: refresh
refresh: tags bundle
	@echo "Using BBOP-JS at: $(BBOP_JS)"
	cd $(BBOP_JS); make bundle
	cp $(BBOP_JS)/staging/bbop.js ./_data
	cp ./javascript/lib/amigo/data/*.js $(BBOP_JS)/_data/
	cp ./javascript/lib/amigo/data/golr.js $(BBOP_JS)/demo/
	./install -v -e -g
	./scripts/blank-kvetch.pl

###
### Essentially a lite refresh for when working on or testing HTML,
### CSS, etc.
###

.PHONY: rollout
rollout:
	./install -v -e -g
	./scripts/blank-kvetch.pl
<commit_msg>i believe that the data target is no longer used<commit_after>####
#### Testing and release procedures for AmiGO JS.
####
#### A report-mistakes-only testing run can be done as:
####   make test | grep -i fail
####

TESTS = $(wildcard javascript/lib/amigo/*.js.tests) \
 $(wildcard javascript/lib/amigo/data/*.js.tests) \
 $(wildcard javascript/lib/amigo/ui/*.js.tests) \
 $(wildcard javascript/lib/amigo/handler/*.js.tests)
#BENCHMARKS = $(wildcard _benchmark/*.js)
METADATA = $(wildcard metadata/*.yaml)
JS = rhino # or smjs
JSFLAGS = -opt -1
#JSENGINES = node smjs rhino
BBOP_JS = ../bbop-js/

all:
	@echo "Default JS engine: $(JS)"
	@echo "See: http://wiki.geneontology.org/index.php/AmiGO_Manual:_Installation_2.0"
	@echo "for more details."
#	@echo "All JS engines: $(JSENGINES)"
#	@echo "Try make: 'test', 'docs', 'install', 'bundle', 'data', or 'release'"

###
### Tests.
###

.PHONY: test $(TESTS)
test: $(TESTS)
$(TESTS): bundle
	echo "trying: $@"
	cd $(@D) && $(JS) $(JSFLAGS) -f $(@F)

###
### Check the metadata using kwalify.
###

.PHONY: check_metadata $(METADATA)
check_metadata: $(METADATA)
$(METADATA):
	kwalify -f ./scripts/schema.yaml $@

###
### Just the exit code results of the tests.
###

.PHONY: pass
pass: check_metadata
	make test | grep -i fail; test $$? -ne 0

###
### Documentation for JavaScript and Perl modules.
###

.PHONY: docs
docs:
	naturaldocs --rebuild-output --input ./javascript/lib/amigo --project javascript/docs/.naturaldocs_project/ --output html javascript/docs/
	naturaldocs --rebuild-output --input ./perl/lib/ --project perl/docs/.naturaldocs_project/ --output html perl/docs

###
### Create exportable JS bundle. Only captures the statistics data if
### it has been generated separately.
###

.PHONY: bundle
bundle:
	./install -b

.PHONY: bundle-uncompressed
bundle-uncompressed:
	./install -b -u

# ###
# ### Produce static statistics data files for landing page.
# ###

# .PHONY: data

# data:
# 	cd ./javascript/bin/; rhino -opt -1 ./generate_static_data.js --ann-source >../../staging/ann-source.dat; rhino -opt -1 ./generate_static_data.js --ann-evidence >../../staging/ann-evidence.dat; rhino -opt -1 ./generate_static_data.js --ann-overview >../../staging/ann-overview.dat

###
### Installation.
###

.PHONY: install
install: test docs
	./install -v -e -g

## This target skips testing.
.PHONY: install-uncompressed
install-uncompressed: docs
	./install -v -e -g -u

###
### Copy in some dummy values for use with testing.
###

.PHONY: dummy

dummy:
	cp conf/.dummy_values.yaml conf/amigo.yaml

###
### Release: docs and bundle; then to an upload.
###

.PHONY: release
release: bundle docs
	s3cmd -P put javascript/staging/amigo*.js s3://bbop/jsapi/

###
### Ctags file for development.
###

.PHONY: tags
tags:
	@echo "Using BBOP-JS at: $(BBOP_JS)"
	rm -f TAGS
	find ./perl/lib ./javascript/lib/amigo $(BBOP_JS)/lib/bbop | grep ".*\.\(js\|pm\)$$" | xargs ctags -e -a

###
### Refresh the bundle in BBOP JS and install.
### Copy the bundle over for easy use by our tests.
###

.PHONY: refresh
refresh: tags bundle
	@echo "Using BBOP-JS at: $(BBOP_JS)"
	cd $(BBOP_JS); make bundle
	cp $(BBOP_JS)/staging/bbop.js ./_data
	cp ./javascript/lib/amigo/data/*.js $(BBOP_JS)/_data/
	cp ./javascript/lib/amigo/data/golr.js $(BBOP_JS)/demo/
	./install -v -e -g
	./scripts/blank-kvetch.pl

###
### Essentially a lite refresh for when working on or testing HTML,
### CSS, etc.
###

.PHONY: rollout
rollout:
	./install -v -e -g
	./scripts/blank-kvetch.pl

{'fraction_non_alphanumeric': 0.18362354295582098, 'fraction_numerical': 0.002590300762699669, 'mean_word_length': 3.4954721862871927, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6447626', 'n_tokens_mistral': 2637, 'n_tokens_neox': 2537, 'n_words': 727}