Skip to content

Commit ea4bdac

Browse files
Merge pull request #13385 from kartg/build-dist-make-target
Adding a "source-bundle" target to the Makefile
2 parents 3059182 + 741e04b commit ea4bdac

File tree

1 file changed

+28
-6
lines changed

1 file changed

+28
-6
lines changed

Makefile

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ endef
138138
# --------------------------------------------------------------------
139139

140140
.PHONY: source-dist clean-source-dist
141+
.PHONY: source-bundle clean-source-bundle
141142

142143
SOURCE_DIST_BASE ?= rabbitmq-server
143144
SOURCE_DIST_SUFFIXES ?= tar.xz
@@ -149,6 +150,13 @@ SOURCE_DIST_FILES = $(addprefix $(SOURCE_DIST).,$(SOURCE_DIST_SUFFIXES))
149150

150151
.PHONY: $(SOURCE_DIST_FILES)
151152

153+
# Override rsync flags as a pre-requisite
154+
source-bundle: RSYNC_FLAGS = $(SOURCE_BUNDLE_RSYNC_FLAGS)
155+
source-bundle: $(SOURCE_DIST_FILES)
156+
@:
157+
158+
# Override rsync flags as a pre-requisite
159+
source-dist: RSYNC_FLAGS = $(SOURCE_DIST_RSYNC_FLAGS)
152160
source-dist: $(SOURCE_DIST_FILES)
153161
@:
154162

@@ -157,7 +165,9 @@ RSYNC_V_0 =
157165
RSYNC_V_1 = -v
158166
RSYNC_V_2 = -v
159167
RSYNC_V = $(RSYNC_V_$(V))
160-
RSYNC_FLAGS += -a $(RSYNC_V) \
168+
BASE_RSYNC_FLAGS += -a $(RSYNC_V) \
169+
--delete \
170+
--delete-excluded \
161171
--exclude '.sw?' --exclude '.*.sw?' \
162172
--exclude '*.beam' \
163173
--exclude '*.d' \
@@ -188,12 +198,10 @@ RSYNC_FLAGS += -a $(RSYNC_V) \
188198
--exclude '$(notdir $(DEPS_DIR))/' \
189199
--exclude 'hexer*' \
190200
--exclude 'logs/' \
191-
--exclude 'packaging' \
192201
--exclude 'PKG_*.md' \
193202
--exclude '/plugins/' \
194203
--include 'cli/plugins' \
195204
--exclude '$(notdir $(DIST_DIR))/' \
196-
--exclude 'test' \
197205
--exclude '/$(notdir $(PACKAGES_DIR))/' \
198206
--exclude '/PACKAGES/' \
199207
--exclude '/amqp_client/doc/' \
@@ -208,9 +216,21 @@ RSYNC_FLAGS += -a $(RSYNC_V) \
208216
--exclude '/ranch/doc/' \
209217
--exclude '/ranch/examples/' \
210218
--exclude '/sockjs/examples/' \
211-
--exclude '/workflow_sources/' \
212-
--delete \
213-
--delete-excluded
219+
--exclude '/workflow_sources/'
220+
221+
SOURCE_DIST_RSYNC_FLAGS += $(BASE_RSYNC_FLAGS) \
222+
--exclude 'packaging' \
223+
--exclude 'test'
224+
225+
# For source-bundle, explicitly include folders that are needed
226+
# for tests to execute. These are added before excludes from
227+
# the base flags so rsync honors the first match.
228+
SOURCE_BUNDLE_RSYNC_FLAGS += \
229+
--include 'rabbit_shovel_test/ebin' \
230+
--include 'rabbit_shovel_test/ebin/*' \
231+
--include 'rabbitmq_ct_helpers/tools' \
232+
--include 'rabbitmq_ct_helpers/tools/*' \
233+
$(BASE_RSYNC_FLAGS)
214234

215235
TAR ?= tar
216236
TAR_V_0 =
@@ -375,6 +395,8 @@ $(SOURCE_DIST).zip: $(SOURCE_DIST).manifest
375395

376396
clean:: clean-source-dist
377397

398+
clean-source-bundle:: clean-source-dist
399+
378400
clean-source-dist:
379401
$(gen_verbose) rm -rf -- $(SOURCE_DIST_BASE)-*
380402

0 commit comments

Comments
 (0)