<commit_before>#!/bin/bash

# author: <NAME>
# Javadoc generator and publisher script for Nexus Engine

# highlight
HGL='\e[93m'
# end of color
NC='\033[0m' 

# adding a virtual user
git config --global user.email "<EMAIL>"
git config --global user.name "Mr. Robot"

echo -e "\n${HGL}GENERATING OF JAVA DOCS${NC}\n"

# re-create the directory for the old repo
rm -rf javadoc_old
mkdir javadoc_old

# get the Java version.
# Java 1.5 will give 15.
# Java 1.6 will give 16.
# Java 1.7 will give 17.
# Java 1.8 will give 18.
VER=`java -version 2>&1 | sed 's/java version "\(.*\)\.\(.*\)\..*"/\1\2/; 1q'`

# only when JAVA SE (Oracle JDK 8)
if [ $VER == "18" ]
then
	echo -e "\n${HGL}...looking for the nexus-engine-javadoc repo${NC}\n"
	# clone the javadoc repo to the previously created directory
	cd javadoc_old
	git clone https://DoveID:$UTOKEN@github.com/Youama/nexus-engine-javadoc.git -q &> /dev/null
	cd ..

	# remove the local javadoc static files
	rm -rf javadoc/apidocs

	echo -e "\n${HGL}...create new JAVA doc${NC}\n"
	# generate javadoc from the source code
	mvn javadoc:javadoc

	if [ -d "javadoc/apidocs" ]
	then
		# copy the old repo headers to the newly generated javadoc
		cp javadoc_old/nexus-engine-javadoc/.gitignore javadoc/apidocs/.gitignore
		cp -r javadoc_old/nexus-engine-javadoc/.git javadoc/apidocs/.git

		# remove the iframe from javadoc
		cd javadoc/apidocs
		rm index.html
		cp index-all.html index.html

		echo -e "\n${HGL}...publishing the new JAVA doc${NC}\n"
		# publish the new docusmentation
		git add .
		git add -u .
		git commit -m "Auto commit from Nexus Engine build" &> /dev/null
		git push -q &> /dev/null

		echo -e "\n${HGL}JAVA doc has been generated and buplished automatically${NC}\n\n"
		echo -e "2015 ${HGL}Nexus Engine${NC}\n"
	else
		echo -e "\n${HGL}ERROR: JAVA doc is not created${NC}\n"
	fi
fi
<commit_msg>Updates docs only when branch is master<commit_after>#!/bin/bash

# author: <NAME>
# Javadoc generator and publisher script for Nexus Engine

# get the Java version.
# Java 1.5 will give 15.
# Java 1.6 will give 16.
# Java 1.7 will give 17.
# Java 1.8 will give 18.
VER=`java -version 2>&1 | sed 's/java version "\(.*\)\.\(.*\)\..*"/\1\2/; 1q'`

# only when JAVA SE (Oracle JDK 8) and Master branch
if [ $VER == "18" ] || [ $TRAVIS_BRANCH == "master" ]
then
	# highlight
	HGL='\e[93m'
	# end of color
	NC='\033[0m' 
	
	echo -e "\n${HGL}GENERATING OF JAVA DOCS${NC}\n"
	
	# re-create the directory for the old repo
	rm -rf javadoc_old
	mkdir javadoc_old

	echo -e "\n${HGL}...looking for the nexus-engine-javadoc repo${NC}\n"
	
	# adding a virtual user
	git config --global user.email "<EMAIL>"
	git config --global user.name "Mr. Robot"

	# clone the javadoc repo to the previously created directory
	cd javadoc_old
	git clone https://DoveID:$UTOKEN@github.com/Youama/nexus-engine-javadoc.git -q &> /dev/null
	cd ..

	# remove the local javadoc static files
	rm -rf javadoc/apidocs

	echo -e "\n${HGL}...create new JAVA doc${NC}\n"
	# generate javadoc from the source code
	mvn javadoc:javadoc

	if [ -d "javadoc/apidocs" ]
	then
		# copy the old repo headers to the newly generated javadoc
		cp javadoc_old/nexus-engine-javadoc/.gitignore javadoc/apidocs/.gitignore
		cp -r javadoc_old/nexus-engine-javadoc/.git javadoc/apidocs/.git

		# remove the iframe from javadoc
		cd javadoc/apidocs
		rm index.html
		cp index-all.html index.html

		echo -e "\n${HGL}...publishing the new JAVA doc${NC}\n"
		# publish the new docusmentation
		git add .
		git add -u .
		git commit -m "Auto commit from Nexus Engine build" &> /dev/null
		git push -q &> /dev/null

		echo -e "\n${HGL}JAVA doc has been generated and buplished automatically${NC}\n\n"
		echo -e "2015 ${HGL}Nexus Engine${NC}\n"
	else
		echo -e "\n${HGL}ERROR: JAVA doc is not created${NC}\n"
	fi
fi

{'fraction_non_alphanumeric': 0.13873590348806714, 'fraction_numerical': 0.017833726724364018, 'mean_word_length': 3.205071664829107, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '2513422', 'n_tokens_mistral': 1634, 'n_tokens_neox': 1401, 'n_words': 469}