Colin Cross | ea8fc51 | 2017-10-19 15:06:43 -0700 | [diff] [blame] | 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 | |
Paul Duffin | 9c099e2 | 2019-06-03 13:38:17 +0100 | [diff] [blame] | 17 | package { |
| 18 | default_visibility: ["//visibility:private"], |
| 19 | } |
| 20 | |
Neil Fuller | 7c21fa4 | 2018-09-24 15:37:43 +0100 | [diff] [blame] | 21 | // The source files that contribute to Android's core library APIs. |
| 22 | filegroup { |
| 23 | name: "okhttp_api_files", |
Paul Duffin | 9c099e2 | 2019-06-03 13:38:17 +0100 | [diff] [blame] | 24 | visibility: ["//libcore"], |
Paul Duffin | aa7ed34 | 2018-11-13 14:51:39 +0000 | [diff] [blame] | 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"], |
Neil Fuller | 7c21fa4 | 2018-09-24 15:37:43 +0100 | [diff] [blame] | 28 | } |
Colin Cross | ea8fc51 | 2017-10-19 15:06:43 -0700 | [diff] [blame] | 29 | |
Paul Duffin | 9c099e2 | 2019-06-03 13:38:17 +0100 | [diff] [blame] | 30 | nojarjar_visibility = [ |
Paul Duffin | 3fd3830 | 2020-01-13 16:48:51 +0000 | [diff] [blame] | 31 | "//art/build/sdk", |
Paul Duffin | 9c099e2 | 2019-06-03 13:38:17 +0100 | [diff] [blame] | 32 | "//cts/tests/libcore/okhttp", |
| 33 | ] |
| 34 | |
Neil Fuller | 7c21fa4 | 2018-09-24 15:37:43 +0100 | [diff] [blame] | 35 | // non-jarjar'd version of okhttp to compile the tests against |
| 36 | java_library { |
| 37 | name: "okhttp-nojarjar", |
Paul Duffin | 9c099e2 | 2019-06-03 13:38:17 +0100 | [diff] [blame] | 38 | visibility: nojarjar_visibility, |
Colin Cross | ea8fc51 | 2017-10-19 15:06:43 -0700 | [diff] [blame] | 39 | srcs: [ |
Paul Duffin | 8474608 | 2018-11-13 11:45:44 +0000 | [diff] [blame] | 40 | "android/src/main/java/**/*.java", |
Colin Cross | ea8fc51 | 2017-10-19 15:06:43 -0700 | [diff] [blame] | 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 | ], |
Colin Cross | ea8fc51 | 2017-10-19 15:06:43 -0700 | [diff] [blame] | 46 | target: { |
| 47 | android: { |
| 48 | srcs: ["android/main/java/**/*.java"], |
| 49 | exclude_srcs: ["okhttp/src/main/java/com/squareup/okhttp/internal/Platform.java"], |
| 50 | }, |
| 51 | }, |
Neil Fuller | 7c21fa4 | 2018-09-24 15:37:43 +0100 | [diff] [blame] | 52 | exclude_srcs: ["okhttp/src/main/java/com/squareup/okhttp/internal/Platform.java"], |
Colin Cross | ea8fc51 | 2017-10-19 15:06:43 -0700 | [diff] [blame] | 53 | |
Neil Fuller | 7c21fa4 | 2018-09-24 15:37:43 +0100 | [diff] [blame] | 54 | hostdex: true, |
Colin Cross | ea8fc51 | 2017-10-19 15:06:43 -0700 | [diff] [blame] | 55 | |
Paul Duffin | 9b9fc8e | 2019-06-12 11:07:55 +0100 | [diff] [blame] | 56 | sdk_version: "none", |
Neil Fuller | 4c219c6 | 2018-10-04 13:11:17 +0100 | [diff] [blame] | 57 | system_modules: "core-all-system-modules", |
Colin Cross | ea8fc51 | 2017-10-19 15:06:43 -0700 | [diff] [blame] | 58 | libs: [ |
Paul Duffin | db68fd6 | 2019-10-02 14:01:10 +0100 | [diff] [blame] | 59 | "conscrypt.module.intra.core.api.stubs", |
Colin Cross | ea8fc51 | 2017-10-19 15:06:43 -0700 | [diff] [blame] | 60 | ], |
Colin Cross | ea8fc51 | 2017-10-19 15:06:43 -0700 | [diff] [blame] | 61 | java_version: "1.7", |
| 62 | } |
| 63 | |
| 64 | java_library { |
| 65 | name: "okhttp", |
Paul Duffin | 777d507 | 2019-03-28 14:26:55 +0000 | [diff] [blame] | 66 | visibility: [ |
| 67 | "//art/build/apex", |
| 68 | "//external/robolectric-shadows", |
| 69 | "//libcore", |
| 70 | ], |
Paul Duffin | aa7ed34 | 2018-11-13 14:51:39 +0000 | [diff] [blame] | 71 | srcs: [ |
| 72 | // Although some of the classes in the android/ directory are already in the correct |
| 73 | // package and do not need to be moved to another package they are transformed as they |
| 74 | // reference other classes that do require repackaging. |
| 75 | "repackaged/android/src/main/java/**/*.java", |
| 76 | "repackaged/okhttp/src/main/java/**/*.java", |
| 77 | "repackaged/okhttp-urlconnection/src/main/java/**/*.java", |
| 78 | "repackaged/okhttp-android-support/src/main/java/**/*.java", |
| 79 | "repackaged/okio/okio/src/main/java/**/*.java", |
| 80 | ], |
Neil Fuller | 7c21fa4 | 2018-09-24 15:37:43 +0100 | [diff] [blame] | 81 | |
| 82 | hostdex: true, |
| 83 | installable: true, |
| 84 | |
Paul Duffin | 9b9fc8e | 2019-06-12 11:07:55 +0100 | [diff] [blame] | 85 | sdk_version: "none", |
Neil Fuller | 4c219c6 | 2018-10-04 13:11:17 +0100 | [diff] [blame] | 86 | system_modules: "core-all-system-modules", |
Colin Cross | ea8fc51 | 2017-10-19 15:06:43 -0700 | [diff] [blame] | 87 | libs: [ |
Paul Duffin | db68fd6 | 2019-10-02 14:01:10 +0100 | [diff] [blame] | 88 | "conscrypt.module.intra.core.api.stubs", |
Colin Cross | ea8fc51 | 2017-10-19 15:06:43 -0700 | [diff] [blame] | 89 | ], |
Colin Cross | ea8fc51 | 2017-10-19 15:06:43 -0700 | [diff] [blame] | 90 | java_version: "1.7", |
Anton Hansson | 4dcddc9 | 2020-01-10 16:00:45 +0000 | [diff] [blame] | 91 | apex_available: [ |
| 92 | "com.android.art.debug", |
| 93 | "com.android.art.release", |
| 94 | ], |
Colin Cross | ea8fc51 | 2017-10-19 15:06:43 -0700 | [diff] [blame] | 95 | } |
| 96 | |
| 97 | // A guaranteed unstripped version of okhttp. |
| 98 | // The build system may or may not strip the okhttp jar, but this one will |
| 99 | // not be stripped. See b/24535627. |
| 100 | java_library { |
| 101 | name: "okhttp-testdex", |
Paul Duffin | 9c099e2 | 2019-06-03 13:38:17 +0100 | [diff] [blame] | 102 | visibility: [ |
| 103 | "//art:__subpackages__", |
| 104 | ], |
Colin Cross | ea8fc51 | 2017-10-19 15:06:43 -0700 | [diff] [blame] | 105 | static_libs: ["okhttp"], |
Neil Fuller | 7c21fa4 | 2018-09-24 15:37:43 +0100 | [diff] [blame] | 106 | |
| 107 | installable: true, |
| 108 | |
Paul Duffin | 9b9fc8e | 2019-06-12 11:07:55 +0100 | [diff] [blame] | 109 | sdk_version: "none", |
Paul Duffin | 6461a1b | 2019-09-20 14:43:56 +0100 | [diff] [blame] | 110 | system_modules: "core-all-system-modules", |
Neil Fuller | 4c219c6 | 2018-10-04 13:11:17 +0100 | [diff] [blame] | 111 | libs: [ |
Paul Duffin | db68fd6 | 2019-10-02 14:01:10 +0100 | [diff] [blame] | 112 | "conscrypt.module.intra.core.api.stubs", |
Neil Fuller | 4c219c6 | 2018-10-04 13:11:17 +0100 | [diff] [blame] | 113 | ], |
Vladimir Marko | 5eb6baa | 2018-12-04 10:25:47 +0000 | [diff] [blame] | 114 | dex_preopt: { |
| 115 | enabled: false, |
| 116 | }, |
Colin Cross | ea8fc51 | 2017-10-19 15:06:43 -0700 | [diff] [blame] | 117 | java_version: "1.7", |
| 118 | } |
| 119 | |
Paul Duffin | 9c099e2 | 2019-06-03 13:38:17 +0100 | [diff] [blame] | 120 | java_library { |
Colin Cross | ea8fc51 | 2017-10-19 15:06:43 -0700 | [diff] [blame] | 121 | name: "okhttp-tests-nojarjar", |
Paul Duffin | 9c099e2 | 2019-06-03 13:38:17 +0100 | [diff] [blame] | 122 | visibility: nojarjar_visibility, |
Colin Cross | ea8fc51 | 2017-10-19 15:06:43 -0700 | [diff] [blame] | 123 | srcs: [ |
| 124 | "android/test/java/**/*.java", |
| 125 | "okhttp-android-support/src/test/java/**/*.java", |
| 126 | "okhttp-testing-support/src/main/java/**/*.java", |
| 127 | "okhttp-tests/src/test/java/**/*.java", |
| 128 | "okhttp-urlconnection/src/test/java/**/*.java", |
| 129 | "okhttp-ws/src/main/java/**/*.java", |
| 130 | "okhttp-ws-tests/src/test/java/**/*.java", |
| 131 | "okio/okio/src/test/java/**/*.java", |
| 132 | "mockwebserver/src/main/java/**/*.java", |
| 133 | "mockwebserver/src/test/java/**/*.java", |
| 134 | ], |
| 135 | // Exclude test Android currently has problems with due to @Parameterized (requires JUnit 4.11). |
| 136 | exclude_srcs: ["okhttp-tests/src/test/java/com/squareup/okhttp/WebPlatformUrlTest.java"], |
Neil Fuller | 7c21fa4 | 2018-09-24 15:37:43 +0100 | [diff] [blame] | 137 | |
Paul Duffin | 9b9fc8e | 2019-06-12 11:07:55 +0100 | [diff] [blame] | 138 | sdk_version: "none", |
Paul Duffin | 6461a1b | 2019-09-20 14:43:56 +0100 | [diff] [blame] | 139 | system_modules: "core-all-system-modules", |
Colin Cross | ea8fc51 | 2017-10-19 15:06:43 -0700 | [diff] [blame] | 140 | libs: [ |
| 141 | "okhttp-nojarjar", |
| 142 | "junit", |
Paul Duffin | db68fd6 | 2019-10-02 14:01:10 +0100 | [diff] [blame] | 143 | "conscrypt.module.intra.core.api.stubs", |
Narayan Kamath | 34f350f | 2018-03-01 12:33:49 +0000 | [diff] [blame] | 144 | "bouncycastle-unbundled", |
Colin Cross | ea8fc51 | 2017-10-19 15:06:43 -0700 | [diff] [blame] | 145 | ], |
Neil Fuller | 1a022c1 | 2018-10-09 17:44:35 +0100 | [diff] [blame] | 146 | |
Colin Cross | ea8fc51 | 2017-10-19 15:06:43 -0700 | [diff] [blame] | 147 | java_version: "1.7", |
| 148 | } |