Browse Source

Revert "AMBARI-8583. Ambari-Web build generates incorrect 'app.js.map' file (alexantonenko)"

This reverts commit 2e7b019e300caea925a056b3f4e5a4fcab1fb05e.
Srimanth Gunturi 10 years ago
parent
commit
ddbd346c2a

+ 6 - 6
ambari-web/pom.xml

@@ -117,6 +117,12 @@
             </goals>
             <configuration>
               <target name="ambari-web-compile">
+                <exec dir="${basedir}" executable="${executable.npm}" failonerror="true">
+                  <arg value="${args.npm.install}"/>
+                </exec>
+                <exec dir="${basedir}" executable="${executable.brunch}" failonerror="true">
+                  <arg value="${args.brunch.build}"/>
+                </exec>
                 <!-- sets Ambari version to make it accessible from code -->
                 <exec dir="${basedir}" executable="${executable.shell}" failonerror="true">
                   <arg value="${basedir}${dirsep}set-ambari-version.${fileextension.shell}"/>
@@ -132,12 +138,6 @@
                   <arg value="${basedir}${dirsep}toggle-experimental.${fileextension.shell}"/>
                   <arg value="${enableExperimental}"/>
                 </exec>
-                <exec dir="${basedir}" executable="${executable.npm}" failonerror="true">
-                  <arg value="${args.npm.install}"/>
-                </exec>
-                <exec dir="${basedir}" executable="${executable.brunch}" failonerror="true">
-                  <arg value="${args.brunch.build}"/>
-                </exec>
               </target>
             </configuration>
           </execution>

+ 1 - 1
ambari-web/set-ambari-version.sh

@@ -21,6 +21,6 @@
 if [ "$1" != '${ambariVersion}' ]
 then
   echo "Setting Ambari version to $1"
-  find app -type f -name "*.js" -exec sed -i "s/App.version.*=.*;/App.version = '$1';/" {} \;
+  sed "s/App.version.*=.*;/App.version = '$1';/" public/javascripts/app.js > public/javascripts/tmp.js; mv public/javascripts/tmp.js public/javascripts/app.js
 fi
 

+ 2 - 2
ambari-web/set-default-stack-version.sh

@@ -23,6 +23,6 @@ then
   STACK=${1%-*}
   VERSION=${1##*-}
   echo "Setting default stack to '$STACK' and version to '$VERSION'"
-  find app -type f -name "*.js" -exec sed -i "s/App.defaultStackVersion.*=.*;/App.defaultStackVersion = '${STACK}-${VERSION}';/" {} \;
-  find app -type f -name "*.js" -exec sed -i "s/App.defaultLocalStackVersion.*=.*;/App.defaultLocalStackVersion = '${STACK}Local-${VERSION}';/" {} \;
+  sed "s/App.defaultStackVersion.*=.*;/App.defaultStackVersion = '${STACK}-${VERSION}';/" public/javascripts/app.js > public/javascripts/tmp.js; mv public/javascripts/tmp.js public/javascripts/app.js
+  sed "s/App.defaultLocalStackVersion.*=.*;/App.defaultLocalStackVersion = '${STACK}Local-${VERSION}';/" public/javascripts/app.js > public/javascripts/tmp.js; mv public/javascripts/tmp.js public/javascripts/app.js
 fi

+ 1 - 1
ambari-web/toggle-experimental.sh

@@ -21,5 +21,5 @@
 if [ "$1" == "true" ]
 then
   echo 'Enabling experimental features...'
-  find app -type f -name "*.js" -exec sed -i "s/App.enableExperimental.*=.*;/App.enableExperimental = true;/" {} \;
+  sed 's/App.enableExperimental.*=.*;/App.enableExperimental = true;/' public/javascripts/app.js > public/javascripts/tmp.js; mv public/javascripts/tmp.js public/javascripts/app.js
 fi