diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-12-21 18:44:27 -0600 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-12-21 18:45:40 -0600 |
commit | 4ca4050de7a33985b359b527a59abac3ac3a87f5 (patch) | |
tree | 132aec35b5a7e7f6bea0820edc3f13ecc9e3ed10 | |
parent | 32d73c29a2b866fcd24b6f2a6a7d3390e4435e30 (diff) |
try to keep Class-Path lenght under control
Change-Id: I5cc6f325eff9f5177e77de661728621383fa5558
-rwxr-xr-x | solenv/bin/write_classpath.sh | 16 | ||||
-rw-r--r-- | solenv/gbuild/Jar.mk | 6 |
2 files changed, 19 insertions, 3 deletions
diff --git a/solenv/bin/write_classpath.sh b/solenv/bin/write_classpath.sh new file mode 100755 index 000000000000..29aeecb81abe --- /dev/null +++ b/solenv/bin/write_classpath.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +dest="$1" +shift +base='Class-Path: ' + +while [ "${1}" != "" ]; do + p="$1" + shift + echo "$base $1" >> $dest + base=' ' +done + +#echo "added classpath" +#cat $dest +#echo "===" diff --git a/solenv/gbuild/Jar.mk b/solenv/gbuild/Jar.mk index c9fd2b9c3781..151fb990a0a6 100644 --- a/solenv/gbuild/Jar.mk +++ b/solenv/gbuild/Jar.mk @@ -34,7 +34,7 @@ $(call gb_JavaClassSet_get_classdir,$(call gb_Jar_get_classsetname,$(1))) endef # location of manifest file in workdir -define gb_Jar_get_manifest_target +define gb_Jar_get_manifest_target $(call gb_Jar_get_workdir,$(1))/META-INF/MANIFEST.MF endef @@ -43,7 +43,7 @@ gb_Jar__get_dir_for_layer = $(patsubst $(1):%,%,$(filter $(1):%,$(gb_Jar_LAYER_D gb_Jar_get_install_target = $(call gb_Jar__get_dir_for_layer,$(call gb_Jar__get_layer,$(1)))/$(1).jar # creates classset and META-INF folders if they don't exist -# adds manifest version, class path, solarversion and content from sources to manifest file +# adds manifest version, class path, solarversion and content from sources to manifest file # 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 @@ -58,7 +58,7 @@ define gb_Jar__command $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(call gb_Jar_get_workdir,$(1))/META-INF && \ echo Manifest-Version: 1.0 > $(call gb_Jar_get_manifest_target,$(1)) && \ - $(if $(JARCLASSPATH),echo "Class-Path: $(strip $(JARCLASSPATH))" >> $(call gb_Jar_get_manifest_target,$(1)) &&) \ + $(if $(JARCLASSPATH),$(SRCDIR)/solenv/bin/write_classpath.sh "$(call gb_Jar_get_manifest_target,$(1))" $(strip $(JARCLASSPATH)) &&) \ echo "Solar-Version: $(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" >> $(call gb_Jar_get_manifest_target,$(1)) && \ $(if $(MANIFEST),cat $(MANIFEST) >> $(call gb_Jar_get_manifest_target,$(1)) &&) \ mkdir -p $(dir $(2)) && cd $(call gb_Jar_get_workdir,$(1)) && \ |