Simplifying rules and providing sensible defaults
Updated cordvtn, dhcp, fwd, onos-api, of-api, onlab-rest, onos-rest, onos-gui Also, fixed checkstyle error print Change-Id: I9d6ab76791e8603678079067a3b4e007ca7c4667
Showing
16 changed files
with
198 additions
and
242 deletions
1 | -DEPS = [ | 1 | +CORE = [ |
2 | '//utils/osgi:onlab-osgi', | 2 | '//utils/osgi:onlab-osgi', |
3 | '//utils/junit:onlab-junit', | 3 | '//utils/junit:onlab-junit', |
4 | '//utils/misc:onlab-misc', | 4 | '//utils/misc:onlab-misc', |
... | @@ -81,7 +81,14 @@ DEPS = [ | ... | @@ -81,7 +81,14 @@ DEPS = [ |
81 | 81 | ||
82 | '//web/api:onos-rest', | 82 | '//web/api:onos-rest', |
83 | '//web/gui:onos-gui', | 83 | '//web/gui:onos-gui', |
84 | +] | ||
85 | + | ||
86 | +APPS = [ | ||
87 | + '//apps/dhcp:onos-apps-dhcp-oar', | ||
88 | + '//apps/fwd:onos-apps-fwd-oar', | ||
89 | +] | ||
84 | 90 | ||
91 | +APP_JARS = [ | ||
85 | '//apps/cpman/api:onos-app-cpman-api', | 92 | '//apps/cpman/api:onos-app-cpman-api', |
86 | '//apps/cpman/app:onos-app-cpman-app', | 93 | '//apps/cpman/app:onos-app-cpman-app', |
87 | '//apps/aaa:onos-app-aaa', | 94 | '//apps/aaa:onos-app-aaa', |
... | @@ -90,14 +97,14 @@ DEPS = [ | ... | @@ -90,14 +97,14 @@ DEPS = [ |
90 | '//apps/routing-api:onos-app-routing-api', | 97 | '//apps/routing-api:onos-app-routing-api', |
91 | '//apps/cip:onos-app-cip', | 98 | '//apps/cip:onos-app-cip', |
92 | '//apps/cordmcast:onos-app-cord-mcast', | 99 | '//apps/cordmcast:onos-app-cord-mcast', |
93 | - '//apps/cordvtn:onos-app-cordvtn', | 100 | + '//apps/cordvtn:onos-apps-cordvtn', |
94 | - '//apps/dhcp/api:onos-app-dhcp-api', | 101 | + '//apps/dhcp/api:onos-apps-dhcp-api', |
95 | - '//apps/dhcp/app:onos-app-dhcp-app', | 102 | + '//apps/dhcp/app:onos-apps-dhcp-app', |
96 | '//apps/drivermatrix:onos-app-drivermatrix', | 103 | '//apps/drivermatrix:onos-app-drivermatrix', |
97 | '//apps/events:onos-app-events', | 104 | '//apps/events:onos-app-events', |
98 | '//apps/faultmanagement:onos-app-fm', | 105 | '//apps/faultmanagement:onos-app-fm', |
99 | '//apps/flowanalyzer:onos-app-flowanalyzer', | 106 | '//apps/flowanalyzer:onos-app-flowanalyzer', |
100 | - '//apps/fwd:onos-app-fwd', | 107 | + '//apps/fwd:onos-apps-fwd', |
101 | '//apps/igmp:onos-app-igmp', | 108 | '//apps/igmp:onos-app-igmp', |
102 | '//apps/influxdbmetrics:onos-app-influxdb', | 109 | '//apps/influxdbmetrics:onos-app-influxdb', |
103 | '//apps/olt:onos-app-olt-api', | 110 | '//apps/olt:onos-app-olt-api', |
... | @@ -128,9 +135,21 @@ DEPS = [ | ... | @@ -128,9 +135,21 @@ DEPS = [ |
128 | ] | 135 | ] |
129 | 136 | ||
130 | java_library( | 137 | java_library( |
131 | - name = 'onos', | 138 | + name = 'core', |
132 | - visibility = ['PUBLIC'], | 139 | + visibility = ['PUBLIC'], |
133 | - deps = DEPS | 140 | + deps = CORE, |
141 | +) | ||
142 | + | ||
143 | +java_library( | ||
144 | + name = 'apps', | ||
145 | + visibility = ['PUBLIC'], | ||
146 | + deps = APPS + APP_JARS, | ||
147 | +) | ||
148 | + | ||
149 | +java_library( | ||
150 | + name = 'onos', | ||
151 | + visibility = ['PUBLIC'], | ||
152 | + deps = [ ':core', ':apps' ] | ||
134 | ) | 153 | ) |
135 | 154 | ||
136 | INSTALL = [ | 155 | INSTALL = [ | ... | ... |
1 | -SRC = 'src/main/java/org/onosproject/**/' | ||
2 | -TEST = 'src/test/java/org/onosproject/**/' | ||
3 | - | ||
4 | -CURRENT_NAME = 'onos-app-cordvtn' | ||
5 | -CURRENT_TARGET = ':' + CURRENT_NAME | ||
6 | - | ||
7 | COMPILE_DEPS = [ | 1 | COMPILE_DEPS = [ |
8 | '//lib:CORE_DEPS', | 2 | '//lib:CORE_DEPS', |
9 | '//lib:org.apache.karaf.shell.console', | 3 | '//lib:org.apache.karaf.shell.console', |
... | @@ -13,29 +7,14 @@ COMPILE_DEPS = [ | ... | @@ -13,29 +7,14 @@ COMPILE_DEPS = [ |
13 | '//cli:onos-cli', | 7 | '//cli:onos-cli', |
14 | '//core/store/serializers:onos-core-serializers', | 8 | '//core/store/serializers:onos-core-serializers', |
15 | '//apps/openstackinterface:onos-app-openstackinterface-api', | 9 | '//apps/openstackinterface:onos-app-openstackinterface-api', |
16 | - '//apps/dhcp/api:onos-app-dhcp-api', | 10 | + '//apps/dhcp/api:onos-apps-dhcp-api', |
17 | '//protocols/ovsdb/api:onos-ovsdb-api', | 11 | '//protocols/ovsdb/api:onos-ovsdb-api', |
18 | '//protocols/ovsdb/rfc:onos-ovsdb-rfc', | 12 | '//protocols/ovsdb/rfc:onos-ovsdb-rfc', |
19 | ] | 13 | ] |
20 | 14 | ||
21 | -TEST_DEPS = [ | 15 | +osgi_jar_with_tests ( |
22 | - '//lib:TEST', | ||
23 | -] | ||
24 | - | ||
25 | -java_library( | ||
26 | - name = CURRENT_NAME, | ||
27 | - srcs = glob([SRC + '/*.java']), | ||
28 | deps = COMPILE_DEPS, | 16 | deps = COMPILE_DEPS, |
29 | - visibility = ['PUBLIC'], | 17 | + web_context = '/onos/cordvtn', |
30 | - resources_root = 'src/main/resources', | ||
31 | - resources = glob(['src/main/resources/**']), | ||
32 | ) | 18 | ) |
33 | 19 | ||
34 | -java_test( | 20 | +#FIXME need onos_app |
35 | - name = 'tests', | ||
36 | - srcs = glob([TEST + '/*.java']), | ||
37 | - deps = COMPILE_DEPS + | ||
38 | - TEST_DEPS + | ||
39 | - [CURRENT_TARGET], | ||
40 | - source_under_test = [CURRENT_TARGET], | ||
41 | -) | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
1 | BUNDLES = [ | 1 | BUNDLES = [ |
2 | - '//apps/dhcp/api:onos-app-dhcp-api', | 2 | + '//apps/dhcp/api:onos-apps-dhcp-api', |
3 | - '//apps/dhcp/app:onos-app-dhcp-app', | 3 | + '//apps/dhcp/app:onos-apps-dhcp-app', |
4 | ] | 4 | ] |
5 | 5 | ||
6 | onos_app( | 6 | onos_app( |
7 | - app_name = 'org.onosproject.dhcp', | 7 | + feature_coords = ONOS_GROUP_ID + ':onos-apps-dhcp:' + ONOS_VERSION, |
8 | - feature_coords = ONOS_GROUP_ID + ':onos-app-dhcp:' + ONOS_VERSION, | ||
9 | title = 'DHCP Server App', | 8 | title = 'DHCP Server App', |
10 | category = 'Utility', | 9 | category = 'Utility', |
11 | url = 'http://onosproject.org', | 10 | url = 'http://onosproject.org', | ... | ... |
1 | -SRC = 'src/main/java/org/onosproject/**/' | ||
2 | -TEST = 'src/test/java/org/onosproject/**/' | ||
3 | - | ||
4 | -CURRENT_NAME = 'onos-app-dhcp-api' | ||
5 | -CURRENT_TARGET = ':' + CURRENT_NAME | ||
6 | - | ||
7 | COMPILE_DEPS = [ | 1 | COMPILE_DEPS = [ |
8 | '//lib:CORE_DEPS', | 2 | '//lib:CORE_DEPS', |
9 | ] | 3 | ] |
10 | 4 | ||
11 | -TEST_DEPS = [ | 5 | +osgi_jar_with_tests ( |
12 | - '//lib:TEST', | ||
13 | -] | ||
14 | - | ||
15 | -osgi_jar( | ||
16 | - name = CURRENT_NAME, | ||
17 | - srcs = glob([SRC + '/*.java']), | ||
18 | deps = COMPILE_DEPS, | 6 | deps = COMPILE_DEPS, |
19 | - visibility = ['PUBLIC'], | 7 | +) |
20 | -) | ||
21 | - | ||
22 | -java_test( | ||
23 | - name = 'tests', | ||
24 | - srcs = glob([TEST + '/*.java']), | ||
25 | - deps = COMPILE_DEPS + | ||
26 | - TEST_DEPS + | ||
27 | - [CURRENT_TARGET], | ||
28 | - source_under_test = [CURRENT_TARGET], | ||
29 | -) | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
1 | -CURRENT_NAME = 'onos-app-dhcp-app' | ||
2 | - | ||
3 | COMPILE_DEPS = [ | 1 | COMPILE_DEPS = [ |
4 | '//lib:CORE_DEPS', | 2 | '//lib:CORE_DEPS', |
5 | '//lib:javax.ws.rs-api', | 3 | '//lib:javax.ws.rs-api', |
6 | '//lib:org.apache.karaf.shell.console', | 4 | '//lib:org.apache.karaf.shell.console', |
7 | - '//apps/dhcp/api:onos-app-dhcp-api', | 5 | + '//apps/dhcp/api:onos-apps-dhcp-api', |
8 | '//utils/rest:onlab-rest', | 6 | '//utils/rest:onlab-rest', |
9 | '//core/store/serializers:onos-core-serializers', | 7 | '//core/store/serializers:onos-core-serializers', |
10 | '//cli:onos-cli', | 8 | '//cli:onos-cli', |
... | @@ -14,12 +12,8 @@ TEST_DEPS = [ | ... | @@ -14,12 +12,8 @@ TEST_DEPS = [ |
14 | '//lib:TEST_ADAPTERS', | 12 | '//lib:TEST_ADAPTERS', |
15 | ] | 13 | ] |
16 | 14 | ||
17 | -osgi_jar( | 15 | +osgi_jar_with_tests ( |
18 | - name = CURRENT_NAME, | ||
19 | deps = COMPILE_DEPS, | 16 | deps = COMPILE_DEPS, |
20 | - srcs = glob([SRC + '/*.java']), | ||
21 | - resources = glob([RESOURCES_ROOT + '**']), | ||
22 | - test_srcs = glob([TEST + '/*.java']), | ||
23 | test_deps = TEST_DEPS, | 17 | test_deps = TEST_DEPS, |
24 | web_context = '/onos/dhcp', | 18 | web_context = '/onos/dhcp', |
25 | ) | 19 | ) | ... | ... |
1 | -CURRENT_NAME = 'onos-app-fwd' | ||
2 | -CURRENT_TARGET = ':' + CURRENT_NAME | ||
3 | - | ||
4 | COMPILE_DEPS = [ | 1 | COMPILE_DEPS = [ |
5 | '//lib:CORE_DEPS', | 2 | '//lib:CORE_DEPS', |
6 | '//lib:org.apache.karaf.shell.console', | 3 | '//lib:org.apache.karaf.shell.console', |
7 | '//cli:onos-cli', | 4 | '//cli:onos-cli', |
8 | ] | 5 | ] |
9 | 6 | ||
10 | -TEST_DEPS = [ | ||
11 | - '//lib:TEST', | ||
12 | -] | ||
13 | - | ||
14 | osgi_jar( | 7 | osgi_jar( |
15 | - name = CURRENT_NAME, | ||
16 | - srcs = glob([SRC + '/*.java']), | ||
17 | deps = COMPILE_DEPS, | 8 | deps = COMPILE_DEPS, |
18 | - test_srcs = glob([TEST + '/*.java']), | ||
19 | - test_deps = TEST_DEPS, | ||
20 | - visibility = ['PUBLIC'], | ||
21 | ) | 9 | ) |
22 | 10 | ||
23 | onos_app( | 11 | onos_app( |
24 | - app_name = 'org.onosproject.fwd', | ||
25 | title = 'Reactive Forwarding App', | 12 | title = 'Reactive Forwarding App', |
26 | category = 'Traffic Steering', | 13 | category = 'Traffic Steering', |
27 | url = 'http://onosproject.org', | 14 | url = 'http://onosproject.org', |
28 | description = 'Reactive forwarding application using flow subsystem.', | 15 | description = 'Reactive forwarding application using flow subsystem.', |
29 | - included_bundles = [ CURRENT_TARGET ], | ||
30 | ) | 16 | ) |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -4,21 +4,26 @@ DEBUG_ARG='JAVA_TOOL_OPTIONS="-Xdebug -Xrunjdwp:server=y,transport=dt_socket,add | ... | @@ -4,21 +4,26 @@ DEBUG_ARG='JAVA_TOOL_OPTIONS="-Xdebug -Xrunjdwp:server=y,transport=dt_socket,add |
4 | FORCE_INSTALL=True | 4 | FORCE_INSTALL=True |
5 | NONE='NONE' | 5 | NONE='NONE' |
6 | 6 | ||
7 | -SRC = 'src/main/java/org/onosproject/**/' | 7 | +SRC = 'src/main/java/**/' |
8 | -TEST = 'src/test/java/org/onosproject/**/' | 8 | +TEST = 'src/test/java/**/' |
9 | RESOURCES_ROOT = 'src/main/resources/' | 9 | RESOURCES_ROOT = 'src/main/resources/' |
10 | +TEST_RESOURCES_ROOT = 'src/test/resources/' | ||
11 | + | ||
10 | 12 | ||
11 | ONOS_GROUP_ID = 'org.onosproject' | 13 | ONOS_GROUP_ID = 'org.onosproject' |
12 | ONOS_VERSION = '1.6.0-SNAPSHOT' | 14 | ONOS_VERSION = '1.6.0-SNAPSHOT' |
15 | +ONOS_ARTIFACT_BASE = 'onos-' | ||
16 | + | ||
17 | +def _get_name(): | ||
18 | + base_path = get_base_path() | ||
19 | + return ONOS_ARTIFACT_BASE + base_path.replace('/', '-') #TODO Unix-separator | ||
13 | 20 | ||
14 | def osgi_jar( | 21 | def osgi_jar( |
15 | - name, | 22 | + name = None, |
16 | - srcs, | 23 | + srcs = None, |
17 | - test_srcs = None, | ||
18 | group_id = ONOS_GROUP_ID, | 24 | group_id = ONOS_GROUP_ID, |
19 | version = ONOS_VERSION, | 25 | version = ONOS_VERSION, |
20 | deps = [], | 26 | deps = [], |
21 | - test_deps = [ '//lib:TEST' ], | ||
22 | visibility = ['PUBLIC'], | 27 | visibility = ['PUBLIC'], |
23 | license = 'NONE', | 28 | license = 'NONE', |
24 | description = '', | 29 | description = '', |
... | @@ -27,19 +32,31 @@ def osgi_jar( | ... | @@ -27,19 +32,31 @@ def osgi_jar( |
27 | export_packages = '*', | 32 | export_packages = '*', |
28 | include_resources = NONE, | 33 | include_resources = NONE, |
29 | web_context = NONE, | 34 | web_context = NONE, |
30 | - resources = None, | 35 | + resources = NONE, |
31 | resources_root = None, | 36 | resources_root = None, |
32 | - test_resources = None, | ||
33 | - test_resources_root = None, | ||
34 | **kwargs | 37 | **kwargs |
35 | ): | 38 | ): |
36 | 39 | ||
40 | + # if name and _get_name() != name: | ||
41 | + # print _get_name(), '!=', name | ||
42 | + if name is None: | ||
43 | + name = _get_name() | ||
44 | + | ||
45 | + if srcs is None: | ||
46 | + srcs = glob([SRC + '/*.java']) | ||
47 | + | ||
48 | + if resources == NONE and resources_root is not None: | ||
49 | + resources = glob([resources_root + '**']) | ||
50 | + elif resources == NONE: | ||
51 | + resources = glob([RESOURCES_ROOT + '**']) | ||
52 | + | ||
53 | + if resources and not resources_root: | ||
54 | + resources_root = RESOURCES_ROOT | ||
55 | + | ||
37 | bare_jar_name = name + '-jar' | 56 | bare_jar_name = name + '-jar' |
38 | osgi_jar_name = name + '-osgi' | 57 | osgi_jar_name = name + '-osgi' |
39 | mvn_coords = group_id + ':' + name + ':' + version | 58 | mvn_coords = group_id + ':' + name + ':' + version |
40 | 59 | ||
41 | - if resources and not resources_root: | ||
42 | - resources_root = RESOURCES_ROOT | ||
43 | 60 | ||
44 | java_library( | 61 | java_library( |
45 | name = bare_jar_name, | 62 | name = bare_jar_name, |
... | @@ -98,7 +115,9 @@ def osgi_jar( | ... | @@ -98,7 +115,9 @@ def osgi_jar( |
98 | '-o $OUT', | 115 | '-o $OUT', |
99 | '-c $(location //tools/build/conf:checkstyle-xml)', | 116 | '-c $(location //tools/build/conf:checkstyle-xml)', |
100 | ' '.join(srcs) )) | 117 | ' '.join(srcs) )) |
101 | - error_cmd = '(touch $OUT; cat $OUT | grep "^\[ERROR\]"; exit 1)' | 118 | + error_cmd = ' | '.join(( '( touch $OUT; cat $OUT', |
119 | + 'grep -E "^[^: ]*:\d+:\d+: error:"', | ||
120 | + 'sed "s#^.*__srcs/#%s:#g" ; exit 1)' % name, )) | ||
102 | cmd = ' || '.join((chk_cmd, error_cmd)) | 121 | cmd = ' || '.join((chk_cmd, error_cmd)) |
103 | genrule( | 122 | genrule( |
104 | name = name + '-checkstyle', | 123 | name = name + '-checkstyle', |
... | @@ -126,18 +145,48 @@ def osgi_jar( | ... | @@ -126,18 +145,48 @@ def osgi_jar( |
126 | visibility = visibility, | 145 | visibility = visibility, |
127 | ) | 146 | ) |
128 | 147 | ||
148 | +def osgi_jar_with_tests( | ||
149 | + name = None, | ||
150 | + deps = [], | ||
151 | + test_srcs = None, | ||
152 | + test_deps = [ '//lib:TEST' ], | ||
153 | + test_resources = None, | ||
154 | + test_resources_root = None, | ||
155 | + visibility = [ 'PUBLIC' ], | ||
156 | + **kwargs | ||
157 | + ): | ||
158 | + | ||
159 | + if name is None: | ||
160 | + name = _get_name() | ||
161 | + | ||
162 | + osgi_jar(name = name, | ||
163 | + deps = deps, | ||
164 | + visibility = visibility, | ||
165 | + **kwargs) | ||
129 | 166 | ||
130 | if test_resources and not test_resources_root: | 167 | if test_resources and not test_resources_root: |
131 | - test_resources_root = RESOURCES_ROOT | 168 | + test_resources_root = TEST_RESOURCES_ROOT |
132 | - | 169 | + if test_resources_root and not test_resources: |
133 | - if test_srcs is not None: | 170 | + test_resources = glob([test_resources_root + '**']) |
134 | - java_test( | 171 | + if not test_resources and not test_resources_root: |
135 | - name = 'tests', | 172 | + test_resources = glob([TEST_RESOURCES_ROOT + '**']) |
136 | - srcs = test_srcs, | 173 | + if test_resources: |
137 | - deps = deps + | 174 | + test_resources_root = TEST_RESOURCES_ROOT |
138 | - test_deps + | 175 | + |
139 | - [':' + bare_jar_name], | 176 | + if test_srcs is None: |
140 | - source_under_test = [':' + bare_jar_name], | 177 | + test_srcs = glob([TEST + '/*.java']) |
141 | - resources = test_resources, | 178 | + |
142 | - resources_root = test_resources_root | 179 | + if not test_srcs: |
143 | - ) | 180 | + print "Generating test rule for %s, but there are no tests." % name |
181 | + | ||
182 | + java_test( | ||
183 | + name = name + '-tests', | ||
184 | + srcs = test_srcs, | ||
185 | + deps = deps + | ||
186 | + test_deps + | ||
187 | + [':' + name + '-jar'], | ||
188 | + source_under_test = [':' + name + '-jar'], | ||
189 | + resources = test_resources, | ||
190 | + resources_root = test_resources_root, | ||
191 | + visibility = visibility | ||
192 | + ) | ... | ... |
1 | ONOS_ORIGIN = 'ON.Lab' | 1 | ONOS_ORIGIN = 'ON.Lab' |
2 | ONOS_VERSION = '1.6.0-SNAPSHOT' | 2 | ONOS_VERSION = '1.6.0-SNAPSHOT' |
3 | DEFAULT_APP_CATEGORY = 'Utility' | 3 | DEFAULT_APP_CATEGORY = 'Utility' |
4 | +ONOS_ARTIFACT_BASE = 'onos-' | ||
5 | +APP_PREFIX = 'org.onosproject.' | ||
6 | + | ||
7 | +import os.path | ||
8 | + | ||
9 | +# FIXME Factor this into common place | ||
10 | +def _get_name(): | ||
11 | + base_path = get_base_path() | ||
12 | + return ONOS_ARTIFACT_BASE + base_path.replace('/', '-') #TODO Unix-separator | ||
13 | + | ||
14 | +def _get_app_name(): | ||
15 | + base_path = get_base_path() | ||
16 | + return APP_PREFIX + os.path.basename(base_path) | ||
4 | 17 | ||
5 | def onos_app( | 18 | def onos_app( |
6 | - app_name, | 19 | + app_name = None, |
7 | - title, | 20 | + name = None, |
21 | + title = None, | ||
8 | version = ONOS_VERSION, | 22 | version = ONOS_VERSION, |
9 | origin = ONOS_ORIGIN, | 23 | origin = ONOS_ORIGIN, |
10 | category = DEFAULT_APP_CATEGORY, | 24 | category = DEFAULT_APP_CATEGORY, |
... | @@ -14,13 +28,31 @@ def onos_app( | ... | @@ -14,13 +28,31 @@ def onos_app( |
14 | feature_coords = None, | 28 | feature_coords = None, |
15 | required_features = [ 'onos-api' ], | 29 | required_features = [ 'onos-api' ], |
16 | required_apps = [], | 30 | required_apps = [], |
17 | - included_bundles = [], | 31 | + included_bundles = None, |
18 | excluded_bundles = [], | 32 | excluded_bundles = [], |
33 | + visibility = [ 'PUBLIC' ], | ||
19 | **kwargs): | 34 | **kwargs): |
35 | + if name is None: | ||
36 | + name = _get_name() | ||
37 | + | ||
38 | + if app_name is None: | ||
39 | + app_name = _get_app_name() | ||
40 | + | ||
41 | + if title is None: | ||
42 | + print "Missing title for %s" % _get_name() | ||
43 | + title = _get_app_name() | ||
44 | + | ||
45 | + if included_bundles is None: | ||
46 | + target = ':' + _get_name() | ||
47 | + included_bundles = [ target ] | ||
20 | 48 | ||
21 | if not feature_coords and len(included_bundles) == 1: | 49 | if not feature_coords and len(included_bundles) == 1: |
22 | feature_coords = '$(maven_coords %s)' % included_bundles[0] | 50 | feature_coords = '$(maven_coords %s)' % included_bundles[0] |
23 | 51 | ||
52 | + if not feature_coords: | ||
53 | + print 'Missing maven coordinates for %s app feature.' % name | ||
54 | + return | ||
55 | + | ||
24 | args = [ '-n %s' % feature_coords, | 56 | args = [ '-n %s' % feature_coords, |
25 | '-v %s' % version, | 57 | '-v %s' % version, |
26 | '-t "%s"' % title, | 58 | '-t "%s"' % title, |
... | @@ -36,26 +68,27 @@ def onos_app( | ... | @@ -36,26 +68,27 @@ def onos_app( |
36 | 68 | ||
37 | cmd = '$(exe //buck-tools:onos-app-writer) -F ' + ' '.join(args) + ' > $OUT' | 69 | cmd = '$(exe //buck-tools:onos-app-writer) -F ' + ' '.join(args) + ' > $OUT' |
38 | genrule( | 70 | genrule( |
39 | - name = 'app-features', | 71 | + name = name + '-features', |
40 | bash = cmd, | 72 | bash = cmd, |
41 | out = 'features.xml', | 73 | out = 'features.xml', |
42 | visibility = [], | 74 | visibility = [], |
43 | ) | 75 | ) |
44 | cmd = '$(exe //buck-tools:onos-app-writer) -A ' + ' '.join(args) + ' > $OUT' | 76 | cmd = '$(exe //buck-tools:onos-app-writer) -A ' + ' '.join(args) + ' > $OUT' |
45 | genrule( | 77 | genrule( |
46 | - name = 'app-xml', | 78 | + name = name + '-app-xml', |
47 | bash = cmd, | 79 | bash = cmd, |
48 | out = 'app.xml', | 80 | out = 'app.xml', |
49 | visibility = [], | 81 | visibility = [], |
50 | ) | 82 | ) |
51 | 83 | ||
52 | sources = [ | 84 | sources = [ |
53 | - '$(location :app-features) %s' % feature_coords, | 85 | + '$(location :%s-features) %s' % (name, feature_coords), |
54 | - '$(location :app-xml) NONE', | 86 | + '$(location :%s-app-xml) NONE' % name, |
55 | ] | 87 | ] |
56 | sources += ['$(location %s) $(maven_coords %s)' % (i, i) for i in included_bundles] | 88 | sources += ['$(location %s) $(maven_coords %s)' % (i, i) for i in included_bundles] |
57 | genrule( | 89 | genrule( |
58 | - name = 'app-oar', | 90 | + name = name + '-oar', |
59 | out = 'app.oar', | 91 | out = 'app.oar', |
60 | - bash = '$(exe //buck-tools:onos-app-oar) $OUT ' + ' '.join(sources) | 92 | + bash = '$(exe //buck-tools:onos-app-oar) $OUT ' + ' '.join(sources), |
93 | + visibility = visibility, | ||
61 | ) | 94 | ) | ... | ... |
1 | -SRC = 'src/main/java/org/onosproject/**/' | ||
2 | -TEST = 'src/test/java/org/onosproject/**/' | ||
3 | -CURRENT_NAME = 'onos-api' | ||
4 | -CURRENT_TARGET = ':' + CURRENT_NAME | ||
5 | - | ||
6 | COMPILE_DEPS = [ | 1 | COMPILE_DEPS = [ |
7 | '//lib:COMPILE', | 2 | '//lib:COMPILE', |
8 | '//utils/misc:onlab-misc', | 3 | '//utils/misc:onlab-misc', |
... | @@ -10,25 +5,7 @@ COMPILE_DEPS = [ | ... | @@ -10,25 +5,7 @@ COMPILE_DEPS = [ |
10 | '//utils/rest:onlab-rest', | 5 | '//utils/rest:onlab-rest', |
11 | ] | 6 | ] |
12 | 7 | ||
13 | -TEST_DEPS = [ | 8 | +osgi_jar_with_tests ( |
14 | - '//lib:TEST', | 9 | + name = 'onos-api', |
15 | -] | ||
16 | - | ||
17 | -osgi_jar( | ||
18 | - name = CURRENT_NAME, | ||
19 | - srcs = glob([SRC + '/*.java']), | ||
20 | deps = COMPILE_DEPS, | 10 | deps = COMPILE_DEPS, |
21 | - visibility = ['PUBLIC'], | 11 | +) |
22 | -) | ||
23 | - | ||
24 | -java_test( | ||
25 | - name = 'onos-api-tests', | ||
26 | - visibility = ['PUBLIC'], | ||
27 | - srcs = glob([TEST + '/*.java']), | ||
28 | - deps = COMPILE_DEPS + | ||
29 | - TEST_DEPS + | ||
30 | - [CURRENT_TARGET], | ||
31 | - source_under_test = [CURRENT_TARGET], | ||
32 | - resources_root = 'src/test/resources', | ||
33 | - resources = glob(['src/test/resources/**']), | ||
34 | -) | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -593,12 +593,12 @@ maven_jar( | ... | @@ -593,12 +593,12 @@ maven_jar( |
593 | license = 'Apache2.0', | 593 | license = 'Apache2.0', |
594 | ) | 594 | ) |
595 | 595 | ||
596 | -maven_jar( | 596 | +# maven_jar( |
597 | - name = 'atomix-coordination', | 597 | +# name = 'atomix-coordination', |
598 | - id = 'io.atomix:atomix-coordination:1.0.0-rc3', | 598 | +# id = 'io.atomix:atomix-coordination:1.0.0-rc3', |
599 | - sha1 = '182a2618cbef13e6efe58b85aadfa1176b9d08f3', | 599 | +# sha1 = '182a2618cbef13e6efe58b85aadfa1176b9d08f3', |
600 | - license = 'Apache2.0', | 600 | +# license = 'Apache2.0', |
601 | -) | 601 | +# ) |
602 | 602 | ||
603 | maven_jar( | 603 | maven_jar( |
604 | name = 'atomix-messaging', | 604 | name = 'atomix-messaging', | ... | ... |
... | @@ -105,8 +105,28 @@ | ... | @@ -105,8 +105,28 @@ |
105 | --> | 105 | --> |
106 | <repositories> | 106 | <repositories> |
107 | <repository> | 107 | <repository> |
108 | + <id>central</id> | ||
109 | + <name>Central Repository</name> | ||
110 | + <url>http://repo.maven.apache.org/maven2</url> | ||
111 | + <layout>default</layout> | ||
112 | + <snapshots> | ||
113 | + <enabled>false</enabled> | ||
114 | + </snapshots> | ||
115 | + <releases> | ||
116 | + <enabled>true</enabled> | ||
117 | + <updatePolicy>never</updatePolicy> | ||
118 | + <checksumPolicy>fail</checksumPolicy> | ||
119 | + </releases> | ||
120 | + </repository> | ||
121 | + | ||
122 | + <repository> | ||
108 | <id>snapshots</id> | 123 | <id>snapshots</id> |
109 | <url>https://oss.sonatype.org/content/repositories/snapshots</url> | 124 | <url>https://oss.sonatype.org/content/repositories/snapshots</url> |
125 | + <snapshots> | ||
126 | + <enabled>true</enabled> | ||
127 | + <updatePolicy>never</updatePolicy> | ||
128 | + <checksumPolicy>fail</checksumPolicy> | ||
129 | + </snapshots> | ||
110 | </repository> | 130 | </repository> |
111 | </repositories> | 131 | </repositories> |
112 | 132 | ... | ... |
1 | -SRC = 'src/main/java/org/onosproject/**/' | ||
2 | -TEST = 'src/test/java/org/onosproject/**/' | ||
3 | -CURRENT_NAME = 'onos-of-api' | ||
4 | -CURRENT_TARGET = ':' + CURRENT_NAME | ||
5 | - | ||
6 | COMPILE_DEPS = [ | 1 | COMPILE_DEPS = [ |
7 | '//lib:CORE_DEPS', | 2 | '//lib:CORE_DEPS', |
8 | '//lib:openflowj', | 3 | '//lib:openflowj', |
... | @@ -13,18 +8,8 @@ TEST_DEPS = [ | ... | @@ -13,18 +8,8 @@ TEST_DEPS = [ |
13 | '//core/api:onos-api-tests', | 8 | '//core/api:onos-api-tests', |
14 | ] | 9 | ] |
15 | 10 | ||
16 | -osgi_jar( | 11 | +osgi_jar_with_tests ( |
17 | - name = CURRENT_NAME, | 12 | + name = 'onos-of-api', |
18 | - srcs = glob([SRC + '/*.java']), | ||
19 | deps = COMPILE_DEPS, | 13 | deps = COMPILE_DEPS, |
20 | - visibility = ['PUBLIC'], | 14 | + test_deps = TEST_DEPS, |
21 | -) | ||
22 | - | ||
23 | -java_test( | ||
24 | - name = 'tests', | ||
25 | - srcs = glob([TEST + '/*.java']), | ||
26 | - deps = COMPILE_DEPS + | ||
27 | - TEST_DEPS + | ||
28 | - [CURRENT_TARGET], | ||
29 | - source_under_test = [CURRENT_TARGET], | ||
30 | ) | 15 | ) | ... | ... |
... | @@ -14,6 +14,7 @@ genrule( | ... | @@ -14,6 +14,7 @@ genrule( |
14 | visibility = [ 'PUBLIC' ] | 14 | visibility = [ 'PUBLIC' ] |
15 | ) | 15 | ) |
16 | 16 | ||
17 | +#FIXME location suppression.xml does not trigger this rule | ||
17 | export_file( | 18 | export_file( |
18 | name = 'suppressions.xml', | 19 | name = 'suppressions.xml', |
19 | src = suppression_source, | 20 | src = suppression_source, | ... | ... |
1 | -SRC = 'src/main/java/org/onlab/**/' | ||
2 | -TEST = 'src/test/java/org/onlab/**/' | ||
3 | -CURRENT_NAME = 'onlab-rest' | ||
4 | -CURRENT_TARGET = ':' + CURRENT_NAME | ||
5 | - | ||
6 | COMPILE_DEPS = [ | 1 | COMPILE_DEPS = [ |
7 | '//lib:COMPILE', | 2 | '//lib:COMPILE', |
8 | '//utils/osgi:onlab-osgi', | 3 | '//utils/osgi:onlab-osgi', |
... | @@ -11,22 +6,7 @@ COMPILE_DEPS = [ | ... | @@ -11,22 +6,7 @@ COMPILE_DEPS = [ |
11 | '//lib:jersey-server', | 6 | '//lib:jersey-server', |
12 | ] | 7 | ] |
13 | 8 | ||
14 | -TEST_DEPS = [ | 9 | +osgi_jar_with_tests ( |
15 | - '//lib:TEST', | 10 | + name = 'onlab-rest', |
16 | -] | ||
17 | - | ||
18 | -osgi_jar( | ||
19 | - name = CURRENT_NAME, | ||
20 | - srcs = glob([SRC + '/*.java']), | ||
21 | deps = COMPILE_DEPS, | 11 | deps = COMPILE_DEPS, |
22 | - visibility = ['PUBLIC'], | 12 | +) |
23 | -) | ||
24 | - | ||
25 | -java_test( | ||
26 | - name = 'tests', | ||
27 | - srcs = glob([TEST + '/*.java']), | ||
28 | - deps = COMPILE_DEPS + | ||
29 | - TEST_DEPS + | ||
30 | - [CURRENT_TARGET], | ||
31 | - source_under_test = [CURRENT_TARGET], | ||
32 | -) | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
1 | -SRC = 'src/main/java/org/onosproject/**/' | ||
2 | -TEST = 'src/test/java/org/onosproject/**/' | ||
3 | -RESOURCES_ROOT = 'src/main/resources/' | ||
4 | - | ||
5 | -CURRENT_NAME = 'onos-rest' | ||
6 | -CURRENT_TARGET = ':' + CURRENT_NAME | ||
7 | - | ||
8 | COMPILE_DEPS = [ | 1 | COMPILE_DEPS = [ |
9 | '//lib:CORE_DEPS', | 2 | '//lib:CORE_DEPS', |
10 | '//incubator/api:onos-incubator-api', | 3 | '//incubator/api:onos-incubator-api', |
... | @@ -16,26 +9,9 @@ TEST_DEPS = [ | ... | @@ -16,26 +9,9 @@ TEST_DEPS = [ |
16 | '//lib:TEST_REST', | 9 | '//lib:TEST_REST', |
17 | ] | 10 | ] |
18 | 11 | ||
19 | -osgi_jar( | 12 | +osgi_jar_with_tests ( |
20 | - name = CURRENT_NAME, | 13 | + name = 'onos-rest', |
21 | - srcs = glob([SRC + '/*.java']), | ||
22 | - resources = glob([RESOURCES_ROOT + '**']), | ||
23 | - resources_root = RESOURCES_ROOT, | ||
24 | deps = COMPILE_DEPS, | 14 | deps = COMPILE_DEPS, |
25 | - visibility = ['PUBLIC'], | 15 | + test_deps = TEST_DEPS, |
26 | - debug = False, | 16 | + web_context = '/onos/v1', |
27 | - web_context = '/onos/v1' | 17 | +) |
28 | -) | ||
29 | - | ||
30 | -SOURCE_JAR = CURRENT_TARGET + '-jar' | ||
31 | -java_test( | ||
32 | - name = 'onos-rest-tests', | ||
33 | - srcs = glob([TEST + '/*.java']), | ||
34 | - deps = COMPILE_DEPS + | ||
35 | - TEST_DEPS + | ||
36 | - [SOURCE_JAR], | ||
37 | - source_under_test = [SOURCE_JAR], | ||
38 | - visibility = ['PUBLIC'], | ||
39 | - resources_root = 'src/test/resources', | ||
40 | - resources = glob(['src/test/resources/**']), | ||
41 | -) | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
1 | -SRC = 'src/main/java/org/onosproject/**/' | ||
2 | -TEST = 'src/test/java/org/onosproject/**/' | ||
3 | -RESOURCES_ROOT = 'src/main/resources/' | ||
4 | - | ||
5 | -CURRENT_NAME = 'onos-gui' | ||
6 | -CURRENT_TARGET = ':' + CURRENT_NAME | ||
7 | - | ||
8 | COMPILE_DEPS = [ | 1 | COMPILE_DEPS = [ |
9 | '//lib:CORE_DEPS', | 2 | '//lib:CORE_DEPS', |
10 | '//lib:javax.ws.rs-api', | 3 | '//lib:javax.ws.rs-api', |
... | @@ -33,23 +26,10 @@ RESOURCES = [ | ... | @@ -33,23 +26,10 @@ RESOURCES = [ |
33 | 'WEB-INF/classes/raw=src/main/webapp/raw', | 26 | 'WEB-INF/classes/raw=src/main/webapp/raw', |
34 | ] | 27 | ] |
35 | 28 | ||
36 | -osgi_jar( | 29 | +osgi_jar_with_tests ( |
37 | - name = CURRENT_NAME, | 30 | + name = 'onos-gui', |
38 | - srcs = glob([SRC + '/*.java']), | ||
39 | - resources = glob([RESOURCES_ROOT + '**']), | ||
40 | - resources_root = RESOURCES_ROOT, | ||
41 | deps = COMPILE_DEPS, | 31 | deps = COMPILE_DEPS, |
42 | - visibility = ['PUBLIC'], | 32 | + test_deps = TEST_DEPS, |
43 | include_resources = ','.join(RESOURCES), | 33 | include_resources = ','.join(RESOURCES), |
44 | web_context = '/onos/ui', | 34 | web_context = '/onos/ui', |
45 | - debug = False, | ||
46 | -) | ||
47 | - | ||
48 | -java_test( | ||
49 | - name = 'tests', | ||
50 | - srcs = glob([TEST + '/*.java']), | ||
51 | - deps = COMPILE_DEPS + | ||
52 | - TEST_DEPS + | ||
53 | - [CURRENT_TARGET], | ||
54 | - source_under_test = [CURRENT_TARGET], | ||
55 | ) | 35 | ) | ... | ... |
-
Please register or login to post a comment