restructure

This commit is contained in:
Dengke Tang
2023-02-22 11:42:34 -08:00
parent 9ff650e6d9
commit 9de07efb76
13 changed files with 81 additions and 13 deletions
+4 -2
View File
@@ -1,6 +1,6 @@
INT_DIR=build/install INT_DIR=build/install
GENERATE_STUBS=$(shell expr `php --version | head -1 | cut -f 2 -d' '` \>= 7.1) GENERATE_STUBS=$(expr `php --version | head -1 | cut -f 2 -d' '` \>= 7.1)
CMAKE = cmake3 CMAKE = cmake3
ifeq (, $(shell which cmake3)) ifeq (, $(shell which cmake3))
@@ -46,8 +46,10 @@ ext/awscrt.lo: ext/awscrt.c
ext/awscrt.c: build/aws-crt-ffi-static/libaws-crt-ffi.a ext/api.h ext/awscrt_arginfo.h ext/awscrt.c: build/aws-crt-ffi-static/libaws-crt-ffi.a ext/api.h ext/awscrt_arginfo.h
ext/awscrt_arginfo.h: ext/awscrt.stub.php gen_stub.php ext/awscrt_arginfo.h: awscrt.stub.php gen_stub.php
ifeq ($(GENERATE_STUBS),1) ifeq ($(GENERATE_STUBS),1)
# install awscrt.stub.php to ext/
cp -v awscrt.stub.php ext/awscrt.stub.php
# generate awscrt_arginfo.h # generate awscrt_arginfo.h
php gen_stub.php --minimal-arginfo ext/awscrt.stub.php php gen_stub.php --minimal-arginfo ext/awscrt.stub.php
endif endif
+1 -1
View File
@@ -32,6 +32,6 @@
"NO_INTERACTION": "1" "NO_INTERACTION": "1"
}, },
"test_steps": [ "test_steps": [
["./run_tests"] ["./dev-scripts/run_tests"]
] ]
} }
+1 -1
View File
@@ -27,7 +27,7 @@
] ]
}, },
"scripts": { "scripts": {
"test": "./run_tests", "test": "./dev-scripts/run_tests",
"test-extension": "@test", "test-extension": "@test",
"test-win": "run_tests" "test-win": "run_tests"
}, },
+48
View File
@@ -0,0 +1,48 @@
#!/usr/bin/env bash
BASENAME=${0}
TOOLS_DIR=$(dirname ${BASENAME})
WORK_DIR="${TOOLS_DIR}/.."
cd "${WORK_DIR}"
find . -name \*.tgz -a |xargs rm -rf
## get rid of anything that phpize, configure and make as well
rm -rf .deps \
.libs \
Makefile \
Makefile.fragments \
Makefile.global \
Makefile.objects \
acinclude.m4 \
aclocal.m4 \
autom4te.cache \
build \
config.guess \
config.h \
config.h.in* \
config.log \
config.nice \
config.status \
config.sub \
configure \
configure.in \
configure.ac \
include \
install-sh \
libtool \
ltmain.sh \
missing \
mkinstalldirs \
modules \
run-tests.php \
awscrt.la \
vendor \
composer.lock \
ext/awscrt.stub.php \
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
+7
View File
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
BASENAME=${0}
TOOLS_DIR=$(dirname ${BASENAME})
WORK_DIR="${TOOLS_DIR}/.."
cd "${WORK_DIR}"
@@ -11,9 +11,12 @@ EMAIL="${opts[--email]}"
VERSION="${opts[--version]}" VERSION="${opts[--version]}"
NOTES="${opts[--notes]}" NOTES="${opts[--notes]}"
BASENAME=${0}
TOOLS_DIR=$(dirname ${BASENAME})
TODAY=$(date -u +%Y-%m-%d) TODAY=$(date -u +%Y-%m-%d)
cat package.xml-template_pre \ cat $TOOLS_DIR/package.xml-template_pre \
| sed "s/{{{NAME}}}/$NAME/g" \ | sed "s/{{{NAME}}}/$NAME/g" \
| sed "s/{{{USER}}}/$USER/g" \ | sed "s/{{{USER}}}/$USER/g" \
| sed "s/{{{EMAIL}}}/$EMAIL/g" \ | sed "s/{{{EMAIL}}}/$EMAIL/g" \
@@ -24,14 +27,14 @@ cat package.xml-template_pre \
source_ext='(c|cc|h|cpp|hpp|m4|w32|ini|frag|cmake|inl|in|py|gnu|yaml|def|pl|S|s|errordata|go|lds|num|asm|mod|peg|mk|rs|toml|sh)' source_ext='(c|cc|h|cpp|hpp|m4|w32|ini|frag|cmake|inl|in|py|gnu|yaml|def|pl|S|s|errordata|go|lds|num|asm|mod|peg|mk|rs|toml|sh)'
doc_ext='(md|json|html|dot|graphml|png|gn|sha1|css|rst|)' doc_ext='(md|json|html|dot|graphml|png|gn|sha1|css|rst|)'
special_docs='(LICENSE*|NOTICE|changelog.txt|CHANGELOG|THIRD-PARTY|README*|readme|METADATA|CONTRIBUTORS|UPDATING|doc.config)' special_docs='(LICENSE*|NOTICE|changelog.txt|CHANGELOG|THIRD-PARTY|README*|readme|METADATA|CONTRIBUTORS|UPDATING|doc.config|THIRD-PARTY-LICENSES.txt)'
special_tests='(ci-test.sh|format-check.sh|run_tests*|sanitizer-blacklist.txt|run-clang-tidy.sh|benchmark-build-run.sh|break-tests.sh|generate-coverage.sh|test.xml)' special_tests='(ci-test.sh|format-check.sh|run_tests*|sanitizer-blacklist.txt|run-clang-tidy.sh|benchmark-build-run.sh|break-tests.sh|generate-coverage.sh|test.xml)'
special_src='(gen_api.php|gen_stub.php|CMakeLists.txt|post.sh|postun.sh|Makefile*|build-buildspec.sh|build-deps.sh|objects.txt|go.*|BUILD*|DEPS|install_and_run.sh|codemod.sh|requirements.txt)' special_src='(gen_api.php|gen_stub.php|CMakeLists.txt|post.sh|postun.sh|Makefile*|build-buildspec.sh|build-deps.sh|objects.txt|go.*|BUILD*|DEPS|install_and_run.sh|codemod.sh|requirements.txt)'
skip_files='(package.xml*|prepare_release.sh|codereview.settings|*.o|*.a|*.obj|*.lib|break-tests-android.sh|whitespace.txt|prepare_package_xml.sh|crypto_test_data.cc|*.pdf|*.svg|*.docx|cbmc-proof.txt|codecov*|litani*|*.toml)' skip_files='(package.xml*|prepare_release.sh|codereview.settings|*.o|*.a|*.obj|*.lib|break-tests-android.sh|whitespace.txt|prepare_package_xml.sh|crypto_test_data.cc|*.pdf|*.svg|*.docx|cbmc-proof.txt|codecov*|litani*|*.toml|module.modulemap)'
special_scripts='(awscrt.stub.php)' special_scripts='(awscrt.stub.php)'
skip_directories='(tests|test|AWSCRTAndroidTestRunner|docker-images|codebuild|fuzz|verfication|third_party|docs|generated-src|aws-lc|aws-crt-sys)' skip_directories='(tests|test|AWSCRTAndroidTestRunner|docker-images|codebuild|fuzz|verfication|third_party|docs|generated-src|aws-lc|aws-crt-sys|ecdsa-fuzz-corpus|bin|examples|compliance)'
process_file() { process_file() {
if (( $# == 0 )) if (( $# == 0 ))
@@ -140,5 +143,4 @@ do
done done
echo '</dir>' echo '</dir>'
cat package.xml-template_post cat $TOOLS_DIR/package.xml-template_post
@@ -11,7 +11,15 @@ EMAIL="${opts[--email]}"
VERSION="${opts[--version]}" VERSION="${opts[--version]}"
NOTES="${opts[--notes]}" NOTES="${opts[--notes]}"
./prepare_package_xml.sh --name "${NAME}" --user "${USER}" --email "${EMAIL}" --version "${VERSION}" --notes "${NOTES}" >package.xml
BASENAME=${0}
TOOLS_DIR=$(dirname ${BASENAME})
WORK_DIR="${TOOLS_DIR}/.."
cd "${WORK_DIR}"
$TOOLS_DIR/cleanup.sh
$TOOLS_DIR/prepare_package_xml.sh --name "${NAME}" --user "${USER}" --email "${EMAIL}" --version "${VERSION}" --notes "${NOTES}" >package.xml
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
echo "ERROR PROCESSING review package.xml" echo "ERROR PROCESSING review package.xml"
exit 1 exit 1
View File
+1
View File
@@ -1,2 +1,3 @@
*.so *.so
api.h api.h
awscrt.stub.php