<commit_before>#!/bin/sh
trap 'echo PACK FAILED!; exit 1' ERR
SELF=`echo $0 | sed 's/\\\\/\\//g'`
cd "`dirname "$SELF"`" || exit 1
PATH="Stuff:$PATH"
OUT="upload"

# Detect version
if [ -n "$RELEASE_VERSION" ]; then
    VERSION="$RELEASE_VERSION"
else
    VERSION=$(cat VERSION.txt)"-local"
fi

# Detect revision
if [ -n "$BUILD_VCS_NUMBER" ]; then
    REVISION=`echo "$BUILD_VCS_NUMBER" | cut -c1-7`
else
    REVISION=`git rev-parse --short HEAD`
fi

# Detect branch
if [ -z "$BRANCH" ]; then
    BRANCH=`git rev-parse --abbrev-ref HEAD`
fi

# Disable suffix on release branches, otherwise
# use commit SHA as prerelease suffix
case $BRANCH in
release-*)
    SUFFIX=
    ;;
master)
    SUFFIX="--suffix=master-$REVISION"
    ;;
*)
    SUFFIX="--suffix=dev-$REVISION"
    ;;
esac

stuff install Stuff
bash Stuff/Devtools/update-version-numbers.sh --verify
uno doctor --configuration=Release

# Make packages
for f in Source/*; do
    name=`basename "$f"`
    project=$f/$name.unoproj
    if [ -f "$project" ]; then
        uno pack "$project" \
            --out-dir="$OUT" \
            $SUFFIX
    fi
done

stuff pack ProjectTemplates \
    --name=ProjectTemplates \
    --suffix=-$VERSION \
    --output-dir=ProjectTemplatesUpload

stuff pack Tests/AutomaticTestApp \
    --name=AutomaticTestApp \
    --suffix=-$VERSION \
    --output-dir=AutomaticTestAppUpload

# Build standalone release
mkdir -p release
rm -rf release/*

echo "Copying files to release/"<commit_msg>Make stuff/uno pack use same versioning scheme<commit_after>#!/bin/sh
trap 'echo PACK FAILED!; exit 1' ERR
SELF=`echo $0 | sed 's/\\\\/\\//g'`
cd "`dirname "$SELF"`" || exit 1
PATH="Stuff:$PATH"
OUT="upload"

VERSION=$(cat VERSION.txt)

# Detect revision
if [ -n "$BUILD_VCS_NUMBER" ]; then
    REVISION=`echo "$BUILD_VCS_NUMBER" | cut -c1-7`
else
    REVISION=`git rev-parse --short HEAD`
fi

# Detect branch
if [ -z "$BRANCH" ]; then
    BRANCH=`git rev-parse --abbrev-ref HEAD`
fi

# Disable suffix on release branches, otherwise
# use commit SHA as prerelease suffix
case $BRANCH in
release-*)
    UNO_SUFFIX=
    STUFF_SUFFIX="--suffix=-$VERSION"
    ;;
master)
    UNO_SUFFIX="--suffix=master-$REVISION"
    STUFF_SUFFIX="--suffix=-$VERSION-master-$REVISION"
    ;;
*)
    UNO_SUFFIX="--suffix=dev-$REVISION"
    STUFF_SUFFIX="--suffix=-$VERSION-dev-$REVISION"
    ;;
esac

stuff install Stuff
bash Stuff/Devtools/update-version-numbers.sh --verify
uno doctor --configuration=Release

# Make packages
for f in Source/*; do
    name=`basename "$f"`
    project=$f/$name.unoproj
    if [ -f "$project" ]; then
        uno pack "$project" \
            --out-dir="$OUT" \
            $UNO_SUFFIX
    fi
done

stuff pack ProjectTemplates \
    --name=ProjectTemplates \
    $STUFF_SUFFIX \
    --output-dir=ProjectTemplatesUpload

stuff pack Tests/AutomaticTestApp \
    --name=AutomaticTestApp \
    $STUFF_SUFFIX \
    --output-dir=AutomaticTestAppUpload

# Build standalone release
mkdir -p release
rm -rf release/*

echo "Copying files to release/"
{'fraction_non_alphanumeric': 0.14800132144037, 'fraction_numerical': 0.003303600925008259, 'mean_word_length': 3.0808625336927222, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7667341', 'n_tokens_mistral': 1125, 'n_tokens_neox': 1061, 'n_words': 267}