<commit_before>import os
import sys
import shutil
import time

################################################################################
# This script is used to build documentation for IRIDA for deployment.  It will
# build the IRIDA javadoc and transfer all the documentation directories to an
# external documentation repository.  See below for usage.
################################################################################

# If no args, print usage statement
if len(sys.argv) == 1:
    print("IRIDA documentation deployment script.")
    print("Usage: build-docs.py TARGET_DIRECTORY")
    print("TARGET_DIRECTORY should be the 'irida-documentation/docs' directory")
    exit(0)

pom_file = 'pom.xml'
result_dir = sys.argv[1]
doc_dir = 'doc/'

# Check if we're in the irida directory
if not os.path.exists(pom_file):
    print("Cannot find pom file.  This script must be run in the base directory of the IRIDA repository.")
    exit(1)

if not os.path.isdir(doc_dir):
    print("Cannot find `/doc` directory.  This script must be run in the base directory of the IRIDA repository.")
    exit(1)

# check if the argument is the irida-documentation/docs directory
if not (result_dir.endswith('docs') or result_dir.endswith('docs/')) or not os.path.isdir(result_dir):
    print("The target directory doesn't appear to be the irida-documentation repository's `/docs` directory.")
    exit(1)

# first generate the Open API file
print("========== Generating the Open API file")
retval = os.system('./gradlew clean generateOpenApiDocs -Dspring.profiles.active=dev,swagger -DskipTests=true -Dliquibase.update.database.schema=false')

# ensure it generated correctly
if retval != 0:
    print("========== Open API file generation failed.  See above for error messages")
    exit(1)

# second run mvn site to build the javadoc
print("========== Building documentation pages")
retval = os.system('./gradlew clean javadoc')

# ensure it built correctly
if retval != 0:
    print("========== Docs construction failed.  See above for error messages")
    exit(1)<commit_msg>remove mvn reference in build-docs.py<commit_after>import os
import sys
import shutil
import time

################################################################################
# This script is used to build documentation for IRIDA for deployment.  It will
# build the IRIDA javadoc and transfer all the documentation directories to an
# external documentation repository.  See below for usage.
################################################################################

# If no args, print usage statement
if len(sys.argv) == 1:
    print("IRIDA documentation deployment script.")
    print("Usage: build-docs.py TARGET_DIRECTORY")
    print("TARGET_DIRECTORY should be the 'irida-documentation/docs' directory")
    exit(0)

pom_file = 'pom.xml'
result_dir = sys.argv[1]
doc_dir = 'doc/'

# Check if we're in the irida directory
if not os.path.exists(pom_file):
    print("Cannot find pom file.  This script must be run in the base directory of the IRIDA repository.")
    exit(1)

if not os.path.isdir(doc_dir):
    print("Cannot find `/doc` directory.  This script must be run in the base directory of the IRIDA repository.")
    exit(1)

# check if the argument is the irida-documentation/docs directory
if not (result_dir.endswith('docs') or result_dir.endswith('docs/')) or not os.path.isdir(result_dir):
    print("The target directory doesn't appear to be the irida-documentation repository's `/docs` directory.")
    exit(1)

# first generate the Open API file
print("========== Generating the Open API file")
retval = os.system('./gradlew clean generateOpenApiDocs -Dspring.profiles.active=dev,swagger -DskipTests=true -Dliquibase.update.database.schema=false')

# ensure it generated correctly
if retval != 0:
    print("========== Open API file generation failed.  See above for error messages")
    exit(1)

# second run gradle javadoc to build the javadoc
print("========== Building documentation pages")
retval = os.system('./gradlew clean javadoc')

# ensure it built correctly
if retval != 0:
    print("========== Docs construction failed.  See above for error messages")
    exit(1)
{'fraction_non_alphanumeric': 0.17986641221374045, 'fraction_numerical': 0.004770992366412214, 'mean_word_length': 4.831710709318498, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '7434403', 'n_tokens_mistral': 1177, 'n_tokens_neox': 1105, 'n_words': 439}