<commit_before>set -ex
cd `dirname $0`

build() {
	TARGET=$1
	# Set path
	_PATH=$PATH
	case "$TARGET" in
		"i686-pc-windows" ) 
			RUST=$TOOLS/rust-nightly-$TARGET-gnu
			export PATH=$PATH:/mingw32/bin/
			export OPENSSL_LIBS=crypto:ssl
			;;
		"x86_64-pc-windows" ) 
			RUST=$TOOLS/rust-nightly-$TARGET-gnu
			export PATH=$PATH:/mingw64/bin/
			export OPENSSL_LIBS=crypto:ssl
			;;
		* )
			RUST=
			;;
	esac
	
	if [ "$RUST" != "" ] && [ -d "$RUST" ]; then
		export PATH=$PATH:$RUST/rustc/bin/:$RUST/cargo/bin/
	fi

	# Build
	rustc --version
	cargo version
	cargo clean
	cargo test
	cargo build --release
	
	# Prepare for installer
	if [ "$TARGET" == "i686-pc-windows" ]; then
		cp $RUST/rustc/bin/libgcc*.dll target/release/
	fi
	
	# Build installer
	if [ "$WIXSHARP_DIR" != "" ]; then
		$WIXSHARP_DIR/cscs wixcs/setup.cs
		nuget pack target/octobuild.nuspec -OutputDirectory target
	fi
	
	# Restore path
	export PATH=$_PATH
}

if [ "$1" != "" ]; then
	# User defined target
	case $1 in
		"i686" )
			build i686-pc-windows
			;;
		"x86_64" )<commit_msg>Don't remove previous installer<commit_after>set -ex
cd `dirname $0`

build() {
	TARGET=$1
	# Set path
	_PATH=$PATH
	case "$TARGET" in
		"i686-pc-windows" ) 
			RUST=$TOOLS/rust-nightly-$TARGET-gnu
			export PATH=$PATH:/mingw32/bin/
			export OPENSSL_LIBS=crypto:ssl
			;;
		"x86_64-pc-windows" ) 
			RUST=$TOOLS/rust-nightly-$TARGET-gnu
			export PATH=$PATH:/mingw64/bin/
			export OPENSSL_LIBS=crypto:ssl
			;;
		* )
			RUST=
			;;
	esac
	
	if [ "$RUST" != "" ] && [ -d "$RUST" ]; then
		export PATH=$PATH:$RUST/rustc/bin/:$RUST/cargo/bin/
	fi

	# Build
	rustc --version
	cargo version
	rm -fR target/release
	cargo test
	cargo build --release
	
	# Prepare for installer
	if [ "$TARGET" == "i686-pc-windows" ]; then
		cp $RUST/rustc/bin/libgcc*.dll target/release/
	fi
	
	# Build installer
	if [ "$WIXSHARP_DIR" != "" ]; then
		$WIXSHARP_DIR/cscs wixcs/setup.cs
		nuget pack target/octobuild.nuspec -OutputDirectory target
	fi
	
	# Restore path
	export PATH=$_PATH
}

if [ "$1" != "" ]; then
	# User defined target
	case $1 in
		"i686" )
			build i686-pc-windows
			;;
		"x86_64" )
{'fraction_non_alphanumeric': 0.15762394761459309, 'fraction_numerical': 0.026192703461178673, 'mean_word_length': 3.0742857142857143, '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': '3641872', 'n_tokens_mistral': 1021, 'n_tokens_neox': 871, 'n_words': 180}