You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2017/06/11 00:10:41 UTC

svn commit: r1798341 - in /webservices/axiom/trunk: WORKSPACE axiom-api/BUILD buildutils/bnd.bzl buildutils/test.bzl implementations/axiom-impl/BUILD systests/osgi-tests/BUILD systests/osgi-tests/build_defs.bzl third_party/BUILD

Author: veithen
Date: Sun Jun 11 00:10:41 2017
New Revision: 1798341

URL: http://svn.apache.org/viewvc?rev=1798341&view=rev
Log:
Make one of the OSGi tests executable with Bazel.

Added:
    webservices/axiom/trunk/systests/osgi-tests/BUILD
    webservices/axiom/trunk/systests/osgi-tests/build_defs.bzl
Modified:
    webservices/axiom/trunk/WORKSPACE
    webservices/axiom/trunk/axiom-api/BUILD
    webservices/axiom/trunk/buildutils/bnd.bzl
    webservices/axiom/trunk/buildutils/test.bzl
    webservices/axiom/trunk/implementations/axiom-impl/BUILD
    webservices/axiom/trunk/third_party/BUILD

Modified: webservices/axiom/trunk/WORKSPACE
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/WORKSPACE?rev=1798341&r1=1798340&r2=1798341&view=diff
==============================================================================
--- webservices/axiom/trunk/WORKSPACE (original)
+++ webservices/axiom/trunk/WORKSPACE Sun Jun 11 00:10:41 2017
@@ -72,6 +72,12 @@ maven_jar(
 )
 
 maven_jar(
+    name = "felix",
+    artifact = "org.apache.felix:org.apache.felix.framework:5.0.0",
+    sha1 = "9fabb10642ca45792b0041d5a660b131282869db"
+)
+
+maven_jar(
     name = "guava",
     artifact = "com.google.guava:guava:20.0",
     sha1 = "89507701249388e1ed5ddcf8c41f4ce1be7831ef",
@@ -126,18 +132,114 @@ maven_jar(
 )
 
 maven_jar(
+    name = "ops4j_io",
+    artifact = "org.ops4j.base:ops4j-base-io:1.5.0",
+    sha1 = "15acc9a1b56c8963db471cee926d7001591e6b4d",
+)
+
+maven_jar(
+    name = "ops4j_lang",
+    artifact = "org.ops4j.base:ops4j-base-lang:1.5.0",
+    sha1 = "da31d176ffa8b78c0b83e183951c86cbd7bfb0b9",
+)
+
+maven_jar(
+    name = "ops4j_store",
+    artifact = "org.ops4j.base:ops4j-base-store:1.5.0",
+    sha1 = "7c5d6ed88638a61b15b3c285b8c16eee7753de1c",
+)
+
+maven_jar(
+    name = "ops4j_util_property",
+    artifact = "org.ops4j.base:ops4j-base-util-property:1.5.0",
+    sha1 = "10a2f7cfa055e776eb996ca456747a07fdf2015e",
+)
+
+maven_jar(
     name = "osgi_core",
     artifact = "org.osgi:org.osgi.core:5.0.0",
     sha1 = "6e5e8cd3c9059c08e1085540442a490b59a7783c",
 )
 
 maven_jar(
+    name = "pax_exam",
+    artifact = "org.ops4j.pax.exam:pax-exam:4.9.1",
+    sha1 = "3311a0d0e4e949fcebd332511c8ba1911e289cf7",
+)
+
+maven_jar(
+    name = "pax_exam_container_native",
+    artifact = "org.ops4j.pax.exam:pax-exam-container-native:4.9.1",
+    sha1 = "8d8b17bba21e9c4a79633d337104515aa79089b4",
+)
+
+maven_jar(
+    name = "pax_exam_junit4",
+    artifact = "org.ops4j.pax.exam:pax-exam-junit4:4.9.1",
+    sha1 = "8341f035345f7ffa89db0b24bbd7b6ddc52c2cec",
+)
+
+maven_jar(
+    name = "pax_exam_link_assembly",
+    artifact = "org.ops4j.pax.exam:pax-exam-link-assembly:4.9.1",
+    sha1 = "b2b002626b77ce7e2aa236af12c8328df014162a",
+)
+
+maven_jar(
+    name = "pax_exam_spi",
+    artifact = "org.ops4j.pax.exam:pax-exam-spi:4.9.1",
+    sha1 = "211d0d89b05842a88451bd6bb4723270a10aae6c",
+)
+
+maven_jar(
+    name = "pax_swissbox_tracker",
+    artifact = "org.ops4j.pax.swissbox:pax-swissbox-tracker:1.8.2",
+    sha1 = "699d52d350f2377b30a1927a52c4b43ca4d8e5c5",
+)
+
+maven_jar(
+    name = "pax_tinybundles",
+    artifact = "org.ops4j.pax.tinybundles:tinybundles:2.1.1",
+    sha1 = "d894c29d13f0d7a9094793c25a0a7723b9537c0b",
+)
+
+maven_jar(
+    name = "pax_url_classpath",
+    artifact = "org.ops4j.pax.url:pax-url-classpath:2.4.5",
+    sha1 = "fa99960fad95b2f8cf64c380a74bf845d9084a27",
+)
+
+maven_jar(
+    name = "pax_url_commons",
+    artifact = "org.ops4j.pax.url:pax-url-commons:2.4.5",
+    sha1 = "342030b66367f84c82ca5b82cb7e230660156766",
+)
+
+maven_jar(
+    name = "pax_url_link",
+    artifact = "org.ops4j.pax.url:pax-url-link:2.4.5",
+    sha1 = "eb9065c74a008e641389366748dba5cc6630ce8c",
+)
+
+maven_jar(
     name = "saxon",
     artifact = "net.sf.saxon:Saxon-HE:9.7.0-18",
     sha1 = "b1742ac9973d71bc23b1e8bc3e870a0994fc0ab2",
 )
 
 maven_jar(
+    name = "slf4j_api",
+    artifact = "org.slf4j:slf4j-api:1.5.11",
+    sha1 = "d6a855b608971025b4fbb0970f829391cc6f727a",
+)
+
+maven_jar(
+    name = "slf4j_jdk14",
+    artifact = "org.slf4j:slf4j-jdk14:1.5.11",
+    sha1 = "a2106f2feaea391154e3a47d3db667b45519231f",
+)
+
+maven_jar(
     name = "stax2_api",
     artifact = "org.codehaus.woodstox:stax2-api:3.1.1",
     sha1 = "0466eab062e9d1a3ce2c4631b6d09b5e5c0cbd1b",

Modified: webservices/axiom/trunk/axiom-api/BUILD
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-api/BUILD?rev=1798341&r1=1798340&r2=1798341&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-api/BUILD (original)
+++ webservices/axiom/trunk/axiom-api/BUILD Sun Jun 11 00:10:41 2017
@@ -215,5 +215,6 @@ bundle(
     activation_policy = "lazy",
     deps = [
         ":locator",
+        ":util-sax",
     ],
 )

Modified: webservices/axiom/trunk/buildutils/bnd.bzl
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/buildutils/bnd.bzl?rev=1798341&r1=1798340&r2=1798341&view=diff
==============================================================================
--- webservices/axiom/trunk/buildutils/bnd.bzl (original)
+++ webservices/axiom/trunk/buildutils/bnd.bzl Sun Jun 11 00:10:41 2017
@@ -30,6 +30,7 @@ def _impl(ctx):
       "-removeheaders": "Bnd-LastModified,Build-Jdk,Built-By,Private-Package,Include-Resource",
       "-nodefaultversion": "true",
       "-consumer-policy": "",
+      "Include-Resource": "@%s!/**" % ctx.files.resource_jar[0].path.split("/")[-1],
   }
   if ctx.attr.activator:
     instructions["Bundle-Activator"] = ctx.attr.activator
@@ -45,18 +46,19 @@ def _impl(ctx):
     args.extend(["-c", f.path])
   args.append(bnd_file.path)
   ctx.action(
-      inputs=dep_jars + [bnd_file],
+      inputs=dep_jars + ctx.files.resource_jar + [bnd_file],
       outputs=[bundle_jar],
       arguments=args,
       progress_message="Building bundle %s" % bundle_jar.short_path,
       executable=ctx.executable._bnd)
 
-bundle = rule(
+_bundle = rule(
     implementation = _impl,
     attrs = {
         "deps": attr.label_list(
             allow_files=False,
         ),
+        "resource_jar": attr.label(allow_files=False),
         "symbolic_name": attr.string(mandatory=True),
         "private_packages": attr.string_list(),
         "export_packages": attr.string_list(),
@@ -74,3 +76,13 @@ bundle = rule(
         "bundle_jar": "%{name}.jar",
     },
 )
+
+def bundle(name, resources=[], **kwargs):
+  native.java_library(
+      name = "%s_resources" % name,
+      resources = resources,
+  )
+  _bundle(
+      name = name,
+      resource_jar = ":%s_resources" % name,
+      **kwargs)

Modified: webservices/axiom/trunk/buildutils/test.bzl
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/buildutils/test.bzl?rev=1798341&r1=1798340&r2=1798341&view=diff
==============================================================================
--- webservices/axiom/trunk/buildutils/test.bzl (original)
+++ webservices/axiom/trunk/buildutils/test.bzl Sun Jun 11 00:10:41 2017
@@ -62,11 +62,13 @@ _jacoco = rule(
     },
 )
 
-def test(name, srcs, deps, test_class):
+def test(name, srcs, test_class, deps=[], runtime_deps=[], data=[]):
   native.java_library(
       name = "%s_lib" % name,
       srcs = srcs,
       deps = deps + ["//third_party:junit"],
+      runtime_deps = runtime_deps,
+      data = data,
   )
 
   native.java_test(

Modified: webservices/axiom/trunk/implementations/axiom-impl/BUILD
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-impl/BUILD?rev=1798341&r1=1798340&r2=1798341&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-impl/BUILD (original)
+++ webservices/axiom/trunk/implementations/axiom-impl/BUILD Sun Jun 11 00:10:41 2017
@@ -18,6 +18,7 @@
 #
 
 load("//buildutils:aspectj.bzl", "aj_library")
+load("//buildutils:bnd.bzl", "bundle")
 load("//buildutils:test.bzl", "test")
 
 java_library(
@@ -47,6 +48,33 @@ aj_library(
     ],
 )
 
+bundle(
+    name = "bundle",
+    symbolic_name = "org.apache.ws.commons.axiom.axiom-impl",
+    private_packages = [
+        "org.apache.axiom.core.*",
+        "!org.apache.axiom.om.impl",
+        "org.apache.axiom.om.impl.llom.*;-split-package:=merge-first",
+        "org.apache.axiom.om.impl.*",
+        "org.apache.axiom.soap.impl.*;-split-package:=merge-first",
+        "org.apache.axiom.shared.*",
+        "org.apache.axiom.util.xml.*",
+        # TODO: remove this; see r1796490
+        "org.aspectj.lang",
+        "org.aspectj.lang.annotation",
+    ],
+    import_packages = [
+        "!org.aspectj.*",
+        "*",
+    ],
+    activation_policy = "lazy",
+    visibility = ["//visibility:public"],
+    deps = [
+        "axiom-impl",
+    ],
+    resources = ["src/main/resources/META-INF/axiom.xml"],
+)
+
 test(
     name = "om-implementation-test",
     srcs = ["src/test/java/org/apache/axiom/om/impl/llom/OMImplementationTest.java"],

Added: webservices/axiom/trunk/systests/osgi-tests/BUILD
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/systests/osgi-tests/BUILD?rev=1798341&view=auto
==============================================================================
--- webservices/axiom/trunk/systests/osgi-tests/BUILD (added)
+++ webservices/axiom/trunk/systests/osgi-tests/BUILD Sun Jun 11 00:10:41 2017
@@ -0,0 +1,56 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+load(":build_defs.bzl", "link")
+load("//buildutils:test.bzl", "test")
+
+link(
+    name = "mime4j",
+    bundle = "@mime4j_core//jar",
+    symbolic_name = "org.apache.james.apache-mime4j-core",
+)
+
+link(
+    name = "axiom-api",
+    bundle = "//axiom-api:bundle",
+    symbolic_name = "org.apache.ws.commons.axiom.axiom-api",
+)
+
+link(
+    name = "axiom-impl",
+    bundle = "//implementations/axiom-impl:bundle",
+    symbolic_name = "org.apache.ws.commons.axiom.axiom-impl",
+)
+
+test(
+    name = "system-deps-test",
+    srcs = [
+        "src/test/java/org/apache/axiom/test/SystemDepsTest.java",
+    ],
+    test_class = "org.apache.axiom.test.SystemDepsTest",
+    deps = [
+        "//axiom-api",
+        "//third_party:pax-exam",
+    ],
+    runtime_deps = [
+        ":axiom-api",
+        ":axiom-impl",
+        ":mime4j",
+    ],
+)

Added: webservices/axiom/trunk/systests/osgi-tests/build_defs.bzl
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/systests/osgi-tests/build_defs.bzl?rev=1798341&view=auto
==============================================================================
--- webservices/axiom/trunk/systests/osgi-tests/build_defs.bzl (added)
+++ webservices/axiom/trunk/systests/osgi-tests/build_defs.bzl Sun Jun 11 00:10:41 2017
@@ -0,0 +1,42 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+def link(name, bundle, symbolic_name):
+  native.genrule(
+      name = "%s_link" % name,
+      srcs = [],
+      outs = ["src/generated/resources/%s.link" % symbolic_name],
+      cmd = "echo classpath:%s.jar > $@" % name,
+  )
+
+  native.genrule(
+      name = "%s_jar" % name,
+      srcs = [bundle],
+      outs = ["src/generated/resources/%s.jar" % name],
+      cmd = "cp $< $@",
+  )
+
+  native.java_library(
+      name = name,
+      resources = [
+          ":%s_link" % name,
+          ":%s_jar" % name,
+      ],
+      data = [bundle],
+  )

Modified: webservices/axiom/trunk/third_party/BUILD
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/third_party/BUILD?rev=1798341&r1=1798340&r2=1798341&view=diff
==============================================================================
--- webservices/axiom/trunk/third_party/BUILD (original)
+++ webservices/axiom/trunk/third_party/BUILD Sun Jun 11 00:10:41 2017
@@ -51,6 +51,31 @@ java_library(
 )
 
 java_library(
+    name = "pax-exam",
+    exports = [
+        "@pax_exam//jar",
+        "@pax_exam_junit4//jar",
+        "@pax_exam_spi//jar",
+    ],
+    runtime_deps = [
+        "@felix//jar",
+        "@ops4j_io//jar",
+        "@ops4j_lang//jar",
+        "@ops4j_store//jar",
+        "@ops4j_util_property//jar",
+        "@pax_exam_container_native//jar",
+        "@pax_exam_link_assembly//jar",
+        "@pax_swissbox_tracker//jar",
+        "@pax_tinybundles//jar",
+        "@pax_url_classpath//jar",
+        "@pax_url_commons//jar",
+        "@pax_url_link//jar",
+        "@slf4j_api//jar",
+        "@slf4j_jdk14//jar",
+    ],
+)
+
+java_library(
     name = "xerces",
     exports = [
         "@xerces//jar",