diff options
author | David Ostrovsky <david@ostrovsky.org> | 2012-10-02 23:22:37 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-10-02 21:51:51 +0000 |
commit | ae1f2f6b932d43e6770022039d9cbe3f3960ab27 (patch) | |
tree | f9c4eda156cfb1b6558b638c0e9b008bf80be1c4 /rhino | |
parent | 58deab04a99ab0ad49d4f33348dc801ca932c0ca (diff) |
gbuildification of rhino
Default patch level 3 was not working here and must
be overriden with gb_UnpackedTarball_set_patchlevel
function with 2.
New java file OfficeScriptInfo.java was extracted from
rhino1_5R5.patch and added with gb_UnpackedTarball_add_file.
Change-Id: Iba25b2350caffd943af93f59fa2139332b009ef2
Reviewed-on: https://gerrit.libreoffice.org/752
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'rhino')
-rw-r--r-- | rhino/ExternalProject_rhino.mk | 37 | ||||
-rw-r--r-- | rhino/Makefile | 7 | ||||
-rw-r--r-- | rhino/Module_rhino.mk | 22 | ||||
-rw-r--r-- | rhino/OfficeScriptInfo.java | 128 | ||||
-rw-r--r-- | rhino/Package_rhino.mk | 16 | ||||
-rw-r--r-- | rhino/UnpackedTarball_rhino.mk | 24 | ||||
-rw-r--r-- | rhino/makefile.mk | 75 | ||||
-rw-r--r-- | rhino/prj/build.lst | 5 | ||||
-rw-r--r-- | rhino/prj/d.lst | 1 | ||||
-rw-r--r-- | rhino/prj/dmake | 0 | ||||
-rw-r--r-- | rhino/rhino1_5R5.patch | 134 |
11 files changed, 236 insertions, 213 deletions
diff --git a/rhino/ExternalProject_rhino.mk b/rhino/ExternalProject_rhino.mk new file mode 100644 index 000000000000..0ca364e59c09 --- /dev/null +++ b/rhino/ExternalProject_rhino.mk @@ -0,0 +1,37 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +# for RSCREVISION +include $(SOLARENV)/inc/minor.mk + +$(eval $(call gb_ExternalProject_ExternalProject,rhino)) + +$(eval $(call gb_ExternalProject_use_unpacked,rhino,rhino)) + +$(eval $(call gb_ExternalProject_register_targets,rhino,\ + build \ +)) + +$(call gb_ExternalProject_get_state_target,rhino,build) : + cd "$(call gb_UnpackedTarball_get_dir,rhino)" && \ + "$(ANT)" \ + -q \ + -f build.xml \ + -Dbuild.label="build-$(RSCREVISION)" \ + -DTARFILE_LOCATION="$(TARFILE_LOCATION)" \ + $(if $(filter yes,$(JAVACISGCJ))\ + ,-Dbuild.compiler=gcj \ + ,-Dant.build.javac.source=$(JAVA_SOURCE_VER) \ + -Dant.build.javac.target=$(JAVA_TARGET_VER) \ + ) \ + $(if $(debug),-Dbuild.debug="on") \ + jar && \ + touch $@ + +# vim: set noet sw=4 ts=4: diff --git a/rhino/Makefile b/rhino/Makefile new file mode 100644 index 000000000000..ccb1c85a04da --- /dev/null +++ b/rhino/Makefile @@ -0,0 +1,7 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- + +module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST)))) + +include $(module_directory)/../solenv/gbuild/partial_build.mk + +# vim: set noet sw=4 ts=4: diff --git a/rhino/Module_rhino.mk b/rhino/Module_rhino.mk new file mode 100644 index 000000000000..5fccae447cea --- /dev/null +++ b/rhino/Module_rhino.mk @@ -0,0 +1,22 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_Module_Module,rhino)) + +ifneq ($(SOLAR_JAVA),) +ifneq ($(filter RHINO,$(BUILD_TYPE)),) +$(eval $(call gb_Module_add_targets,rhino,\ + ExternalProject_rhino \ + Package_rhino \ + UnpackedTarball_rhino \ +)) +endif +endif + +# vim: set noet sw=4 ts=4: diff --git a/rhino/OfficeScriptInfo.java b/rhino/OfficeScriptInfo.java new file mode 100644 index 000000000000..0732ca2df1dd --- /dev/null +++ b/rhino/OfficeScriptInfo.java @@ -0,0 +1,128 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +package org.mozilla.javascript.tools.debugger; +import java.net.URL; +import java.util.Hashtable; +import org.mozilla.javascript.Scriptable; + +public class OfficeScriptInfo +{ + private Hashtable loadedSFScripts = new Hashtable(); + + public void addScript( URL url, Scriptable scope, Runnable closeCallback ) + { + addScript( url.toString(), url, scope, closeCallback ); + } + + public void addScript( String key, URL url, Scriptable scope, Runnable closeCallback ) + { + SFScriptInfo si = (SFScriptInfo)loadedSFScripts.get( key ); + if ( si == null ) + { + si = new SFScriptInfo(); + si.url = url; + si.scope = scope; + si.closeCallback = closeCallback; + loadedSFScripts.put( key, si ); + } + } + + public void deleteScript( String key ) + { + SFScriptInfo info = (SFScriptInfo)loadedSFScripts.remove( key ); + if ( info != null ) + { + if ( info.closeCallback != null ) + { + System.out.println("** In removeSFScriptInfo have callback for " + key ); + info.closeCallback.run(); // really need to do this in seperate thread???? + } + } + } + + public Scriptable getScriptScope( String key ) + { + Scriptable result = null; + SFScriptInfo info = (SFScriptInfo)loadedSFScripts.get( key ); + if ( info != null ) + { + result = info.scope; + } + return result; + } + + public URL getScriptUrl( String key ) + { + URL result = null; + SFScriptInfo info = (SFScriptInfo)loadedSFScripts.get( key ); + if ( info != null ) + { + result = info.url; + } + return result; + } + public boolean hasScript( String key ) + { + boolean result = true; + SFScriptInfo info = (SFScriptInfo)loadedSFScripts.get( key ); + if ( info == null ) + { + result = false; + } + return result; + } + + public void setScriptRunning( String key, boolean running ) + { + SFScriptInfo info = (SFScriptInfo)loadedSFScripts.get( key ); + if ( info != null ) + { + info.isExecuting = running; + } + } + + public boolean isScriptRunning( String key ) + { + boolean result = false; + SFScriptInfo info = (SFScriptInfo)loadedSFScripts.get( key ); + if ( info != null ) + { + result = info.isExecuting; + } + return result; + } + + class SFScriptInfo + { + Scriptable scope; + boolean isExecuting; + URL url; + Runnable closeCallback; + } +} diff --git a/rhino/Package_rhino.mk b/rhino/Package_rhino.mk new file mode 100644 index 000000000000..075c49c8a401 --- /dev/null +++ b/rhino/Package_rhino.mk @@ -0,0 +1,16 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_Package_Package,rhino,$(call gb_UnpackedTarball_get_dir,rhino))) + +$(eval $(call gb_Package_use_external_project,rhino,rhino)) + +$(eval $(call gb_Package_add_file,rhino,bin/js.jar,build/rhino1_5R5/js.jar)) + +# vim: set noet sw=4 ts=4: diff --git a/rhino/UnpackedTarball_rhino.mk b/rhino/UnpackedTarball_rhino.mk new file mode 100644 index 000000000000..32c64573cd12 --- /dev/null +++ b/rhino/UnpackedTarball_rhino.mk @@ -0,0 +1,24 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_UnpackedTarball_UnpackedTarball,rhino)) + +$(eval $(call gb_UnpackedTarball_set_tarball,rhino,$(RHINO_TARBALL))) + +$(eval $(call gb_UnpackedTarball_set_patchlevel,rhino,2)) + +$(eval $(call gb_UnpackedTarball_add_patches,rhino,\ + rhino/rhino1_5R5.patch \ + rhino/rhino1_5R5-find_swing.patch \ + rhino/rhino1_5R5-updateToolTip.patch \ +)) + +$(eval $(call gb_UnpackedTarball_add_file,rhino,toolsrc/org/mozilla/javascript/tools/debugger/OfficeScriptInfo.java,rhino/OfficeScriptInfo.java)) + +# vim: set noet sw=4 ts=4: diff --git a/rhino/makefile.mk b/rhino/makefile.mk deleted file mode 100644 index 8a2a80c1e8e6..000000000000 --- a/rhino/makefile.mk +++ /dev/null @@ -1,75 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=. - -PRJNAME=ooo_rhino -TARGET=ooo_rhino - -.IF "$(SOLAR_JAVA)"!="" -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : antsettings.mk - -# --- Files -------------------------------------------------------- - -TARFILE_NAME=rhino1_5R5 -TARFILE_MD5=798b2ffdc8bcfe7bca2cf92b62caf685 -TARFILE_ROOTDIR=rhino1_5R5 - -ADDITIONAL_FILES= \ - toolsrc/org/mozilla/javascript/tools/debugger/OfficeScriptInfo.java - -PATCH_FILES=rhino1_5R5.patch \ - rhino1_5R5-find_swing.patch \ - rhino1_5R5-updateToolTip.patch - -.IF "$(OS_FOR_BUILD)"=="WNT" -FIXED_TARFILE_LOCATION=`cygpath -m -s "$(TARFILE_LOCATION)"` -.ELSE -FIXED_TARFILE_LOCATION=$(TARFILE_LOCATION) -.ENDIF - -.IF "$(JAVACISGCJ)"=="yes" -JAVA_HOME= -.EXPORT : JAVA_HOME -BUILD_ACTION="$(ANT)" -DTARFILE_LOCATION="$(FIXED_TARFILE_LOCATION)" -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj jar -.ELSE -BUILD_ACTION="$(ANT)" -DTARFILE_LOCATION="$(FIXED_TARFILE_LOCATION)" -Dbuild.label="build-$(RSCREVISION)" -Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER) jar -.ENDIF - -# --- Targets ------------------------------------------------------ - -.INCLUDE : set_ext.mk -.INCLUDE : target.mk -.INCLUDE : tg_ext.mk - -.ELSE -all: - @echo java disabled -.ENDIF diff --git a/rhino/prj/build.lst b/rhino/prj/build.lst index d23bc3660d7e..3e20ebe2d8b6 100644 --- a/rhino/prj/build.lst +++ b/rhino/prj/build.lst @@ -1,3 +1,2 @@ -xh rhino : soltools NULL -xh rhino usr1 - all xh_mkout NULL -xh rhino nmake - all xh_rhino NULL +xh rhino : soltools NULL +xh rhino\prj nmake - all xh_rhino NULL diff --git a/rhino/prj/d.lst b/rhino/prj/d.lst index b98f6b7e73a6..e69de29bb2d1 100644 --- a/rhino/prj/d.lst +++ b/rhino/prj/d.lst @@ -1 +0,0 @@ -..\%__SRC%\misc\build\rhino1_5R5\build\rhino1_5R5\js.jar %_DEST%\bin\js.jar diff --git a/rhino/prj/dmake b/rhino/prj/dmake deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/rhino/prj/dmake +++ /dev/null diff --git a/rhino/rhino1_5R5.patch b/rhino/rhino1_5R5.patch index 21b4a484be8e..5b10c320d015 100644 --- a/rhino/rhino1_5R5.patch +++ b/rhino/rhino1_5R5.patch @@ -1041,140 +1041,6 @@ + } ---- misc/rhino1_5R5/toolsrc/org/mozilla/javascript/tools/debugger/OfficeScriptInfo.java Fri Mar 28 17:25:34 2008 -+++ misc/build/rhino1_5R5/toolsrc/org/mozilla/javascript/tools/debugger/OfficeScriptInfo.java Fri Mar 28 17:24:59 2008 -@@ -1 +1,130 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2000, 2010 Oracle and/or its affiliates. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+ -+package org.mozilla.javascript.tools.debugger; -+import java.net.URL; -+import java.util.Hashtable; -+import org.mozilla.javascript.Scriptable; -+ -+public class OfficeScriptInfo -+{ -+ private Hashtable loadedSFScripts = new Hashtable(); -+ -+ public void addScript( URL url, Scriptable scope, Runnable closeCallback ) -+ { -+ addScript( url.toString(), url, scope, closeCallback ); -+ } -+ -+ public void addScript( String key, URL url, Scriptable scope, Runnable closeCallback ) -+ { -+ SFScriptInfo si = (SFScriptInfo)loadedSFScripts.get( key ); -+ if ( si == null ) -+ { -+ si = new SFScriptInfo(); -+ si.url = url; -+ si.scope = scope; -+ si.closeCallback = closeCallback; -+ loadedSFScripts.put( key, si ); -+ } -+ } -+ -+ public void deleteScript( String key ) -+ { -+ SFScriptInfo info = (SFScriptInfo)loadedSFScripts.remove( key ); -+ if ( info != null ) -+ { -+ if ( info.closeCallback != null ) -+ { -+ System.out.println("** In removeSFScriptInfo have callback for " + key ); -+ info.closeCallback.run(); // really need to do this in seperate thread???? -+ } -+ } -+ } -+ -+ public Scriptable getScriptScope( String key ) -+ { -+ Scriptable result = null; -+ SFScriptInfo info = (SFScriptInfo)loadedSFScripts.get( key ); -+ if ( info != null ) -+ { -+ result = info.scope; -+ } -+ return result; -+ } -+ -+ public URL getScriptUrl( String key ) -+ { -+ URL result = null; -+ SFScriptInfo info = (SFScriptInfo)loadedSFScripts.get( key ); -+ if ( info != null ) -+ { -+ result = info.url; -+ } -+ return result; -+ } -+ public boolean hasScript( String key ) -+ { -+ boolean result = true; -+ SFScriptInfo info = (SFScriptInfo)loadedSFScripts.get( key ); -+ if ( info == null ) -+ { -+ result = false; -+ } -+ return result; -+ } -+ -+ public void setScriptRunning( String key, boolean running ) -+ { -+ SFScriptInfo info = (SFScriptInfo)loadedSFScripts.get( key ); -+ if ( info != null ) -+ { -+ info.isExecuting = running; -+ } -+ } -+ -+ public boolean isScriptRunning( String key ) -+ { -+ boolean result = false; -+ SFScriptInfo info = (SFScriptInfo)loadedSFScripts.get( key ); -+ if ( info != null ) -+ { -+ result = info.isExecuting; -+ } -+ return result; -+ } -+ -+ -+ -+ class SFScriptInfo -+ { -+ Scriptable scope; -+ boolean isExecuting; -+ URL url; -+ Runnable closeCallback; -+ } -+} --- misc/rhino1_5R5/toolsrc/org/mozilla/javascript/tools/shell/JavaPolicySecurity.java Thu Mar 25 21:54:34 2004 +++ misc/build/rhino1_5R5/toolsrc/org/mozilla/javascript/tools/shell/JavaPolicySecurity.java Fri Mar 28 17:24:23 2008 @@ -36,6 +36,7 @@ |