8210318: idea.sh script doesn't work on Mac
authormcimadamore
Thu, 06 Sep 2018 13:13:35 +0100
changeset 51657 0fd48caf8243
parent 51656 5b1d1a7d4def
child 51658 805807f15830
8210318: idea.sh script doesn't work on Mac Summary: remove usage non-portable sed options Reviewed-by: erikj, ihse
bin/idea.sh
make/langtools/intellij/template/runConfigurations/javac.xml
make/langtools/intellij/template/runConfigurations/javadoc.xml
make/langtools/intellij/template/runConfigurations/javap.xml
make/langtools/intellij/template/runConfigurations/jshell.xml
make/langtools/intellij/template/runConfigurations/sjavac.xml
--- a/bin/idea.sh	Thu Sep 06 02:01:20 2018 -0400
+++ b/bin/idea.sh	Thu Sep 06 13:13:35 2018 +0100
@@ -113,21 +113,14 @@
   echo "FATAL: SPEC is empty" >&2; exit 1
 fi
 
-
-addSourceFolder() {
-  root=$@
-  relativePath="`echo "$root" | sed -e s@"$TOP/\(.*$\)"@"\1"@`"
-  folder="`echo "$SOURCE_FOLDER" | sed -e s@"\(.*/\)####\(.*\)"@"\1$relativePath\2"@`"
-  printf "%s\n" "$folder" >> $IDEA_JDK
-}
-
 ### Replace template variables
 
 NUM_REPLACEMENTS=0
 
 replace_template_file() {
     for i in $(seq 1 $NUM_REPLACEMENTS); do
-      eval "sed -i \"s|\${FROM${i}}|\${TO${i}}|g\" $1"
+      eval "sed \"s|\${FROM${i}}|\${TO${i}}|g\" $1 > $1.tmp"
+      mv $1.tmp $1
     done
 }
 
@@ -154,7 +147,7 @@
 SOURCE_POSTFIX="\" isTestSource=\"false\" />"
 
 for root in $MODULE_ROOTS; do
-    SOURCES=$SOURCES"\n$SOURCE_PREFIX""$root""$SOURCE_POSTFIX"
+    SOURCES=$SOURCES" $SOURCE_PREFIX""$root""$SOURCE_POSTFIX"
 done
 
 add_replacement "###SOURCE_ROOTS###" "$SOURCES"
--- a/make/langtools/intellij/template/runConfigurations/javac.xml	Thu Sep 06 02:01:20 2018 -0400
+++ b/make/langtools/intellij/template/runConfigurations/javac.xml	Thu Sep 06 13:13:35 2018 +0100
@@ -16,7 +16,7 @@
     <ConfigurationWrapper RunnerId="Run" />
     <method>
       <option name="Make" enabled="false" />
-      <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-all-classes" />
+      <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/make/langtools/intellij/build.xml" target="build-all-classes" />
     </method>
   </configuration>
 </component>
--- a/make/langtools/intellij/template/runConfigurations/javadoc.xml	Thu Sep 06 02:01:20 2018 -0400
+++ b/make/langtools/intellij/template/runConfigurations/javadoc.xml	Thu Sep 06 13:13:35 2018 +0100
@@ -16,7 +16,7 @@
     <ConfigurationWrapper RunnerId="Run" />
     <method>
       <option name="Make" enabled="false" />
-      <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-all-classes" />
+      <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/make/langtools/intellij/build.xml" target="build-all-classes" />
     </method>
   </configuration>
 </component>
--- a/make/langtools/intellij/template/runConfigurations/javap.xml	Thu Sep 06 02:01:20 2018 -0400
+++ b/make/langtools/intellij/template/runConfigurations/javap.xml	Thu Sep 06 13:13:35 2018 +0100
@@ -16,7 +16,7 @@
     <ConfigurationWrapper RunnerId="Run" />
     <method>
       <option name="Make" enabled="false" />
-      <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-all-classes" />
+      <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/make/langtools/intellij/build.xml" target="build-all-classes" />
     </method>
   </configuration>
 </component>
--- a/make/langtools/intellij/template/runConfigurations/jshell.xml	Thu Sep 06 02:01:20 2018 -0400
+++ b/make/langtools/intellij/template/runConfigurations/jshell.xml	Thu Sep 06 13:13:35 2018 +0100
@@ -14,7 +14,7 @@
     <envs />
     <method>
       <option name="Make" enabled="false" />
-      <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-all-classes" />
+      <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/make/langtools/intellij/build.xml" target="build-all-classes" />
     </method>
   </configuration>
 </component>
--- a/make/langtools/intellij/template/runConfigurations/sjavac.xml	Thu Sep 06 02:01:20 2018 -0400
+++ b/make/langtools/intellij/template/runConfigurations/sjavac.xml	Thu Sep 06 13:13:35 2018 +0100
@@ -16,7 +16,7 @@
     <ConfigurationWrapper RunnerId="Run" />
     <method>
       <option name="Make" enabled="false" />
-      <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/.idea/build.xml" target="build-all-classes" />
+      <option name="AntTarget" enabled="true" antfile="file://$PROJECT_DIR$/make/langtools/intellij/build.xml" target="build-all-classes" />
     </method>
   </configuration>
 </component>