Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env bash

#
# Copyright 2022 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# IGNORE this file, it's only used in the internal Google release process
# Fail on any error.
set -e

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
APP_OUT=$DIR/app/build/outputs

# This script assembles the release build of the Android application.
# Ensure gradlew is executable
chmod +x ./gradlew

# Clean the project (optional, but good for a fresh release build)
echo "Cleaning the project..."
./gradlew clean

# Assemble the release build
echo "Assembling the release build..."
./gradlew app:bundleRelease

# Check if the build was successful
if [ $? -eq 0 ]; then
echo "Build successful! The APK/AAB can be found in app/build/outputs/"
else
echo "Build failed. Please check the console output for errors."
exit 1
fi

exit 0
1 change: 1 addition & 0 deletions kokoro/gcp_ubuntu_docker/continuous.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build_file: "androidify/kokoro/gcp_ubuntu_docker/kokoro_build.sh"
19 changes: 19 additions & 0 deletions kokoro/gcp_ubuntu_docker/kokoro_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# Fail on any error.
set -e

# Display commands being run.
# WARNING: please only enable 'set -x' if necessary for debugging, and be very
# careful if you handle credentials (e.g. from Keystore) with 'set -x':
# statements like "export VAR=$(cat /tmp/keystore/credentials)" will result in
# the credentials being printed in build logs.
# Additionally, recursive invocation with credentials as command-line
# parameters, will print the full command, with credentials, in the build logs.
# set -x

# Code under repo is checked out to ${KOKORO_ARTIFACTS_DIR}/github.
# The final directory name in this path is determined by the scm name specified
# in the job configuration.
cd "${KOKORO_ARTIFACTS_DIR}/github/androidify"
./build.sh
1 change: 1 addition & 0 deletions kokoro/gcp_ubuntu_docker/presubmit.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build_file: "kokoro-codelab-riggaroo/kokoro/gcp_ubuntu_docker/kokoro_build.sh"