blob: 6612f8cc7e3884208577e2e0768a7f950101c463 [file] [log] [blame]
// Copyright (C) 2015 The Android Open Source Project
//
// 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.
package {
default_visibility: [":__subpackages__"]
}
java_import_host {
name: "dagger2-bootstrap-compiler-jar",
jars: ["java/dagger/internal/codegen/bootstrap/bootstrap_compiler_deploy.jar"],
}
java_plugin {
name: "dagger2-bootstrap-compiler",
processor_class: "dagger.internal.codegen.ComponentProcessor",
generates_api: true,
static_libs: ["dagger2-bootstrap-compiler-jar"],
jarjar_rules: "jarjar-rules.txt",
}
java_library {
name: "dagger2",
visibility: ["//visibility:public"],
host_supported: true,
srcs: [
"java/dagger/*.java",
"java/dagger/internal/*.java",
"java/dagger/multibindings/*.java",
"java/dagger/releasablereferences/*.java",
],
exclude_srcs: ["java/dagger/android/**/*.java"],
libs: [
"guava",
"jsr330",
],
java_version: "1.8",
sdk_version: "core_current",
}
// build dagger2 producers library
// ============================================================
java_library {
name: "dagger2-producers",
host_supported: true,
srcs: ["java/dagger/producers/**/*.java"],
static_libs: [
"error_prone_annotations",
],
libs: [
"dagger2",
"dagger2-android-annotation-stubs",
"guava",
"jsr330",
],
java_version: "1.8",
sdk_version: "core_current",
}
// build dagger2 compiler plugin
// ============================================================
java_plugin {
name: "dagger2-compiler",
visibility: ["//visibility:public"],
processor_class: "dagger.internal.codegen.ComponentProcessor",
generates_api: true,
use_tools_jar: true,
srcs: [
"java/dagger/internal/codegen/**/*.java",
"java/dagger/internal/codegen/**/*.proto",
"java/dagger/model/*.java",
"java/dagger/spi/*.java",
],
exclude_srcs: [
"java/dagger/internal/codegen/BindingGraphStatisticsCollector.java",
"java/dagger/internal/codegen/kythe/DaggerKythePlugin.java",
],
// Manually include META-INF/services/javax.annotation.processing.Processor
// as the AutoService processor doesn't work properly.
java_resource_dirs: ["resources"],
static_libs: [
"auto_common",
"dagger2",
"dagger2-producers",
"google_java_format",
"guava",
"javapoet",
"jsr330",
"kotlin-stdlib",
"kotlinx_metadata_jvm",
],
// shade guava to avoid conflicts with guava embedded in Error Prone.
jarjar_rules: "jarjar-rules.txt",
libs: [
"auto_factory_annotations",
"auto_service_annotations",
"auto_value_annotations",
"auto_value_memoized_extension_annotations",
"dagger2-android-annotation-stubs",
],
plugins: [
"auto_factory_plugin",
"auto_service_plugin",
"auto_value_plugin",
"auto_value_memoized_extension_plugin",
"auto_annotation_plugin",
"dagger2-bootstrap-compiler",
],
proto: {
type: "full",
include_dirs: ["external/protobuf/src/"],
},
java_version: "1.8",
}
// Compile dummy implementations of annotations used by dagger2 but not
// present in the Android tree.
java_library {
name: "dagger2-android-annotation-stubs",
host_supported: true,
sdk_version: "core_current",
srcs: ["android-annotation-stubs/src/**/*.java"],
}