< prev index next >

bin/idea.sh

Print this page




  59 
  60      * )  # non option
  61       break
  62       ;;
  63   esac
  64   shift
  65 done
  66 
  67 mkdir -p $IDEA_OUTPUT || exit 1
  68 cd $IDEA_OUTPUT; IDEA_OUTPUT=`pwd`
  69 
  70 if [ "x$TOPLEVEL_DIR" = "x" ] ; then
  71     cd $SCRIPT_DIR/..
  72     TOPLEVEL_DIR=`pwd`
  73     cd $IDEA_OUTPUT
  74 fi
  75 
  76 MAKE_DIR="$SCRIPT_DIR/../make"
  77 IDEA_MAKE="$MAKE_DIR/idea"
  78 IDEA_TEMPLATE="$IDEA_MAKE/template"


  79 
  80 cp -r "$IDEA_TEMPLATE"/* "$IDEA_OUTPUT"
  81 
  82 #override template
  83 if [ -d "$TEMPLATES_OVERRIDE" ] ; then
  84     for file in `ls -p "$TEMPLATES_OVERRIDE" | grep -v /`; do
  85         cp "$TEMPLATES_OVERRIDE"/$file "$IDEA_OUTPUT"/
  86     done
  87 fi
  88 
  89 if [ "$VERBOSE" = "true" ] ; then
  90   echo "output dir: $IDEA_OUTPUT"
  91   echo "idea template dir: $IDEA_TEMPLATE"
  92 fi
  93 
  94 cd $TOP ; make -f "$IDEA_MAKE/idea.gmk" -I $MAKE_DIR/.. idea MAKEOVERRIDES= OUT=$IDEA_OUTPUT/env.cfg MODULES="$*" || exit 1
  95 cd $SCRIPT_DIR
  96 
  97 . $IDEA_OUTPUT/env.cfg
  98 


 152     if [ "x$JT_HOME" = "x" ]; then
 153       add_replacement "###JTREG_HOME###" ""
 154     else
 155       add_replacement "###JTREG_HOME###" "`cygpath -am $JT_HOME`"
 156     fi
 157 fi
 158 
 159 SOURCE_PREFIX="<sourceFolder url=\"file://"
 160 SOURCE_POSTFIX="\" isTestSource=\"false\" />"
 161 
 162 for root in $MODULE_ROOTS; do
 163     if [ "x$CYGPATH" != "x" ]; then
 164         root=`cygpath -am $root`
 165     fi
 166     SOURCES=$SOURCES" $SOURCE_PREFIX""$root""$SOURCE_POSTFIX"
 167 done
 168 
 169 add_replacement "###SOURCE_ROOTS###" "$SOURCES"
 170 
 171 replace_template_dir "$IDEA_OUTPUT"
































 172 
 173 ### Compile the custom Logger
 174 
 175 CLASSES=$IDEA_OUTPUT/classes
 176 
 177 if [ "x$ANT_HOME" = "x" ] ; then
 178    # try some common locations, before giving up
 179    if [ -f "/usr/share/ant/lib/ant.jar" ] ; then
 180      ANT_HOME="/usr/share/ant"
 181    elif [ -f "/usr/local/Cellar/ant/1.9.4/libexec/lib/ant.jar" ] ; then
 182      ANT_HOME="/usr/local/Cellar/ant/1.9.4/libexec"
 183    else
 184      echo "FATAL: cannot find ant. Try setting ANT_HOME." >&2; exit 1
 185    fi
 186 fi
 187 CP=$ANT_HOME/lib/ant.jar
 188 rm -rf $CLASSES; mkdir $CLASSES
 189 
 190 if [ "x$CYGPATH" = "x" ] ; then ## CYGPATH may be set in env.cfg
 191   JAVAC_SOURCE_FILE=$IDEA_OUTPUT/src/idea/JdkIdeaAntLogger.java


  59 
  60      * )  # non option
  61       break
  62       ;;
  63   esac
  64   shift
  65 done
  66 
  67 mkdir -p $IDEA_OUTPUT || exit 1
  68 cd $IDEA_OUTPUT; IDEA_OUTPUT=`pwd`
  69 
  70 if [ "x$TOPLEVEL_DIR" = "x" ] ; then
  71     cd $SCRIPT_DIR/..
  72     TOPLEVEL_DIR=`pwd`
  73     cd $IDEA_OUTPUT
  74 fi
  75 
  76 MAKE_DIR="$SCRIPT_DIR/../make"
  77 IDEA_MAKE="$MAKE_DIR/idea"
  78 IDEA_TEMPLATE="$IDEA_MAKE/template"
  79 RUN_JEXTRACT_TEMPLATE="$IDEA_TEMPLATE/runConfigurations/jextract.xml"
  80 IDEA_RUN_JEXTRACT="$IDEA_OUTPUT/runConfigurations/jextract.xml"
  81 
  82 cp -r "$IDEA_TEMPLATE"/* "$IDEA_OUTPUT"
  83 
  84 #override template
  85 if [ -d "$TEMPLATES_OVERRIDE" ] ; then
  86     for file in `ls -p "$TEMPLATES_OVERRIDE" | grep -v /`; do
  87         cp "$TEMPLATES_OVERRIDE"/$file "$IDEA_OUTPUT"/
  88     done
  89 fi
  90 
  91 if [ "$VERBOSE" = "true" ] ; then
  92   echo "output dir: $IDEA_OUTPUT"
  93   echo "idea template dir: $IDEA_TEMPLATE"
  94 fi
  95 
  96 cd $TOP ; make -f "$IDEA_MAKE/idea.gmk" -I $MAKE_DIR/.. idea MAKEOVERRIDES= OUT=$IDEA_OUTPUT/env.cfg MODULES="$*" || exit 1
  97 cd $SCRIPT_DIR
  98 
  99 . $IDEA_OUTPUT/env.cfg
 100 


 154     if [ "x$JT_HOME" = "x" ]; then
 155       add_replacement "###JTREG_HOME###" ""
 156     else
 157       add_replacement "###JTREG_HOME###" "`cygpath -am $JT_HOME`"
 158     fi
 159 fi
 160 
 161 SOURCE_PREFIX="<sourceFolder url=\"file://"
 162 SOURCE_POSTFIX="\" isTestSource=\"false\" />"
 163 
 164 for root in $MODULE_ROOTS; do
 165     if [ "x$CYGPATH" != "x" ]; then
 166         root=`cygpath -am $root`
 167     fi
 168     SOURCES=$SOURCES" $SOURCE_PREFIX""$root""$SOURCE_POSTFIX"
 169 done
 170 
 171 add_replacement "###SOURCE_ROOTS###" "$SOURCES"
 172 
 173 replace_template_dir "$IDEA_OUTPUT"
 174 
 175 ### generate jextract run config
 176 
 177 ALTERNATE_JRE="    <option name=\"ALTERNATIVE_JRE_PATH\" value=\"####/images/jdk\" />"
 178 
 179 addAltJreDir() {
 180   DIR=`dirname $SPEC`
 181   mn="`echo "$ALTERNATE_JRE" | sed -e s@"\(.*\)####\(.*\)"@"\1$DIR\2"@`"
 182   printf "%s\n" "$mn" >> $IDEA_RUN_JEXTRACT
 183 }
 184 
 185 rm -f $IDEA_RUN_JEXTRACT
 186 
 187 while IFS= read -r line
 188 
 189 do
 190 
 191   if echo "$line" | egrep "^ .* <env name=\"LD_LIBRARY_PATH\"" > /dev/null ; then
 192 
 193     addClangLib
 194 
 195   elif echo "$line" | egrep "^ .*<option name=\"ALTERNATIVE_JRE_PATH\"" > /dev/null ; then
 196 
 197     addAltJreDir
 198 
 199   else
 200 
 201     printf "%s\n" "$line" >> $IDEA_RUN_JEXTRACT
 202 
 203   fi
 204 
 205 done < "$RUN_JEXTRACT_TEMPLATE"
 206 
 207 ### Compile the custom Logger
 208 
 209 CLASSES=$IDEA_OUTPUT/classes
 210 
 211 if [ "x$ANT_HOME" = "x" ] ; then
 212    # try some common locations, before giving up
 213    if [ -f "/usr/share/ant/lib/ant.jar" ] ; then
 214      ANT_HOME="/usr/share/ant"
 215    elif [ -f "/usr/local/Cellar/ant/1.9.4/libexec/lib/ant.jar" ] ; then
 216      ANT_HOME="/usr/local/Cellar/ant/1.9.4/libexec"
 217    else
 218      echo "FATAL: cannot find ant. Try setting ANT_HOME." >&2; exit 1
 219    fi
 220 fi
 221 CP=$ANT_HOME/lib/ant.jar
 222 rm -rf $CLASSES; mkdir $CLASSES
 223 
 224 if [ "x$CYGPATH" = "x" ] ; then ## CYGPATH may be set in env.cfg
 225   JAVAC_SOURCE_FILE=$IDEA_OUTPUT/src/idea/JdkIdeaAntLogger.java
< prev index next >