función makefile, mejores dependencias makefile
This commit is contained in:
parent
c1d76ed496
commit
f0db9c880e
3 changed files with 12 additions and 10 deletions
|
|
@ -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
|
||||
|
|
|
|||
14
Makefile
14
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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue