<commit_before>#!/bin/bash

set -e

blendedVersion="2.0-SNAPSHOT"
classesDir="eclipse-target/classes"
testClassesDir="eclipse-target/test-classes"
libsDir="eclipse-target/libs"

projects="\
blended-updater-maven-plugin \
blended.activemq.brokerstarter \
blended.activemq.client \
blended.activemq.defaultbroker \
blended.akka \
blended.akka.itest \
blended.build \
blended.camel.utils \
blended.container.context \
blended.container.registry \
blended.demo.launcher \
blended.demo.mgmt \
blended.domino \
blended.hawtio.login \
blended.itestsupport \
blended.jms.utils \
blended.jmx \
blended.jolokia \
blended.launcher \
blended.launcher.features \
blended.mgmt.agent \
blended.mgmt.base \
blended.mgmt.mock \
blended.mgmt.repo \
blended.mgmt.repo.rest \
blended.mgmt.rest \
blended.mgmt.ui \
blended.parent \
blended.persistence \
blended.persistence.orient \
blended.samples \
blended.security \
blended.security.boot \
blended.spray \
blended.spray.api \
blended.testsupport \
blended.updater \
blended.updater.config \
blended.updater.remote \
blended.updater.tools \
blended.util \
"

genForProjects="$projects"

if [ -n "$*" ]; then
  echo "Generating for selected projects: $*"
  genForProjects="$*"
fi

for project in $genForProjects; do

  echo ""
  echo "*******************************************************"
  echo "* Project: $project"
  echo "* "

  cd "$project"

  if [ -e src/main/scala -o -e src/test/scala ]; then

    cat > .project << EOF
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
        <name>$project</name>
        <comment></comment>
        <projects>
        </projects>
        <buildSpec>
                <buildCommand>
                        <name>org.scala-ide.sdt.core.scalabuilder</name>
                        <arguments>
                        </arguments>
                </buildCommand>
<buildCommand>
                        <name>org.eclipse.m2e.core.maven2Builder</name>
                        <arguments>
                        </arguments>
                </buildCommand>
        </buildSpec>
        <natures>
                <nature>org.scala-ide.sdt.core.scalanature</nature>
                <nature>org.eclipse.jdt.core.javanature</nature>
                <nature>org.eclipse.m2e.core.maven2Nature</nature>
        </natures>
</projectDescription>
EOF

  else

    echo "Generating project without scala support"

    cat > .project << EOF
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
        <name>$project</name>
        <comment></comment>
        <projects>
        </projects>
        <buildSpec>
                <buildCommand>
                        <name>org.eclipse.m2e.core.maven2Builder</name>
                        <arguments>
                        </arguments>
                </buildCommand>
                <buildCommand>
                        <name>org.eclipse.jdt.core.javabuilder</name>
                        <arguments>
                        </arguments>
                </buildCommand>
        </buildSpec>
        <natures>
                <nature>org.eclipse.jdt.core.javanature</nature>
                <nature>org.eclipse.m2e.core.maven2Nature</nature>
        </natures>
</projectDescription>
EOF

  fi

  cat > .classpath << EOF
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
EOF

  for path in src/main/scala src/main/java src/main/binaryResources src/main/resources; do
    if [ -e "$path" ]; then
      cat >> .classpath << EOF
        <classpathentry kind="src" path="$path"/>
EOF
    fi
  done

  for path in src/test/scala src/test/java src/test/binaryResources src/test/resources; do
    if [ -e "$path" ]; then
      cat >> .classpath << EOF
        <classpathentry kind="src" output="${testClassesDir}" path="$path"/>
EOF
    fi
  done

  cat >> .classpath << EOF
        <classpathentry kind="output" path="${classesDir}"/>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
EOF

  mkdir -p .settings

  cat > .settings/org.eclipse.core.resources.prefs << EOF
eclipse.preferences.version=1
encoding/<project>=UTF-8
EOF<commit_msg>Added src/shared/scala as source path to Eclipse projects<commit_after>#!/bin/bash

set -e

blendedVersion="2.0-SNAPSHOT"
classesDir="eclipse-target/classes"
testClassesDir="eclipse-target/test-classes"
libsDir="eclipse-target/libs"

projects="\
blended-updater-maven-plugin \
blended.activemq.brokerstarter \
blended.activemq.client \
blended.activemq.defaultbroker \
blended.akka \
blended.akka.itest \
blended.build \
blended.camel.utils \
blended.container.context \
blended.container.registry \
blended.demo.launcher \
blended.demo.mgmt \
blended.domino \
blended.hawtio.login \
blended.itestsupport \
blended.jms.utils \
blended.jmx \
blended.jolokia \
blended.launcher \
blended.launcher.features \
blended.mgmt.agent \
blended.mgmt.base \
blended.mgmt.mock \
blended.mgmt.repo \
blended.mgmt.repo.rest \
blended.mgmt.rest \
blended.mgmt.ui \
blended.parent \
blended.persistence \
blended.persistence.orient \
blended.samples \
blended.security \
blended.security.boot \
blended.spray \
blended.spray.api \
blended.testsupport \
blended.updater \
blended.updater.config \
blended.updater.remote \
blended.updater.tools \
blended.util \
"

genForProjects="$projects"

if [ -n "$*" ]; then
  echo "Generating for selected projects: $*"
  genForProjects="$*"
fi

for project in $genForProjects; do

  echo ""
  echo "*******************************************************"
  echo "* Project: $project"
  echo "* "

  cd "$project"

  if [ -e src/main/scala -o -e src/test/scala -o -e src/shared/scala ]; then

    cat > .project << EOF
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
        <name>$project</name>
        <comment></comment>
        <projects>
        </projects>
        <buildSpec>
                <buildCommand>
                        <name>org.scala-ide.sdt.core.scalabuilder</name>
                        <arguments>
                        </arguments>
                </buildCommand>
<buildCommand>
                        <name>org.eclipse.m2e.core.maven2Builder</name>
                        <arguments>
                        </arguments>
                </buildCommand>
        </buildSpec>
        <natures>
                <nature>org.scala-ide.sdt.core.scalanature</nature>
                <nature>org.eclipse.jdt.core.javanature</nature>
                <nature>org.eclipse.m2e.core.maven2Nature</nature>
        </natures>
</projectDescription>
EOF

  else

    echo "Generating project without scala support"

    cat > .project << EOF
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
        <name>$project</name>
        <comment></comment>
        <projects>
        </projects>
        <buildSpec>
                <buildCommand>
                        <name>org.eclipse.m2e.core.maven2Builder</name>
                        <arguments>
                        </arguments>
                </buildCommand>
                <buildCommand>
                        <name>org.eclipse.jdt.core.javabuilder</name>
                        <arguments>
                        </arguments>
                </buildCommand>
        </buildSpec>
        <natures>
                <nature>org.eclipse.jdt.core.javanature</nature>
                <nature>org.eclipse.m2e.core.maven2Nature</nature>
        </natures>
</projectDescription>
EOF

  fi

  cat > .classpath << EOF
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
EOF

  for path in src/main/scala src/main/java src/shared/scala src/main/binaryResources src/main/resources; do
    if [ -e "$path" ]; then
      cat >> .classpath << EOF
        <classpathentry kind="src" path="$path"/>
EOF
    fi
  done

  for path in src/test/scala src/test/java src/test/binaryResources src/test/resources; do
    if [ -e "$path" ]; then
      cat >> .classpath << EOF
        <classpathentry kind="src" output="${testClassesDir}" path="$path"/>
EOF
    fi
  done

  cat >> .classpath << EOF
        <classpathentry kind="output" path="${classesDir}"/>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
EOF

  mkdir -p .settings

  cat > .settings/org.eclipse.core.resources.prefs << EOF
eclipse.preferences.version=1
encoding/<project>=UTF-8
EOF
{'fraction_non_alphanumeric': 0.1462488129154796, 'fraction_numerical': 0.005460588793922127, 'mean_word_length': 2.2604489164086687, 'pattern_counts': {'":': 0, '<': 165, '<?xml version=': 6, '>': 157, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '1191945', 'n_tokens_mistral': 2792, 'n_tokens_neox': 2643, 'n_words': 444}