Skip to content

Commit 81603e7

Browse files
committed
8246325: Add DRYRUN facility to SetupExecute
1 parent e8c7d2a commit 81603e7

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
lines changed

make/Bundles.gmk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ ifneq ($(filter product-bundles% legacy-bundles, $(MAKECMDGOALS)), )
301301
$(call LogWarn, Signing $(JDK_BUNDLE_NAME))
302302
$(CODESIGN) -s "$(MACOSX_CODESIGN_IDENTITY)" \
303303
--timestamp --options runtime --deep --force \
304-
$(JDK_MACOSX_BUNDLE_DIR_SIGNED)/$(JDK_MACOSX_BUNDLE_TOP_DIR) $(LOG_DEBUG)
304+
$(JDK_MACOSX_BUNDLE_DIR_SIGNED)/$(JDK_MACOSX_BUNDLE_TOP_SUBDIR) $(LOG_DEBUG)
305305
$(TOUCH) $@
306306

307307
$(eval $(call SetupBundleFile, BUILD_JDK_BUNDLE, \
@@ -330,7 +330,7 @@ ifneq ($(filter product-bundles% legacy-bundles, $(MAKECMDGOALS)), )
330330
$(call LogWarn, Signing $(JRE_BUNDLE_NAME))
331331
$(CODESIGN) -s "$(MACOSX_CODESIGN_IDENTITY)" \
332332
--timestamp --options runtime --deep --force \
333-
$(JRE_MACOSX_BUNDLE_DIR_SIGNED)/$(JRE_MACOSX_BUNDLE_TOP_DIR) $(LOG_DEBUG)
333+
$(JRE_MACOSX_BUNDLE_DIR_SIGNED)/$(JRE_MACOSX_BUNDLE_TOP_SUBDIR) $(LOG_DEBUG)
334334
$(TOUCH) $@
335335

336336
$(eval $(call SetupBundleFile, BUILD_JRE_BUNDLE, \

make/autoconf/spec.gmk.template

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -898,12 +898,14 @@ JDK_MACOSX_BUNDLE_DIR = $(IMAGES_OUTPUTDIR)/$(JDK_MACOSX_BUNDLE_SUBDIR)
898898
JRE_MACOSX_BUNDLE_DIR = $(IMAGES_OUTPUTDIR)/$(JRE_MACOSX_BUNDLE_SUBDIR)
899899
JDK_MACOSX_BUNDLE_DIR_SIGNED = $(IMAGES_OUTPUTDIR)/$(JDK_MACOSX_BUNDLE_SUBDIR_SIGNED)
900900
JRE_MACOSX_BUNDLE_DIR_SIGNED = $(IMAGES_OUTPUTDIR)/$(JRE_MACOSX_BUNDLE_SUBDIR_SIGNED)
901-
JDK_MACOSX_BUNDLE_TOP_DIR = jdk-$(VERSION_NUMBER).jdk
902-
JRE_MACOSX_BUNDLE_TOP_DIR = jre-$(VERSION_NUMBER).jre
903-
JDK_MACOSX_CONTENTS_SUBDIR = $(JDK_MACOSX_BUNDLE_TOP_DIR)/Contents
904-
JRE_MACOSX_CONTENTS_SUBDIR = $(JRE_MACOSX_BUNDLE_TOP_DIR)/Contents
901+
JDK_MACOSX_BUNDLE_TOP_SUBDIR = jdk-$(VERSION_NUMBER).jdk
902+
JRE_MACOSX_BUNDLE_TOP_SUBDIR = jre-$(VERSION_NUMBER).jre
903+
JDK_MACOSX_CONTENTS_SUBDIR = $(JDK_MACOSX_BUNDLE_TOP_SUBDIR)/Contents
904+
JRE_MACOSX_CONTENTS_SUBDIR = $(JRE_MACOSX_BUNDLE_TOP_SUBDIR)/Contents
905905
JDK_MACOSX_CONTENTS_DIR = $(JDK_MACOSX_BUNDLE_DIR)/$(JDK_MACOSX_CONTENTS_SUBDIR)
906906
JRE_MACOSX_CONTENTS_DIR = $(JRE_MACOSX_BUNDLE_DIR)/$(JRE_MACOSX_CONTENTS_SUBDIR)
907+
JDK_MACOSX_BUNDLE_TOP_DIR = $(JDK_MACOSX_BUNDLE_DIR)/$(JDK_MACOSX_BUNDLE_TOP_SUBDIR)
908+
JRE_MACOSX_BUNDLE_TOP_DIR = $(JRE_MACOSX_BUNDLE_DIR)/$(JRE_MACOSX_BUNDLE_TOP_SUBDIR)
907909

908910
# Bundle names
909911
ifneq ($(VERSION_BUILD), )

make/common/Execute.gmk

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ ifeq ($(INCLUDE), true)
8282
# INFO : Message to display at LOG=info level when running command (optional)
8383
# WARN : Message to display at LOG=warn level when running command (optional)
8484
# DEPS : Dependencies for the execution to take place
85+
# DRYRUN : Set to true to perform everything but executing the command \
86+
# (defaults to false, primarily intended for debugging)
8587
#
8688

8789
# Setup make rules for copying files, with an option to do more complex
@@ -161,8 +163,13 @@ define SetupExecuteBody
161163
$$(TOUCH) $$@
162164

163165
$$($1_EXEC_RESULT): $$($1_PRE_MARKER)
164-
$$(call ExecuteWithLog, $$($1_BASE)_exec, \
165-
cd $$($1_WORKING_DIR) && $$($1_COMMAND))
166+
ifneq ($$($1_DRYRUN), true)
167+
$$(call ExecuteWithLog, $$($1_BASE)_exec, \
168+
cd $$($1_WORKING_DIR) && $$($1_COMMAND))
169+
else
170+
$$(call LogWarn, DRYRUN enabled for $1, not actually running command)
171+
$$(TOUCH) $$@
172+
endif
166173
ifeq ($$($1_EXEC_RESULT), $$($1_EXEC_MARKER))
167174
$$(TOUCH) $$@
168175
endif
@@ -177,8 +184,13 @@ define SetupExecuteBody
177184
$$(call LogInfo, $$($1_INFO))
178185
endif
179186
$$(call MakeDir, $$(call EncodeSpace, $$($1_WORKING_DIR)) $$(call EncodeSpace, $$($1_SUPPORT_DIR)) $$(call EncodeSpace, $$($1_OUTPUT_DIR)))
180-
$$(call ExecuteWithLog, $$($1_BASE)_exec, \
181-
cd $$($1_WORKING_DIR) && $$($1_COMMAND))
187+
ifneq ($$($1_DRYRUN), true)
188+
$$(call ExecuteWithLog, $$($1_BASE)_exec, \
189+
cd $$($1_WORKING_DIR) && $$($1_COMMAND))
190+
else
191+
$$(call LogWarn, DRYRUN enabled for $1, not actually running command)
192+
$$(TOUCH) $$@
193+
endif
182194
ifeq ($$($1_EXEC_RESULT), $$($1_EXEC_MARKER))
183195
$$(TOUCH) $$@
184196
endif

0 commit comments

Comments
 (0)