<commit_before>#!/bin/bash
# --------------------------------------------------------------
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
#
# --------------------------------------------------------------

# This script depends on eclipse being installed to 
# /home/vagrant/eclipse

set -e
set -x

if [ -f /etc/developer_provisioned_date ]
then
   echo "Stratos developer already provisioned so exiting."
   exit 0
fi

SVN_URL=https://svn.wso2.org/repos/wso2/carbon/platform/tags/turing-chunk05

CARBON_SRC=/home/vagrant/carbon-source

MAVEN_SETTINGS=/vagrant/maven_settings.xml

############################
# checkout and build carbon
############################

yum install -y subversion

if [ -d $CARBON_SRC ]; 
then
   # TODO should we do an update?
   echo 'Found carbon src folder.  Not updating src.'
else
   sudo -i -u vagrant \
      svn checkout $SVN_URL \
      $CARBON_SRC
fi

# must be build with tests - see:
# http://wso2-oxygen-tank.10903.n7.nabble.com/Dev-Platform-build-failure-4-1-2-patch-release-td77798.html
sudo -i -u vagrant \
   $M2_HOME/bin/mvn -B -f $CARBON_SRC/product-releases/chunk-05/pom.xml \
   -s $MAVEN_SETTINGS \
   -l /vagrant/log/mvn_clean_install.log \
   clean install \
   --fail-never

#####################
# maven eclipse setup
#####################

# perform mvn eclipse:eclipse

sudo -i -u vagrant \
   $M2_HOME/bin/mvn -B -f $CARBON_SRC/product-releases/chunk-05/pom.xml \
   -s $MAVEN_SETTINGS \
   -l /vagrant/log/mvn_eclipse_eclipse.log \
   -D downloadSources=true \
   eclipse:eclipse 

# we need an eclipse plugin that will perform the headless import
# of projects into the workspace

sudo -i -u vagrant \
   wget -P /home/vagrant/eclipse/dropins/ \
      https://github.com/snowch/test.myapp/raw/master/test.myapp_1.0.0.jar

# get all the directories that can be imported into eclipse and append them
# with '-import'

IMPORTS=$(find ${CARBON_SRC} -type f -name .project)

# Although it is possible to import multiple directories with one 
# invocation of the test.myapp.App, this fails if one of the imports
# was not successful.  Using a for loop is slower, but more robust
for item in ${IMPORTS[*]}; 
do 
   IMPORT="$(dirname $item)/"

   # perform the import
   sudo -i -u vagrant \
      /home/vagrant/eclipse/eclipse -nosplash \
      -application test.myapp.App \
      -data /home/vagrant/workspace \
      -import $IMPORT
done

# add the M2_REPO variable to the workspace

sudo -i -u vagrant \<commit_msg>add some more debugging output<commit_after>#!/bin/bash
# --------------------------------------------------------------
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
#
# --------------------------------------------------------------

# This script depends on eclipse being installed to 
# /home/vagrant/eclipse

set -e
set -x

if [ -f /etc/developer_provisioned_date ]
then
   echo "Stratos developer already provisioned so exiting."
   exit 0
fi

SVN_URL=https://svn.wso2.org/repos/wso2/carbon/platform/tags/turing-chunk05

CARBON_SRC=/home/vagrant/carbon-source

MAVEN_SETTINGS=/vagrant/maven_settings.xml

############################
# checkout and build carbon
############################

yum install -y subversion

if [ -d $CARBON_SRC ]; 
then
   # TODO should we do an update?
   echo 'Found carbon src folder.  Not updating src.'
else
   sudo -i -u vagrant \
      svn checkout $SVN_URL \
      $CARBON_SRC
fi

# must be build with tests - see:
# http://wso2-oxygen-tank.10903.n7.nabble.com/Dev-Platform-build-failure-4-1-2-patch-release-td77798.html
sudo -i -u vagrant \
   $M2_HOME/bin/mvn -B -f $CARBON_SRC/product-releases/chunk-05/pom.xml \
   -s $MAVEN_SETTINGS \
   -l /vagrant/log/mvn_clean_install.log \
   clean install \
   --fail-never

#####################
# maven eclipse setup
#####################

# perform mvn eclipse:eclipse

sudo -i -u vagrant \
   $M2_HOME/bin/mvn -B -f $CARBON_SRC/product-releases/chunk-05/pom.xml \
   -s $MAVEN_SETTINGS \
   -l /vagrant/log/mvn_eclipse_eclipse.log \
   -D downloadSources=true \
   eclipse:eclipse 

# we need an eclipse plugin that will perform the headless import
# of projects into the workspace

sudo -i -u vagrant \
   wget -P /home/vagrant/eclipse/dropins/ \
      https://github.com/snowch/test.myapp/raw/master/test.myapp_1.0.0.jar

# get all the directories that can be imported into eclipse and append them
# with '-import'

IMPORTS=$(find ${CARBON_SRC} -type f -name .project)

# Although it is possible to import multiple directories with one 
# invocation of the test.myapp.App, this fails if one of the imports
# was not successful.  Using a for loop is slower, but more robust
for item in ${IMPORTS[*]}; 
do 
   IMPORT="$(dirname $item)/"
   echo "Importing ${IMPORT}"

   # perform the import
   sudo -i -u vagrant \
      /home/vagrant/eclipse/eclipse -nosplash \
      -application test.myapp.App \
      -data /home/vagrant/workspace \
      -import $IMPORT
done

# add the M2_REPO variable to the workspace

sudo -i -u vagrant \
{'fraction_non_alphanumeric': 0.1572773576169162, 'fraction_numerical': 0.01049544682821423, 'mean_word_length': 2.8594401429422276, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1330621', 'n_tokens_mistral': 2101, 'n_tokens_neox': 2007, 'n_words': 675}