aboutsummaryrefslogtreecommitdiff
From 3dbdc68093e90f0ef9b77b70490d8e0b1dcfbf8f Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Sun, 17 Sep 2017 21:08:45 +0200
Subject: [PATCH] Add ExceptionUtilsGenerator.java.

A gradle task (in gradle/utils.gradle) is normally used to generate an
ExceptionUtils class. Since gradle depends on groovy, we cannot use it, so
we copy the code from the gradle task to a new file. Running this file then
generates the required class.
---
 .../codehaus/groovy/ExceptionUtilsGenerator.java   | 75 ++++++++++++++++++++++
 1 file changed, 75 insertions(+)
 create mode 100644 config/ant/src/org/codehaus/groovy/ExceptionUtilsGenerator.java

diff --git a/config/ant/src/org/codehaus/groovy/ExceptionUtilsGenerator.java b/config/ant/src/org/codehaus/groovy/ExceptionUtilsGenerator.java
new file mode 100644
index 0000000..41f006d
--- /dev/null
+++ b/config/ant/src/org/codehaus/groovy/ExceptionUtilsGenerator.java
@@ -0,0 +1,75 @@
+package org.codehaus.groovy;
+
+import org.objectweb.asm.*;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.logging.Logger;
+
+public class ExceptionUtilsGenerator implements Opcodes {
+    private final static Logger LOGGER = Logger.getLogger(ExceptionUtilsGenerator.class.getName());
+
+    public static void main(String... args) {
+        if (args==null || args.length==0) {
+            throw new IllegalArgumentException("You must specify at least one file");
+        }
+
+        ClassWriter cw = new ClassWriter(0);
+        MethodVisitor mv;
+
+        cw.visit(V1_5, ACC_PUBLIC + ACC_SUPER, "org/codehaus/groovy/runtime/ExceptionUtils", null, "java/lang/Object", null);
+
+        cw.visitSource("ExceptionUtils.java", null);
+
+        mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
+        mv.visitCode();
+        Label l0 = new Label();
+        mv.visitLabel(l0);
+        mv.visitLineNumber(18, l0);
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
+        mv.visitInsn(RETURN);
+        Label l1 = new Label();
+        mv.visitLabel(l1);
+        mv.visitLocalVariable("this", "Lorg/codehaus/groovy/runtime/ExceptionUtils;", null, l0, l1, 0);
+        mv.visitMaxs(1, 1);
+        mv.visitEnd();
+
+        mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "sneakyThrow", "(Ljava/lang/Throwable;)V", null, null);
+        mv.visitCode();
+        Label l2 = new Label();
+        mv.visitLabel(l2);
+        mv.visitLineNumber(20, l2);
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitInsn(ATHROW);
+        Label l3 = new Label();
+        mv.visitLabel(l3);
+        mv.visitLocalVariable("e", "Ljava/lang/Throwable;", null, l2, l3, 0);
+        mv.visitMaxs(1, 1);
+        mv.visitEnd();
+
+        cw.visitEnd();
+
+        LOGGER.info("Generating ExceptionUtils");
+        byte[] bytes = cw.toByteArray();
+        for (String classFilePath : args) {
+            File classFile = new File(classFilePath);
+            if (classFile.getParentFile().exists() || classFile.getParentFile().mkdirs()) {
+                try {
+                    if (classFile.exists()) {
+                        classFile.delete();
+                    }
+                    BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(classFile));
+                    bos.write(bytes);
+                    bos.close();
+                } catch (IOException e) {
+                    LOGGER.warning("Unable to write file "+classFile);
+                }
+            } else {
+                LOGGER.warning("Unable to create directory "+classFile.getParentFile());
+            }
+        }
+	}
+}
-- 
2.14.1

/packages/haskell-apps.scm, gnu/packages/haskell-xyz.scm, gnu/packages/hexedit.scm, gnu/packages/i2p.scm, gnu/packages/ibus.scm, gnu/packages/image-processing.scm, gnu/packages/image-viewers.scm, gnu/packages/image.scm, gnu/packages/ipfs.scm, gnu/packages/java-graphics.scm, gnu/packages/java-maths.scm, gnu/packages/java.scm, gnu/packages/javascript.scm, gnu/packages/jrnl.scm, gnu/packages/julia.scm, gnu/packages/jupyter.scm, gnu/packages/kodi.scm, gnu/packages/language.scm, gnu/packages/lego.scm, gnu/packages/less.scm, gnu/packages/libusb.scm, gnu/packages/linux.scm, gnu/packages/lirc.scm, gnu/packages/lisp-xyz.scm, gnu/packages/llvm.scm, gnu/packages/logging.scm, gnu/packages/lolcode.scm, gnu/packages/lua.scm, gnu/packages/lxde.scm, gnu/packages/lxqt.scm, gnu/packages/machine-learning.scm, gnu/packages/mail.scm, gnu/packages/markup.scm, gnu/packages/maths.scm, gnu/packages/maven.scm, gnu/packages/mes.scm, gnu/packages/messaging.scm, gnu/packages/monitoring.scm, gnu/packages/mpd.scm, gnu/packages/music.scm, gnu/packages/networking.scm, gnu/packages/node-xyz.scm, gnu/packages/ocaml.scm, gnu/packages/ocr.scm, gnu/packages/onc-rpc.scm, gnu/packages/opencl.scm, gnu/packages/opencog.scm, gnu/packages/pantheon.scm, gnu/packages/password-utils.scm, gnu/packages/patchutils.scm, gnu/packages/pdf.scm, gnu/packages/perl6.scm, gnu/packages/phabricator.scm, gnu/packages/popt.scm, gnu/packages/printers.scm, gnu/packages/prolog.scm, gnu/packages/protobuf.scm, gnu/packages/pulseaudio.scm, gnu/packages/python-crypto.scm, gnu/packages/python-web.scm, gnu/packages/python-xyz.scm, gnu/packages/qt.scm, gnu/packages/radio.scm, gnu/packages/rails.scm, gnu/packages/rdf.scm, gnu/packages/rednotebook.scm, gnu/packages/rpc.scm, gnu/packages/rsync.scm, gnu/packages/ruby.scm, gnu/packages/rust.scm, gnu/packages/scheme.scm, gnu/packages/screen.scm, gnu/packages/security-token.scm, gnu/packages/selinux.scm, gnu/packages/serialization.scm, gnu/packages/shells.scm, gnu/packages/shellutils.scm, gnu/packages/simh.scm, gnu/packages/sml.scm, gnu/packages/ssh.scm, gnu/packages/statistics.scm, gnu/packages/stenography.scm, gnu/packages/sync.scm, gnu/packages/syncthing.scm, gnu/packages/synergy.scm, gnu/packages/telephony.scm, gnu/packages/terminals.scm, gnu/packages/tex.scm, gnu/packages/texinfo.scm, gnu/packages/text-editors.scm, gnu/packages/textutils.scm, gnu/packages/time.scm, gnu/packages/tmux.scm, gnu/packages/tor.scm, gnu/packages/toys.scm, gnu/packages/version-control.scm, gnu/packages/video.scm, gnu/packages/vim.scm, gnu/packages/virtualization.scm, gnu/packages/vlang.scm, gnu/packages/vnc.scm, gnu/packages/vpn.scm, gnu/packages/web-browsers.scm, gnu/packages/web.scm, gnu/packages/wireservice.scm, gnu/packages/wm.scm, gnu/packages/wxwidgets.scm, gnu/packages/xdisorg.scm, gnu/packages/xml.scm, gnu/packages/xorg.scm, tests/lint.scm: Remove trailing ".git" from 'git-reference' URL. Ludovic Courtès 2020-05-18gnu: python-mpsse: Update to 1.4.1....Follow-up to a7b20226b2bf1a73b8f0f6536e7fa43326f35e33. * gnu/packages/embedded.scm (python-libmpsse): Update to 1.4.1. Danny Milosavljevic 2020-05-15gnu: python-libmpsse: Update to 1.4.1....* gnu/packages/embedded.scm (python-libmpsse): Update to 1.4.1. [arguments]<#:phases>[set-environment-up]: Fix build with Python 3.8. Danny Milosavljevic 2020-05-14gnu: gcc-arm-none-eabi@7-2018-q2-update: Fix conflicting GCC headers....This is a follow-up of 7f6d3f395023ff430cf8b7a981d4780698e9d132 and merely a copy-and-paste of Marius Bakke's fix. * gnu/packages/embedded.scm (gcc-arm-none-eabi-7-2018-q2-update)[arguments]: Add phase to remove the default compiler from CPLUS_INCLUDE_PATH. [native-inputs]: Distinguish GCC-5. Björn Höfling 2020-05-13gnu: gcc-arm-none-eabi: Fix conflicting GCC headers....Fixes <https://bugs.gnu.org/41210>. Reported by Ricardo Wurmus <rekado@elephly.net>. * gnu/packages/embedded.scm (gcc-arm-none-eabi-4.9)[arguments]: Add phase to remove the default compiler from CPLUS_INCLUDE_PATH. [native-inputs]: Distinguish GCC-5. Marius Bakke 2020-03-17gnu: libjaylink: Use HTTPS home page....* gnu/packages/embedded.scm (libjaylink)[home-page]: Use HTTPS. Tobias Geerinckx-Rice 2020-03-12gnu: picprog: Use HTTPS home page....* gnu/packages/embedded.scm (picprog)[home-page]: Use HTTPS. Tobias Geerinckx-Rice 2020-02-17gnu: newlib: Use HTTPS home page....* gnu/packages/embedded.scm (newlib)[home-page]: Use HTTPS. Tobias Geerinckx-Rice 2020-01-24gnu: jimtcl: Update to 0.79....* gnu/packages/embedded.scm (jimtcl): Update to 0.79. [home-page]: Update home-page. Efraim Flashner 2020-01-24gnu: jimtcl: Don't use unstable tarball....* gnu/packages/embedded.scm (jimtcl)[source]: Download using git-fetch. Efraim Flashner 2020-01-24gnu: stlink: Don't use unstable tarball....* gnu/packages/embedded.scm (stlink)[source]: Download using git-fetch. Efraim Flashner 2020-01-24gnu: spin2cpp: Don't use unstable tarball....* gnu/packages/embedded.scm (spin2cpp)[source]: Download using git-fetch. Efraim Flashner 2020-01-24gnu: openspin: Don't use unstable tarball....* gnu/packages/embedded.scm (openspin)[source]: Download using git-fetch. Efraim Flashner 2020-01-15Avoid warnings for the 'delete' binding of (guix build utils)....On Guile 3, importing (guix build utils) leads to warnings such as: WARNING: (gnu packages embedded): imported module (guix build utils) overrides core binding `delete' * gnu/packages/embedded.scm: Select 'alist-replace' from (guix build utils). * guix/ui.scm: Hide 'delete' from (guix build utils). Ludovic Courtès 2019-12-25gnu: Add arm-none-eabi-nano-toolchain-7-2018-q2-update....* gnu/packages/embedded.scm (arm-none-eabi-nano-toolchain-7-2018-q2-update): New variable. Ricardo Wurmus 2019-12-25gnu: Add arm-none-eabi-toolchain-7-2018-q2-update....* gnu/packages/embedded.scm (arm-none-eabi-toolchain-7-2018-q2-update): New variable. Ricardo Wurmus 2019-12-25gnu: Add newlib-nano-arm-none-eabi-7-2018-q2-update....* gnu/packages/embedded.scm (newlib-nano-arm-none-eabi-7-2018-q2-update): New variable. Ricardo Wurmus 2019-12-25gnu: Add newlib-arm-none-eabi-7-2018-q2-update....* gnu/packages/embedded.scm (newlib-arm-none-eabi-7-2018-q2-update): New variable. Ricardo Wurmus 2019-12-25gnu: Add gcc-arm-none-eabi-7-2018-q2-update....* gnu/packages/embedded.scm (gcc-arm-none-eabi-7-2018-q2-update): New variable. * gnu/packages/patches/gcc-7-cross-environment-variables.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Ricardo Wurmus 2019-12-05gnu: Add west....* gnu/packages/embedded.scm (west): New variable. Clément Lassieur 2019-10-01Merge branch 'master' into core-updatesLudovic Courtès 2019-09-28gnu: fc-host-tools: Improve description....* gnu/packages/embedded.scm (fc-host-tools)[description]: Improve description. Danny Milosavljevic 2019-09-28gnu: fc-host-tools: Update to 11....* gnu/packages/embedded.scm (fc-host-tools): Update to 11. [arguments]<:phases>[handle-tarbomb]: Delete phase. [patch-installation-paths]: Modify. Danny Milosavljevic 2019-09-27Merge branch 'master' into core-updatesMarius Bakke 2019-09-26gnu: python-libmpsse: Update to 1.4....* gnu/packages/embedded.scm (python2-libmpsse): Rename to... (python-libmpsse): ...this. [version]: Update to 1.4. [source]: Change repository and version. [inputs]: Change Python version. [arguments]: Add #parallel-build?. (python2-libmpsse): New variable. Danny Milosavljevic 2019-09-19gnu: gcc-arm-none-eabi-4.9: Build with GCC 5....* gnu/packages/embedded.scm (gcc-arm-none-eabi-4.9)[native-inputs]: Add gcc-5. Ricardo Wurmus 2019-04-12gnu: fc-host-tools: Fix fc-loadtool....* gnu/packages/embedded.scm (fc-host-tools)[arguments]<#:phases> [patch-installation-paths]: Modify. Danny Milosavljevic 2019-03-08gnu: fc-host-tools: Update to 10....* gnu/packages/embedded.scm (fc-host-tools): Update to 10. [arguments]<:make-flags>: Change INSTBIN to INSTALL_PREFIX. Danny Milosavljevic 2019-02-04gnu: fc-host-tools: Update to 9a....* gnu/packages/embedded.scm (fc-host-tools)[source]: Update to 9a. [arguments]<#:phases>[patch-installation-paths]: Modify. Danny Milosavljevic 2019-01-25gnu: proplib: Use INVOKE....* gnu/packages/embedded.scm (proplib)[arguments]: Use INVOKE. Ricardo Wurmus 2019-01-25gnu: jimtcl: Use INVOKE....* gnu/packages/embedded.scm (jimtcl)[arguments]: Use INVOKE. Ricardo Wurmus 2018-11-11gnu: openocd: Use INVOKE....* gnu/packages/embedded.scm (openocd)[arguments]: Use INVOKE and return #T unconditionally. Ricardo Wurmus 2018-11-11gnu: libjaylink: Remove custom bootstrap phase....* gnu/packages/embedded.scm (libjaylink)[arguments]: Remove. Ricardo Wurmus 2018-10-04gnu: Add stlink....* gnu/packages/embedded.scm (stlink): New variable. Clément Lassieur 2018-07-10gnu: fc-host-tools: Fix internal invocations....* gnu/packages/embedded.scm (fc-host-tools)[arguments]<#:phases> [patch-installation-paths]: Modify. Danny Milosavljevic 2018-07-10gnu: fc-host-tools: Update description....* gnu/packages/embedded.scm (fc-host-tools)[description]: Modify. Danny Milosavljevic 2018-03-29Merge branch 'master' into core-updatesMarius Bakke 2018-03-27gnu: Use invoke and return #t from all builders....* gnu/packages/admin.scm, gnu/packages/android.scm, gnu/packages/audio.scm, gnu/packages/avr.scm, gnu/packages/base.scm, gnu/packages/bioinformatics.scm, gnu/packages/certs.scm, gnu/packages/check.scm, gnu/packages/code.scm, gnu/packages/commencement.scm, gnu/packages/dictionaries.scm, gnu/packages/docbook.scm, gnu/packages/emacs.scm, gnu/packages/embedded.scm, gnu/packages/fonts.scm, gnu/packages/games.scm, gnu/packages/gnome.scm, gnu/packages/gnu-doc.scm, gnu/packages/guile.scm, gnu/packages/hurd.scm, gnu/packages/javascript.scm, gnu/packages/libreoffice.scm, gnu/packages/linux.scm, gnu/packages/lisp.scm, gnu/packages/lxde.scm, gnu/packages/mail.scm, gnu/packages/markup.scm, gnu/packages/mate.scm, gnu/packages/pkg-config.scm, gnu/packages/qt.scm, gnu/packages/rust.scm, gnu/packages/scheme.scm, gnu/packages/sdl.scm, gnu/packages/statistics.scm, gnu/packages/syncthing.scm, gnu/packages/tex.scm, gnu/packages/web.scm, gnu/packages/wine.scm, gnu/packages/xfce.scm: In the builders of packages using 'trivial-build-system', use invoke where appropriate, raise exceptions on errors, and otherwise return #t. Mark H Weaver 2018-03-25gnu: fc-host-tools: Update to version 8....* gnu/packages/embedded.scm (fc-host-tools): Update to version 8. Danny Milosavljevic 2018-03-25gnu: binutils-vc4: Use invoke....* gnu/packages/embedded.scm (binutils-vc4)[arguments]: Use invoke. Mark H Weaver