función makefile, mejores dependencias makefile

This commit is contained in:
Álvaro González 2026-01-09 13:57:44 +01:00
parent c1d76ed496
commit f0db9c880e
3 changed files with 12 additions and 10 deletions

View file

@ -12,10 +12,8 @@ ENV GRADLE_USER_HOME=/cache/gradle-cache
RUN mkdir -p $PUB_CACHE $GRADLE_USER_HOME RUN mkdir -p $PUB_CACHE $GRADLE_USER_HOME
# Copy pubspec files and get dependencies # Copy pubspec files and get dependencies
# This step is separated to leverage Docker layer caching # COPY pubspec.yaml pubspec.lock ./
# REMEMBER: buld application with Makefile, it builds docker image first # RUN flutter pub get
COPY pubspec.yaml pubspec.lock ./
RUN flutter pub get
# Copy the rest of the application code and build # 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 # Commented out to avoid building the app during image creation, this will be handled externally by makefile

View file

@ -1,16 +1,20 @@
flutter-container-exec = podman-compose run --entrypoint "$(1)" flutter
build-podman: build-podman:
podman-compose build podman-compose build
clean-podman: build-podman 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 build-android-release-podman: pub-get-podman
podman-compose run --entrypoint "flutter build apk --release" flutter $(call flutter-container-exec, flutter build apk --release)
build-linux-debug-podman: build-podman build-linux-debug-podman: pub-get-podman
podman-compose run --entrypoint "flutter build linux --debug" flutter $(call flutter-container-exec, flutter build linux --debug)
run-linux-debug: build-linux-debug-podman run-linux-debug: build-linux-debug-podman
build/linux/x64/debug/bundle/d4rt_formulas build/linux/x64/debug/bundle/d4rt_formulas

View file

@ -7,7 +7,7 @@ services:
dockerfile: Dockerfile dockerfile: Dockerfile
image: d4rt-formulas-builder image: d4rt-formulas-builder
volumes: volumes:
- ./docker/cache:/cache:z - ./.build-container-cache:/cache:z
- .:/app:z # Link the current directory to /app in the container - .:/app:z # Link the current directory to /app in the container
environment: environment:
- FLUTTER_FLAVOR=prod # Example environment variable, adjust as needed - FLUTTER_FLAVOR=prod # Example environment variable, adjust as needed