<commit_before>#!/bin/sh

# environment
JAVA_LIB_PATH="../../lib"
export CLASSPATH="bin:../../lib/tightdb.jar:../lib-sqlite/sqlite4java.jar"
mkdir -p $(pwd)/bin
mkdir -p $(pwd)/generated

# compile
JAVAC=$(which javac)
if [ -n "$JAVAC" ]; then
    echo "compiling ..."
    FILES="com/tightdb/examples/tutorial/tutorial.java"
    for f in $FILES; do
        javac \
            -sourcepath "src" \
            -target 1.6 -g:none \
            -processor com.tightdb.generator.CodeGenProcessor \
            -processorpath "../../lib/tightdb-devkit.jar" \
            -s "generated" -proc:only -source 1.6 \
            "src/$f" > /dev/null 2>&1
    done

    for f in $FILES; do
        javac \
            -d "bin" \
            -classpath $CLASSPATH \
            -sourcepath "src:generated" \
            -target 1.6 \
            -g:source,line,vars \
            -source 1.6 \
            "src/$f" > /dev/null 2>&1
    done
fi

echo "running ..."
java -Djava.library.path=$JAVA_LIB_PATH \
    com.tightdb.examples.tutorial.tutorial<commit_msg>More fixes<commit_after>#!/bin/sh

# environment

# FIXME: This one is not working. The idea was that this test should be able to run without requiring installation of core library and Java language binding. It looks like the problem is in out custom class loader. Due to this problem, the example fails unless installation has been performed first.
JAVA_LIB_PATH="$(pwd)/../lib"


export CLASSPATH="bin:../lib/tightdb.jar:../lib-sqlite/sqlite4java.jar"
mkdir "bin"
mkdir "generated"

# compile
JAVAC=$(which javac)
if [ -n "$JAVAC" ]; then
    echo "compiling ..."
    FILES="com/tightdb/examples/tutorial/tutorial.java"
    for f in $FILES; do
        javac \
            -sourcepath "src" \
            -target 1.6 -g:none \
            -processor com.tightdb.generator.CodeGenProcessor \
            -processorpath "../lib/tightdb-devkit.jar" \
            -s "generated" -proc:only -source 1.6 \
            "src/$f"
    done

    for f in $FILES; do
        javac \
            -d "bin" \
            -sourcepath "src:generated" \
            -target 1.6 \
            -source 1.6 \
            "src/$f"
    done
fi

echo "running ..."
java -Djava.library.path=$JAVA_LIB_PATH \
    com.tightdb.examples.tutorial.tutorial
{'fraction_non_alphanumeric': 0.13808267370272648, 'fraction_numerical': 0.009674582233948988, 'mean_word_length': 1.8870558375634519, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '6423885', 'n_tokens_mistral': 792, 'n_tokens_neox': 734, 'n_words': 186}