diff options
author | Samuel Thibault <sthibault@hypra.fr> | 2018-02-16 13:22:10 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2018-02-20 22:21:48 +0100 |
commit | 226697ae27ef451cad404256e83eef88262f16d1 (patch) | |
tree | 30b3361c0bb8338139f3331473688a94318373ef /solenv/gbuild | |
parent | 88560550021908b7877b7c02b4601b92f97ea7d4 (diff) |
Integrate initial version of gla11y tool in the build system
This is part of integrating an accessibility non-regression tool. This
adds checks in configure.ac for the presence of python lxml which we will
need, and adds support for calling the tool at build time, to check for
definite UI errors. For now, that only emits errors for missing or duplicate
accessibility relation targets, and senseless relations: a label being
mnemonic for several widgets.
Change-Id: Idda91b15b9a9e0322d16db33dfac8e03f2aa518c
Reviewed-on: https://gerrit.libreoffice.org/49856
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'solenv/gbuild')
-rw-r--r-- | solenv/gbuild/TargetLocations.mk | 2 | ||||
-rw-r--r-- | solenv/gbuild/UIConfig.mk | 26 |
2 files changed, 27 insertions, 1 deletions
diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk index a8310655039a..06ec8bea0f43 100644 --- a/solenv/gbuild/TargetLocations.mk +++ b/solenv/gbuild/TargetLocations.mk @@ -156,6 +156,7 @@ gb_ScpTemplateTarget_get_target = $(abspath $(WORKDIR)/ScpTemplateTarget/$(dir $ gb_SdiTarget_get_target = $(WORKDIR)/SdiTarget/$(1) gb_ThesaurusIndexTarget_get_target = $(WORKDIR)/ThesaurusIndexTarget/$(basename $(1)).idx gb_UIConfig_get_imagelist_target = $(WORKDIR)/UIConfig/$(1).ilst +gb_UIConfig_get_a11yerrors_target = $(WORKDIR)/UIConfig/$(1).a11yerrors gb_UIConfig_get_target = $(WORKDIR)/UIConfig/$(1).done gb_UIImageListTarget_get_target = $(WORKDIR)/UIImageListTarget/$(1).ilst gb_UIMenubarTarget_get_target = $(WORKDIR)/UIMenubarTarget/$(1).xml @@ -280,6 +281,7 @@ $(eval $(call gb_Helper_make_clean_targets,\ CppunitTestFakeExecutable \ CustomTarget \ ExternalProject \ + UIA11YErrorsTarget \ UIConfig \ UIImageListTarget \ UIMenubarTarget \ diff --git a/solenv/gbuild/UIConfig.mk b/solenv/gbuild/UIConfig.mk index 01bfdbaea5b6..fb8762e8a09c 100644 --- a/solenv/gbuild/UIConfig.mk +++ b/solenv/gbuild/UIConfig.mk @@ -94,6 +94,7 @@ endef # * UIConfig/<name> containing all nontranslatable files gb_UIConfig_INSTDIR := $(LIBO_SHARE_FOLDER)/config/soffice.cfg +gb_UIConfig_a11yerrors_COMMAND = $(SRCDIR)/bin/gla11y $(dir $(call gb_UIConfig_get_target,%)).dir : $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) @@ -101,7 +102,7 @@ $(dir $(call gb_UIConfig_get_target,%)).dir : $(dir $(call gb_UIConfig_get_target,%))%/.dir : $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) -$(call gb_UIConfig_get_target,%) : $(call gb_UIConfig_get_imagelist_target,%) +$(call gb_UIConfig_get_target,%) : $(call gb_UIConfig_get_imagelist_target,%) $(call gb_UIConfig_get_a11yerrors_target,%) $(call gb_Output_announce,$*,$(true),UIC,2) $(call gb_Helper_abbreviate_dirs,\ touch $@ \ @@ -117,6 +118,25 @@ $(call gb_UIConfig_get_clean_target,%) : rm -f $(call gb_UIConfig_get_target,$*) \ ) +define gb_UIConfig_a11yerrors__command +$(call gb_Output_announce,$(2),$(true),UIA,1) +$(call gb_Helper_abbreviate_dirs,\ + $(gb_UIConfig_a11yerrors_COMMAND) -W none $(UIFILE) > $@ +) +endef + +$(call gb_UIConfig_get_a11yerrors_target,%) : $(gb_UIConfig_a11yerrors_COMMAND) +ifeq ($(PYTHON_LXML),TRUE) + $(call gb_UIConfig_a11yerrors__command,$@,$*) +else + touch $@ +endif + +.PHONY : $(call gb_UIA11YErrorsTarget_get_clean_target,%) +$(call gb_UIA11YErrorsTarget_get_clean_target,%) : + $(call gb_Output_announce,$*,$(false),UIA,2) + rm -f $(call gb_UIConfig_get_a11yerrors_target,$*) + gb_UIConfig_get_packagename = UIConfig/$(1) gb_UIConfig_get_packagesetname = UIConfig/$(1) @@ -138,6 +158,7 @@ $(call gb_PackageSet_add_package,$(call gb_UIConfig_get_packagesetname,$(1)),$(c $(call gb_UIConfig_get_target,$(1)) :| $(dir $(call gb_UIConfig_get_target,$(1))).dir $(call gb_UIConfig_get_imagelist_target,$(1)) :| $(dir $(call gb_UIConfig_get_imagelist_target,$(1))).dir +$(call gb_UIConfig_get_a11yerrors_target,$(1)) :| $(dir $(call gb_UIConfig_get_a11yerrors_target,$(1))).dir $(call gb_UIConfig_get_target,$(1)) : $(call gb_PackageSet_get_target,$(call gb_UIConfig_get_packagesetname,$(1))) $(call gb_UIConfig_get_clean_target,$(1)) : $(call gb_PackageSet_get_clean_target,$(call gb_UIConfig_get_packagesetname,$(1))) @@ -168,6 +189,9 @@ $(call gb_UIConfig_get_imagelist_target,$(1)) : UI_IMAGELISTS += $(call gb_UIIma $(call gb_UIConfig_get_imagelist_target,$(1)) : $(call gb_UIImageListTarget_get_target,$(2)) $(call gb_UIConfig_get_clean_target,$(1)) : $(call gb_UIImageListTarget_get_clean_target,$(2)) +$(call gb_UIConfig_get_a11yerrors_target,$(1)) : UIFILE := $(SRCDIR)/$(2).ui +$(call gb_UIConfig_get_clean_target,$(1)) : $(call gb_UIA11YErrorsTarget_get_clean_target,$(2)) + endef gb_UIConfig_ALLFILES:= |