1 ;;; jde-make.el -- Integrated Development Environment for Java.
4 ;; Author: Paul Kinnucan <pkinnucan@attbi.com>
5 ;; Maintainer: Paul Kinnucan
6 ;; Keywords: java, tools
8 ;; Copyright (C) 1997, 1998, 2001, 2002, 2003, 2004 Paul Kinnucan.
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
27 (defgroup jde-make nil
32 (defcustom jde-make-program "make"
33 "*Specifies name of make program."
37 (defcustom jde-make-working-directory ""
38 "*Path of the working directory to use in 'make' build mode. This
39 string must end in a slash, for example, c:/foo/bar/ or ./ .
40 If this string is empty, the 'make' build mode uses the current file
41 location as its working directory."
45 (defcustom jde-make-args ""
46 "*Specifies arguments to be passed to make program."
50 (defcustom jde-make-finish-hook
51 '(jde-compile-finish-refresh-speedbar jde-compile-finish-update-class-info)
52 "List of functions to be invoked when compilation of a
53 Java source file terminates. Each function should accept
54 two arguments: the compilation buffer and a string
55 describing how the compilation finished."
59 (defvar jde-interactive-make-args ""
60 "String of compiler arguments entered in the minibuffer.")
62 (defcustom jde-read-make-args nil
63 "*Specify whether to prompt for additional make arguments.
64 If this variable is non-nil, and if `jde-build-use-make' is non nil
65 the jde-build command prompts you to enter additional make
66 arguments in the minibuffer. These arguments are appended to those
67 specified by customization variables. The JDE maintains a history
68 list of arguments entered in the minibuffer."
74 (defun jde-make-make-command (more-args)
75 "Constructs the java compile command as: jde-compiler + options + buffer file name."
76 (concat jde-make-program " " jde-make-args
77 (if (not (string= more-args ""))
78 (concat " " more-args))
84 "Run the make program specified by `jde-make-program' with the
85 command-line arguments specified by `jde-make-args'. If
86 `jde-read-make-args' is nonnil, this command also prompts you to enter
87 make arguments in the minibuffer and passes any arguments that you
88 enter to the make program along with the arguments specified by
91 (if jde-read-make-args
92 (setq jde-interactive-make-args
95 jde-interactive-make-args
97 '(jde-interactive-make-arg-history . 1))))
100 (jde-make-make-command
101 jde-interactive-make-args))
102 (save-default-directory default-directory)
104 (if (string= jde-make-working-directory "")
106 (jde-normalize-path 'jde-make-working-directory))))
109 ;; Force save-some-buffers to use the minibuffer
110 ;; to query user about whether to save modified buffers.
111 ;; Otherwise, when user invokes jde-make from
112 ;; menu, save-some-buffers tries to popup a menu
113 ;; which seems not to be supported--at least on
115 (if (and (eq system-type 'windows-nt)
117 (let ((temp last-nonmenu-event))
118 ;; The next line makes emacs think that jde-make
119 ;; was invoked from the minibuffer, even when it
120 ;; is actually invoked from the menu-bar.
121 (setq last-nonmenu-event t)
122 (save-some-buffers (not compilation-ask-about-save) nil)
123 (setq last-nonmenu-event temp))
124 (save-some-buffers (not compilation-ask-about-save) nil))
126 (setq compilation-finish-function
128 (run-hook-with-args 'jde-make-finish-hook buf msg)
129 (setq compilation-finish-function nil)))
131 (cd default-directory)
132 (compile-internal make-command "No more errors")
133 (cd save-default-directory)))
136 (defun jde-make-show-options ()
137 "Show the JDE Make Options panel."
139 (customize-apropos "jde-make" 'groups))
141 ;; Register and initialize the customization variables defined
143 (jde-update-autoloaded-symbols)
147 ;; $Log: jde-make.el,v $
148 ;; Revision 1.17 2004/08/21 04:30:43 paulk
149 ;; Update the JDEE wizard class list after making a project.
151 ;; Revision 1.16 2003/09/16 05:13:39 paulk
152 ;; Update jde-make command to issue a cd to the default directory before invoking
153 ;; make and to restore the original cwd afterwards. This fixes a bug in the
154 ;; implementation of the jde-make-working-directory variable.
156 ;; Revision 1.15 2002/11/21 04:18:41 paulk
157 ;; These packages, when autoloaded, now register and initialize the customization variables
158 ;; that they define to the values specified in the current project file.
160 ;; Revision 1.14 2002/10/22 05:02:09 paulk
161 ;; Put make customization variables in their own group and provide an autoloaded command for displaying them as a group.
163 ;; Revision 1.13 2002/09/16 05:14:18 paulk
164 ;; Adds a jde-make-finish-hook variable that allows you to specify functions
165 ;; to run when make finishes. By default the variable is set to functions
166 ;; that update the speedbar and the completion cache. Thanks to Sandip Chitale.
168 ;; Revision 1.12 2002/03/22 05:24:32 paulk
169 ;; Expanded documentation for the jde-make command.
171 ;; Revision 1.11 2001/07/16 13:39:33 paulk
172 ;; Added note to the doc for jde-make-working-directory that the path must end in a path separator.
174 ;; Revision 1.10 2001/05/31 04:00:50 paulk
175 ;; Backed out the previous change which was NOT a bug.
177 ;; Revision 1.9 2001/05/31 01:09:13 paulk
178 ;; Small bug fix. Thanks to Luis Miguel Hernanz Iglesias <luish@germinus.com>.
180 ;; Revision 1.8 2001/04/16 05:59:17 paulk
181 ;; Normalize paths. Thanks to Nick Sieger.
183 ;; Revision 1.7 2000/08/09 03:29:26 paulk
184 ;; Added jde-make-working-directory variable. Thanks to Laurent Latil <Laurent.Latil@france.sun.com>
186 ;; Revision 1.6 1999/04/27 16:44:49 paulk
187 ;; Updated to allow interactive entry of make arguments. Thanks to Yarek J. Kowalik <jgk@klg.com> for providing this enhancement.
189 ;; Revision 1.5 1999/01/17 00:43:57 paulk
190 ;; Removed two line feeds at the end of make command as they appeared to
191 ;; confuse GNU make for NT.
193 ;; Revision 1.4 1998/11/27 09:38:23 paulk
194 ;; Changed to use compile mode as suggested by Robert Grace <rmg2768@draper.com>.
196 ;; Revision 1.3 1998/05/29 01:46:39 paulk
197 ;; Added dummy function for jde-make-mode to facilitate autoloading.
199 ;; Revision 1.2 1998/05/27 06:04:52 paulk
200 ;; Added autoload comments.
202 ;; Revision 1.1 1998/03/27 04:44:36 kinnucan
206 ;; End of jde-make.el