# Build + test stage: a failing test fails the image build, which is what lizCI checks. FROM eclipse-temurin:21-jdk AS build WORKDIR /src # Android SDK: core and ui have Android targets, so Gradle needs one even for the desktop build. ENV ANDROID_HOME=/opt/android-sdk RUN apt-get update && apt-get install -y --no-install-recommends unzip curl && rm -rf /var/lib/apt/lists/* \ && mkdir -p $ANDROID_HOME/cmdline-tools && curl -fsSL -o /tmp/clt.zip https://dl.google.com/android/repository/commandlinetools-linux-13114758_latest.zip \ && unzip -q /tmp/clt.zip -d $ANDROID_HOME/cmdline-tools && mv $ANDROID_HOME/cmdline-tools/cmdline-tools $ANDROID_HOME/cmdline-tools/latest && rm /tmp/clt.zip \ && yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null # Warm the Gradle wrapper and dependency cache before copying sources. COPY gradlew settings.gradle.kts build.gradle.kts gradle.properties ./ COPY gradle gradle COPY core/build.gradle.kts core/ COPY ui/build.gradle.kts ui/ COPY desktop/build.gradle.kts desktop/ COPY android/build.gradle.kts android/ RUN ./gradlew --no-daemon -q help COPY . . RUN ./gradlew --no-daemon :core:jvmTest :desktop:createDistributable # Artifact image: just the packaged Linux desktop app (with its bundled runtime). FROM alpine:3.20 AS rookery ARG COMMIT=unknown COPY --from=build /src/desktop/build/compose/binaries/main/app/rookery /opt/rookery RUN printf '%s' "$COMMIT" > /opt/rookery/commit CMD ["ls", "/opt/rookery"]