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 target: { 41 windows: { 42 enabled: true, 43 }, 44 }, 45} 46 47python_binary_host { 48 name: "gson_version_generator", 49 main: "version_generator.py", 50 srcs: ["version_generator.py"], 51} 52 53genrule { 54 name: "GsonBuildConfig.java", 55 srcs: [ 56 "gson/src/main/java-templates/com/google/gson/internal/GsonBuildConfig.java", 57 "pom.xml", 58 ], 59 out: ["com/google/gson/internal/GsonBuildConfig.java"], 60 cmd: "$(location gson_version_generator) $(in) > $(out)", 61 tools: ["gson_version_generator"], 62} 63