Match hunk edit format and upload build artifacts

This commit is contained in:
Joe Tretter
2026-05-19 12:10:44 -05:00
parent bea901acfe
commit b48244d4c2
6 changed files with 58 additions and 11 deletions

View File

@@ -11,6 +11,7 @@ GRADLE_USER_HOME_DIR="$PROJECT_DIR/.gradle-user-home"
STATE_FILE="$PROJECT_DIR/.android-project-tooling.state"
LEGACY_STATE_FILE="$PROJECT_DIR/.setup-build-environment.state"
COMMIT_SUMMARY_FILE="$PROJECT_DIR/commit-summary.txt"
UPLOAD_SCRIPT="$PROJECT_DIR/upload2DL.sh"
CMDLINE_TOOLS_DIR="$SDK_DIR/cmdline-tools"
CMDLINE_TOOLS_LATEST_DIR="$CMDLINE_TOOLS_DIR/latest"
WRAPPER_JAR_PATH="$PROJECT_DIR/gradle/wrapper/gradle-wrapper.jar"
@@ -103,6 +104,7 @@ auto_commit_if_needed() {
git -C "$PROJECT_DIR" reset -q HEAD -- \
keystore.properties \
commit-summary.txt \
upload2DL.sh \
'*.keystore' \
'*.jks' 2>/dev/null || true
@@ -268,6 +270,23 @@ print(match.group(1))
PY
}
upload_build_artifact_if_possible() {
local artifact_path="$1"
if [ ! -f "$artifact_path" ]; then
echo "Upload artifact not found: $artifact_path" >&2
exit 1
fi
if [ ! -f "$UPLOAD_SCRIPT" ]; then
log "No upload2DL.sh found; skipping artifact upload"
return
fi
log "Uploading $(basename "$artifact_path") with upload2DL.sh"
bash "$UPLOAD_SCRIPT" "$artifact_path"
}
setup_env() {
setup_java_env
export ANDROID_HOME="$SDK_DIR"
@@ -563,6 +582,7 @@ maybe_run_operation() {
if [ -n "$artifact_source" ] && [ -f "$artifact_source" ]; then
log "Renaming $(basename "$artifact_source") to $(basename "$artifact_target")"
mv -f "$artifact_source" "$artifact_target"
upload_build_artifact_if_possible "$artifact_target"
elif [ -n "$artifact_source" ]; then
log "Expected build output not found for rename: ${artifact_source#$PROJECT_DIR/}"
fi