Skip to content

Commit

Permalink
chore: delete handwritten samples (#8425)
Browse files Browse the repository at this point in the history
* chore: add script to delete handwritten samples

* chore: delete handwritten samples
  • Loading branch information
meltsufin authored Sep 20, 2022
1 parent 36fb66a commit 419fd18
Show file tree
Hide file tree
Showing 1,941 changed files with 24 additions and 153,083 deletions.
18 changes: 18 additions & 0 deletions generation/delete_non_generated_samples.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

set -e

for samples_dir in $(find . -maxdepth 2 -mindepth 2 -type d -name 'samples'); do
pushd $samples_dir/..

if [[ -d "samples/snippets/generated" ]]; then
mkdir -p _TMP_/snippets
cp -R samples/snippets/generated _TMP_/snippets
rm -rf samples
mv _TMP_ samples
else
rm -rf samples
fi

popd
done
15 changes: 6 additions & 9 deletions generation/generate_release_please_config.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

set -e
set -xe

echo "{" > .release-please-manifest.json

Expand All @@ -15,7 +15,7 @@ rp_manifest_line=""

for module in $(find . -mindepth 2 -maxdepth 2 -name pom.xml |sort | xargs dirname); do

if [[ "${module}" = *google-cloud-gapic-bom ]] || [[ "${module}" = *CoverageAggregator ]]; then
if [[ "${module}" = *google-cloud-gapic-bom ]] || [[ "${module}" = *CoverageAggregator ]] || grep -q 'SNAPSHOT<\/version>' "${module}/pom.xml" ; then
continue
fi

Expand Down Expand Up @@ -59,10 +59,9 @@ for module in $(find . -mindepth 2 -maxdepth 2 -name pom.xml |sort | xargs dirna
old_version=$(echo "${line}" | awk -F':' '{print $3}')
new_version=$(echo ${old_version} | awk -F'.' '{print $1"."$2"."$3+1}' | sed s/[.]$//)
new_version="${new_version}-SNAPSHOT"
sed -i "s|${artifact_name}:${old_version}:${old_version}|${artifact_name}:${old_version}:${new_version}|" ${version_file}
sed -i.bak -e "s|${artifact_name}:${old_version}:${old_version}|${artifact_name}:${old_version}:${new_version}|" "${version_file}" && rm "${version_file}".bak
artifact_directory="${module}/${artifact_name}"
mvn -B -ntp -f ${artifact_directory} -U versions:set -DnewVersion=${new_version}
mvn versions:commit
mvn -B -ntp -f ${artifact_directory} -U versions:set -DnewVersion=${new_version} -DgenerateBackupPoms=false
fi
done

Expand All @@ -71,8 +70,7 @@ for module in $(find . -mindepth 2 -maxdepth 2 -name pom.xml |sort | xargs dirna
#bumping to snapshot in module bom directory, if it exists
bom_directory="${module-name}/${artifactName_config}-bom"
if [ -d "${bom_directory}" ]; then
mvn -B -ntp -f ${bom_directory} -U versions:set -DnewVersion="${snapshot_version}-SNAPSHOT"
mvn versions:commit
mvn -B -ntp -f ${bom_directory} -U versions:set -DnewVersion="${snapshot_version}-SNAPSHOT" -DgenerateBackupPoms=false
fi

#bumping to snapshot in module root pom
Expand All @@ -81,8 +79,7 @@ for module in $(find . -mindepth 2 -maxdepth 2 -name pom.xml |sort | xargs dirna

#specific case
if [[ ${module_name} == "java-notification" ]]; then
mvn -B -ntp -f ${module} -U versions:set -DnewVersion="${snapshot_version}-beta-SNAPSHOT"
mvn versions:commit
mvn -B -ntp -f ${module} -U versions:set -DnewVersion="${snapshot_version}-beta-SNAPSHOT" -DgenerateBackupPoms=false
fi

done
Expand Down
90 changes: 0 additions & 90 deletions java-accessapproval/samples/install-without-bom/pom.xml

This file was deleted.

56 changes: 0 additions & 56 deletions java-accessapproval/samples/pom.xml

This file was deleted.

89 changes: 0 additions & 89 deletions java-accessapproval/samples/snapshot/pom.xml

This file was deleted.

66 changes: 0 additions & 66 deletions java-accessapproval/samples/snippets/pom.xml

This file was deleted.

Loading

0 comments on commit 419fd18

Please sign in to comment.