@@ -138,6 +138,7 @@ endef
138138# --------------------------------------------------------------------
139139
140140.PHONY : source-dist clean-source-dist
141+ .PHONY : source-bundle clean-source-bundle
141142
142143SOURCE_DIST_BASE ?= rabbitmq-server
143144SOURCE_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 )
152160source-dist : $(SOURCE_DIST_FILES )
153161 @:
154162
@@ -157,7 +165,9 @@ RSYNC_V_0 =
157165RSYNC_V_1 = -v
158166RSYNC_V_2 = -v
159167RSYNC_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
215235TAR ?= tar
216236TAR_V_0 =
@@ -375,6 +395,8 @@ $(SOURCE_DIST).zip: $(SOURCE_DIST).manifest
375395
376396clean :: clean-source-dist
377397
398+ clean-source-bundle :: clean-source-dist
399+
378400clean-source-dist :
379401 $(gen_verbose ) rm -rf -- $(SOURCE_DIST_BASE ) -*
380402
0 commit comments