xref: /aosp_15_r20/external/okhttp/srcgen/generate_android_src.sh (revision ab625e417e7950f52094c019474d2a9e9f14a68c)
1*ab625e41SAndroid Build Coastguard Worker#!/bin/bash
2*ab625e41SAndroid Build Coastguard Worker# Copyright (C) 2018 The Android Open Source Project
3*ab625e41SAndroid Build Coastguard Worker#
4*ab625e41SAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License");
5*ab625e41SAndroid Build Coastguard Worker# you may not use this file except in compliance with the License.
6*ab625e41SAndroid Build Coastguard Worker# You may obtain a copy of the License at
7*ab625e41SAndroid Build Coastguard Worker#
8*ab625e41SAndroid Build Coastguard Worker#      http://www.apache.org/licenses/LICENSE-2.0
9*ab625e41SAndroid Build Coastguard Worker#
10*ab625e41SAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software
11*ab625e41SAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS,
12*ab625e41SAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*ab625e41SAndroid Build Coastguard Worker# See the License for the specific language governing permissions and
14*ab625e41SAndroid Build Coastguard Worker# limitations under the License.
15*ab625e41SAndroid Build Coastguard Worker
16*ab625e41SAndroid Build Coastguard Workerif [[ -z "${ANDROID_BUILD_TOP}" ]]; then
17*ab625e41SAndroid Build Coastguard Worker    echo "Missing environment variables. Did you run build/envsetup.sh and lunch?" >&2
18*ab625e41SAndroid Build Coastguard Worker    exit 1
19*ab625e41SAndroid Build Coastguard Workerfi
20*ab625e41SAndroid Build Coastguard Worker
21*ab625e41SAndroid Build Coastguard WorkerPROJECT_DIR=external/okhttp
22*ab625e41SAndroid Build Coastguard Worker
23*ab625e41SAndroid Build Coastguard WorkerPACKAGE_TRANSFORMATIONS="\
24*ab625e41SAndroid Build Coastguard Worker    com.squareup:com.android \
25*ab625e41SAndroid Build Coastguard Worker    okio:com.android.okhttp.okio \
26*ab625e41SAndroid Build Coastguard Worker"
27*ab625e41SAndroid Build Coastguard Worker
28*ab625e41SAndroid Build Coastguard WorkerMODULE_DIRS="\
29*ab625e41SAndroid Build Coastguard Worker    android \
30*ab625e41SAndroid Build Coastguard Worker    okhttp \
31*ab625e41SAndroid Build Coastguard Worker    okhttp-urlconnection \
32*ab625e41SAndroid Build Coastguard Worker    okhttp-android-support \
33*ab625e41SAndroid Build Coastguard Worker    okio/okio \
34*ab625e41SAndroid Build Coastguard Worker"
35*ab625e41SAndroid Build Coastguard Worker
36*ab625e41SAndroid Build Coastguard WorkerSOURCE_DIRS="\
37*ab625e41SAndroid Build Coastguard Worker    src/main/java \
38*ab625e41SAndroid Build Coastguard Worker"
39*ab625e41SAndroid Build Coastguard Worker
40*ab625e41SAndroid Build Coastguard WorkerTAB_SIZE=2
41*ab625e41SAndroid Build Coastguard Worker
42*ab625e41SAndroid Build Coastguard Worker# Repackage the project's source.
43*ab625e41SAndroid Build Coastguard Workersource ${ANDROID_BUILD_TOP}/tools/currysrc/scripts/repackage-common.sh
44*ab625e41SAndroid Build Coastguard Worker
45*ab625e41SAndroid Build Coastguard Worker# Remove an unused source file:
46*ab625e41SAndroid Build Coastguard Workerrm ${REPACKAGED_DIR}/okhttp/src/main/java/com/android/okhttp/internal/Platform.java
47