github.com/mysteriumnetwork/node@v0.0.0-20240516044423-365054f76801/bin/package_android (about)

     1  #!/bin/bash
     2  
     3  ###########################################################################
     4  # Packaging script which creates Android AAR (Android Archive).
     5  #
     6  # Usage:
     7  #> bin/package_android <architecture>
     8  #
     9  # Package (specific architecture: arm64, arm):
    10  #> bin/package_android arm64
    11  
    12  set -e
    13  
    14  source bin/helpers/output.sh
    15  source bin/helpers/functions.sh
    16  
    17  DIR_BUILD="build/package"
    18  OUT_BASENAME="mobile-node-${BUILD_VERSION}"
    19  OUT_FILENAME_AAR="${DIR_BUILD}/${OUT_BASENAME}.aar"
    20  
    21  docker run --rm \
    22      -v "$PWD"/$DIR_BUILD:/build \
    23      -v "$PWD":/app \
    24      -w /app \
    25      -e OUT=$OUT_BASENAME \
    26      -e FLAG_V=false \
    27      -e FLAG_X=false \
    28      -e FLAG_RACE=false \
    29      -e FLAG_LDFLAGS="-w -s $(get_linker_ldflags)" \
    30      -e FLAG_BUILDMODE=default \
    31      -e FLAG_TAGS="android" \
    32      -e TARGETS=android/. \
    33      -e EXT_GOPATH=/ext-go/1 \
    34      -e GO111MODULE=on \
    35      -e GOFLAGS=-mod=mod \
    36      mysteriumnetwork/xgomobile:1.20.2 ./mobile/mysterium
    37  
    38  if [[ -f $OUT_FILENAME_AAR ]]; then
    39      print_success "Android package ${OUT_FILENAME_AAR} build complete!"
    40      exit 0
    41  fi
    42  
    43  print_error "Failed to build Android package."
    44  exit 1