diff --git a/build.sh b/build.sh new file mode 100644 index 00000000..d0ebf9c7 --- /dev/null +++ b/build.sh @@ -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 \ No newline at end of file diff --git a/kokoro/gcp_ubuntu_docker/continuous.cfg b/kokoro/gcp_ubuntu_docker/continuous.cfg new file mode 100644 index 00000000..d9f93353 --- /dev/null +++ b/kokoro/gcp_ubuntu_docker/continuous.cfg @@ -0,0 +1 @@ +build_file: "androidify/kokoro/gcp_ubuntu_docker/kokoro_build.sh" \ No newline at end of file diff --git a/kokoro/gcp_ubuntu_docker/kokoro_build.sh b/kokoro/gcp_ubuntu_docker/kokoro_build.sh new file mode 100644 index 00000000..b30ebda8 --- /dev/null +++ b/kokoro/gcp_ubuntu_docker/kokoro_build.sh @@ -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 \ No newline at end of file diff --git a/kokoro/gcp_ubuntu_docker/presubmit.cfg b/kokoro/gcp_ubuntu_docker/presubmit.cfg new file mode 100644 index 00000000..1b9d8a93 --- /dev/null +++ b/kokoro/gcp_ubuntu_docker/presubmit.cfg @@ -0,0 +1 @@ +build_file: "kokoro-codelab-riggaroo/kokoro/gcp_ubuntu_docker/kokoro_build.sh" \ No newline at end of file