On 2019-01-25 16:27, Severin Gehwolf wrote:
Hi,

I'm working on an enhancement for jlink. In particular a platform
specific plugin. I.e. It would only get built on unix/linux platforms.
My trouble is getting some resouce properties set up properly. In my
example there is two versions of plugins.properties: one in
shared/classes one in unix/classes. These, need to get merged into one
via the MergeProperties build tool class. So far so good. But for the
cases where there is only one resource property it should just get
copied to support/gensrc and that source root be used for compiling
those properties into actual ListResourceBundle Java classes.

The copying from the src tree to the gensrc tree doesn't seem to work.
I've tried using $(CP) and SetupCopyFiles to no avail. Would anybody
willing to help?
SetupCopyFile should work, but in this case I think it's simplest to just use install-file. Like this perhaps:

ifneq ($$($1_NUM_INPUT_FILES), 1)
  $$($1_TARGET): $$($1_INPUT_FILES)
      $$(call LogInfo, Merging $$($1_NUM_INPUT_FILES) properties files into a single properties file for jdk.jlink)
      $(TOOL_MERGE_PROPERTIES) \
$(GENERATED_JLINK_RESOURCES_DIR)/$$($1_PROP).properties \
              $$($1_INPUT_FILES)
else
  $$($1_TARGET): $$($1_INPUT_FILES)
    $$(install-file)
endif

$1 += $$($1_TARGET)

/Magnus

$$($1_TARGET): $$($1_DEPS)




WIP webrev is:
http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8214796-wip/01/webrev/

I thought I'd do the copying in an else branch in SetupPropertiesMerge,
where I've put in a FIXME comment. Am I on the wrong track?

Thanks,
Severin


Reply via email to