1package { 2 // See: http://go/android-license-faq 3 // A large-scale-change added 'default_applicable_licenses' to import 4 // all of the 'license_kinds' from "external_rust_beto-rust_license" 5 // to get the below license kinds: 6 // legacy_unencumbered 7 // SPDX-license-identifier-Apache-2.0 8 // SPDX-license-identifier-Unlicense 9 default_applicable_licenses: ["external_rust_beto-rust_license"], 10} 11 12rust_library_rlib { 13 name: "libcrypto_provider", 14 host_supported: true, 15 crate_name: "crypto_provider", 16 cargo_env_compat: true, 17 cargo_pkg_version: "0.1.0", 18 srcs: ["crypto/crypto_provider/src/lib.rs"], 19 edition: "2021", 20 features: [ 21 "std", 22 "alloc", 23 "default", 24 ], 25 rustlibs: [ 26 "libhex", 27 "librand", 28 ], 29 apex_available: [ 30 "//apex_available:platform", 31 "//apex_available:anyapex", 32 ], 33} 34 35rust_library_rlib { 36 name: "libcrypto_provider_openssl", 37 host_supported: true, 38 crate_name: "crypto_provider_openssl", 39 cargo_env_compat: true, 40 cargo_pkg_version: "0.1.0", 41 cfgs: ["soong"], 42 srcs: ["crypto/crypto_provider_openssl/src/lib.rs"], 43 edition: "2021", 44 features: ["boringssl"], 45 rustlibs: [ 46 "libcfg_if", 47 "libcrypto_provider", 48 "libopenssl", 49 "librand", 50 ], 51 apex_available: [ 52 "//apex_available:platform", 53 "//apex_available:anyapex", 54 ], 55} 56 57rust_ffi_shared { 58 name: "libukey2_c_ffi_shared", 59 stem: "libukey2_c_ffi", 60 host_supported: true, 61 crate_name: "ukey2_c_ffi", 62 cargo_env_compat: true, 63 cargo_pkg_version: "0.1.0", 64 srcs: ["connections/ukey2/ukey2_c_ffi/src/lib.rs"], 65 edition: "2021", 66 features: ["openssl"], 67 rlibs: [ 68 "libcfg_if", 69 "libcrypto_provider_openssl", 70 "liblazy_static", 71 "liblog_rust", 72 "librand", 73 "librand_chacha", 74 "libspin_nostd", 75 "libukey2_connections", 76 "libukey2_rs", 77 ], 78 apex_available: [ 79 "//apex_available:platform", 80 "//apex_available:anyapex", 81 ], 82} 83 84rust_library_rlib { 85 name: "libukey2_connections", 86 host_supported: true, 87 crate_name: "ukey2_connections", 88 cargo_env_compat: true, 89 cargo_pkg_version: "0.1.0", 90 srcs: ["connections/ukey2/ukey2_connections/src/lib.rs"], 91 edition: "2021", 92 rustlibs: [ 93 "libbytes", 94 "libcrypto_provider", 95 "libnom", 96 "librand", 97 "libukey2_proto", 98 "libukey2_rs", 99 ], 100 apex_available: [ 101 "//apex_available:platform", 102 "//apex_available:anyapex", 103 ], 104} 105 106rust_ffi_shared { 107 name: "libukey2_jni_shared", 108 stem: "libukey2_jni", 109 host_supported: true, 110 crate_name: "ukey2_jni", 111 cargo_env_compat: true, 112 cargo_pkg_version: "0.1.0", 113 srcs: ["connections/ukey2/ukey2_jni/src/lib.rs"], 114 edition: "2021", 115 features: ["openssl"], 116 // Using rlibs instead of rustlibs here to minimize the size impact on the system image. Since 117 // most of the transitive dependencies are included only by this project for U, building this 118 // as a single dylib will be more space-efficient. As more Rust project gets added, this may 119 // change and it may be better for different projects to share the same dylib, especially for 120 // common projects like libjni and libprotobuf. 121 rlibs: [ 122 "libcfg_if", 123 "libcrypto_provider_openssl", 124 "libjni", 125 "liblazy_static", 126 "librand", 127 "librand_chacha", 128 "libspin_nostd", 129 "libukey2_connections", 130 "libukey2_rs", 131 ], 132 compile_multilib: "first", 133 apex_available: [ 134 "//apex_available:platform", 135 "//apex_available:anyapex", 136 ], 137} 138 139rust_library_rlib { 140 name: "libukey2_proto", 141 host_supported: true, 142 crate_name: "ukey2_proto", 143 cargo_env_compat: true, 144 cargo_pkg_version: "0.1.0", 145 srcs: ["connections/ukey2/ukey2_proto/src/lib.rs"], 146 edition: "2021", 147 features: [ 148 "default", 149 ], 150 rustlibs: [ 151 "libprotobuf", 152 ], 153 apex_available: [ 154 "//apex_available:platform", 155 "//apex_available:anyapex", 156 ], 157} 158 159rust_library_rlib { 160 name: "libukey2_rs", 161 host_supported: true, 162 crate_name: "ukey2_rs", 163 cargo_env_compat: true, 164 cargo_pkg_version: "0.1.0", 165 srcs: ["connections/ukey2/ukey2/src/lib.rs"], 166 edition: "2021", 167 rustlibs: [ 168 "libcrypto_provider", 169 "libnum_bigint", 170 "liblog_rust", 171 "librand", 172 "libukey2_proto", 173 ], 174 proc_macros: ["libderive_getters"], 175 apex_available: [ 176 "//apex_available:platform", 177 "//apex_available:anyapex", 178 ], 179} 180 181java_library_static { 182 name: "ukey2_jni", 183 srcs: [ 184 "connections/ukey2/ukey2_jni/java/src/main/**/*.java", 185 "connections/ukey2/ukey2_jni/java/src/main/**/*.kt", 186 ], 187 host_supported: true, 188 static_libs: [ 189 "jsr305", 190 ], 191 required: [ 192 "libukey2_jni_shared", 193 ], 194} 195