1// Copyright (C) 2023 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16    default_applicable_licenses: ["Android-Apache-2.0"],
17}
18
19// The weather effects library only contains rendering logic.
20android_library {
21    name: "WeatherEffectsGraphicsLib",
22    sdk_version: "system_current",
23    // min_sdk version must be specified to not compile against platform apis.
24    // Using HardwareBufferRenderer requires minimum of 34.
25    min_sdk_version: "34",
26    static_libs: [
27        // Do not add Torus dependency here, since this package is only for rendering. The host app
28        // will include Torus or Livewallpaper frameworks.
29        "androidx.appcompat_appcompat",
30    ],
31    srcs: [
32        "graphics/src/**/*.java",
33        "graphics/src/**/*.kt",
34    ],
35    asset_dirs: [
36        "graphics/assets",
37    ],
38    javacflags: ["-Adagger.fastInit=enabled"],
39    kotlincflags: ["-Xjvm-default=all"],
40    plugins: ["dagger2-compiler"],
41    dxflags: ["--multi-dex"],
42}
43
44// Debug app.
45android_app {
46    name: "WeatherEffectsDebug",
47    manifest: "debug/AndroidManifest.xml",
48    owner: "google",
49    platform_apis: true,
50    srcs: [
51        "src/**/*.java",
52        "src/**/*.kt",
53        "debug/src/**/*.java",
54        "debug/src/**/*.kt",
55    ],
56    resource_dirs: [
57        "res",
58        "debug/res",
59    ],
60    asset_dirs: [
61        "debug/assets",
62    ],
63    static_libs: [
64        "androidx.slice_slice-core",
65        "androidx.slice_slice-builders",
66        "dagger2",
67        "jsr330", // Dagger inject annotations.
68        "kotlinx_coroutines_android",
69        "kotlinx_coroutines",
70        "androidx.core_core-ktx",
71        "androidx.appcompat_appcompat",
72        "androidx-constraintlayout_constraintlayout",
73        "toruslib",
74        "WeatherEffectsGraphicsLib",
75    ],
76    use_embedded_native_libs: true,
77    plugins: ["dagger2-compiler"],
78    optimize: {
79        enabled: true,
80        shrink: true,
81        shrink_resources: true,
82    },
83}
84
85android_test {
86    name: "weathereffects_tests",
87    instrumentation_for: "WeatherEffectsDebug",
88    manifest: "AndroidManifest.xml",
89    test_suites: ["general-tests"],
90    sdk_version: "current",
91    owner: "google",
92    srcs: [
93        "tests/src/**/*.java",
94        "tests/src/**/*.kt",
95    ],
96    static_libs: [
97        "WeatherEffectsGraphicsLib",
98        "androidx.test.rules",
99        "androidx.test.ext.junit",
100        "androidx.test.core",
101        "androidx.test.runner",
102        "kotlinx_coroutines_test",
103        "truth",
104    ],
105}
106