<commit_before>#! /bin/bash

# OSX 32
rm -rf spoofax-osx-x86
./director/director \
  -repository http://download.eclipse.org/eclipse/updates/4.3,http://download.spoofax.org/update/unstable/ \
  -destination spoofax-osx-x86 \
  -bundlepool spoofax-osx-x86 \
  -profile SDKProfile \
  -profileProperties org.eclipse.update.install.features=true \
  -installIU org.eclipse.sdk.ide \
  -installIU org.strategoxt.imp.feature.group \
  -p2.os macosx \
  -p2.ws cocoa \
  -p2.arch x86 \
  -roaming \

# remove vm args
sed -i 's|-Xms[0-9]*m||' spoofax-osx-x86/Eclipse.app/Contents/MacOS/eclipse.ini
sed -i 's|-Xss[0-9]*m||' spoofax-osx-x86/Eclipse.app/Contents/MacOS/eclipse.ini
sed -i 's|-Xmx[0-9]*m||' spoofax-osx-x86/Eclipse.app/Contents/MacOS/eclipse.ini
sed -i 's|-XX:MaxPermSize=[0-9]*m||' spoofax-osx-x86/Eclipse.app/Contents/MacOS/eclipse.ini
sed -i '/^$/d' spoofax-osx-x86/Eclipse.app/Contents/MacOS/eclipse.ini
perl -pi -e "s/^\r\n//" spoofax-osx-x86/Eclipse.app/Contents/MacOS/eclipse.ini

# add own default vmwargs
echo "-Xms512m" >> spoofax-osx-x86/Eclipse.app/Contents/MacOS/eclipse.ini
echo "-Xmx1024m" >> spoofax-osx-x86/Eclipse.app/Contents/MacOS/eclipse.ini
echo "-Xss16m" >> spoofax-osx-x86/Eclipse.app/Contents/MacOS/eclipse.ini
echo "-XX:MaxPermSize=256m" >> spoofax-osx-x86/Eclipse.app/Contents/MacOS/eclipse.ini
echo "-server" >> spoofax-osx-x86/Eclipse.app/Contents/MacOS/eclipse.ini


# OSX 64
rm -rf spoofax-osx-x86_64
./director/director \
  -repository http://download.eclipse.org/eclipse/updates/4.3,http://download.spoofax.org/update/unstable/ \
  -destination spoofax-osx-x86_64 \
  -bundlepool spoofax-osx-x86_64 \
  -profile SDKProfile \
  -profileProperties org.eclipse.update.install.features=true \
  -installIU org.eclipse.sdk.ide \
  -installIU org.strategoxt.imp.feature.group \
  -p2.os macosx \
  -p2.ws cocoa \
  -p2.arch x86_64 \
  -roaming \

# remove vm args
sed -i 's|-Xms[0-9]*m||' spoofax-osx-x86_64/Eclipse.app/Contents/MacOS/eclipse.ini
sed -i 's|-Xss[0-9]*m||' spoofax-osx-x86_64/Eclipse.app/Contents/MacOS/eclipse.ini
sed -i 's|-Xmx[0-9]*m||' spoofax-osx-x86_64/Eclipse.app/Contents/MacOS/eclipse.ini
sed -i 's|-XX:MaxPermSize=[0-9]*m||' spoofax-osx-x86_64/Eclipse.app/Contents/MacOS/eclipse.ini
sed -i '/^$/d' spoofax-osx-x86_64/Eclipse.app/Contents/MacOS/eclipse.ini
perl -pi -e "s/^\r\n//" spoofax-osx-x86_64/Eclipse.app/Contents/MacOS/eclipse.ini

# add own default vmwargs
echo "-Xms512m" >> spoofax-osx-x86_64/Eclipse.app/Contents/MacOS/eclipse.ini
echo "-Xmx1024m" >> spoofax-osx-x86_64/Eclipse.app/Contents/MacOS/eclipse.ini
echo "-Xss16m" >> spoofax-osx-x86_64/Eclipse.app/Contents/MacOS/eclipse.ini
echo "-XX:MaxPermSize=256m" >> spoofax-osx-x86_64/Eclipse.app/Contents/MacOS/eclipse.ini
echo "-server" >> spoofax-osx-x86_64/Eclipse.app/Contents/MacOS/eclipse.ini



# Windows 64
rm -rf spoofax-win32-x86_64
./director/director \
  -repository http://download.eclipse.org/eclipse/updates/4.3,http://download.spoofax.org/update/unstable/ \
  -destination spoofax-win32-x86_64 \
  -bundlepool spoofax-win32-x86_64 \
  -profile SDKProfile \
  -profileProperties org.eclipse.update.install.features=true \
  -installIU org.eclipse.sdk.ide \
  -installIU org.strategoxt.imp.feature.group \
  -p2.os win32 \
  -p2.ws win32 \
  -p2.arch x86_64 \
  -roaming \

# remove vm args
sed -i 's|-Xms[0-9]*m||' spoofax-win32-x86_64/eclipse.ini
sed -i 's|-Xss[0-9]*m||' spoofax-win32-x86_64/eclipse.ini
sed -i 's|-Xmx[0-9]*m||' spoofax-win32-x86_64/eclipse.ini
sed -i 's|-XX:MaxPermSize=[0-9]*m||' spoofax-win32-x86_64/eclipse.ini
sed -i '/^$/d' spoofax-win32-x86_64/eclipse.ini
perl -pi -e "s/^\r\n//" spoofax-win32-x86_64/eclipse.ini

# add own default vmwargs
echo "-Xms512m" >> spoofax-win32-x86_64/eclipse.ini
echo "-Xmx1024m" >> spoofax-win32-x86_64/eclipse.ini
echo "-Xss16m" >> spoofax-win32-x86_64/eclipse.ini
echo "-XX:MaxPermSize=256m" >> spoofax-win32-x86_64/eclipse.ini
echo "-server" >> spoofax-win32-x86_64/eclipse.ini


# Windows 32
rm -rf spoofax-win32-x86
./director/director \
  -repository http://download.eclipse.org/eclipse/updates/4.3,http://download.spoofax.org/update/unstable/ \
  -destination spoofax-win32-x86 \
  -bundlepool spoofax-win32-x86 \
  -profile SDKProfile \
  -profileProperties org.eclipse.update.install.features=true \
  -installIU org.eclipse.sdk.ide \
  -installIU org.strategoxt.imp.feature.group \
  -p2.os win32 \
  -p2.ws win32 \
  -p2.arch x86 \
  -roaming \

# remove vm args
sed -i 's|-Xms[0-9]*m||' spoofax-win32-x86/eclipse.ini
sed -i 's|-Xss[0-9]*m||' spoofax-win32-x86/eclipse.ini
sed -i 's|-Xmx[0-9]*m||' spoofax-win32-x86/eclipse.ini
sed -i 's|-XX:MaxPermSize=[0-9]*m||' spoofax-win32-x86/eclipse.ini
sed -i '/^$/d' spoofax-win32-x86/eclipse.ini
perl -pi -e "s/^\r\n//" spoofax-win32-x86/eclipse.ini

# add own default vmwargs
echo "-Xms512m" >> spoofax-win32-x86/eclipse.ini
echo "-Xmx1024m" >> spoofax-win32-x86/eclipse.ini
echo "-Xss16m" >> spoofax-win32-x86/eclipse.ini
echo "-XX:MaxPermSize=256m" >> spoofax-win32-x86/eclipse.ini
echo "-server" >> spoofax-win32-x86/eclipse.ini
<commit_msg>Move stuff into function.<commit_after>#! /bin/bash

ECLIPSE_REPO="http://download.eclipse.org/eclipse/updates/4.3"
SPOOFAX_REPO="http://download.spoofax.org/update/unstable/"

function create-eclipse-installation {
  # 1. os
  # 2. ws
  # 3. arch
  # 4. ini path

  INSTALL_PATH="spoofax-$1-$3"
  INSTALL_ZIP="spoofax-$1-$3.zip"
  INI_PATH="$INSTALL_PATH/$4"

  # Delete old stuff
  rm -rf $INSTALL_PATH
  rm -rf $INSTALL_ZIP

  # Create eclipse installation
  ./director/director \
    -repository $ECLIPSE_REPO,$SPOOFAX_REPO \
    -destination $INSTALL_PATH \
    -bundlepool $INSTALL_PATH \
    -profile SDKProfile \
    -profileProperties org.eclipse.update.install.features=true \
    -installIU org.eclipse.sdk.ide \
    -installIU org.strategoxt.imp.feature.group \
    -p2.os $1 \
    -p2.ws $2 \
    -p2.arch $3 \
    -roaming

  # Remove regular VM args
  sed -i '' -e 's|-Xms[0-9]*m||' $INI_PATH
  sed -i '' -e 's|-Xss[0-9]*m||' $INI_PATH
  sed -i '' -e 's|-Xmx[0-9]*m||' $INI_PATH
  sed -i '' -e 's|-XX:MaxPermSize=[0-9]*m||' $INI_PATH
  sed -i '' -e '/^$/d' $INI_PATH
  perl -pi -e "s/^\r\n//" $INI_PATH
  # TODO: Remove -install argument

  # Add own VM arguments
  echo "-Xms512m" >> $INI_PATH
  echo "-Xmx1024m" >> $INI_PATH
  echo "-Xss16m" >> $INI_PATH
  echo "-XX:MaxPermSize=256m" >> $INI_PATH
  echo "-server" >> $INI_PATH
}


create-eclipse-installation "macosx" "cocoa" "x86" "Eclipse.app/Contents/MacOS/eclipse.ini"
create-eclipse-installation "macosx" "cocoa" "x86_64" "Eclipse.app/Contents/MacOS/eclipse.ini"

create-eclipse-installation "win32" "win32" "x86" "eclipse.ini"
create-eclipse-installation "win32" "win32" "x86_64" "eclipse.ini"

create-eclipse-installation "linux" "gtk" "x86" "Eclipse.app/Contents/MacOS/eclipse.ini"
create-eclipse-installation "linux" "gtk" "x86_64" "Eclipse.app/Contents/MacOS/eclipse.ini"

{'fraction_non_alphanumeric': 0.17694524495677233, 'fraction_numerical': 0.05979827089337176, 'mean_word_length': 3.554461942257218, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 53, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5366167', 'n_tokens_mistral': 3255, 'n_tokens_neox': 2966, 'n_words': 440}