<commit_before>#! /bin/bash
set -eu
./change-scala-versions.sh 2.11 # should be idempotent, this is the default
mvn "$@"
./change-scala-versions.sh 2.10
mvn "$@"
./change-scala-versions.sh 2.11 #back to default<commit_msg> Only rebuild needed modules between different scala version builds (#1784)<commit_after>#! /bin/bash
BASEDIR=$(dirname $(readlink -f "$0"))

function whatchanged() {
    cd $BASEDIR
    for i in $(git status -s --porcelain -- $(find ./ -mindepth 2 -name pom.xml)|awk '{print $2}'); do
	echo $(dirname $i)
	cd $BASEDIR
    done
}

set -eu
./change-scala-versions.sh 2.11 # should be idempotent, this is the default
mvn "$@"
./change-scala-versions.sh 2.10
mvn -Dmaven.clean.skip=true -pl $(whatchanged| tr '\n' ',') -amd "$@"
./change-scala-versions.sh 2.11 #back to default
{'fraction_non_alphanumeric': 0.1721105527638191, 'fraction_numerical': 0.031407035175879394, 'mean_word_length': 3.5804597701149423, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, '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': '7222207', 'n_tokens_mistral': 310, 'n_tokens_neox': 279, 'n_words': 88}