diff --git a/WORKSPACE b/WORKSPACE index 0a6cb7d8bc..5467f54f38 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -158,7 +158,6 @@ python_configure(name = "local_config_python", python_version = "3") http_archive( name = "pcre2", build_file = "//bazel:pcre2.BUILD", - patches = ["//bazel:pcre2.patch"], strip_prefix = "pcre2-10.42", urls = [ "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.42/pcre2-10.42.tar.gz", diff --git a/bazel/BUILD.bazel b/bazel/BUILD.bazel index 9e517a90ed..8595e06d73 100644 --- a/bazel/BUILD.bazel +++ b/bazel/BUILD.bazel @@ -27,9 +27,3 @@ exports_files([ "archive_helper.bzl", "python_deps.txt", ]) - -sh_binary( - name = "run_swig", - srcs = ["run_swig.sh"], - visibility = ["//visibility:public"], -) diff --git a/bazel/pcre2.patch b/bazel/pcre2.patch deleted file mode 100644 index 0eab2aeb6d..0000000000 --- a/bazel/pcre2.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- /dev/null 2022-12-31 10:33:36 -+++ WORKSPACE 2022-12-31 10:31:42 -@@ -0,0 +1,10 @@ -+load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository", "new_git_repository") -+ -+# Bazel Skylib rules. -+git_repository( -+ name = "bazel_skylib", -+ tag = "1.2.1", -+ remote = "https://github.com/bazelbuild/bazel-skylib.git", -+) -+load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") -+bazel_skylib_workspace() diff --git a/bazel/run_swig.sh b/bazel/run_swig.sh deleted file mode 100755 index 2b871a16e8..0000000000 --- a/bazel/run_swig.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2021 The Cross-Media Measurement Authors -# -# Licensed 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. - - -# Wrapper which creates the directory specified as $1, then executing the -# command in $2 with the remaining arguments. -# -# This is to work around https://github.com/bazelbuild/bazel/issues/6393 - -exec swig "$@" \ No newline at end of file diff --git a/bazel/swig.BUILD b/bazel/swig.BUILD index 50d0a6b6fe..3919fed885 100644 --- a/bazel/swig.BUILD +++ b/bazel/swig.BUILD @@ -107,7 +107,6 @@ cc_binary( "-fexceptions", ], }), - data = [":templates"], includes = [ "Source/CParse", "Source/DOH", @@ -123,12 +122,24 @@ cc_binary( ) filegroup( - name = "templates", + name = "lib_java", + srcs = glob([ + 'Lib/*', + 'Lib/java/*', + 'Lib/std/*', + 'Lib/typemaps/*' + ]), + licenses = ["notice"], # simple notice license for Lib/ + path = "Lib", + visibility = ["//visibility:public"], +) + +filegroup( + name = "lib_python", srcs = glob([ 'Lib/*', 'Lib/python/*', 'Lib/std/*', - 'Lib/java/*', 'Lib/typemaps/*' ]), licenses = ["notice"], # simple notice license for Lib/ diff --git a/bazel/swig_java.bzl b/bazel/swig_java.bzl index 462684c134..920d8651f3 100644 --- a/bazel/swig_java.bzl +++ b/bazel/swig_java.bzl @@ -1,10 +1,9 @@ -# Copyright 2020 The Cross-Media Measurement Authors -# +# Copyright 2010-2022 Google LLC # Licensed 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 +# 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, @@ -185,7 +184,7 @@ def ortools_java_wrap_cc( deps = deps, swig_opt = swig_opt, module = module, - swig_includes = swig_includes, + swig_includes = swig_includes + ["@swig//:lib_java"], use_directors = use_directors, visibility = ["//visibility:private"], **kwargs