4242 text=${text/ api_shortname/ api-name}
4343 echo -e " \n" $text >> ${service} /.OwlBot.yaml
4444 git add .
45+ git config --add secrets.allowed " dest.*src"
4546 git commit -am " chore: setup owlbot configuration"
4647
4748 cd ../google-cloud-java
@@ -63,10 +64,56 @@ cd google-cloud-java
6364git add pom.xml
6465git commit -am ' feat: create aggregator pom'
6566
67+ # generate BOM of the artifacts in this repository
68+ bom_lines=" "
69+ for bom_directory in $( find . -name ' google-*-bom' | sort) ; do
70+ repo_metadata=" ${bom_directory} /../.repo-metadata.json"
71+ pom_file=" ${bom_directory} /pom.xml"
72+ groupId_line=$( grep --max-count=1 ' groupId' " ${pom_file} " )
73+ artifactId_line=$( grep --max-count=1 ' artifactId' " ${pom_file} " )
74+ version_line=$( grep --max-count=1 ' x-version-update' " ${pom_file} " )
75+ if ! grep --quiet ' "release_level": "stable"' " ${repo_metadata} " ; then
76+ # Not including non-GA libraries, except those that happened to be included
77+ # already in google-cloud-bom.
78+ if [[ $artifactId_line != * " google-cloud-datalabeling" * ]] \
79+ && [[ $artifactId_line != * " google-cloud-errorreporting" * ]] \
80+ && [[ $artifactId_line != * " google-cloud-logging-logback" * ]] \
81+ && [[ $artifactId_line != * " google-cloud-mediatranslation" * ]] \
82+ && [[ $artifactId_line != * " google-cloud-nio" * ]] \
83+ && [[ $artifactId_line != * " google-cloud-notification" * ]] \
84+ && [[ $artifactId_line != * " google-cloud-phishingprotection" * ]]; then
85+ echo " Not adding ${pom_file} to the BOM because it's not stable."
86+ continue
87+ fi
88+ fi
89+
90+ bom_lines+=" <dependency>
91+ ${groupId_line}
92+ ${artifactId_line}
93+ ${version_line}
94+ <type>pom</type>
95+ <scope>import</scope>
96+ </dependency>
97+ "
98+ done
99+
100+ mkdir google-cloud-gapic-bom
101+ awk -v " dependencyManagements=$bom_lines " ' {gsub(/BOM_ARTIFACT_LIST/,dependencyManagements)}1' \
102+ ../../bom.pom.xml > google-cloud-gapic-bom/pom.xml
103+
104+ git add google-cloud-gapic-bom/pom.xml
105+ git commit -am ' feat: create bom module'
106+
107+ # Confirm everything is fine so far
108+ mvn -q -B -ntp validate
109+
110+
111+ # Template files
66112cp -r --preserve=all ../../templates/. ./
67113git add --all
68114git commit -m ' chore: add template files'
69115
116+
70117# generate coverage report
71118mkdir CoverageAggregator
72119cp ../../coverage.pom.xml CoverageAggregator/pom.xml
0 commit comments