2021-01-25 16:04:52 +00:00
|
|
|
load("@rules_android//android:rules.bzl", "android_binary", "android_library")
|
2021-02-02 20:09:33 +00:00
|
|
|
load("@rules_cc//cc:defs.bzl", "cc_library")
|
2021-03-12 16:54:14 +00:00
|
|
|
load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake")
|
2018-08-13 18:01:39 +00:00
|
|
|
|
2021-03-09 18:55:01 +00:00
|
|
|
cmake(
|
2018-08-13 18:01:39 +00:00
|
|
|
name = "libhello",
|
2019-01-07 09:31:27 +00:00
|
|
|
lib_source = "//cmake_hello_world_lib/static:srcs",
|
2018-10-23 14:49:20 +00:00
|
|
|
out_include_dir = "include/version123",
|
2018-08-13 18:01:39 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "hello_lib_usage_example",
|
|
|
|
srcs = ["hello_lib-example.cpp"],
|
|
|
|
linkstatic = True,
|
|
|
|
deps = [":libhello"],
|
|
|
|
alwayslink = True,
|
|
|
|
)
|
|
|
|
|
|
|
|
android_library(
|
|
|
|
name = "lib",
|
|
|
|
srcs = ["java/com/example/android/bazel/MainActivity.java"],
|
|
|
|
custom_package = "com.example.android.bazel",
|
|
|
|
manifest = "LibraryManifest.xml",
|
|
|
|
resource_files = glob(["res/**/*"]),
|
|
|
|
deps = [
|
|
|
|
":hello_lib_usage_example",
|
2019-07-10 16:44:57 +00:00
|
|
|
"@maven//:com_android_support_appcompat_v7",
|
|
|
|
"@maven//:com_android_support_constraint_constraint_layout",
|
2018-08-13 18:01:39 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
android_binary(
|
|
|
|
name = "app",
|
|
|
|
custom_package = "com.example.android.bazel",
|
|
|
|
manifest = "AndroidManifest.xml",
|
|
|
|
deps = [":lib"],
|
|
|
|
)
|