@@ -111,6 +111,7 @@ endef
111111# --------------------------------------------------------------------
112112
113113.PHONY : source-dist clean-source-dist
114+ .PHONY : source-bundle clean-source-bundle
114115
115116SOURCE_DIST_BASE ?= rabbitmq-server
116117SOURCE_DIST_SUFFIXES ?= tar.xz
@@ -122,6 +123,13 @@ SOURCE_DIST_FILES = $(addprefix $(SOURCE_DIST).,$(SOURCE_DIST_SUFFIXES))
122123
123124.PHONY : $(SOURCE_DIST_FILES )
124125
126+ # Override rsync flags as a pre-requisite
127+ source-bundle : RSYNC_FLAGS = $(SOURCE_BUNDLE_RSYNC_FLAGS )
128+ source-bundle : $(SOURCE_DIST_FILES )
129+ @:
130+
131+ # Override rsync flags as a pre-requisite
132+ source-dist : RSYNC_FLAGS = $(SOURCE_DIST_RSYNC_FLAGS )
125133source-dist : $(SOURCE_DIST_FILES )
126134 @:
127135
@@ -130,7 +138,9 @@ RSYNC_V_0 =
130138RSYNC_V_1 = -v
131139RSYNC_V_2 = -v
132140RSYNC_V = $(RSYNC_V_$(V ) )
133- RSYNC_FLAGS += -a $(RSYNC_V ) \
141+ BASE_RSYNC_FLAGS += -a $(RSYNC_V ) \
142+ --delete \
143+ --delete-excluded \
134144 --exclude '.sw?' --exclude '.*.sw?' \
135145 --exclude '*.beam' \
136146 --exclude '*.d' \
@@ -162,7 +172,6 @@ RSYNC_FLAGS += -a $(RSYNC_V) \
162172 --exclude '$(notdir $(DEPS_DIR ) ) /' \
163173 --exclude 'hexer*' \
164174 --exclude 'logs/' \
165- --exclude 'packaging' \
166175 --exclude 'PKG_*.md' \
167176 --exclude '/plugins/' \
168177 --include 'cli/plugins' \
@@ -185,9 +194,21 @@ RSYNC_FLAGS += -a $(RSYNC_V) \
185194 --exclude '/ranch/doc/' \
186195 --exclude '/ranch/examples/' \
187196 --exclude '/sockjs/examples/' \
188- --exclude '/workflow_sources/' \
189- --delete \
190- --delete-excluded
197+ --exclude '/workflow_sources/'
198+
199+ SOURCE_DIST_RSYNC_FLAGS += $(BASE_RSYNC_FLAGS ) \
200+ --exclude 'packaging' \
201+ --exclude 'test'
202+
203+ # For source-bundle, explicitly include folders that are needed
204+ # for tests to execute. These are added before excludes from
205+ # the base flags so rsync honors the first match.
206+ SOURCE_BUNDLE_RSYNC_FLAGS += \
207+ --include 'rabbit_shovel_test/ebin' \
208+ --include 'rabbit_shovel_test/ebin/*' \
209+ --include 'rabbitmq_ct_helpers/tools' \
210+ --include 'rabbitmq_ct_helpers/tools/*' \
211+ $(BASE_RSYNC_FLAGS )
191212
192213TAR ?= tar
193214TAR_V_0 =
@@ -352,6 +373,8 @@ $(SOURCE_DIST).zip: $(SOURCE_DIST).manifest
352373
353374clean :: clean-source-dist
354375
376+ clean-source-bundle :: clean-source-dist
377+
355378clean-source-dist :
356379 $(gen_verbose ) rm -rf -- $(SOURCE_DIST_BASE ) -*
357380
0 commit comments