Permalink
Browse files

bucklet for yang based OSGI libraries

Change-Id: Ieeef6357250c4e74e9c78310a65c809b3edd102b
  • Loading branch information...
1 parent 5af2e4f commit e88d69b61c67839eef67c08bc70ef8de7723ecb5 @ray-milkey ray-milkey committed Dec 17, 2016
Showing with 68 additions and 7 deletions.
  1. +3 −3 apps/tenbi/BUCK
  2. +1 −1 apps/tenbi/yangmodel/BUCK
  3. +1 −1 apps/yms/app/pom.xml
  4. +1 −1 apps/yms/pom.xml
  5. +1 −0 buck-tools/default.defs
  6. +51 −0 bucklets/yang.bucklet
  7. +9 −1 lib/BUCK
  8. +1 −0 lib/deps.json
View
@@ -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' ],
)
@@ -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']),
@@ -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
@@ -39,7 +39,7 @@
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onos-yang-datamodel</artifactId>
- <version>1.10</version>
+ <version>1.11</version>
</dependency>
</dependencies>
@@ -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 = [
View
@@ -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
@@ -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'],
@@ -1026,6 +1026,14 @@ remote_jar (
)
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',
url = 'mvn:org.onosproject:cord-config:jar:1.0-b1',
View
@@ -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",

0 comments on commit e88d69b

Please sign in to comment.