xref: /aosp_15_r20/frameworks/rs/script_api/generate.sh (revision e1eccf28f96817838ad6867f7f39d2351ec11f56)
1*e1eccf28SAndroid Build Coastguard Worker#!/bin/bash
2*e1eccf28SAndroid Build Coastguard Worker#
3*e1eccf28SAndroid Build Coastguard Worker# Copyright (C) 2014 The Android Open Source Project
4*e1eccf28SAndroid Build Coastguard Worker#
5*e1eccf28SAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License");
6*e1eccf28SAndroid Build Coastguard Worker# you may not use this file except in compliance with the License.
7*e1eccf28SAndroid Build Coastguard Worker# You may obtain a copy of the License at
8*e1eccf28SAndroid Build Coastguard Worker#
9*e1eccf28SAndroid Build Coastguard Worker#      http://www.apache.org/licenses/LICENSE-2.0
10*e1eccf28SAndroid Build Coastguard Worker#
11*e1eccf28SAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software
12*e1eccf28SAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS,
13*e1eccf28SAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14*e1eccf28SAndroid Build Coastguard Worker# See the License for the specific language governing permissions and
15*e1eccf28SAndroid Build Coastguard Worker# limitations under the License.
16*e1eccf28SAndroid Build Coastguard Worker#
17*e1eccf28SAndroid Build Coastguard Worker
18*e1eccf28SAndroid Build Coastguard Worker# TODO: $ANDROID_BUILD_TOP/prebuilts/clang/host/linux-x86/clang-stable/bin
19*e1eccf28SAndroid Build Coastguard Worker# no longer contains clang on AOSP master. Need a stable way to reach clang
20*e1eccf28SAndroid Build Coastguard Worker# binaries here.
21*e1eccf28SAndroid Build Coastguard Worker
22*e1eccf28SAndroid Build Coastguard Workerif [ x"$1" == "x" ]; then
23*e1eccf28SAndroid Build Coastguard Worker  echo "Please specify the top-level Piper client directory."
24*e1eccf28SAndroid Build Coastguard Worker  exit 1
25*e1eccf28SAndroid Build Coastguard Workerfi
26*e1eccf28SAndroid Build Coastguard Worker
27*e1eccf28SAndroid Build Coastguard WorkerDOC_DIR="$1/googledata/devsite/site-android/en/guide/topics/renderscript/"
28*e1eccf28SAndroid Build Coastguard Workerif [ ! -d $DOC_DIR ]; then
29*e1eccf28SAndroid Build Coastguard Worker  echo "Expecting top-level Piper client directory."
30*e1eccf28SAndroid Build Coastguard Worker  exit 2
31*e1eccf28SAndroid Build Coastguard Workerfi
32*e1eccf28SAndroid Build Coastguard Worker
33*e1eccf28SAndroid Build Coastguard Workercd `dirname $0`
34*e1eccf28SAndroid Build Coastguard Worker
35*e1eccf28SAndroid Build Coastguard Workerset -e
36*e1eccf28SAndroid Build Coastguard Worker
37*e1eccf28SAndroid Build Coastguard Workermkdir -p test
38*e1eccf28SAndroid Build Coastguard Workermkdir -p include
39*e1eccf28SAndroid Build Coastguard Workermkdir -p docs
40*e1eccf28SAndroid Build Coastguard Workermkdir -p slangtest
41*e1eccf28SAndroid Build Coastguard Worker
42*e1eccf28SAndroid Build Coastguard Worker# The order of the arguments passed to generator matter because:
43*e1eccf28SAndroid Build Coastguard Worker# 1. The overview is expected to be in the first file.
44*e1eccf28SAndroid Build Coastguard Worker# 2. The order specified will be the order they will show in the guide_toc.cs snippet.
45*e1eccf28SAndroid Build Coastguard Worker#    This can be manually changed when cut&pasting the snippet into guide_toc.cs.
46*e1eccf28SAndroid Build Coastguard Worker# 3. rsIs/Clear/SetObject is documented in rs_object_info but also found in rs_graphics.
47*e1eccf28SAndroid Build Coastguard Worker#    The latter must appear after the former.
48*e1eccf28SAndroid Build Coastguard Worker$ANDROID_HOST_OUT/bin/rs-api-doc-generator rs_core.spec rs_value_types.spec rs_object_types.spec rs_convert.spec rs_math.spec rs_vector_math.spec rs_matrix.spec rs_quaternion.spec rs_atomic.spec rs_time.spec rs_allocation_create.spec rs_allocation_data.spec rs_object_info.spec rs_for_each.spec rs_io.spec rs_debug.spec rs_graphics.spec
49*e1eccf28SAndroid Build Coastguard Worker
50*e1eccf28SAndroid Build Coastguard Workerrm -f ../../../cts/tests/tests/renderscript/src/android/renderscript/cts/generated/*
51*e1eccf28SAndroid Build Coastguard Workermv test/* ../../../cts/tests/tests/renderscript/src/android/renderscript/cts/generated/
52*e1eccf28SAndroid Build Coastguard Workerrmdir test
53*e1eccf28SAndroid Build Coastguard Worker
54*e1eccf28SAndroid Build Coastguard Workerrm -f "$DOC_DIR"/reference/*.html
55*e1eccf28SAndroid Build Coastguard Workermv docs/*.html "$DOC_DIR"/reference
56*e1eccf28SAndroid Build Coastguard Worker
57*e1eccf28SAndroid Build Coastguard Worker# Current API level : 24
58*e1eccf28SAndroid Build Coastguard WorkerRS_API_LEVEL=24
59*e1eccf28SAndroid Build Coastguard Worker
60*e1eccf28SAndroid Build Coastguard Workerfor ((i=11; i<=RS_API_LEVEL; i++))
61*e1eccf28SAndroid Build Coastguard Worker  do
62*e1eccf28SAndroid Build Coastguard Worker    mv slangtest/all$i.rscript ../../compile/slang/tests/P_all_api_$i
63*e1eccf28SAndroid Build Coastguard Workerdone
64*e1eccf28SAndroid Build Coastguard Workerrm -rf slangtest
65*e1eccf28SAndroid Build Coastguard Worker
66*e1eccf28SAndroid Build Coastguard Workermv RSFunctionsList.cpp ../../compile/libbcc/lib/
67*e1eccf28SAndroid Build Coastguard Workermv RsFunctionsList.h ../../compile/libbcc/lib/
68