From f25c24872310ea02c8f29817ebda4d48bf70d938 Mon Sep 17 00:00:00 2001 From: Thomas Vachuska Date: Tue, 12 Jun 2018 13:18:45 -0700 Subject: [PATCH] Moved /features to /tools/package/features. Change-Id: I6b52c92b688a833b9e3813416b785533cb4dd829 --- modules.defs | 13 ++++++++++++ pom.xml | 2 +- tools/package/BUCK | 21 +------------------ tools/package/BUILD | 7 +++++-- {features => tools/package/features}/BUCK | 6 ++++++ {features => tools/package/features}/BUILD | 20 +++++++++--------- .../package/features}/features.xml | 0 {features => tools/package/features}/pom.xml | 1 + tools/test/bin/onos-check-bits | 6 ++++++ 9 files changed, 43 insertions(+), 33 deletions(-) rename {features => tools/package/features}/BUCK (96%) rename {features => tools/package/features}/BUILD (91%) rename {features => tools/package/features}/features.xml (100%) rename {features => tools/package/features}/pom.xml (98%) diff --git a/modules.defs b/modules.defs index dabd5f90d3..c43a273d08 100644 --- a/modules.defs +++ b/modules.defs @@ -304,5 +304,18 @@ APP_JARS = [ '//apps/kafka-integration/app:onos-apps-kafka-integration-app', ] +FEATURES = [ + '//tools/package/features:onos-thirdparty-base', + '//tools/package/features:onos-thirdparty-web', + '//tools/package/features:onos-api', + '//tools/package/features:onos-core', + '//tools/package/features:onos-incubator', + '//tools/package/features:onos-rest', + '//tools/package/features:onos-gui', + '//tools/package/features:onos-gui2', + '//tools/package/features:onos-cli', + '//tools/package/features:onos-security', +] + APPS = ONOS_DRIVERS + ONOS_PROVIDERS + ONOS_APPS + MODELS + PIPELINES \ + PROTOCOL_APPS diff --git a/pom.xml b/pom.xml index b32e8a9d2a..862234f0be 100644 --- a/pom.xml +++ b/pom.xml @@ -64,10 +64,10 @@ apps incubator - features models + tools/package/features tools/package/archetypes tools/package/branding tools/package/maven-plugin diff --git a/tools/package/BUCK b/tools/package/BUCK index 9324c2c866..b7adf19793 100644 --- a/tools/package/BUCK +++ b/tools/package/BUCK @@ -2,19 +2,6 @@ KARAF = '//lib:apache-karaf' BRANDING = '//tools/package/branding:onos-tools-package-branding' PATCHES = '//lib:apache-karaf-patches' -FEATURES = [ - '//features:onos-thirdparty-base', - '//features:onos-thirdparty-web', - '//features:onos-api', - '//features:onos-core', - '//features:onos-incubator', - '//features:onos-rest', - '//features:onos-gui', - '//features:onos-gui2', - '//features:onos-cli', - '//features:onos-security', -] - #TODO move to buck-tools export_file ( name = 'onos-prep-karaf', @@ -28,17 +15,11 @@ genrule( out = 'karaf.zip', ) -compile_features( - name = 'onos-features', - features = FEATURES, - maven_coords = 'org.onosproject:onos-features:xml:features:' + ONOS_VERSION, -) - staged_repos = ['$(location %s-repo)' % f for f in FEATURES] staged_apps = ['$(location %s)' % a for a in APPS] # feature_coords = 'foo:bar:1.3' -sources = [ '$(location :onos-features)', ] +sources = [ '$(location //tools/package/features:onos-features)', ] sources += staged_repos + staged_apps tar_file( diff --git a/tools/package/BUILD b/tools/package/BUILD index 93a0e1c55e..2067140001 100644 --- a/tools/package/BUILD +++ b/tools/package/BUILD @@ -22,7 +22,7 @@ genrule( # FIXME: Move /features to under tools/package/features PACKAGING_REQUIREMENTS = [ - "//features:onos-features", + "//tools/package/features:onos-features", ":onos-karaf", ] @@ -35,6 +35,7 @@ genrule( cmd = "$(location onos_stage.py) $(location onos.tar.gz) %s $(location :onos-karaf) $(SRCS)" % ONOS_VERSION, visibility = ["//visibility:public"], tools = ["onos_stage.py"], + output_to_bindir = True, ) filegroup( @@ -50,6 +51,7 @@ genrule( cmd = "mkdir onos-admin-%s; cp $(SRCS) onos-admin-%s; tar zcf $(location onos-admin.tar.gz) onos-admin-%s"\ % (ONOS_VERSION, ONOS_VERSION, ONOS_VERSION), visibility = ["//visibility:public"], + output_to_bindir = True, ) # Generates the onos-test.tar.gz file with test tools @@ -60,6 +62,7 @@ genrule( cmd = "mkdir onos-test-%s; cp -r tools onos-test-%s; tar zcf $(location onos-test.tar.gz) onos-test-%s"\ % (ONOS_VERSION, ONOS_VERSION, ONOS_VERSION), visibility = ["//visibility:public"], + output_to_bindir = True, ) # Runs ONOS as a single instance from the /tmp directory @@ -70,7 +73,7 @@ genrule( srcs = ["onos-run-karaf", "onos-package"], cmd = "sed \"s#ONOS_TAR=#ONOS_TAR=$(location :onos-package)#\" $(location onos-run-karaf) > $(location onos-runner); chmod +x $(location onos-runner)", executable = True, - local = True, + output_to_bindir = True, visibility = ["//visibility:public"], ) diff --git a/features/BUCK b/tools/package/features/BUCK similarity index 96% rename from features/BUCK rename to tools/package/features/BUCK index 03ee6cfd56..479d4881a8 100644 --- a/features/BUCK +++ b/tools/package/features/BUCK @@ -158,3 +158,9 @@ osgi_feature ( '//core/security:onos-security', ] ) + +compile_features( + name = 'onos-features', + features = FEATURES, + maven_coords = 'org.onosproject:onos-features:xml:features:' + ONOS_VERSION, +) diff --git a/features/BUILD b/tools/package/features/BUILD similarity index 91% rename from features/BUILD rename to tools/package/features/BUILD index 19577879b4..54438428ee 100644 --- a/features/BUILD +++ b/tools/package/features/BUILD @@ -107,16 +107,16 @@ osgi_feature( FEATURES = [ - "//features:onos-thirdparty-base", - "//features:onos-thirdparty-web", - "//features:onos-api", - "//features:onos-core", -# "//features:onos-incubator", -# "//features:onos-rest", -# "//features:onos-gui", -# "//features:onos-gui2", -# "//features:onos-cli", -# "//features:onos-security", + "//tools/package/features:onos-thirdparty-base", + "//tools/package/features:onos-thirdparty-web", + "//tools/package/features:onos-api", + "//tools/package/features:onos-core", +# "//tools/package/features:onos-incubator", +# "//tools/package/features:onos-rest", +# "//tools/package/features:onos-gui", +# "//tools/package/features:onos-gui2", +# "//tools/package/features:onos-cli", +# "//tools/package/features:onos-security", ] osgi_feature_repo( diff --git a/features/features.xml b/tools/package/features/features.xml similarity index 100% rename from features/features.xml rename to tools/package/features/features.xml diff --git a/features/pom.xml b/tools/package/features/pom.xml similarity index 98% rename from features/pom.xml rename to tools/package/features/pom.xml index 7fe9034f27..18dd3c4312 100644 --- a/features/pom.xml +++ b/tools/package/features/pom.xml @@ -23,6 +23,7 @@ org.onosproject onos 1.14.0-SNAPSHOT + ../../../pom.xml onos-features diff --git a/tools/test/bin/onos-check-bits b/tools/test/bin/onos-check-bits index cc087463d5..2b0acd3c90 100755 --- a/tools/test/bin/onos-check-bits +++ b/tools/test/bin/onos-check-bits @@ -12,6 +12,12 @@ if [ -f $BUCK_TAR ] && [ $BUCK_TAR -nt $ONOS_TAR ]; then rm -f $ONOS_TAR >/dev/null; ln -s $BUCK_TAR $ONOS_TAR fi +# If the Bazel-built bits are newer than the BUCK-built bits, use the former. +# BAZEL_TAR=$ONOS_ROOT/bazel-bin/tools/package/onos.tar.gz +# if [ -f $BAZEL_TAR ] && [ $BAZEL_TAR -nt $BUCK_TAR ]; then +# rm -f $ONOS_TAR >/dev/null; ln -s $BAZEL_TAR $ONOS_TAR +# fi + ls -lL $ONOS_TAR && cksum $ONOS_TAR if [ $? -ne 0 ]; then echo "ONOS archive is unreadable" && exit 1