summaryrefslogtreecommitdiff
path: root/srcgen
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2018-11-21 10:29:50 +0000
committerPaul Duffin <paulduffin@google.com>2018-11-23 11:59:22 +0000
commit6eec96b310861c8392330a3a56e4ec30766f1f62 (patch)
tree2e6001871c9f3b3d0793abce98f9898b986841e6 /srcgen
parent718d6a1c5ca465b2bc8305fe25906c9e2864882f (diff)
downloadbouncycastle-6eec96b310861c8392330a3a56e4ec30766f1f62.tar.gz
Move android_bcprov to repackaged/bcprov
This is needed to provide consistency between bouncycastle and other users of RepackagingTransform to allow them to switch to using a common script. The previous change to switch from jarjar to currysrc did not correctly update the build exclusion of the repackaged version of org/bouncycastle/asn1/ocsp which is not required on Android. That meant it was incorrectly being included in the bouncycastle library. This updates the build script to remove the repackaged versions of those files altogether and removes the unnecessary build exclusion. Tested by running the script and verifying that apart from the now deleted files the repackaged files only differed by location and not content. Bug: 117818301 Test: see above Change-Id: I88eef5583071156c277ac82bb89ec76a91603df9
Diffstat (limited to 'srcgen')
-rwxr-xr-xsrcgen/generate_android_src.sh24
1 files changed, 22 insertions, 2 deletions
diff --git a/srcgen/generate_android_src.sh b/srcgen/generate_android_src.sh
index ffdeeb3d..5fcfd12f 100755
--- a/srcgen/generate_android_src.sh
+++ b/srcgen/generate_android_src.sh
@@ -1,4 +1,17 @@
#!/bin/bash
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
if [ -z "$ANDROID_BUILD_TOP" ]; then
echo "Missing environment variables. Did you run build/envsetup.sh and lunch?" 1>&2
@@ -13,6 +26,7 @@ make -j15 currysrc
CORE_PLATFORM_API_FILE=${BOUNCY_CASTLE_DIR}/srcgen/core-platform-api.txt
UNSUPPORTED_APP_USAGE_FILE=${BOUNCY_CASTLE_DIR}/srcgen/unsupported-app-usage.json
+DEFAULT_CONSTRUCTORS_FILE=${BOUNCY_CASTLE_DIR}/srcgen/default-constructors.txt
function do_transform() {
local SRC_IN_DIR=$1
@@ -30,9 +44,15 @@ function do_transform() {
--target-dir ${SRC_OUT_DIR} \
--package-transformation "org.bouncycastle:com.android.org.bouncycastle" \
--core-platform-api-file ${CORE_PLATFORM_API_FILE} \
- --unsupported-app-usage-file ${UNSUPPORTED_APP_USAGE_FILE}
+ --unsupported-app-usage-file ${UNSUPPORTED_APP_USAGE_FILE} \
+ --default-constructors ${DEFAULT_CONSTRUCTORS_FILE} \
+
}
+REPACKAGED_DIR=${BOUNCY_CASTLE_DIR}/repackaged
BCPROV_SRC_IN_DIR=${BOUNCY_CASTLE_DIR}/bcprov/src/main/java
-BCPROV_SRC_OUT_DIR=${BOUNCY_CASTLE_DIR}/android_bcprov/src/main/java
+BCPROV_SRC_OUT_DIR=${REPACKAGED_DIR}/bcprov/src/main/java
do_transform ${BCPROV_SRC_IN_DIR} ${BCPROV_SRC_OUT_DIR}
+
+# Remove some unused source files:
+rm -fr ${REPACKAGED_DIR}/bcprov/src/main/java/com/android/org/bouncycastle/asn1/ocsp/