ONOS-628 - Download and extract node binaries for the GUI build step
- Added gulp build task the:
- Bundles Vendor JS files
- Bundles ONOS JS Files
- Bundles ONOS CSS Files
- Added SourceMaps to JS bundles - Helps with debugging during development
- Added Bundles to index.js and removed old references
- Git Ignored any generated files
- Ensured the build step is able to build without a local copy of node installed
- Added BUCK genrules (provided by Viswa)
- Added BUCK Dependency to GUI
- Buck Rule to run when src changes
- Node/NPM downloaded using BUCK remote_file
Change-Id: Ia6ca3b952ff801850ade7469c23aac76c8520400
diff --git a/web/gui/BUCK b/web/gui/BUCK
index 88181de..e15ce91 100644
--- a/web/gui/BUCK
+++ b/web/gui/BUCK
@@ -1,3 +1,5 @@
+NODE_VERSION = '8.0.1'
+
COMPILE_DEPS = [
'//lib:CORE_DEPS',
'//lib:javax.ws.rs-api',
@@ -12,6 +14,7 @@
'//incubator/net:onos-incubator-net',
'//utils/rest:onlab-rest',
'//core/store/serializers:onos-core-serializers',
+ ':onos-tools-gui'
]
TEST_DEPS = [
@@ -30,10 +33,33 @@
'WEB-INF/classes/raw': 'src/main/webapp/raw',
}
+include_defs('//bucklets/node.bucklet')
+sh_src='onos-gui-build'
+
+fetch_node(version = 'v8.1.2')
+
+export_file (
+ name = 'onos-tools-gui-exe',
+ src = sh_src,
+ visibility = [ 'PUBLIC' ],
+)
+
+genrule(
+ name = 'onos-tools-gui',
+ srcs = ['src/main/webapp'],
+ bash = '$(location :onos-tools-gui-exe) '
+ + '$(location //web/gui:node-release-v8.1.2) '
+ + '$(location //web/gui:node-bin-v8.1.2) > $OUT',
+ cmd_exe = '',
+ out = 'onos-tools-gui.log',
+ visibility = [ 'PUBLIC' ],
+)
+
osgi_jar_with_tests (
name = 'onos-gui',
deps = COMPILE_DEPS,
test_deps = TEST_DEPS,
include_resources = RESOURCES,
web_context = '/onos/ui',
+ do_javadocs = False,
)