blob: eddff31a741013904399aca30726e8a6372c6765 [file] [log] [blame]
// Copyright 2018 Google Inc. All rights reserved
//
// 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.
filegroup {
name: "kythe_protos",
srcs: [
"kythe/proto/analysis.proto",
"kythe/proto/buildinfo.proto",
"kythe/proto/common.proto",
"kythe/proto/cxx.proto",
"kythe/proto/filecontext.proto",
"kythe/proto/metadata.proto",
"kythe/proto/storage.proto",
],
}
java_library_host {
name: "javac_extractor",
srcs: [
"kythe/java/com/google/devtools/kythe/extractors/java/standalone/AbstractJavacWrapper.java",
"kythe/java/com/google/devtools/kythe/extractors/java/standalone/Javac9Wrapper.java",
"kythe/java/com/google/devtools/kythe/extractors/java/*.java",
"kythe/java/com/google/devtools/kythe/extractors/shared/*.java",
"kythe/java/com/google/devtools/kythe/platform/kzip/*.java",
"kythe/java/com/google/devtools/kythe/platform/java/JavacOptionsUtils.java",
"kythe/java/com/google/devtools/kythe/platform/java/filemanager/ForwardingStandardJavaFileManager.java",
"kythe/java/com/google/devtools/kythe/platform/shared/CompilationUnits.java",
"kythe/java/com/google/devtools/kythe/util/DeleteRecursively.java",
"kythe/java/com/google/devtools/kythe/util/JsonUtil.java",
":kythe_protos",
"kythe/proto/java.proto",
],
javacflags: [
"-target 1.9",
"--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED",
"--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED",
"--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED",
"--add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED",
"--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
"--add-modules java.compiler",
],
manifest: "javac_extractor_manifest.txt",
proto: {
include_dirs: [
"external/kythe",
"external/protobuf/src",
],
type: "full",
canonical_path_from_root: false,
},
static_libs: [
"gson-prebuilt-jar",
"libprotobuf-java-full",
"libprotobuf-java-util-full",
"guava",
"jsr305",
],
java_version: "1.9",
}
cc_defaults {
name: "kythe_common_defaults",
cflags: [
"-Wall",
"-Wextra",
"-Wno-deprecated",
"-Wno-missing-field-initializers",
"-Wno-unused-parameter",
"-Wno-unused-private-field",
"-Wno-sign-compare",
"-Wno-unused-variable",
"-fno-exceptions",
"-fno-rtti",
],
}
cc_defaults {
name: "kythe_proto_defaults",
srcs: [":kythe_protos"],
proto: {
include_dirs: [
"external/kythe",
"external/protobuf/src",
],
type: "full",
canonical_path_from_root: false,
},
shared_libs: [
"libprotobuf-cpp-full",
],
}
cc_library_host_static {
name: "kythe_cxx_glog",
defaults: ["kythe_common_defaults"],
srcs: ["kythe/cxx/glog/logging.cc"],
export_include_dirs: ["kythe/cxx"],
shared_libs: ["libbase"],
}
cc_library_host_static {
name: "kythe_cxx_common",
defaults: [
"kythe_common_defaults",
"kythe_proto_defaults",
],
srcs: [
"kythe/cxx/common/file_utils.cc",
"kythe/cxx/common/file_vname_generator.cc",
"kythe/cxx/common/json_proto.cc",
"kythe/cxx/common/kythe_metadata_file.cc",
"kythe/cxx/common/kzip_writer_aosp.cc",
"kythe/cxx/common/path_utils.cc",
"kythe/cxx/common/status.cc",
],
header_libs: [
"libabsl_headers",
"rapidjson_headers",
],
static_libs: [
"kythe_cxx_glog",
"libabsl_strings",
"libgflags",
"libcrypto",
"regex-re2",
],
shared_libs: [
"libbase",
"libziparchive",
],
}
cc_binary_host {
name: "cxx_extractor",
defaults: [
"kythe_common_defaults",
"kythe_proto_defaults",
],
srcs: [
"kythe/cxx/common/index_writer.cc",
"kythe/cxx/common/schema/edges.cc",
"kythe/cxx/extractor/CommandLineUtils.cc",
"kythe/cxx/extractor/cxx_details.cc",
"kythe/cxx/extractor/cxx_extractor.cc",
"kythe/cxx/extractor/cxx_extractor_main.cc",
"kythe/cxx/extractor/language.cc",
"kythe/cxx/extractor/path_utils.cc",
"kythe/cxx/indexer/cxx/clang_utils.cc",
"third_party/llvm/src/cxx_extractor_preprocessor_utils.cc",
"third_party/llvm/src/clang_builtin_headers.cc",
],
shared_libs: [
"libbase",
"libLLVM_host",
"libclang_cxx_host",
"libziparchive",
],
header_libs: [
"libabsl_headers",
],
static_libs: [
"kythe_cxx_glog",
"kythe_cxx_common",
"regex-re2",
"libabsl_strings",
"libabsl_base",
"libabsl_numeric",
"libcrypto",
],
generated_headers: ["clang_builtin_headers_resources"],
}
cc_binary_host {
name: "protoc_extractor",
defaults: [
"kythe_common_defaults",
"kythe_proto_defaults",
],
srcs: [
"kythe/cxx/extractor/proto/proto_extractor.cc",
"kythe/cxx/extractor/proto/proto_extractor_main.cc",
"kythe/cxx/indexer/proto/search_path.cc",
],
header_libs: [
"libabsl_headers",
],
static_libs: [
"kythe_cxx_glog",
"kythe_cxx_common",
"regex-re2",
"libabsl_base",
"libabsl_debugging",
"libabsl_flags",
"libabsl_numeric",
"libabsl_strings",
"libabsl_synchronization",
"libabsl_time",
"libcrypto",
],
shared_libs: [
"libbase",
"libziparchive",
],
}
// A plugin for protobuffers compiler (aprotoc) to include metadata descriptor
// into the generated header. Extractors and indexers use it to trace the entities in
// the generated files back to the protobuffer dec
cc_binary_host {
name: "proto_metadata_plugin",
defaults: [
"kythe_common_defaults",
"kythe_proto_defaults",
],
srcs: [
"kythe/cxx/tools/proto_metadata_plugin.cc",
],
header_libs: [
"libabsl_headers",
],
static_libs: [
"kythe_cxx_glog",
"libabsl_base",
"libabsl_container",
"libabsl_debugging",
"libabsl_hash",
"libabsl_numeric",
"libabsl_strings",
"libabsl_synchronization",
"libabsl_time",
"libprotoc-kythe",
],
shared_libs: [
"libbase",
"libziparchive",
],
target: {
darwin: {
host_ldlibs: [
"-framework CoreFoundation",
],
},
},
}
// Go extractor
bootstrap_go_package {
name: "go-extractors-golang",
pkgPath: "kythe.io/kythe/go/extractors/golang",
srcs: [
"kythe/go/extractors/golang/golang.go",
"kythe/go/extractors/golang/packages.go",
],
deps: [
"creachadair-stringset",
"go-extractors-govname",
"go-platform-analysis",
"go-platform-kindex",
"go-platform-vfs",
"go-util-ptypes",
"go-proto-analysis_go_proto",
"go-proto-go_go_proto",
"go-proto-storage_go_proto",
],
}
bootstrap_go_package {
name: "go-extractors-govname",
pkgPath: "kythe.io/kythe/go/extractors/govname",
srcs: [
"kythe/go/extractors/govname/govname.go",
"kythe/go/extractors/govname/types.go",
],
deps: [
"golang-x-tools-go-vcs",
"go-util-vnameutil",
"go-proto-storage_go_proto",
],
}
bootstrap_go_package {
name: "go-platform-analysis",
pkgPath: "kythe.io/kythe/go/platform/analysis",
srcs: ["kythe/go/platform/analysis/analysis.go"],
deps: [
"go-proto-analysis_go_proto",
"go-proto-storage_go_proto",
],
}
bootstrap_go_package {
name: "go-platform-delimited",
pkgPath: "kythe.io/kythe/go/platform/delimited",
srcs: ["kythe/go/platform/delimited/delimited.go"],
deps: [
"golang-protobuf-proto",
],
}
bootstrap_go_package {
name: "go-platform-kcd",
pkgPath: "kythe.io/kythe/go/platform/kcd",
srcs: ["kythe/go/platform/kcd/kcd.go"],
}
bootstrap_go_package {
name: "go-platform-kcd-kythe",
pkgPath: "kythe.io/kythe/go/platform/kcd/kythe",
srcs: ["kythe/go/platform/kcd/kythe/units.go"],
deps: [
"golang-protobuf-jsonpb",
"golang-protobuf-proto",
"go-platform-kcd",
"go-util-ptypes",
"go-proto-analysis_go_proto",
"go-proto-buildinfo_go_proto",
"go-proto-storage_go_proto",
],
}
bootstrap_go_package {
name: "go-platform-kindex",
pkgPath: "kythe.io/kythe/go/platform/kindex",
srcs: ["kythe/go/platform/kindex/kindex.go"],
deps: [
"golang-protobuf-proto",
"go-platform-analysis",
"go-platform-delimited",
"go-platform-vfs",
"go-util-ptypes",
"go-proto-analysis_go_proto",
"go-proto-storage_go_proto",
],
}
bootstrap_go_package {
name: "go-platform-kzip",
pkgPath: "kythe.io/kythe/go/platform/kzip",
srcs: ["kythe/go/platform/kzip/kzip.go"],
deps: [
"creachadair-stringset",
"golang-protobuf-jsonpb",
"golang-protobuf-proto",
"golang-x-sync-errgroup",
"go-platform-kcd-kythe",
"go-proto-analysis_go_proto",
"go-proto-buildinfo_go_proto",
"go-proto-cxx_go_proto",
"go-proto-filecontext_go_proto",
"go-proto-go_go_proto",
"go-proto-java_go_proto",
],
}
bootstrap_go_package {
name: "go-platform-vfs",
pkgPath: "kythe.io/kythe/go/platform/vfs",
srcs: ["kythe/go/platform/vfs/vfs.go"],
}
bootstrap_go_package {
name: "go-proto-analysis_go_proto",
pkgPath: "kythe.io/kythe/proto/analysis_go_proto",
srcs: ["kythe/proto/analysis_go_proto/analysis.pb.go"],
deps: [
"golang-protobuf-proto",
"golang-protobuf-ptypes-any",
"go-proto-storage_go_proto",
],
}
bootstrap_go_package {
name: "go-proto-cxx_go_proto",
pkgPath: "kythe.io/kythe/proto/cxx_go_proto",
srcs: ["kythe/proto/cxx_go_proto/cxx.pb.go"],
deps: [
"golang-protobuf-proto",
],
}
bootstrap_go_package {
name: "go-proto-filecontext_go_proto",
pkgPath: "kythe.io/kythe/proto/filecontext_go_proto",
srcs: ["kythe/proto/filecontext_go_proto/filecontext.pb.go"],
deps: [
"golang-protobuf-proto",
],
}
bootstrap_go_package {
name: "go-proto-buildinfo_go_proto",
pkgPath: "kythe.io/kythe/proto/buildinfo_go_proto",
srcs: ["kythe/proto/buildinfo_go_proto/buildinfo.pb.go"],
deps: [
"golang-protobuf-proto",
],
}
bootstrap_go_package {
name: "go-proto-go_go_proto",
pkgPath: "kythe.io/kythe/proto/go_go_proto",
srcs: ["kythe/proto/go_go_proto/go.pb.go"],
deps: ["golang-protobuf-proto"],
}
bootstrap_go_package {
name: "go-proto-java_go_proto",
pkgPath: "kythe.io/kythe/proto/java_go_proto",
srcs: ["kythe/proto/java_go_proto/java.pb.go"],
deps: [
"go-proto-storage_go_proto",
"golang-protobuf-proto",
],
}
bootstrap_go_package {
name: "go-proto-storage_go_proto",
pkgPath: "kythe.io/kythe/proto/storage_go_proto",
srcs: ["kythe/proto/storage_go_proto/storage.pb.go"],
deps: [
"golang-protobuf-proto",
],
}
bootstrap_go_package {
name: "go-util-build",
pkgPath: "kythe.io/kythe/go/util/build",
srcs: ["kythe/go/util/build/build.go"],
deps: [
"golang-protobuf-proto",
"golang-protobuf-ptypes",
"golang-protobuf-ptypes-any",
],
}
bootstrap_go_package {
name: "go-util-flagutil",
pkgPath: "kythe.io/kythe/go/util/flagutil",
srcs: ["kythe/go/util/flagutil/flagutil.go"],
deps: [
"creachadair-stringset",
"go-util-build",
],
}
bootstrap_go_package {
name: "go-util-ptypes",
pkgPath: "kythe.io/kythe/go/util/ptypes",
srcs: ["kythe/go/util/ptypes/ptypes.go"],
deps: [
"golang-protobuf-proto",
"golang-protobuf-ptypes",
"golang-protobuf-ptypes-any",
],
}
bootstrap_go_package {
name: "go-util-vnameutil",
pkgPath: "kythe.io/kythe/go/util/vnameutil",
srcs: [
"kythe/go/util/vnameutil/order.go",
"kythe/go/util/vnameutil/rewrite.go",
],
deps: [
"go-proto-storage_go_proto",
"golang-protobuf-jsonpb",
],
}
blueprint_go_binary {
name: "go_extractor",
srcs: ["kythe/go/extractors/cmd/gotool/gotool.go"],
deps: [
"go-extractors-golang",
"go-platform-analysis",
"go-platform-delimited",
"go-platform-kcd",
"go-platform-kcd-kythe",
"go-platform-kzip",
"go-platform-vfs",
"go-proto-analysis_go_proto",
"go-proto-buildinfo_go_proto",
"go-proto-cxx_go_proto",
"go-proto-filecontext_go_proto",
"go-proto-java_go_proto",
"go-util-flagutil",
"go-util-vnameutil",
"go-util-build",
"golang-x-sync-errgroup",
"golang-x-tools-go-vcs",
],
// TODO(asmundak): is there a way to set linker flags
// (e.g., -ldflags="-s -w" -trimpath
}