<commit_before>GRADLE ?= gradle
GIT    ?= git
PATCH  ?= patch
JAVA   ?= java

SOURCE_FILES = $(shell find src/main -type f)


all: src/main/jastadd/PrettyPrint.jadd | extendj/build.gradle
	$(GRADLE) check >gradle.log
	@echo
	@echo
	@echo -e "\e[32mjastics.jar built successfully!\e[0m"
	@echo
	@echo -e 'You can try running some examples now:'
	@echo
	@for file in examples/*.java examples/WineSearch; do \
		name="$$(basename $$file | sed s/\.java//)"; \
		echo -e "\e[36m - make $$name.example\e[0m"; \
	done
	@echo
	@echo


test: src/main/jastadd/PrettyPrint.jadd | extendj/build.gradle
	$(GRADLE) cleanTest check

jastics.jar: src/main/jastadd/PrettyPrint.jadd $(SOURCE_FILES) build.gradle | extendj/build.gradle
	$(GRADLE) jar

extendj/build.gradle:
	$(GIT) submodule update --init
	$(PATCH) -p0 <patches/java4.patch
	$(PATCH) -p0 <patches/java5.patch


WineSearch.example: examples/WineSearch jastics.jar
	-$(MAKE) -C $<

%.example: examples/%.class jastics.jar
	$(JAVA) -cp examples:jastics.jar $*

examples/%.class: examples/%.java jastics.jar
	$(JAVA) -jar jastics.jar $< -cp jastics.jar


src/main/jastadd/PrettyPrint.jadd: src/main/pretty-print/SemanticsPrettyPrint.tt | aspectgen/aspectgen.jar
	$(JAVA) -jar aspectgen/aspectgen.jar -aspect SemanticsPrettyPrint $< > $@

aspectgen/aspectgen.jar: | aspectgen
	cd aspectgen && $(GRADLE) jar

aspectgen:
	$(GIT) clone --recursive 'https://bitbucket.org/joqvist/aspectgen'


gradle-wrapper: gradle gradlew gradlew.bat

clean-gradle-wrapper:
	rm -rf gradle gradlew gradlew.bat

gradle: extendj/gradle
	cp -r $< $@

gradlew: extendj/gradlew
	cp $< $@

gradlew.bat: extendj/gradlew.bat
	cp $< $@


clean:
	$(GRADLE) clean
	rm -f examples/*.class gradle.log
	$(MAKE) -C examples/WineSearch clean

realclean: clean
	rm -f jastics.jar
	$(MAKE) -C examples/WineSearch realclean


.PHONY: all test gradle-wrapper clean-gradle-wrapper clean realclean
.PRECIOUS: examples/%.class
<commit_msg>Remove gradle wrapper targets from Makefile<commit_after>GRADLE ?= gradle
GIT    ?= git
PATCH  ?= patch
JAVA   ?= java

SOURCE_FILES = $(shell find src/main -type f)


all: src/main/jastadd/PrettyPrint.jadd | extendj/build.gradle
	$(GRADLE) check >gradle.log
	@echo
	@echo
	@echo -e "\e[32mjastics.jar built successfully!\e[0m"
	@echo
	@echo -e 'You can try running some examples now:'
	@echo
	@for file in examples/*.java examples/WineSearch; do \
		name="$$(basename $$file | sed s/\.java//)"; \
		echo -e "\e[36m - make $$name.example\e[0m"; \
	done
	@echo
	@echo


test: src/main/jastadd/PrettyPrint.jadd | extendj/build.gradle
	$(GRADLE) cleanTest check

jastics.jar: src/main/jastadd/PrettyPrint.jadd $(SOURCE_FILES) build.gradle | extendj/build.gradle
	$(GRADLE) jar

extendj/build.gradle:
	$(GIT) submodule update --init
	$(PATCH) -p0 <patches/java4.patch
	$(PATCH) -p0 <patches/java5.patch


WineSearch.example: examples/WineSearch jastics.jar
	-$(MAKE) -C $<

%.example: examples/%.class jastics.jar
	$(JAVA) -cp examples:jastics.jar $*

examples/%.class: examples/%.java jastics.jar
	$(JAVA) -jar jastics.jar $< -cp jastics.jar


src/main/jastadd/PrettyPrint.jadd: src/main/pretty-print/SemanticsPrettyPrint.tt | aspectgen/aspectgen.jar
	$(JAVA) -jar aspectgen/aspectgen.jar -aspect SemanticsPrettyPrint $< > $@

aspectgen/aspectgen.jar: | aspectgen
	cd aspectgen && $(GRADLE) jar

aspectgen:
	$(GIT) clone --recursive 'https://bitbucket.org/joqvist/aspectgen'


clean:
	$(GRADLE) clean
	rm -f examples/*.class gradle.log
	$(MAKE) -C examples/WineSearch clean

realclean: clean
	rm -f jastics.jar
	$(MAKE) -C examples/WineSearch realclean


.PHONY: all test clean realclean
.PRECIOUS: examples/%.class

{'fraction_non_alphanumeric': 0.14950711938663747, 'fraction_numerical': 0.00547645125958379, 'mean_word_length': 3.997264021887825, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '3236540', 'n_tokens_mistral': 1519, 'n_tokens_neox': 1394, 'n_words': 317}