1// Copyright (C) 2022 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: ["external_gson_license"], 17} 18 19license { 20 name: "external_gson_license", 21 visibility: [":__subpackages__"], 22 license_kinds: [ 23 "SPDX-license-identifier-Apache-2.0", 24 ], 25 license_text: [ 26 "LICENSE", 27 ], 28} 29 30java_library { 31 name: "gson", 32 host_supported: true, 33 srcs: [ 34 "gson/src/main/java/com/google/gson/**/*.java", 35 ":GsonBuildConfig.java", 36 ], 37 sdk_version: "current", 38 // b/267831518: Pin tradefed and dependencies to Java 11. 39 java_version: "11", 40} 41 42python_binary_host { 43 name: "gson_version_generator", 44 main: "version_generator.py", 45 srcs: ["version_generator.py"], 46} 47 48genrule { 49 name: "GsonBuildConfig.java", 50 srcs: [ 51 "gson/src/main/java-templates/com/google/gson/internal/GsonBuildConfig.java", 52 "pom.xml", 53 ], 54 out: ["com/google/gson/internal/GsonBuildConfig.java"], 55 cmd: "$(location gson_version_generator) $(in) > $(out)", 56 tools: ["gson_version_generator"], 57} 58