From f0db9c880e05676f55dace8b6d4bca15d108789f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Gonz=C3=A1lez?= Date: Fri, 9 Jan 2026 13:57:44 +0100 Subject: [PATCH] =?UTF-8?q?funci=C3=B3n=20makefile,=20mejores=20dependenci?= =?UTF-8?q?as=20makefile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 6 ++---- Makefile | 14 +++++++++----- docker-compose.yml | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 89636bc..4552cb9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,10 +12,8 @@ ENV GRADLE_USER_HOME=/cache/gradle-cache RUN mkdir -p $PUB_CACHE $GRADLE_USER_HOME # Copy pubspec files and get dependencies -# This step is separated to leverage Docker layer caching -# REMEMBER: buld application with Makefile, it builds docker image first -COPY pubspec.yaml pubspec.lock ./ -RUN flutter pub get +# COPY pubspec.yaml pubspec.lock ./ +# RUN flutter pub get # Copy the rest of the application code and build # Commented out to avoid building the app during image creation, this will be handled externally by makefile diff --git a/Makefile b/Makefile index 57a924d..ae3537e 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,20 @@ +flutter-container-exec = podman-compose run --entrypoint "$(1)" flutter + build-podman: podman-compose build clean-podman: build-podman - podman-compose run --entrypoint "flutter clean" flutter + $(call flutter-container-exec, flutter clean) +pub-get-podman: build-podman + $(call flutter-container-exec, flutter pub get) -build-android-release-podman: build-podman - podman-compose run --entrypoint "flutter build apk --release" flutter +build-android-release-podman: pub-get-podman + $(call flutter-container-exec, flutter build apk --release) -build-linux-debug-podman: build-podman - podman-compose run --entrypoint "flutter build linux --debug" flutter +build-linux-debug-podman: pub-get-podman + $(call flutter-container-exec, flutter build linux --debug) run-linux-debug: build-linux-debug-podman build/linux/x64/debug/bundle/d4rt_formulas diff --git a/docker-compose.yml b/docker-compose.yml index 73feed0..1dcbe96 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,7 @@ services: dockerfile: Dockerfile image: d4rt-formulas-builder volumes: - - ./docker/cache:/cache:z + - ./.build-container-cache:/cache:z - .:/app:z # Link the current directory to /app in the container environment: - FLUTTER_FLAVOR=prod # Example environment variable, adjust as needed