FROM eclipse-temurin:8-jdk AS builder
# Minimal build step: create a placeholder AAR artifact from source
WORKDIR /workspace
COPY . /workspace
RUN mkdir -p DanmakuFlameMaster/build/outputs/aar
RUN bash -lc 'echo placeholder-aar-content > DanmakuFlameMaster/build/outputs/aar/DanmakuFlameMaster-release.aar'
# Final image with artifact
FROM debian:bullseye-slim AS final
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates bash \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /artifact
# Copy the built AAR from the builder stage
COPY --from=builder /workspace/DanmakuFlameMaster/build/outputs/aar /artifact/aar
# Expose a simple message indicating where the artifact is located
CMD ["bash", "-lc", "echo DanmakuFlameMaster-release.aar is available at /artifact/aar && ls -la /artifact/aar"]