<commit_before>#!/bin/sh

######################################################
# Input argument: 
#      $1: ReportEngine/lib
#      $2: Target folder to put the genReport.sh/.bat
######################################################

ls $1 > lib.path
wc -l lib.path > lib.path.count
count=`awk '{print $1}' lib.path.count`
rm -f lib.path.count

########################################
#Generate $2/genReport.sh
########################################
########################PRINT USAGE OF REPORTRUNNER###########################
echo echo \"org.eclipse.birt.report.engine.impl.ReportRunner Usage:\"\; > $2/genReport.sh
echo echo \"--mode/-m [ run \| render \| runrender] the default is runrender \" >> $2/genReport.sh
echo echo \"for runrender mode: \" >> $2/genReport.sh
echo echo \"\"  \"we should add it in the end \<design file\>  \" >> $2/genReport.sh
echo echo \"\"  \"--format/-f [ HTML \| PDF ]  \" >> $2/genReport.sh
echo echo \"\"  \"--output/-o \<target file\>\" >> $2/genReport.sh
echo echo \"\"  \"--htmlType/-t \< HTML \| ReportletNoCSS \>\" >> $2/genReport.sh
echo echo \"\"  \"--locale /-l\<locale\>\" >> $2/genReport.sh
echo echo \"\"  \"--parameter/-p \<\"parameterName=parameterValue\"\>\" >> $2/genReport.sh
echo echo \"\"  \"--file/-F \<parameter file\>\" >> $2/genReport.sh
echo echo \"\"  \"--encoding/-e \<target encoding\>\" >> $2/genReport.sh
echo echo \" \" >> $2/genReport.sh
echo echo \"Locale: default is english\" >> $2/genReport.sh
echo echo \"parameters in command line will overide parameters in parameter file\" >> $2/genReport.sh
echo echo \"parameter name can't include characters such as \' \'\, \'=\'\, \':\'\" >> $2/genReport.sh
echo echo \" \" >> $2/genReport.sh
echo echo \"For RUN mode:\" >> $2/genReport.sh
echo echo \"we should add it in the end\<design file\>\" >> $2/genReport.sh
echo echo \"\"  \"--output/-o \<target file\>\" >> $2/genReport.sh
echo echo \"\"  \"--locale /-l\<locale\>\" >> $2/genReport.sh
echo echo \"\"  \"--parameter/-p \<parameterName=parameterValue\>\" >> $2/genReport.sh
echo echo \"\"  \"--file/-F \<parameter file\>\" >> $2/genReport.sh
echo echo \" \" >> $2/genReport.sh
echo echo \"Locale: default is english\" >> $2/genReport.sh
echo echo \"parameters in command line will overide parameters in parameter file\" >> $2/genReport.sh
echo echo \"parameter name can't include characters such as \' \'\, \'=\'\, \':\'\" >> $2/genReport.sh
echo echo \" \" >> $2/genReport.sh
echo echo \"For RENDER mode:\" >> $2/genReport.sh
echo echo \"\" \"we should add it in the end\<design file\>\" >> $2/genReport.sh
echo echo \"\" \"--output/-o \<target file\>\" >> $2/genReport.sh
echo echo \"\" \"--page/-p \<pageNumber\>\" >> $2/genReport.sh
echo echo \"\" \"--locale /-l\<locale\>\" >> $2/genReport.sh
echo echo \" \" >> $2/genReport.sh
echo echo \"Locale: default is english\" >> $2/genReport.sh

#########################END OF PRINT USAGE###########################

echo if [ \"\$BIRT_HOME\" == \"\" ]\; >> $2/genReport.sh
echo "" >> $2/genReport.sh

echo then >> $2/genReport.sh
echo echo \" The BIRT_HOME need be set before BirtRunner can run.\"\; >> $2/genReport.sh
echo else >> $2/genReport.sh
echo "" >> $2/genReport.sh


awk  'NR==1 {printf "export BIRTCLASSPATH=\"$BIRT_HOME/ReportEngine/lib/"$1}'  lib.path >> $2/genReport.sh
awk  'NR>=2  {printf ":$BIRT_HOME/ReportEngine/lib/"$1}'  lib.path >> $2/genReport.sh
echo \" >> $2/genReport.sh

echo "" >> $2/genReport.sh
echo JAVACMD=\'java\'\; >> $2/genReport.sh

echo  \$JAVACMD -cp \"\$BIRTCLASSPATH\" -DBIRT_HOME=\"\$BIRT_HOME/ReportEngine\" org.eclipse.birt.report.engine.api.ReportRunner \$1 \$2 \$3 \$4 \$5 \$6 \$7 \$8 \$9 \${10} \${11} \${12} \${13} \${14} \${15} \${16} \${17} \${18} \${19} >> $2/genReport.sh
echo "" >> $2/genReport.sh
echo fi >> $2/genReport.sh

chmod +x $2/genReport.sh

########################################
#Generate $2/genReport.bat
########################################

echo ECHO off > $2/genReport.bat
echo "" >> $2/genReport.bat

##################USAGE OF REPORT ENGINE################
echo REM org.eclipse.birt.report.engine.impl.ReportRunner Usage: > $2/genReport.bat
echo REM --mode/-m [ run \| render \| runrender] the default is runrender >> $2/genReport.bat<commit_msg>Fix bugzilla bug 211182: [enhancement] Instructions of genReport.sh/bat file should be comment out<commit_after>#!/bin/sh

######################################################
# Input argument: 
#      $1: ReportEngine/lib
#      $2: Target folder to put the genReport.sh/.bat
######################################################

ls $1 > lib.path
wc -l lib.path > lib.path.count
count=`awk '{print $1}' lib.path.count`
rm -f lib.path.count

########################################
#Generate $2/genReport.sh
########################################

echo "################USAGE OF REPORTRUNNER#########################"> $2/genReport.sh
echo "#" echo \"org.eclipse.birt.report.engine.impl.ReportRunner Usage:\"\; >> $2/genReport.sh
echo "#" echo \"--mode/-m [ run \| render \| runrender] the default is runrender \" >> $2/genReport.sh
echo "#" echo \"for runrender mode: \" >> $2/genReport.sh
echo "#" echo \"\"  \"we should add it in the end \<design file\>  \" >> $2/genReport.sh
echo "#" echo \"\"  \"--format/-f [ HTML \| PDF ]  \" >> $2/genReport.sh
echo "#" echo \"\"  \"--output/-o \<target file\>\" >> $2/genReport.sh
echo "#" echo \"\"  \"--htmlType/-t \< HTML \| ReportletNoCSS \>\" >> $2/genReport.sh
echo "#" echo \"\"  \"--locale /-l\<locale\>\" >> $2/genReport.sh
echo "#" echo \"\"  \"--parameter/-p \<\"parameterName=parameterValue\"\>\" >> $2/genReport.sh
echo "#" echo \"\"  \"--file/-F \<parameter file\>\" >> $2/genReport.sh
echo "#" echo \"\"  \"--encoding/-e \<target encoding\>\" >> $2/genReport.sh
echo "#" echo \" \" >> $2/genReport.sh
echo "#" echo \"Locale: default is english\" >> $2/genReport.sh
echo "#" echo \"parameters in command line will overide parameters in parameter file\" >> $2/genReport.sh
echo "#" echo \"parameter name can't include characters such as \' \'\, \'=\'\, \':\'\" >> $2/genReport.sh
echo "#" echo \" \" >> $2/genReport.sh
echo "#" echo \"For RUN mode:\" >> $2/genReport.sh
echo "#" echo \"we should add it in the end\<design file\>\" >> $2/genReport.sh
echo "#" echo \"\"  \"--output/-o \<target file\>\" >> $2/genReport.sh
echo "#" echo \"\"  \"--locale /-l\<locale\>\" >> $2/genReport.sh
echo "#" echo \"\"  \"--parameter/-p \<parameterName=parameterValue\>\" >> $2/genReport.sh
echo "#" echo \"\"  \"--file/-F \<parameter file\>\" >> $2/genReport.sh
echo "#" echo \" \" >> $2/genReport.sh
echo "#" echo \"Locale: default is english\" >> $2/genReport.sh
echo "#" echo \"parameters in command line will overide parameters in parameter file\" >> $2/genReport.sh
echo "#" echo \"parameter name can't include characters such as \' \'\, \'=\'\, \':\'\" >> $2/genReport.sh
echo "#" echo \" \" >> $2/genReport.sh
echo "#" echo \"For RENDER mode:\" >> $2/genReport.sh
echo "#" echo \"\" \"we should add it in the end\<design file\>\" >> $2/genReport.sh
echo "#" echo \"\" \"--output/-o \<target file\>\" >> $2/genReport.sh
echo "#" echo \"\" \"--page/-p \<pageNumber\>\" >> $2/genReport.sh
echo "#" echo \"\" \"--locale /-l\<locale\>\" >> $2/genReport.sh
echo "#" echo \" \" >> $2/genReport.sh
echo "#" echo \"Locale: default is english\" >> $2/genReport.sh
echo "################END OF USAGE #########################">> $2/genReport.sh

echo if [ \"\$BIRT_HOME\" == \"\" ]\; >> $2/genReport.sh
echo "" >> $2/genReport.sh

echo then >> $2/genReport.sh
echo echo \" The BIRT_HOME need be set before BirtRunner can run.\"\; >> $2/genReport.sh
echo else >> $2/genReport.sh
echo "" >> $2/genReport.sh


awk  'NR==1 {printf "export BIRTCLASSPATH=\"$BIRT_HOME/ReportEngine/lib/"$1}'  lib.path >> $2/genReport.sh
awk  'NR>=2  {printf ":$BIRT_HOME/ReportEngine/lib/"$1}'  lib.path >> $2/genReport.sh
echo \" >> $2/genReport.sh

echo "" >> $2/genReport.sh
echo JAVACMD=\'java\'\; >> $2/genReport.sh

echo  \$JAVACMD -cp \"\$BIRTCLASSPATH\" -DBIRT_HOME=\"\$BIRT_HOME/ReportEngine\" org.eclipse.birt.report.engine.api.ReportRunner \$1 \$2 \$3 \$4 \$5 \$6 \$7 \$8 \$9 \${10} \${11} \${12} \${13} \${14} \${15} \${16} \${17} \${18} \${19} >> $2/genReport.sh
echo "" >> $2/genReport.sh
echo fi >> $2/genReport.sh

chmod +x $2/genReport.sh

########################################
#Generate $2/genReport.bat
########################################

echo ECHO off > $2/genReport.bat
echo "" >> $2/genReport.bat

##################USAGE OF REPORT ENGINE################
echo REM org.eclipse.birt.report.engine.impl.ReportRunner Usage: >> $2/genReport.bat
echo REM --mode/-m [ run \| render \| runrender] the default is runrender >> $2/genReport.bat
{'fraction_non_alphanumeric': 0.30505952380952384, 'fraction_numerical': 0.02197802197802198, 'mean_word_length': 3.43502538071066, 'pattern_counts': {'":': 2, '<': 35, '<?xml version=': 0, '>': 248, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '6036677', 'n_tokens_mistral': 3130, 'n_tokens_neox': 2910, 'n_words': 757}