<commit_before>#!/bin/bash

set -e

GHC_VER=7.6.3
CABAL_VER=1.20
IDEA_VERSION=13.1.2
IDEA_TAR=ideaIC-${IDEA_VERSION}.tar.gz

echo "Installing ghc $GHC_VER and cabal-install $CABAL_VER"
sudo add-apt-repository -y ppa:hvr/ghc
sudo apt-get update
sudo apt-get install cabal-install-$CABAL_VER ghc-$GHC_VER

export PATH=/opt/ghc/$GHC_VER/bin:/opt/cabal/$CABAL_VER/bin:$PATH

if [ -z $(which cabal) ]; then
    echo "Could not find cabal on the path."
    exit 1
fi

if [ -f ~/$IDEA_TAR ]; then
    echo "Copying existing IDEA archive."
    cp ~/$IDEA_TAR .
else
    echo "Downloading IDEA archive."
    wget http://download.jetbrains.com/idea/$IDEA_TAR -P ~
    echo "Copying IDEA archive."
    cp ~/$IDEA_TAR .
fi

echo "Removing existing IDEA installation."
rm -rf idea-IC-*

echo "Installing IDEA to idea-IC/"
tar zxf $IDEA_TAR
rm -rf $IDEA_TAR
mv idea-IC-* idea-IC

echo "Creating build.properties file for ant."
echo "idea.home=$(pwd)/idea-IC" > build.properties

echo "Install parser helper."
git clone https://github.com/pjonsson/parser-helper
cd parser-helper
cabal sandbox init
cabal update
cabal install
export PATH=$(pwd)/.cabal-sandbox/bin:$PATH
cd ..

if [ -z $(which parser-helper) ]; then
    echo "Could not find parser-helper on the path."
    exit 1
fi

echo "Starting ant build."
ant<commit_msg>Updated travis to install happy.<commit_after>#!/bin/bash

set -e

GHC_VER=7.6.3
CABAL_VER=1.20
HAPPY_VER=1.19.3
IDEA_VERSION=13.1.2
IDEA_TAR=ideaIC-${IDEA_VERSION}.tar.gz

echo "Installing ghc $GHC_VER, cabal-install $CABAL_VER, happy $HAPPY_VER"
sudo add-apt-repository -y ppa:hvr/ghc
sudo apt-get update
sudo apt-get install cabal-install-$CABAL_VER ghc-$GHC_VER happy-$HAPPY_VER

export PATH=/opt/happy/$HAPPY_VER/bin:/opt/ghc/$GHC_VER/bin:/opt/cabal/$CABAL_VER/bin:$PATH

if [ -z $(which cabal) ]; then
    echo "Could not find cabal on the path."
    exit 1
fi

if [ -z $(which happy) ]; then
    echo "Could not find happy on the path."
    exit 1
fi

echo "Install parser helper."
git clone https://github.com/pjonsson/parser-helper
cd parser-helper
cabal sandbox init
cabal update
cabal install
export PATH=$(pwd)/.cabal-sandbox/bin:$PATH
cd ..

if [ -z $(which parser-helper) ]; then
    echo "Could not find parser-helper on the path."
    exit 1
fi

if [ -f ~/$IDEA_TAR ]; then
    echo "Copying existing IDEA archive."
    cp ~/$IDEA_TAR .
else
    echo "Downloading IDEA archive."
    wget http://download.jetbrains.com/idea/$IDEA_TAR -P ~
    echo "Copying IDEA archive."
    cp ~/$IDEA_TAR .
fi

echo "Removing existing IDEA installation."
rm -rf idea-IC-*

echo "Installing IDEA to idea-IC/"
tar zxf $IDEA_TAR
rm -rf $IDEA_TAR
mv idea-IC-* idea-IC

echo "Creating build.properties file for ant."
echo "idea.home=$(pwd)/idea-IC" > build.properties

echo "Starting ant build."
ant
{'fraction_non_alphanumeric': 0.12941176470588237, 'fraction_numerical': 0.01033868092691622, 'mean_word_length': 3.56260162601626, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3887295', 'n_tokens_mistral': 1135, 'n_tokens_neox': 1080, 'n_words': 304}