gbuild: add ExtensionPackageSet class
Change-Id: I947207c78e28b416aebe2e33172043fd8cfa4f17
This commit is contained in:
parent
e0b50db09a
commit
60211134bc
3 changed files with 44 additions and 3 deletions
|
@ -112,6 +112,7 @@ gbuild_TARGETS := AllLangHelp \
|
|||
Executable \
|
||||
Extension \
|
||||
ExtensionPackage \
|
||||
ExtensionPackageSet \
|
||||
ExternalPackage \
|
||||
ExternalProject \
|
||||
GeneratedPackage \
|
||||
|
|
|
@ -30,14 +30,21 @@ $(call gb_ExtensionPackage_get_target,%) :
|
|||
&& zipinfo -1 $(ZIPFILE) | grep -v '/$$' \
|
||||
| sed s+^+$(INSTROOT)/$(LIBO_SHARE_FOLDER)/extensions/$*/+ > $@)
|
||||
|
||||
# call gb_ExtensionPackage_ExtensionPackage,package,oxt
|
||||
define gb_ExtensionPackage_ExtensionPackage
|
||||
# call gb_ExtensionPackage_ExtensionPackage_internal,package,oxt
|
||||
define gb_ExtensionPackage_ExtensionPackage_internal
|
||||
$(if $(2),,$(call gb_Output_error,need 2 parameters))
|
||||
$(call gb_ExtensionPackage_get_target,$(1)) : ZIPFILE := $(2)
|
||||
$(call gb_ExtensionPackage_get_target,$(1)) : $(2)
|
||||
$(2) :| $(call gb_ExtensionPackage_get_preparation_target,$(1))
|
||||
$(call gb_ExtensionPackage_get_target,$(1)) :| \
|
||||
$(INSTROOT)/$(LIBO_SHARE_FOLDER)/extensions/.dir
|
||||
|
||||
endef
|
||||
|
||||
# call gb_ExtensionPackage_ExtensionPackage,package,oxt
|
||||
define gb_ExtensionPackage_ExtensionPackage
|
||||
$(call gb_ExtensionPackage_ExtensionPackage_internal,$(1),$(2))
|
||||
$(2) :| $(call gb_ExtensionPackage_get_preparation_target,$(1))
|
||||
|
||||
$$(eval $$(call gb_Module_register_target,$(call gb_ExtensionPackage_get_target,$(1)),$(call gb_ExtensionPackage_get_clean_target,$(1))))
|
||||
$(call gb_Helper_make_userfriendly_targets,$(1),ExtensionPackage)
|
||||
|
||||
|
@ -50,4 +57,35 @@ $(call gb_ExtensionPackage_get_preparation_target,$(1)) : \
|
|||
|
||||
endef
|
||||
|
||||
# ExtensionPackage class
|
||||
#
|
||||
# This is less boring than writing a dozen 1-line ExtensionPackage files.
|
||||
|
||||
$(call gb_ExtensionPackageSet_get_clean_target,%) :
|
||||
$(call gb_Output_announce,$*,$(false),OXS,3)
|
||||
$(call gb_Helper_abbreviate_dirs,\
|
||||
rm -rf $(call gb_ExtensionPackageSet_get_target,$*))
|
||||
|
||||
$(call gb_ExtensionPackageSet_get_target,%) :
|
||||
$(call gb_Output_announce,$*,$(true),OXS,3)
|
||||
mkdir -p $(dir $@) && touch $@
|
||||
|
||||
# call gb_ExtensionPackageSet_ExtensionPackageSet,set
|
||||
define gb_ExtensionPackageSet_ExtensionPackageSet
|
||||
$$(eval $$(call gb_Module_register_target,$(call gb_ExtensionPackageSet_get_target,$(1)),$(call gb_ExtensionPackageSet_get_clean_target,$(1))))
|
||||
$(call gb_Helper_make_userfriendly_targets,$(1),ExtensionPackageSet)
|
||||
|
||||
endef
|
||||
|
||||
# call gb_ExtensionPackageSet_add_extension,set,package,oxt-filename
|
||||
define gb_ExtensionPackageSet_add_extension
|
||||
$(call gb_ExtensionPackage_ExtensionPackage_internal,$(2),$(TARFILE_LOCATION)/$(3))
|
||||
|
||||
$(call gb_ExtensionPackageSet_get_target,$(1)) : \
|
||||
$(call gb_ExtensionPackage_get_target,$(2))
|
||||
$(call gb_ExtensionPackageSet_get_clean_target,$(1)) : \
|
||||
$(call gb_ExtensionPackage_get_clean_target,$(2))
|
||||
|
||||
endef
|
||||
|
||||
# vim: set noet sw=4 ts=4:
|
||||
|
|
|
@ -86,6 +86,7 @@ gb_Extension_get_rootdir = $(WORKDIR)/Extension/$(1)/root
|
|||
gb_Extension_get_workdir = $(WORKDIR)/Extension/$(1)
|
||||
gb_ExtensionPackage_get_target = $(WORKDIR)/ExtensionPackage/$(1).filelist
|
||||
gb_ExtensionPackage_get_preparation_target = $(WORKDIR)/ExtensionPackage/$(1).prepare
|
||||
gb_ExtensionPackageSet_get_target = $(WORKDIR)/ExtensionPackage/$(1).set
|
||||
gb_ExternalPackage_get_target = $(WORKDIR)/ExternalPackage/$(1)
|
||||
gb_ExternalProject_get_statedir = $(WORKDIR)/ExternalProject/$(1)
|
||||
gb_ExternalProject_get_preparation_target = $(WORKDIR)/ExternalProject/$(1).prepare
|
||||
|
@ -258,6 +259,7 @@ $(eval $(call gb_Helper_make_clean_targets,\
|
|||
ExternalPackage \
|
||||
Extension \
|
||||
ExtensionPackage \
|
||||
ExtensionPackageSet \
|
||||
Gallery \
|
||||
GeneratedPackage \
|
||||
HelpTarget \
|
||||
|
|
Loading…
Reference in a new issue