File: //snap/google-cloud-cli/current/snap/snapcraft.yaml
name: google-cloud-cli
version: 545.0.0
summary: Google Cloud CLI
description: Command-line interface for Google Cloud Platform products and services
grade: stable
confinement: classic
base: core22
environment:
  PATH: $SNAP/usr/bin/:$PATH
apps:
# LINT.IfChange
  gsutil:
    command: bin/gsutil
  bq:
    command: bin/bq
  gcloud:
    command: bin/gcloud
  anthoscli:
    command: bin/anthoscli
  docker-credential-gcloud:
    command: bin/docker-credential-gcloud
  kubectl:
    command: bin/kubectl
# LINT.ThenChange(//depot/google3/third_party/devsite/cloud/en/sdk/_installation/_ubuntu-snap.html)
parts:
  google-cloud-sdk:
    plugin: dump
    source: google-cloud-cli_545.0.0.orig_amd64.tar.gz
    stage-packages:
      - libncursesw5
      - libtinfo5
      - libdb5.3
      - libbz2-1.0
      - zlib1g
      - libgcc1
      - libstdc++6
      - liblzma5
      - libc6
    # stage: required to pickup .install directory and include in snap.
    # See https://forum.snapcraft.io/t/snapcraft-dump-plugin-and-hidden-files/4238
    # and https://bugs.launchpad.net/snapcraft/+bug/1669854
    stage:
      - "*"
      - ".install"
    # Compile python files for speed. This must be done at snap creation time
    # because the snap itself is mounted as a read only file system.
    # "-x ([regex|...])" is needed, otherwise the retval from compileall is non zero
    # and snapcraft fails.
    override-build: |
      platform/bundledpythonunix/bin/python3 -m compileall -q -x "(datastore_query.py|datastore.py|python2|fancy_urllib|third_party\/yaml|gflags|runtime_test.py|vendored\/boto|ez_setup|crcmod\/test.py)" -f bin lib platform
      snapcraftctl build
  google-cloud-sdk-minikube:
    build-attributes: [no-patchelf]
    plugin: dump
    source: google-cloud-cli-minikube_545.0.0.orig_amd64.tar.gz
    stage:
      - "*"
      - ".install"
  google-cloud-sdk-skaffold:
    plugin: dump
    source: google-cloud-cli-skaffold_545.0.0.orig_amd64.tar.gz
    stage:
      - "*"
      - ".install"
  google-cloud-sdk-anthoscli:
    build-attributes: [no-patchelf]
    plugin: dump
    source: google-cloud-cli-anthoscli_545.0.0.orig_amd64.tar.gz
    stage:
      - "*"
      - ".install"
  google-cloud-sdk-kubectl:
    plugin: dump
    source: google-cloud-sdk-kubectl-linux-x86_64-20250929142209.tar.gz
    # The kubectl tar just has the bins with no directory structure, so we "organize".
    organize:
      'kubectl*' : bin/
    stage:
      - "bin/kubectl*"