From 482372dbe2839c8c1da7a575ff817919d0adc793 Mon Sep 17 00:00:00 2001 From: tqcq <99722391+tqcq@users.noreply.github.com> Date: Fri, 17 Nov 2023 16:15:35 +0800 Subject: [PATCH] feature support build_commands --- .drone.yml | 3 +++ drone/build.yaml | 12 ++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index fb8b200..27b81f4 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,6 +4,9 @@ data: default_build_types: - Debug - Release + build_commands: + - cmake . -B$BUILD_DIR -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_VERBOSE_MAKEFILE=ON + - cmake --build $BUILD_DIR --config $BUILD_TYPE -- -j`nproc` builds: - image_name: android-arm64 - image_name: linux-arm64 diff --git a/drone/build.yaml b/drone/build.yaml index 3d4af70..854110f 100644 --- a/drone/build.yaml +++ b/drone/build.yaml @@ -4,10 +4,17 @@ name: default steps: {{ $prepare_commands := .input.prepare_commands }} {{ $before_commands := .input.before_commands }} + {{ $build_commands:= .input.build_commands }} {{ $after_commands := .input.after_commands }} {{ $default_build_types := .input.default_build_types }} {{ range .input.builds }} + {{ $cmake_configure_args := .cmake_configure_args }} + {{ $image_name := .image_name }} + {{ if .cmake_configure_args }} + {{ $cmake_configure_args := .cmake_configure_args }} + {{ end }} + {{ $image_name := .image_name }} - name: build {{ .image_name }} image: dockcross/{{ .image_name }} @@ -31,8 +38,9 @@ steps: - {{ . }} {{ end }} - - cmake . -B$BUILD_DIR -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_VERBOSE_MAKEFILE=ON - - cmake --build $BUILD_DIR --config $BUILD_TYPE -- -j`nproc` + {{ range $build_commands }} + - {{ . }} + {{ end }} {{ range $after_commands }} - {{ . }}