@@ -138,6 +138,7 @@ endef
138
138
# --------------------------------------------------------------------
139
139
140
140
.PHONY : source-dist clean-source-dist
141
+ .PHONY : source-bundle clean-source-bundle
141
142
142
143
SOURCE_DIST_BASE ?= rabbitmq-server
143
144
SOURCE_DIST_SUFFIXES ?= tar.xz
@@ -149,6 +150,13 @@ SOURCE_DIST_FILES = $(addprefix $(SOURCE_DIST).,$(SOURCE_DIST_SUFFIXES))
149
150
150
151
.PHONY : $(SOURCE_DIST_FILES )
151
152
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 )
152
160
source-dist : $(SOURCE_DIST_FILES )
153
161
@:
154
162
@@ -157,7 +165,9 @@ RSYNC_V_0 =
157
165
RSYNC_V_1 = -v
158
166
RSYNC_V_2 = -v
159
167
RSYNC_V = $(RSYNC_V_$(V ) )
160
- RSYNC_FLAGS += -a $(RSYNC_V ) \
168
+ BASE_RSYNC_FLAGS += -a $(RSYNC_V ) \
169
+ --delete \
170
+ --delete-excluded \
161
171
--exclude '.sw?' --exclude '.*.sw?' \
162
172
--exclude '*.beam' \
163
173
--exclude '*.d' \
@@ -188,12 +198,10 @@ RSYNC_FLAGS += -a $(RSYNC_V) \
188
198
--exclude '$(notdir $(DEPS_DIR ) ) /' \
189
199
--exclude 'hexer*' \
190
200
--exclude 'logs/' \
191
- --exclude 'packaging' \
192
201
--exclude 'PKG_*.md' \
193
202
--exclude '/plugins/' \
194
203
--include 'cli/plugins' \
195
204
--exclude '$(notdir $(DIST_DIR ) ) /' \
196
- --exclude 'test' \
197
205
--exclude '/$(notdir $(PACKAGES_DIR ) ) /' \
198
206
--exclude '/PACKAGES/' \
199
207
--exclude '/amqp_client/doc/' \
@@ -208,9 +216,21 @@ RSYNC_FLAGS += -a $(RSYNC_V) \
208
216
--exclude '/ranch/doc/' \
209
217
--exclude '/ranch/examples/' \
210
218
--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 )
214
234
215
235
TAR ?= tar
216
236
TAR_V_0 =
@@ -375,6 +395,8 @@ $(SOURCE_DIST).zip: $(SOURCE_DIST).manifest
375
395
376
396
clean :: clean-source-dist
377
397
398
+ clean-source-bundle :: clean-source-dist
399
+
378
400
clean-source-dist :
379
401
$(gen_verbose ) rm -rf -- $(SOURCE_DIST_BASE ) -*
380
402
0 commit comments