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    sdk_version: "system_current",
50    min_sdk_version: "34",
51    srcs: [
52        "src/**/*.java",
53        "src/**/*.kt",
54        "debug/src/**/*.java",
55        "debug/src/**/*.kt",
56    ],
57    resource_dirs: [
58        "res",
59        "debug/res",
60    ],
61    asset_dirs: [
62        "debug/assets",
63    ],
64    static_libs: [
65        "androidx.slice_slice-core",
66        "androidx.slice_slice-builders",
67        "dagger2",
68        "jsr330", // Dagger inject annotations.
69        "kotlinx_coroutines_android",
70        "kotlinx_coroutines",
71        "androidx.core_core-ktx",
72        "androidx.appcompat_appcompat",
73        "androidx-constraintlayout_constraintlayout",
74        "toruslib",
75        "WeatherEffectsGraphicsLib",
76    ],
77    use_embedded_native_libs: true,
78    plugins: ["dagger2-compiler"],
79    optimize: {
80        enabled: true,
81        shrink: true,
82        shrink_resources: true,
83    },
84}
85
86android_test {
87    name: "weathereffects_tests",
88    instrumentation_for: "WeatherEffectsDebug",
89    manifest: "AndroidManifest.xml",
90    test_suites: ["general-tests"],
91    sdk_version: "current",
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