Skip to content

Commit

Permalink
fix: fixed non-GA logic for gapic-bom (#8631)
Browse files Browse the repository at this point in the history
  • Loading branch information
suztomo committed Oct 18, 2022
1 parent 832c898 commit a959a35
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 7 deletions.
28 changes: 28 additions & 0 deletions gapic-libraries-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,13 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-datalabeling-bom</artifactId>
<version>0.124.0</version><!-- {x-version-update:google-cloud-datalabeling:current} -->
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-dataplex-bom</artifactId>
Expand Down Expand Up @@ -267,6 +274,13 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-errorreporting-bom</artifactId>
<version>0.125.0-beta</version><!-- {x-version-update:google-cloud-errorreporting:current} -->
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-essential-contacts-bom</artifactId>
Expand Down Expand Up @@ -365,6 +379,13 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-mediatranslation-bom</artifactId>
<version>0.10.0</version><!-- {x-version-update:google-cloud-mediatranslation:current} -->
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-memcache-bom</artifactId>
Expand Down Expand Up @@ -442,6 +463,13 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-phishingprotection-bom</artifactId>
<version>0.35.0</version><!-- {x-version-update:google-cloud-phishingprotection:current} -->
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-policy-troubleshooter-bom</artifactId>
Expand Down
12 changes: 5 additions & 7 deletions generation/generate_gapic_bom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,22 @@ for bom_directory in $(find . -maxdepth 3 -name 'google-*-bom' | sort --dictiona
fi
repo_metadata="${bom_directory}/../.repo-metadata.json"

pom_file="${bom_directory}/pom.xml"
groupId_line=$(grep --max-count=1 'groupId' "${pom_file}")
artifactId_line=$(grep --max-count=1 'artifactId' "${pom_file}")
version_line=$(grep --max-count=1 'x-version-update' "${pom_file}")

if ! grep --quiet '"release_level": "stable"' "${repo_metadata}"; then
# Not including non-GA libraries, except those that happened to be included
# already in google-cloud-bom.
if [[ $artifactId_line != *"google-cloud-datalabeling"* ]] \
&& [[ $artifactId_line != *"google-cloud-errorreporting"* ]] \
&& [[ $artifactId_line != *"google-cloud-logging-logback"* ]] \
&& [[ $artifactId_line != *"google-cloud-mediatranslation"* ]] \
&& [[ $artifactId_line != *"google-cloud-nio"* ]] \
&& [[ $artifactId_line != *"google-cloud-notification"* ]] \
&& [[ $artifactId_line != *"google-cloud-phishingprotection"* ]]; then
echo "Not adding ${pom_file} to the BOM because it's not stable."
continue
fi
fi
pom_file="${bom_directory}/pom.xml"
groupId_line=$(grep --max-count=1 'groupId' "${pom_file}")
artifactId_line=$(grep --max-count=1 'artifactId' "${pom_file}")
version_line=$(grep --max-count=1 'x-version-update' "${pom_file}")

bom_lines+=" <dependency>\n\
${groupId_line}\n\
Expand Down

0 comments on commit a959a35

Please sign in to comment.