Brian O'Connor | 9e1352f | 2016-04-29 17:13:33 -0700 | [diff] [blame] | 1 | KARAF = '//lib:apache-karaf' |
| 2 | BRANDING = '//tools/package/branding:onos-tools-package-branding' |
| 3 | |
| 4 | FEATURES = [ |
| 5 | '//features:onos-thirdparty-base', |
| 6 | '//features:onos-thirdparty-web', |
| 7 | '//features:onos-api', |
| 8 | '//features:onos-core', |
| 9 | '//features:onos-incubator', |
| 10 | '//features:onos-rest', |
| 11 | '//features:onos-gui', |
| 12 | '//features:onos-cli', |
| 13 | #'//features:onos-security', |
| 14 | ] |
| 15 | |
Brian O'Connor | 9e1352f | 2016-04-29 17:13:33 -0700 | [diff] [blame] | 16 | #TODO move to buck-tools |
| 17 | export_file ( |
| 18 | name = 'onos-prep-karaf', |
| 19 | ) |
| 20 | |
| 21 | genrule( |
| 22 | name = 'onos-karaf', |
| 23 | srcs = glob(['bin/*', 'etc/*', 'init/*']), |
| 24 | bash = '$(location :onos-prep-karaf) $OUT $(location %s) %s $(location %s)'\ |
| 25 | % (KARAF, ONOS_VERSION, BRANDING), |
| 26 | out = 'karaf.zip', |
| 27 | ) |
| 28 | |
| 29 | compile_features( |
| 30 | name = 'onos-features', |
| 31 | features = FEATURES, |
| 32 | ) |
| 33 | |
| 34 | staged_repos = ['$(location %s-repo)' % f for f in FEATURES] |
| 35 | staged_apps = ['$(location %s)' % a for a in APPS] |
| 36 | |
| 37 | # feature_coords = 'foo:bar:1.3' |
| 38 | sources = [ '$(location :onos-features)', ] |
| 39 | sources += staged_repos + staged_apps |
| 40 | |
| 41 | genrule( |
| 42 | name = 'onos-package', |
Jonathan Hart | 4e22b2c | 2016-07-29 13:39:15 -0700 | [diff] [blame] | 43 | srcs = glob(['bin/*', 'etc/*', 'init/*', 'config/*']), |
Brian O'Connor | 92ec213 | 2016-05-03 17:30:25 -0700 | [diff] [blame] | 44 | out = 'onos.tar.gz', |
Thomas Vachuska | 0483bee | 2016-05-04 19:37:51 -0700 | [diff] [blame] | 45 | bash = '$(exe //buck-tools:onos-stage) $OUT $(location :onos-karaf) ' + ' '.join(sources), |
Brian O'Connor | 9e1352f | 2016-04-29 17:13:33 -0700 | [diff] [blame] | 46 | visibility = [ 'PUBLIC' ], |
Ray Milkey | 43702bf | 2016-05-04 10:40:55 -0700 | [diff] [blame] | 47 | ) |
Thomas Vachuska | 5f54c6f | 2016-05-04 19:19:51 -0700 | [diff] [blame] | 48 | |
| 49 | genrule( |
| 50 | name = 'onos-run', |
| 51 | out = 'onos-run', |
| 52 | srcs = [ 'onos-run-karaf' ], |
| 53 | bash = 'sed "s#ONOS_TAR=#ONOS_TAR=$(location :onos-package)#" $SRCS > $OUT; chmod +x $OUT', |
| 54 | executable = True, |
| 55 | visibility = [ 'PUBLIC' ], |
Ray Milkey | 4abe844 | 2016-05-05 11:21:33 -0700 | [diff] [blame] | 56 | ) |