From f72e0bdb1df87242a144fbd43cef462c17f73de1 Mon Sep 17 00:00:00 2001 From: Florian Barca Date: Tue, 31 Mar 2015 14:08:35 -0700 Subject: AMBARI-10243 [WinTP2] ambari-web build is incomplete Replaced maven-antrun-plugin with exec-maven-plugin. Upgraded to v1.2.1 was necessary because v1.2 doesn't process the tag. Created Windows scripts with identical functionality for set-ambari-version.sh, set-default-stack-version.sh and toggle-experimental.sh. Fixed slider view build. --- ambari-agent/pom.xml | 4 +- ambari-client/python-client/pom.xml | 2 +- ambari-metrics/ambari-metrics-assembly/pom.xml | 2 +- ambari-server/pom.xml | 4 +- ambari-shell/ambari-python-shell/pom.xml | 2 +- ambari-web/pom.xml | 168 +++++++++++++++---------- ambari-web/set-ambari-version.cmd | 17 +++ ambari-web/set-ambari-version.ps1 | 27 ++++ ambari-web/set-default-stack-version.cmd | 17 +++ ambari-web/set-default-stack-version.ps1 | 35 ++++++ ambari-web/toggle-experimental.cmd | 17 +++ ambari-web/toggle-experimental.ps1 | 27 ++++ contrib/views/slider/pom.xml | 137 ++++++++++++-------- 13 files changed, 338 insertions(+), 121 deletions(-) create mode 100644 ambari-web/set-ambari-version.cmd create mode 100644 ambari-web/set-ambari-version.ps1 create mode 100644 ambari-web/set-default-stack-version.cmd create mode 100644 ambari-web/set-default-stack-version.ps1 create mode 100644 ambari-web/toggle-experimental.cmd create mode 100644 ambari-web/toggle-experimental.ps1 diff --git a/ambari-agent/pom.xml b/ambari-agent/pom.xml index 110a8d57cd..447601100c 100644 --- a/ambari-agent/pom.xml +++ b/ambari-agent/pom.xml @@ -113,7 +113,7 @@ org.codehaus.mojo exec-maven-plugin - 1.2 + 1.2.1 @@ -799,7 +799,7 @@ org.codehaus.mojo exec-maven-plugin - 1.2 + 1.2.1 run-heat diff --git a/ambari-client/python-client/pom.xml b/ambari-client/python-client/pom.xml index 3c957eec60..73a6825afa 100644 --- a/ambari-client/python-client/pom.xml +++ b/ambari-client/python-client/pom.xml @@ -71,7 +71,7 @@ org.codehaus.mojo exec-maven-plugin - 1.2 + 1.2.1 diff --git a/ambari-metrics/ambari-metrics-assembly/pom.xml b/ambari-metrics/ambari-metrics-assembly/pom.xml index cf7a92deac..296d399090 100644 --- a/ambari-metrics/ambari-metrics-assembly/pom.xml +++ b/ambari-metrics/ambari-metrics-assembly/pom.xml @@ -925,7 +925,7 @@ org.codehaus.mojo exec-maven-plugin - 1.2 + 1.2.1 run-heat-collector diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml index 18593bd138..1e6be0c817 100644 --- a/ambari-server/pom.xml +++ b/ambari-server/pom.xml @@ -1133,7 +1133,7 @@ org.codehaus.mojo exec-maven-plugin - 1.2 + 1.2.1 @@ -1358,7 +1358,7 @@ org.codehaus.mojo exec-maven-plugin - 1.2 + 1.2.1 run-heat diff --git a/ambari-shell/ambari-python-shell/pom.xml b/ambari-shell/ambari-python-shell/pom.xml index d78c6ea978..c4dddf46da 100644 --- a/ambari-shell/ambari-python-shell/pom.xml +++ b/ambari-shell/ambari-python-shell/pom.xml @@ -71,7 +71,7 @@ org.codehaus.mojo exec-maven-plugin - 1.2 + 1.2.1 diff --git a/ambari-web/pom.xml b/ambari-web/pom.xml index 0849111c4c..04f9b5d48c 100644 --- a/ambari-web/pom.xml +++ b/ambari-web/pom.xml @@ -87,90 +87,130 @@ - org.apache.maven.plugins - maven-antrun-plugin - 1.7 + org.codehaus.mojo + exec-maven-plugin + 1.2.1 - clean + clean-rmdir clean - run + exec + + + ${executable.rmdir} + ${basedir} + ${args.rm.clean} public node_modules + + 0 + 1 + 2 + + + + + clean-mkdir + clean + + exec + + + ${executable.mkdir} + ${basedir} + ${args.mkdir} public + + + + compile-npm + compile + + exec + + + ${executable.npm} + ${basedir} + ${args.npm} install + + + + compile-brunch + compile + + exec + + + ${executable.brunch} + ${basedir} + ${args.brunch} build + + + + set-ambari-version + compile + + exec + + + + ${executable.shell} + ${basedir} + ${args.shell} ${basedir}${dirsep}set-ambari-version.${fileextension.shell} ${ambariVersion} + + + + set-default-stack-version + compile + + exec - - - - - - - - - - + + ${executable.shell} + ${basedir} + ${args.shell} ${basedir}${dirsep}set-default-stack-version.${fileextension.shell} ${defaultStackVersion} - compile + toggle-experimental compile - run + exec - - - - - - - - - - - - - - - - - - - - - - - + + ${executable.shell} + ${basedir} + ${args.shell} ${basedir}${dirsep}toggle-experimental.${fileextension.shell} ${enableExperimental} - test + ambari-web unit tests test - run + exec - - - - - + ${skipTests} + ${executable.npm} + ${basedir} + ${args.npm} test gzip ambari-web content prepare-package - run + exec - - - - - - - - + ${executable.gzip} + ${basedir} + + -f + public/javascripts/app.js + public/javascripts/vendor.js + public/stylesheets/app.css + @@ -230,17 +270,17 @@ win \ cmd - /C brunch build + /C brunch gzip cmd - /C mkdir public + /C mkdir cmd - /C npm install - /C npm test + /C npm cmd /C rmdir /S /Q cmd cmd + /C @@ -254,17 +294,17 @@ linux / brunch - build + gzip mkdir - public + npm - install - test + rm -rf sh sh + diff --git a/ambari-web/set-ambari-version.cmd b/ambari-web/set-ambari-version.cmd new file mode 100644 index 0000000000..14fdec64c8 --- /dev/null +++ b/ambari-web/set-ambari-version.cmd @@ -0,0 +1,17 @@ +@echo off +rem Licensed to the Apache Software Foundation (ASF) under one or more +rem contributor license agreements. See the NOTICE file distributed with +rem this work for additional information regarding copyright ownership. +rem The ASF licenses this file to You under the Apache License, Version 2.0 +rem (the "License"); you may not use this file except in compliance with +rem the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, software +rem distributed under the License is distributed on an "AS IS" BASIS, +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +rem See the License for the specific language governing permissions and +rem limitations under the License. + +powershell -File set-ambari-version.ps1 %* \ No newline at end of file diff --git a/ambari-web/set-ambari-version.ps1 b/ambari-web/set-ambari-version.ps1 new file mode 100644 index 0000000000..a69df44c64 --- /dev/null +++ b/ambari-web/set-ambari-version.ps1 @@ -0,0 +1,27 @@ +# +# 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. +# + +$newVersion = $($args[0]) + +if ($newVersion -ne '${ambariVersion}') +{ + "Setting Ambari version to $newVersion" + Get-Content public/javascripts/app.js -ReadCount 1000 | %{$_ -replace "App.version.*=.*;","App.version = '$newVersion';"} | Set-Content public/javascripts/tmp.js + Move-Item ./public/javascripts/tmp.js ./public/javascripts/app.js -force +} diff --git a/ambari-web/set-default-stack-version.cmd b/ambari-web/set-default-stack-version.cmd new file mode 100644 index 0000000000..e724e1fbb8 --- /dev/null +++ b/ambari-web/set-default-stack-version.cmd @@ -0,0 +1,17 @@ +@echo off +rem Licensed to the Apache Software Foundation (ASF) under one or more +rem contributor license agreements. See the NOTICE file distributed with +rem this work for additional information regarding copyright ownership. +rem The ASF licenses this file to You under the Apache License, Version 2.0 +rem (the "License"); you may not use this file except in compliance with +rem the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, software +rem distributed under the License is distributed on an "AS IS" BASIS, +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +rem See the License for the specific language governing permissions and +rem limitations under the License. + +powershell -File set-default-stack-version.ps1 %* \ No newline at end of file diff --git a/ambari-web/set-default-stack-version.ps1 b/ambari-web/set-default-stack-version.ps1 new file mode 100644 index 0000000000..0528158562 --- /dev/null +++ b/ambari-web/set-default-stack-version.ps1 @@ -0,0 +1,35 @@ +# +# 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. +# + +$newVersion = $($args[0]) + +if ($newVersion -ne '${defaultStackVersion}') +{ + $separator = "-" + $option = [System.StringSplitOptions]::RemoveEmptyEntries + $newStackParts = $newVersion.Split($separator, $option) + + $newStackVersion = $($newStackParts[0]) + "-" + $($newStackParts[1]) + $newLocalStackVersion = $($newStackParts[0]) + "Local-" + $($newStackParts[1]) + "Setting default stack to '$($newStackParts[0])' and version to '$($newStackParts[1])'" + Get-Content public/javascripts/app.js -ReadCount 1000 | %{$_ -replace "App.defaultStackVersion.*=.*;","App.defaultStackVersion = '$newStackVersion';"} | Set-Content public/javascripts/tmp.js + Move-Item ./public/javascripts/tmp.js ./public/javascripts/app.js -force + Get-Content public/javascripts/app.js -ReadCount 1000 | %{$_ -replace "App.defaultLocalStackVersion.*=.*;","App.defaultLocalStackVersion = '$newLocalStackVersion';"} | Set-Content public/javascripts/tmp.js + Move-Item ./public/javascripts/tmp.js ./public/javascripts/app.js -force +} diff --git a/ambari-web/toggle-experimental.cmd b/ambari-web/toggle-experimental.cmd new file mode 100644 index 0000000000..9552279055 --- /dev/null +++ b/ambari-web/toggle-experimental.cmd @@ -0,0 +1,17 @@ +@echo off +rem Licensed to the Apache Software Foundation (ASF) under one or more +rem contributor license agreements. See the NOTICE file distributed with +rem this work for additional information regarding copyright ownership. +rem The ASF licenses this file to You under the Apache License, Version 2.0 +rem (the "License"); you may not use this file except in compliance with +rem the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, software +rem distributed under the License is distributed on an "AS IS" BASIS, +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +rem See the License for the specific language governing permissions and +rem limitations under the License. + +powershell -File toggle-experimental.ps1 %* \ No newline at end of file diff --git a/ambari-web/toggle-experimental.ps1 b/ambari-web/toggle-experimental.ps1 new file mode 100644 index 0000000000..03c51bad3f --- /dev/null +++ b/ambari-web/toggle-experimental.ps1 @@ -0,0 +1,27 @@ +# +# 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. +# + +$enable = $($args[0]) + +if ($enable -eq 'true') +{ + echo 'Enabling experimental features...' + Get-Content public/javascripts/app.js -ReadCount 1000 | %{$_ -replace "App.enableExperimental.*=.*;","App.enableExperimental = true;"} | Set-Content public/javascripts/tmp.js + Move-Item ./public/javascripts/tmp.js ./public/javascripts/app.js -force +} diff --git a/contrib/views/slider/pom.xml b/contrib/views/slider/pom.xml index cf5c0c5cbc..8c1e1b75a4 100644 --- a/contrib/views/slider/pom.xml +++ b/contrib/views/slider/pom.xml @@ -141,62 +141,105 @@ - org.apache.maven.plugins - maven-antrun-plugin - 1.7 + org.codehaus.mojo + exec-maven-plugin + 1.2.1 - clean + clean-rmdir clean - run + exec - - - - - - - - - - + ${executable.rmdir} + ${basedir} + ${args.rm.clean} public node_modules + + 0 + 1 + 2 + + + + + clean-mkdir + clean + + exec + + + ${executable.mkdir} + ${basedir} + ${args.mkdir} public - compile + slider-ui-compile-npm generate-resources - run + exec - - - - - - - - + ${executable.npm} + ${ui.directory} + ${args.npm} install + + + + slider-ui-compile-brunch + compile + + exec + + + ${executable.brunch} + ${ui.directory} + ${args.brunch} build - test + slider-ui-test test - run + exec - - - - - - + ${skipTests} + ${executable.npm} + ${ui.directory} + ${args.npm} test + + ${executable.python} + + gzip ambari-web content + prepare-package + + exec + + + ${executable.gzip} + ${ui.directory} + + -f + public/javascripts/app.js + public/javascripts/vendor.js + public/stylesheets/app.css + + + + + + + + +--> org.apache.maven.plugins maven-compiler-plugin @@ -348,14 +385,14 @@ win \ + python cmd - /C brunch build + /C brunch gzip cmd - /C mkdir public + /C mkdir cmd - /C npm install - /C npm test + /C npm cmd /C rmdir /S /Q cmd @@ -372,14 +409,14 @@ linux / + ${project.basedir}/../ambari-common/src/main/unix/ambari-python-wrap brunch - build + gzip mkdir - public + npm - install - test + rm -rf sh -- cgit v1.2.3