[Libreoffice-commits] .: Branch 'feature/gbuild_a11y' - 4 commits - accessibility/bridge accessibility/Jar_accessibility.mk solenv/gbuild
David Tardon
dtardon at kemper.freedesktop.org
Fri Dec 23 07:12:26 PST 2011
accessibility/Jar_accessibility.mk | 15 +++++++------
accessibility/bridge/Makefile | 15 +------------
solenv/gbuild/Jar.mk | 40 ++++++++++++++++++++++++++++++++-----
solenv/gbuild/JavaClassSet.mk | 15 +++++++++++++
4 files changed, 60 insertions(+), 25 deletions(-)
New commits:
commit e22fef6bebfb3a5bf3907115223650ff9425eced
Author: David Tardon <dtardon at redhat.com>
Date: Fri Dec 23 16:11:57 2011 +0100
use generated java source
diff --git a/accessibility/Jar_accessibility.mk b/accessibility/Jar_accessibility.mk
index ffb86ee..2eb0f72 100644
--- a/accessibility/Jar_accessibility.mk
+++ b/accessibility/Jar_accessibility.mk
@@ -31,15 +31,10 @@ $(eval $(call gb_Jar_add_jars,java_accessibility,\
$(OUTDIR)/bin/jurt.jar \
$(OUTDIR)/bin/ridl.jar \
$(OUTDIR)/bin/unoil.jar \
- $(WORKDIR)/CustomTarget/accessibility/bridge/classes \
))
$(eval $(call gb_Jar_set_packageroot,java_accessibility,org))
-$(eval $(call gb_Jar_add_packagedirs,java_accessibility,\
- $(WORKDIR)/CustomTarget/accessibility/bridge/classes/org \
-))
-
$(eval $(call gb_Jar_add_sourcefiles,java_accessibility,\
accessibility/bridge/org/openoffice/java/accessibility/AbstractButton \
accessibility/bridge/org/openoffice/java/accessibility/AccessibleActionImpl \
@@ -88,9 +83,13 @@ $(eval $(call gb_Jar_add_sourcefiles,java_accessibility,\
accessibility/bridge/org/openoffice/java/accessibility/logging/XAccessibleTextLog \
))
+$(eval $(call gb_Jar_add_generated_sourcefiles,java_accessibility,\
+ CustomTarget/accessibility/bridge/org/openoffice/java/accessibility/Build \
+))
+
# Dummy dep. to satisfy make's depsolver: .../classes is created by a
# custom target, so there is no dependency information for it here.
# It also makes sure that the package is built before this jar .-)
-$(WORKDIR)/CustomTarget/accessibility/bridge/classes :| $(call gb_Package_get_target,accessibility_bridge)
+$(call gb_Jar_get_target,java_accessibility) :| $(call gb_Package_get_target,accessibility_bridge)
# vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/accessibility/bridge/Makefile b/accessibility/bridge/Makefile
index 67792cd..9ed435a 100644
--- a/accessibility/bridge/Makefile
+++ b/accessibility/bridge/Makefile
@@ -26,10 +26,6 @@
# instead of those above.
gb_PARTIALBUILD := T
-include $(GBUILDDIR)/gbuild.mk
-
-TARGETDIR := $(WORKDIR)/CustomTarget/accessibility/bridge
-PACKAGE := org/openoffice/java/accessibility
ifeq ($(PRODUCT),)
DEBUGSWITCH := true
@@ -39,14 +35,7 @@ DEBUGSWITCH := false
PRODUCTSWITCH := true
endif
-$(TARGETDIR)/done : $(TARGETDIR)/classes/$(PACKAGE)/Build.class
- mkdir -p $(dir $@) && touch $@
-
-$(TARGETDIR)/classes/$(PACKAGE)/Build.class : $(TARGETDIR)/src/$(PACKAGE)/Build.java | $(gb_JavaClassSet_JAVACCOMMAND)
- mkdir -p $(dir $@) && \
- $(gb_JavaClassSet_JAVACCOMMAND) $(gb_JavaClassSet_JAVACDEBUG) -d $(TARGETDIR)/classes $^
-
-$(TARGETDIR)/src/$(PACKAGE)/Build.java :
+org/openoffice/java/accessibility/Build.java :
mkdir -p $(dir $@) && (\
echo package org.openoffice.java.accessibility\; && \
echo public class Build \{ && \
@@ -58,6 +47,6 @@ $(TARGETDIR)/src/$(PACKAGE)/Build.java :
.DEFAULT_GOAL := all
.PHONY : all
all : \
- $(TARGETDIR)/done
+ org/openoffice/java/accessibility/Build.java
# vim: set ts=4 sw=4 et:
commit a9afa2b27e1a19066a872b09df14f7a22c3c707b
Author: David Tardon <dtardon at redhat.com>
Date: Fri Dec 23 16:08:18 2011 +0100
allow use of generated files in gb_Jar
diff --git a/solenv/gbuild/Jar.mk b/solenv/gbuild/Jar.mk
index 295aa69..b5ba394 100644
--- a/solenv/gbuild/Jar.mk
+++ b/solenv/gbuild/Jar.mk
@@ -140,6 +140,16 @@ $(foreach sourcefile,$(2),$(call gb_Jar_add_sourcefile,$(1),$(sourcefile)))
endef
+define gb_Jar_add_generated_sourcefile
+$(call gb_JavaClassSet_add_generated_sourcefile,$(call gb_Jar_get_classsetname,$(1)),$(2))
+
+endef
+
+define gb_Jar_add_generated_sourcefiles
+$(foreach sourcefile,$(2),$(call gb_Jar_add_generated_sourcefile,$(1),$(sourcefile)))
+
+endef
+
define gb_JarTest_set_classpath
$(call gb_JavaClassSet_set_classpath,$(call gb_Jar_get_classsetname,$(1)),$(2))
diff --git a/solenv/gbuild/JavaClassSet.mk b/solenv/gbuild/JavaClassSet.mk
index 61cb4e8..6befda1 100644
--- a/solenv/gbuild/JavaClassSet.mk
+++ b/solenv/gbuild/JavaClassSet.mk
@@ -69,6 +69,10 @@ define gb_JavaClassSet__get_sourcefile
$(SRCDIR)/$(1).java
endef
+define gb_JavaClassSet__get_generated_sourcefile
+$(WORKDIR)/$(1).java
+endef
+
define gb_JavaClassSet_add_sourcefile
$(call gb_JavaClassSet_get_target,$(1)) : $(call gb_JavaClassSet__get_sourcefile,$(2))
@@ -79,6 +83,17 @@ $(foreach sourcefile,$(2),$(call gb_JavaClassSet_add_sourcefile,$(1),$(sourcefil
endef
+define gb_JavaClassSet_add_generated_sourcefile
+$(call gb_JavaClassSet_get_target,$(1)) : $(call gb_JavaClassSet__get_generated_sourcefile,$(2))
+$(call gb_JavaClassSet__get_generated_sourcefile,$(2)) : $(gb_Helper_PHONY)
+
+endef
+
+define gb_JavaClassSet_add_generated_sourcefiles
+$(foreach sourcefile,$(2),$(call gb_JavaClassSet_add_generated_sourcefile,$(1),$(sourcefile)))
+
+endef
+
define gb_JavaClassSet_set_classpath
$(call gb_JavaClassSet_get_target,$(1)) : T_CP := $(2)
commit c50936d6a60b05228c036d829156bfa2270cc11a
Author: David Tardon <dtardon at redhat.com>
Date: Fri Dec 23 15:35:55 2011 +0100
avoid copying hack
diff --git a/accessibility/Jar_accessibility.mk b/accessibility/Jar_accessibility.mk
index 5f5737a..ffb86ee 100644
--- a/accessibility/Jar_accessibility.mk
+++ b/accessibility/Jar_accessibility.mk
@@ -36,6 +36,10 @@ $(eval $(call gb_Jar_add_jars,java_accessibility,\
$(eval $(call gb_Jar_set_packageroot,java_accessibility,org))
+$(eval $(call gb_Jar_add_packagedirs,java_accessibility,\
+ $(WORKDIR)/CustomTarget/accessibility/bridge/classes/org \
+))
+
$(eval $(call gb_Jar_add_sourcefiles,java_accessibility,\
accessibility/bridge/org/openoffice/java/accessibility/AbstractButton \
accessibility/bridge/org/openoffice/java/accessibility/AccessibleActionImpl \
@@ -84,11 +88,9 @@ $(eval $(call gb_Jar_add_sourcefiles,java_accessibility,\
accessibility/bridge/org/openoffice/java/accessibility/logging/XAccessibleTextLog \
))
-# XXX yes, I know this is a nasty hack. But it is the easiest way (and,
-# from what I have tried so far, the only working one) to get the damned
-# class file packed into the jar.
-$(WORKDIR)/CustomTarget/accessibility/bridge/classes : $(call gb_Package_get_target,accessibility_bridge)
- mkdir -p $(call gb_Jar_get_workdir,java_accessibility)/org/openoffice/java/accessibility && \
- $(call gb_Deliver_deliver,$(WORKDIR)/CustomTarget/accessibility/bridge/classes/org/openoffice/java/accessibility/Build.class,$(call gb_Jar_get_workdir,java_accessibility)/org/openoffice/java/accessibility)
+# Dummy dep. to satisfy make's depsolver: .../classes is created by a
+# custom target, so there is no dependency information for it here.
+# It also makes sure that the package is built before this jar .-)
+$(WORKDIR)/CustomTarget/accessibility/bridge/classes :| $(call gb_Package_get_target,accessibility_bridge)
# vim:set shiftwidth=4 softtabstop=4 expandtab:
commit f9ad9da6c9bc5050f8a1ed47b4f1cac053bb33d7
Author: David Tardon <dtardon at redhat.com>
Date: Fri Dec 23 15:31:26 2011 +0100
work around deficiency in jar
diff --git a/solenv/gbuild/Jar.mk b/solenv/gbuild/Jar.mk
index 36e5112..295aa69 100644
--- a/solenv/gbuild/Jar.mk
+++ b/solenv/gbuild/Jar.mk
@@ -48,6 +48,12 @@ endef
# creates the target folder of the jar file if it doesn't exist
# creates the jar file
# jar program does not remove the target in case of error, so rm it manually
+# XXX: PACKAGEDIRS need special treatment, because sometimes we need to
+# add into the jar another class hierarchy created outside of our class
+# set (e.g., by javamaker). Because jar does not allow two same root dirs
+# when creating the archive, we work around this deficiency by creating
+# the archive with the main class hierarchy and then updating it from
+# the other one(s), which seems to work .-)
define gb_Jar__command
$(call gb_Output_announce,$*,$(true),JAR,3)
$(call gb_Helper_abbreviate_dirs_native,\
@@ -59,6 +65,7 @@ define gb_Jar__command
mkdir -p $(dir $(2)) && cd $(call gb_Jar_get_workdir,$(1)) && \
$(gb_Jar_JARCOMMAND) cfm $(2) $(call gb_Jar_get_manifest_target,$(1)) \
META-INF $(PACKAGEROOTS) $(PACKAGEFILES) \
+ $(foreach root,$(PACKAGEDIRS),&& $(gb_Jar_JARCOMMAND) uf $(2) -C $(dir $(root)) $(notdir $(root))) \
|| (rm $(2); false) )
endef
@@ -84,6 +91,7 @@ define gb_Jar_Jar
$(call gb_Jar_get_target,$(1)) : MANIFEST :=
$(call gb_Jar_get_target,$(1)) : JARCLASSPATH :=
$(call gb_Jar_get_target,$(1)) : PACKAGEROOTS :=
+$(call gb_Jar_get_target,$(1)) : PACKAGEDIRS :=
$(call gb_Jar_get_target,$(1)) : PACKAGEFILES :=
$(call gb_JavaClassSet_JavaClassSet,$(call gb_Jar_get_classsetname,$(1)))
$(call gb_JavaClassSet_set_classpath,$(call gb_Jar_get_classsetname,$(1)),$(value XCLASSPATH))
@@ -99,19 +107,31 @@ $(call gb_JavaClassSet_add_sourcefile,$(call gb_Jar_get_classsetname,$(1)),$(2))
endef
-# PACKAGEROOTS is the list of all root folders to pack into the jar (without META-INF as this is added automatically)
+# PACKAGEROOTS is the list of all root folders created by the JavaClassSet to pack into the jar (without META-INF as this is added automatically)
define gb_Jar_set_packageroot
$(call gb_Jar_get_target,$(1)) : PACKAGEROOTS := $(2)
endef
+#
+# PACKAGEDIRS is the list of additional root directories to pack into the jar
+define gb_Jar_add_packagedir
+$(call gb_Jar_get_target,$(1)) : PACKAGEDIRS += $(2)
+
+endef
+
+define gb_Jar_add_packagedirs
+$(foreach packagedir,$(2),$(call gb_Jar_add_packagedir,$(1),$(packagedir)))
+
+endef
# PACKAGEFILES is the list of all root files to pack into the jar
define gb_Jar_add_packagefile
$(call gb_Jar_get_target,$(1)) : PACKAGEFILES += $(2)
-$(call gb_Jar_get_target,$(1)) : $(call gb_Jar_get_workdir,$(1))/$(strip $(2))
-$(call gb_Jar_get_workdir,$(1))/$(strip $(2)) : $(3) $(call gb_JavaClassSet_get_target,$(call gb_Jar_get_classsetname,$(1)))
- mkdir -p $$(dir $$@)
- cp -rf $(3) $$@
+
+endef
+
+define gb_Jar_add_packagefiles
+$(foreach packagefile,$(2),$(call gb_Jar_add_packagefile,$(1),$(packagefile)))
endef
More information about the Libreoffice-commits
mailing list