bucklet for yang based OSGI libraries

Change-Id: Ieeef6357250c4e74e9c78310a65c809b3edd102b
This commit is contained in:
Ray Milkey 2016-12-16 17:09:13 -08:00
parent 5af2e4f898
commit e88d69b61c
8 changed files with 68 additions and 7 deletions

View File

@ -11,8 +11,8 @@ onos_app (
url = 'http://onosproject.org',
included_bundles = BUNDLES,
description = 'TE YANG NBI.',
required_apps = [ 'org.onosproject.onos-app-tetopology',
'org.onosproject.onos-app-tetunnel',
'org.onosproject.onos-app-yms' ],
required_apps = [ 'org.onosproject.tetopology',
'org.onosproject.tetunnel',
'org.onosproject.yms' ],
)

View File

@ -2,7 +2,7 @@ COMPILE_DEPS = [
'//lib:CORE_DEPS'
]
yang_library(
yang_osgi_jar(
deps = COMPILE_DEPS,
name = 'onos-apps-tenbi-yangmodel',
srcs = glob(['src/main/**/*.yang']),

View File

@ -57,7 +57,7 @@
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onos-yang-utils-generator</artifactId>
<version>1.10</version>
<version>1.11</version>
</dependency>
</dependencies>

View File

@ -39,7 +39,7 @@
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onos-yang-datamodel</artifactId>
<version>1.10</version>
<version>1.11</version>
</dependency>
</dependencies>

View File

@ -2,6 +2,7 @@ include_defs('//onos.defs')
include_defs('//bucklets/maven_jar.bucklet')
include_defs('//bucklets/onos.bucklet')
include_defs('//bucklets/onos_app.bucklet')
include_defs('//bucklets/yang.bucklet')
include_defs('//bucklets/remote_jar.bucklet')
BASE_DEPS = [

51
bucklets/yang.bucklet Normal file
View File

@ -0,0 +1,51 @@
include_defs('//onos.defs')
def _get_name():
base_path = get_base_path()
return ONOS_ARTIFACT_BASE + base_path.replace('/', '-') #TODO Unix-separator
def yang_osgi_jar(
name = None,
srcs = None,
group_id = ONOS_GROUP_ID,
version = ONOS_VERSION,
deps = [],
visibility = ['PUBLIC'],
license = 'NONE',
**kwargs
):
if name is None:
name = _get_name()
yang_jar = name + '-yang'
bnd_jar = name + '-bnd'
args = { 'group':group_id, 'artifact':name, 'version':version }
yang_library(
deps = deps,
name = yang_jar,
srcs = srcs,
visibility = [ ],
)
cmd = 'java -jar $(location //lib:bndexe) wrap -o $OUT '
cmd += '-b %(group)s.%(artifact)s ' % args
cmd += '-v ' + version.replace('-', '.') + ' '
cmd += '$(location :%s) ' % yang_jar
cmd += ' >/dev/null 2>&1'
genrule(
name = bnd_jar,
bash = cmd,
out = name + '.jar',
visibility = [],
)
prebuilt_jar(
name = name,
binary_jar = ':' + bnd_jar,
maven_coords = '%(group)s:%(artifact)s:%(version)s'%args,
visibility = visibility,
)

View File

@ -1,4 +1,4 @@
# ***** This file was auto-generated at Fri Dec 02 15:14:44 IST 2016. Do not edit this file manually. *****
# ***** This file was auto-generated at Fri Dec 16 13:24:41 PST 2016. Do not edit this file manually. *****
osgi_feature_group(
name = 'COMPILE',
visibility = ['PUBLIC'],
@ -1025,6 +1025,14 @@ remote_jar (
visibility = [ 'PUBLIC' ],
)
remote_jar (
name = 'bndexe',
out = 'biz.aQute.bnd-3.1.0.jar',
url = 'http://onlab.vicci.org/onos/third-party/biz.aQute.bnd-3.1.0.jar',
sha1 = 'ebd6c2af025b66ea94a9fcb217c2699ba23d3ca2',
visibility = [ 'PUBLIC' ],
)
remote_jar (
name = 'cord-config',
out = 'cord-config-1.0-b1.jar',

View File

@ -189,6 +189,7 @@
"checkstyle": "mvn:com.puppycrawl.tools:checkstyle:6.11.2",
"apache-karaf": "http://onlab.vicci.org/onos/third-party/apache-karaf-3.0.5-offline-20161115.tar.gz",
"bndlib": "mvn:biz.aQute.bnd:biz.aQute.bndlib:jar:3.1.0",
"bndexe": "http://onlab.vicci.org/onos/third-party/biz.aQute.bnd-3.1.0.jar",
"cord-config": "mvn:org.onosproject:cord-config:1.0-b1",
"libthrift": "mvn:org.apache.thrift:libthrift:0.9.3",
"qdox": "mvn:com.thoughtworks.qdox:qdox:2.0-M3",