1// 2// Copyright (C) 2012 The Android Open Source Project 3// 4// Licensed under the Apache License, Version 2.0 (the "License"); 5// you may not use this file except in compliance with the License. 6// You may obtain a copy of the License at 7// 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// See the License for the specific language governing permissions and 14// limitations under the License. 15// 16 17package { 18 default_visibility: ["//visibility:private"], 19} 20 21// The source files that contribute to Android's core library APIs. 22filegroup { 23 name: "okhttp_api_files", 24 visibility: ["//libcore"], 25 // Use the repackaged version of android as that is what is used by Android core library 26 // APIs. 27 srcs: ["repackaged/android/src/main/java/com/android/okhttp/internalandroidapi/**/*.java"], 28} 29 30nojarjar_visibility = [ 31 "//art/build/sdk", 32 "//cts/tests/libcore/okhttp", 33] 34 35// non-jarjar'd version of okhttp to compile the tests against 36java_library { 37 name: "okhttp-nojarjar", 38 visibility: nojarjar_visibility, 39 srcs: [ 40 "android/src/main/java/**/*.java", 41 "okhttp/src/main/java/**/*.java", 42 "okhttp-urlconnection/src/main/java/**/*.java", 43 "okhttp-android-support/src/main/java/**/*.java", 44 "okio/okio/src/main/java/**/*.java", 45 ], 46 exclude_srcs: ["okhttp/src/main/java/com/squareup/okhttp/internal/Platform.java"], 47 48 hostdex: true, 49 50 sdk_version: "none", 51 system_modules: "core-all-system-modules", 52 libs: [ 53 "conscrypt.module.intra.core.api.stubs", 54 ], 55 java_version: "1.7", 56} 57 58java_library { 59 name: "okhttp", 60 visibility: [ 61 "//art/build/apex", 62 "//external/robolectric-shadows", 63 "//libcore", 64 ], 65 srcs: [ 66 // Although some of the classes in the android/ directory are already in the correct 67 // package and do not need to be moved to another package they are transformed as they 68 // reference other classes that do require repackaging. 69 "repackaged/android/src/main/java/**/*.java", 70 "repackaged/okhttp/src/main/java/**/*.java", 71 "repackaged/okhttp-urlconnection/src/main/java/**/*.java", 72 "repackaged/okhttp-android-support/src/main/java/**/*.java", 73 "repackaged/okio/okio/src/main/java/**/*.java", 74 ], 75 76 hostdex: true, 77 installable: true, 78 79 sdk_version: "none", 80 system_modules: "core-all-system-modules", 81 libs: [ 82 "conscrypt.module.intra.core.api.stubs", 83 ], 84 java_version: "1.7", 85 apex_available: [ 86 "com.android.art.debug", 87 "com.android.art.release", 88 ], 89} 90 91// A guaranteed unstripped version of okhttp. 92// The build system may or may not strip the okhttp jar, but this one will 93// not be stripped. See b/24535627. 94java_library { 95 name: "okhttp-testdex", 96 visibility: [ 97 "//art:__subpackages__", 98 ], 99 static_libs: ["okhttp"], 100 101 installable: true, 102 103 sdk_version: "none", 104 system_modules: "core-all-system-modules", 105 libs: [ 106 "conscrypt.module.intra.core.api.stubs", 107 ], 108 dex_preopt: { 109 enabled: false, 110 }, 111 java_version: "1.7", 112} 113 114java_library { 115 name: "okhttp-tests-nojarjar", 116 visibility: nojarjar_visibility, 117 srcs: [ 118 "android/test/java/**/*.java", 119 "okhttp-android-support/src/test/java/**/*.java", 120 "okhttp-testing-support/src/main/java/**/*.java", 121 "okhttp-tests/src/test/java/**/*.java", 122 "okhttp-urlconnection/src/test/java/**/*.java", 123 "okhttp-ws/src/main/java/**/*.java", 124 "okhttp-ws-tests/src/test/java/**/*.java", 125 "okio/okio/src/test/java/**/*.java", 126 "mockwebserver/src/main/java/**/*.java", 127 "mockwebserver/src/test/java/**/*.java", 128 ], 129 // Exclude test Android currently has problems with due to @Parameterized (requires JUnit 4.11). 130 exclude_srcs: ["okhttp-tests/src/test/java/com/squareup/okhttp/WebPlatformUrlTest.java"], 131 132 sdk_version: "none", 133 system_modules: "core-all-system-modules", 134 libs: [ 135 "okhttp-nojarjar", 136 "junit", 137 "conscrypt.module.intra.core.api.stubs", 138 "bouncycastle-unbundled", 139 ], 140 141 java_version: "1.7", 142} 143