Commit 34b48e32 authored by Johannes  Schmid's avatar Johannes Schmid Committed by Johannes Schmid

Removed tagmanager/symbol-browser in favour of the nearly stable symbol-db

2008-12-26  Johannes  Schmid <jhs@gnome.org>

	* Makefile.am:
	* configure.in:
	* global-tags/.cvsignore:
	* global-tags/Makefile.am:
	* global-tags/create_global_tags.sh.in:
	* global-tags/tm_global_tags.c:
	* plugins/Makefile.am:
	* plugins/editor/Makefile.am:
	* plugins/editor/aneditor-calltip.cxx:
	* plugins/editor/aneditor-priv.h:
	* plugins/editor/aneditor.cxx:
	* plugins/editor/text_editor.h:
	* plugins/search/Makefile.am:
	* plugins/search/search-replace.c (save_not_opened_files):
	* plugins/search/search-replace_backend.c
	(file_buffer_new_from_te), (file_buffer_new_from_path),
	(create_search_entries):
	* plugins/sourceview/Makefile.am:
	* plugins/symbol-browser/.cvsignore:
	* plugins/symbol-browser/Makefile.am:
	* plugins/symbol-browser/an_symbol.c:
	* plugins/symbol-browser/an_symbol.h:
	* plugins/symbol-browser/an_symbol_info.c:
	* plugins/symbol-browser/an_symbol_info.h:
	* plugins/symbol-browser/an_symbol_iter.c:
	* plugins/symbol-browser/an_symbol_iter.h:
	* plugins/symbol-browser/an_symbol_prefs.c:
	* plugins/symbol-browser/an_symbol_prefs.h:
	* plugins/symbol-browser/an_symbol_search.c:
	* plugins/symbol-browser/an_symbol_search.h:
	* plugins/symbol-browser/an_symbol_view.c:
	* plugins/symbol-browser/an_symbol_view.h:
	* plugins/symbol-browser/anjuta-symbol-browser-plugin.glade:
	* plugins/symbol-browser/anjuta-symbol-browser-plugin.svg:
	* plugins/symbol-browser/anjuta-symbol-browser-plugin.ui:
	* plugins/symbol-browser/anjuta-symbol-browser.plugin.in:
	* plugins/symbol-browser/anjuta-symbol-locals.c:
	* plugins/symbol-browser/anjuta-symbol-locals.h:
	* plugins/symbol-browser/images/.cvsignore:
	* plugins/symbol-browser/images/Makefile.am:
	* plugins/symbol-browser/images/README:
	* plugins/symbol-browser/plugin.c:
	* plugins/symbol-browser/plugin.h:
	* plugins/symbol-browser/test-class.cpp:
	* plugins/symbol-browser/test-class.h:
	* plugins/symbol-browser/test-symbol-browser.c:
	* plugins/symbol-db/Makefile.am:
	* scripts/Makefile.am:
	* scripts/anjuta_import.sh.in:
	* tagmanager/.cvsignore:
	* tagmanager/Makefile.am:
	* tagmanager/acconfig.h:
	* tagmanager/args.c:
	* tagmanager/args.h:
	* tagmanager/asm.c:
	* tagmanager/asp.c:
	* tagmanager/awk.c:
	* tagmanager/beta.c:
	* tagmanager/c.c:
	* tagmanager/cobol.c:
	* tagmanager/ctags.c:
	* tagmanager/ctags.h:
	* tagmanager/debug.c:
	* tagmanager/debug.h:
	* tagmanager/eiffel.c:
	* tagmanager/entry.c:
	* tagmanager/entry.h:
	* tagmanager/erlang.c:
	* tagmanager/fortran.c:
	* tagmanager/general.h:
	* tagmanager/get.c:
	* tagmanager/get.h:
	* tagmanager/html.c:
	* tagmanager/include/.cvsignore:
	* tagmanager/include/Makefile.am:
	* tagmanager/include/tm_file_entry.h:
	* tagmanager/include/tm_project.h:
	* tagmanager/include/tm_source_file.h:
	* tagmanager/include/tm_symbol.h:
	* tagmanager/include/tm_tag.h:
	* tagmanager/include/tm_tagmanager.h:
	* tagmanager/include/tm_work_object.h:
	* tagmanager/include/tm_workspace.h:
	* tagmanager/jscript.c:
	* tagmanager/keyword.c:
	* tagmanager/keyword.h:
	* tagmanager/lisp.c:
	* tagmanager/lregex.c:
	* tagmanager/lua.c:
	* tagmanager/main.h:
	* tagmanager/make.c:
	* tagmanager/options.c:
	* tagmanager/options.h:
	* tagmanager/parse.c:
	* tagmanager/parse.h:
	* tagmanager/parsers.h:
	* tagmanager/pascal.c:
	* tagmanager/perl.c:
	* tagmanager/php.c:
	* tagmanager/python.c:
	* tagmanager/read.c:
	* tagmanager/read.h:
	* tagmanager/readtags.c:
	* tagmanager/readtags.h:
	* tagmanager/regex.c:
	* tagmanager/rexx.c:
	* tagmanager/routines.c:
	* tagmanager/routines.h:
	* tagmanager/ruby.c:
	* tagmanager/scheme.c:
	* tagmanager/sh.c:
	* tagmanager/slang.c:
	* tagmanager/sml.c:
	* tagmanager/sort.c:
	* tagmanager/sort.h:
	* tagmanager/sql.c:
	* tagmanager/strlist.c:
	* tagmanager/strlist.h:
	* tagmanager/tcl.c:
	* tagmanager/test_tm_buffer.c:
	* tagmanager/tm_file_entry.c:
	* tagmanager/tm_project.c:
	* tagmanager/tm_source_file.c:
	* tagmanager/tm_symbol.c:
	* tagmanager/tm_tag.c:
	* tagmanager/tm_tagmanager.c:
	* tagmanager/tm_work_object.c:
	* tagmanager/tm_workspace.c:
	* tagmanager/verilog.c:
	* tagmanager/vim.c:
	* tagmanager/vstring.c:
	* tagmanager/vstring.h:
	* tagmanager/yacc.c:

	Removed tagmanager/symbol-browser in favour of the nearly stable symbol-db plugin. Commented
	some very old code in scintilla that is probably not used anymore though  some portions can be ported
	to IAnjutaSymbolManager interface such as highlighting of tags. 
	Adapted some other plugins that very using tagmanager for strange things (like search).

	* plugins/build/build_file.c:
	* plugins/build/build_file.h:
	* plugins/build/build_project.c:
	* plugins/build/build_project.h:
	* plugins/build/clean_project.c:
	* plugins/build/clean_project.h:
	* plugins/build/commands.c:
	* plugins/build/commands.h:
	* plugins/build/compile.c:
	* plugins/build/compile.h:
	* plugins/build/compiler_options.c:
	* plugins/build/compiler_options.h:
	* plugins/build/configurer.c:
	* plugins/build/configurer.h:
	* plugins/build/executer.c:
	* plugins/build/executer.h:
	Removed obsolete build plugin. If you really need to have a look check the svn history.

	* plugins/gvim/.cvsignore:
	* plugins/gvim/Makefile.am:
	* plugins/gvim/anjuta-vim.c:
	* plugins/gvim/anjuta-vim.h:
	* plugins/gvim/anjuta-vim.plugin.in:
	* plugins/gvim/gtkvim.c:
	* plugins/gvim/gtkvim.h:
	* plugins/gvim/plugin.c:
	* plugins/gvim/plugin.h:
	Removed gvim plugin. It is replaced by the GSoc vim plugin.

2008-12-25  Jens Georg  <mail@jensge.org>
 
	Reviewed by: Johannes Schmid <jhs@gnome.org>
 
	* plugins/search/search-replace_backend.c: 
	* plugins/search/search-replace.c:
	remove usage of std i/o (#565492)

svn path=/trunk/; revision=4484
parent 99b44526
2008-12-25 Johannes <jhs@gnome.org>
2008-12-26 Johannes Schmid <jhs@gnome.org>
* Makefile.am:
* configure.in:
* global-tags/.cvsignore:
* global-tags/Makefile.am:
* global-tags/create_global_tags.sh.in:
* global-tags/tm_global_tags.c:
* plugins/Makefile.am:
* plugins/editor/Makefile.am:
* plugins/editor/aneditor-calltip.cxx:
* plugins/editor/aneditor-priv.h:
* plugins/editor/aneditor.cxx:
* plugins/editor/text_editor.h:
* plugins/search/Makefile.am:
* plugins/search/search-replace.c (save_not_opened_files):
* plugins/search/search-replace_backend.c
(file_buffer_new_from_te), (file_buffer_new_from_path),
(create_search_entries):
* plugins/sourceview/Makefile.am:
* plugins/symbol-browser/.cvsignore:
* plugins/symbol-browser/Makefile.am:
* plugins/symbol-browser/an_symbol.c:
* plugins/symbol-browser/an_symbol.h:
* plugins/symbol-browser/an_symbol_info.c:
* plugins/symbol-browser/an_symbol_info.h:
* plugins/symbol-browser/an_symbol_iter.c:
* plugins/symbol-browser/an_symbol_iter.h:
* plugins/symbol-browser/an_symbol_prefs.c:
* plugins/symbol-browser/an_symbol_prefs.h:
* plugins/symbol-browser/an_symbol_search.c:
* plugins/symbol-browser/an_symbol_search.h:
* plugins/symbol-browser/an_symbol_view.c:
* plugins/symbol-browser/an_symbol_view.h:
* plugins/symbol-browser/anjuta-symbol-browser-plugin.glade:
* plugins/symbol-browser/anjuta-symbol-browser-plugin.svg:
* plugins/symbol-browser/anjuta-symbol-browser-plugin.ui:
* plugins/symbol-browser/anjuta-symbol-browser.plugin.in:
* plugins/symbol-browser/anjuta-symbol-locals.c:
* plugins/symbol-browser/anjuta-symbol-locals.h:
* plugins/symbol-browser/images/.cvsignore:
* plugins/symbol-browser/images/Makefile.am:
* plugins/symbol-browser/images/README:
* plugins/symbol-browser/plugin.c:
* plugins/symbol-browser/plugin.h:
* plugins/symbol-browser/test-class.cpp:
* plugins/symbol-browser/test-class.h:
* plugins/symbol-browser/test-symbol-browser.c:
* plugins/symbol-db/Makefile.am:
* scripts/Makefile.am:
* scripts/anjuta_import.sh.in:
* tagmanager/.cvsignore:
* tagmanager/Makefile.am:
* tagmanager/acconfig.h:
* tagmanager/args.c:
* tagmanager/args.h:
* tagmanager/asm.c:
* tagmanager/asp.c:
* tagmanager/awk.c:
* tagmanager/beta.c:
* tagmanager/c.c:
* tagmanager/cobol.c:
* tagmanager/ctags.c:
* tagmanager/ctags.h:
* tagmanager/debug.c:
* tagmanager/debug.h:
* tagmanager/eiffel.c:
* tagmanager/entry.c:
* tagmanager/entry.h:
* tagmanager/erlang.c:
* tagmanager/fortran.c:
* tagmanager/general.h:
* tagmanager/get.c:
* tagmanager/get.h:
* tagmanager/html.c:
* tagmanager/include/.cvsignore:
* tagmanager/include/Makefile.am:
* tagmanager/include/tm_file_entry.h:
* tagmanager/include/tm_project.h:
* tagmanager/include/tm_source_file.h:
* tagmanager/include/tm_symbol.h:
* tagmanager/include/tm_tag.h:
* tagmanager/include/tm_tagmanager.h:
* tagmanager/include/tm_work_object.h:
* tagmanager/include/tm_workspace.h:
* tagmanager/jscript.c:
* tagmanager/keyword.c:
* tagmanager/keyword.h:
* tagmanager/lisp.c:
* tagmanager/lregex.c:
* tagmanager/lua.c:
* tagmanager/main.h:
* tagmanager/make.c:
* tagmanager/options.c:
* tagmanager/options.h:
* tagmanager/parse.c:
* tagmanager/parse.h:
* tagmanager/parsers.h:
* tagmanager/pascal.c:
* tagmanager/perl.c:
* tagmanager/php.c:
* tagmanager/python.c:
* tagmanager/read.c:
* tagmanager/read.h:
* tagmanager/readtags.c:
* tagmanager/readtags.h:
* tagmanager/regex.c:
* tagmanager/rexx.c:
* tagmanager/routines.c:
* tagmanager/routines.h:
* tagmanager/ruby.c:
* tagmanager/scheme.c:
* tagmanager/sh.c:
* tagmanager/slang.c:
* tagmanager/sml.c:
* tagmanager/sort.c:
* tagmanager/sort.h:
* tagmanager/sql.c:
* tagmanager/strlist.c:
* tagmanager/strlist.h:
* tagmanager/tcl.c:
* tagmanager/test_tm_buffer.c:
* tagmanager/tm_file_entry.c:
* tagmanager/tm_project.c:
* tagmanager/tm_source_file.c:
* tagmanager/tm_symbol.c:
* tagmanager/tm_tag.c:
* tagmanager/tm_tagmanager.c:
* tagmanager/tm_work_object.c:
* tagmanager/tm_workspace.c:
* tagmanager/verilog.c:
* tagmanager/vim.c:
* tagmanager/vstring.c:
* tagmanager/vstring.h:
* tagmanager/yacc.c:
Removed tagmanager/symbol-browser in favour of the nearly stable symbol-db plugin. Commented
some very old code in scintilla that is probably not used anymore though some portions can be ported
to IAnjutaSymbolManager interface such as highlighting of tags.
Adapted some other plugins that very using tagmanager for strange things (like search).
* plugins/build/build_file.c:
* plugins/build/build_file.h:
* plugins/build/build_project.c:
* plugins/build/build_project.h:
* plugins/build/clean_project.c:
* plugins/build/clean_project.h:
* plugins/build/commands.c:
* plugins/build/commands.h:
* plugins/build/compile.c:
* plugins/build/compile.h:
* plugins/build/compiler_options.c:
* plugins/build/compiler_options.h:
* plugins/build/configurer.c:
* plugins/build/configurer.h:
* plugins/build/executer.c:
* plugins/build/executer.h:
Removed obsolete build plugin. If you really need to have a look check the svn history.
* plugins/gvim/.cvsignore:
* plugins/gvim/Makefile.am:
* plugins/gvim/anjuta-vim.c:
* plugins/gvim/anjuta-vim.h:
* plugins/gvim/anjuta-vim.plugin.in:
* plugins/gvim/gtkvim.c:
* plugins/gvim/gtkvim.h:
* plugins/gvim/plugin.c:
* plugins/gvim/plugin.h:
Removed gvim plugin. It is replaced by the GSoc vim plugin.
2008-12-25 Jens Georg <mail@jensge.org>
Reviewed by: Johannes Schmid <jhs@gnome.org>
* plugins/search/search-replace_backend.c:
* plugins/search/search-replace.c:
remove usage of std i/o (#565492)
2008-12-25 Johannes Schmid <jhs@gnome.org>
* plugins/build-basic-autotools/anjuta-build-basic-autotools-plugin
.ui:
......@@ -2,7 +2,7 @@
@INTLTOOL_DESKTOP_RULE@
SUBDIRS = tagmanager global-tags \
SUBDIRS = \
pixmaps scripts data \
doc libanjuta plugins src manuals mime launcher po
......
......@@ -45,7 +45,7 @@ SUBVERSION_REQUIRED=$SVN_MAJOR.$SVN_MINOR.$SVN_PATCH
GTKSOURCEVIEW_REQUIRED=2.4.0
BINUTILS_REQUIRED=2.15.92
LIBWNCK_REQUIRED=2.12
GDA_REQUIRED=3.99.6
GDA_REQUIRED=3.99.7
dnl LIBGTODO_REQUIRED=0.15
......@@ -352,30 +352,8 @@ else
fi
AM_CONDITIONAL(HAVE_PLUGIN_SCINTILLA, [test x$scintilla = xyes])
dnl Build symbol-db only if we have gda
dnl -------------------------------------------------------------
user_disabled_symboldb=1
AC_ARG_ENABLE(plugin-symbol-db,
AC_HELP_STRING([--enable-plugin-symbol-db],[Enable experimental symbol-db plugin]),
[ if test "$enableval" = "yes"; then
user_disabled_symboldb=0
fi ],
[ user_disabled_symboldb=1 ])
AC_MSG_CHECKING(if symbol-db plugin is disabled)
if test "$user_disabled_symboldb" = 1; then
AC_MSG_RESULT(yes)
symboldb="no"
else
AC_MSG_RESULT(no)
PKG_CHECK_MODULES(PLUGIN_SYMBOL_DB,
[libgda-4.0 >= $GDA_REQUIRED],
[symboldb="yes"],
[symboldb="no"])
fi
AM_CONDITIONAL(HAVE_PLUGIN_SYMBOL_DB, [test x$symboldb = xyes])
PKG_CHECK_MODULES(PLUGIN_SYMBOL_DB,
[libgda-4.0 >= $GDA_REQUIRED])
dnl Valgrind plugin
dnl check for libbfd
......@@ -925,9 +903,6 @@ dnl manuals/ja/anjuta-manual/Makefile
AC_OUTPUT([
Makefile
po/Makefile.in
tagmanager/Makefile
tagmanager/include/Makefile
global-tags/Makefile
libanjuta/Makefile
libanjuta/libanjuta-1.0.pc
libanjuta/anjuta-version.h
......@@ -940,7 +915,6 @@ doc/anjuta.1
doc/anjuta_launcher.1
doc/Makefile
scripts/Makefile
scripts/anjuta_import.sh
launcher/Makefile
plugins/Makefile
plugins/sample1/Makefile
......@@ -969,8 +943,7 @@ plugins/terminal/Makefile
plugins/build-basic-autotools/Makefile
plugins/profiler/Makefile
plugins/project-manager/Makefile
plugins/symbol-browser/Makefile
plugins/symbol-browser/images/Makefile
plugins/symbol-db/images/Makefile
plugins/symbol-db/Makefile
plugins/symbol-db/test/Makefile
plugins/cvs-plugin/Makefile
......@@ -1106,12 +1079,6 @@ if [ test x$scintilla = xyes ]; then
else
echo "Building Scintilla based editor: .......................NO"
fi
if [ test x$symboldb = xyes ]; then
echo "Building new (unstable) Symbol-db plugin: ..............YES"
else
echo "Building new (unstable) Symbol-db plugin: ..............NO"
fi
echo "-------------------------------------------------------------------"
#echo "AM_CFLAGS = $AM_CFLAGS"
#echo "AM_CXXFLAGS = $AM_CXXFLAGS"
......
Makefile.in
Makefile
anjuta-tags
system.tags
create_global_tags.sh
*.lo
*.o
*.bak
## Process this file with automake to produce Makefile.in
## Created by Anjuta - will be overwritten
## If you don't want it to overwrite it,
## Please disable it in the Anjuta project configuration
bindir = $(pkglibdir)
scriptdir = $(anjuta_data_dir)/scripts
script_SCRIPTS = create_global_tags.sh
AM_CPPFLAGS = -I$(top_srcdir)/tagmanager/include $(GLIB_CFLAGS)
bin_PROGRAMS = anjuta-tags
anjuta_tags_SOURCES = tm_global_tags.c
anjuta_tags_LDADD = $(top_builddir)/tagmanager/libanjuta-ctags.la
anjuta_tags_LDFLAGS = $(GLIB_LIBS)
edit = sed \
-e 's,\@bindir\@,$(bindir),g'
create_global_tags.sh: Makefile create_global_tags.sh.in
rm -f create_global_tags.sh
$(edit) $(srcdir)/create_global_tags.sh.in > create_global_tags.sh
chmod +x create_global_tags.sh
EXTRA_DIST = create_global_tags.sh.in
#!/bin/bash
if [ -z $XDG_CACHE_HOME ]
then
XDG_CACHE_HOME="$HOME/.cache"
fi
function anjuta_tags {
FILES=""
BASEDIR=`pwd`
PROGDIR=. # `dirname $0`
CFLAGS=""
ANJUTA_TAGS_BIN="@bindir@/anjuta-tags"
OUTPUT_FILE=$1
shift
if [ -x "$ANJUTA_TAGS_BIN" ]
then
for cflag in $*
do
infile=`echo $cflag | sed 's/^-I//'`
if [ -d "$infile" -a "$infile" != "/usr/include" -a "$infile" != "/usr/local/include" ]
then
FILES="$FILES \"$infile/*.h\" \"$infile/*/*.h\" \"$infile/*/*/*.h\""
elif [ ! -d "$infile" -a -e "$infile" ]
then
FILES="$FILES $infile"
fi
done
else
echo "Can not execute $ANJUTA_TAGS_BIN"
exit 1
fi
CFLAGS="$CFLAGS $*"
export CFLAGS
FILES_COUNT=`echo $FILES | wc -w`
echo "Creating $OUTPUT_FILE"
echo "Number of files to scan: $FILES_COUNT"
echo "Files to scan: $FILES"
if [ $FILES_COUNT -gt 0 ] ; then
rm -f $OUTPUT_FILE
$ANJUTA_TAGS_BIN $OUTPUT_FILE $FILES >"$OUTPUT_FILE.log" 2>&1
# If global tags file could not be generated
if [ ! -e $OUTPUT_FILE ] ; then
echo "WARNING: Could not create tags file $OUTPUT_FILE!" >&2
else
gzip -f $OUTPUT_FILE
fi
fi
}
## FILES="\"/usr/include/*.h\" \"/usr/local/include/*.h\""
FILES=""
BASEDIR=`pwd`
PROGDIR=. # `dirname $0`
CFLAGS=""
echo "Generating System tags..."
mkdir -p "$XDG_CACHE_HOME/anjuta/tags/"
# pkg-config libraries
PKG_CONFIG=`which pkg-config 2>/dev/null`
if ( [ ! -z $PKG_CONFIG ] && [ -x $PKG_CONFIG ] ) ; then
##
## We are scaning .pc files directly because --cflags option
## produces include paths and flags for other packages depended by
## the packages, which we don't like. We only want cflags relevent
## to the packages alone.
##
PKG_DEFAULT_CONFIG_PATH=`echo $PKG_CONFIG | sed -e 's/\/bin\/pkg-config/\/lib\/pkgconfig'/`
PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$PKG_DEFAULT_CONFIG_PATH"
PKG_DEFAULT_CONFIG_PATH=`echo $PKG_CONFIG | sed -e 's/\/bin\/pkg-config/\/lib64\/pkgconfig'/`
PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$PKG_DEFAULT_CONFIG_PATH"
PKG_CONFIG_PATH_PROPER=`echo $PKG_CONFIG_PATH | sed -e 's/\:/ /g'`
pkg_files_count=0
for pkg_path in $PKG_CONFIG_PATH_PROPER; do
for pkg_file in `find "$pkg_path" -name '*.pc' 2>/dev/null`; do
pkg_files_count=`expr $pkg_files_count + 1`
done
done
## This line is important for the progress bar. Don't change it.
echo "Scanning $pkg_files_count packages"
for pkg_path in $PKG_CONFIG_PATH_PROPER; do
for pkg_file in `find "$pkg_path" -name '*.pc' 2>/dev/null`; do
# echo "Scanning package: $pkg_file"
PKG_CFLAGS=`grep -e '^\(\w\+=\|\s*Cflags:\)' "$pkg_file"|sed -e 's/Cflags:\s*"\?\(.*\)"\?\s*/echo "\1"/' -e 's/^\(\w\+\)=\("\([^"]*\)"\|\(.*\)\)/\1="\3\4"/'|sh`
# echo $PKG_CFLAGS
package=`basename "$pkg_file" '.pc'`
# if [ ! -e $BASEDIR/tags/$package.anjutatags.gz ] ; then
echo "Creating tags file: $XDG_CACHE_HOME/anjuta/tags/$package.anjutatags.gz ..."
anjuta_tags "$XDG_CACHE_HOME/anjuta/tags/$package.anjutatags" $PKG_CFLAGS > /dev/null
# fi
done
done
echo "Done"
echo "This is just a timestamp" > $XDG_CACHE_HOME/anjuta/system-tags.cache
fi
#include "stdlib.h"
#include "tm_tagmanager.h"
static char *pre_process = "gcc -E -dD -p";
int main(int argc, char **argv)
{
if (argc > 2)
{
/* Create global taglist */
int status;
char *command;
command = g_strdup_printf("%s %s", pre_process,
NVL(getenv("CFLAGS"), ""));
//printf(">%s<\n", command);
status = tm_workspace_create_global_tags(command,
(const char **) (argv + 2),
argc - 2, argv[1]);
g_free(command);
if (!status)
return 1;
}
else
{
fprintf(stderr, "Usage: %s <Tag File> <File list>\n", argv[0]);
return 1;
}
return 0;
}
......@@ -31,7 +31,6 @@ SUBDIRS = . \
profiler \
language-manager \
symbol-db \
symbol-browser \
git \
sourceview \
run-program \
......
/*
build_file.c
Copyright (C) 2000 Kh. Naba Kumar Singh
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/stat.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <signal.h>
#include <string.h>
#include <gnome.h>
#include "anjuta.h"
#include "launcher.h"
#include "message-manager.h"
#include "compile.h"
#include "build_file.h"
void
build_file ()
{
gchar *dirname, *cmd, *buff;
TextEditor *te;
te = anjuta_get_current_text_editor ();
if (!te)
return;
if (te->full_filename == NULL)
{
anjuta_warning (_("This file has not been saved. Save it first and then build."));
return;
}
if (text_editor_is_saved (te) == FALSE)
{
if (text_editor_save_file (te, TRUE) == FALSE)
return;
}
#if 0 /* Skipping dependency check for file */
if (TRUE)
{
gchar *ext, *filename;
struct stat st1, st2;
gint flg;
filename = g_strdup (te->full_filename);
ext = get_file_extension (filename);
if (ext)
*(--ext) = '\0';
stat (te->full_filename, &st1);
flg = stat (filename, &st2);
if ((flg == 0) && (st2.st_mtime > st1.st_mtime))
{
anjuta_warning (_
("The executable is up-to-date, there is no need to build it again."));
g_free (filename);
return;
}
g_free (filename);
}
#endif
anjuta_set_file_properties (te->full_filename);
cmd =
command_editor_get_command_file (app->command_editor,
COMMAND_BUILD_FILE,
te->filename);
if (cmd == NULL) {
anjuta_warning (_
("No build command has been specified for this type of file."));
return;
}
dirname = extract_directory (te->full_filename);
chdir (dirname);
anjuta_set_execution_dir(dirname);
g_free (dirname);
if (build_execute_command (cmd) == FALSE)
{
g_free (cmd);
return;
}
anjuta_update_app_status (TRUE, _("Build"));
an_message_manager_clear (app->messages, MESSAGE_BUILD);
buff = g_strdup_printf (_("Building file: %s...\n"), te->filename);
an_message_manager_append (app->messages, buff, MESSAGE_BUILD);
an_message_manager_append (app->messages, cmd, MESSAGE_BUILD);
an_message_manager_append (app->messages, "\n", MESSAGE_BUILD);
an_message_manager_show (app->messages, MESSAGE_BUILD);
g_free (cmd);
g_free (buff);
}
/* Launching the command */
static void
on_build_mesg_arrived (AnjutaLauncher *launcher,
AnjutaLauncherOutputType output_type,
const gchar * mesg, gpointer data)
{
an_message_manager_append (app->messages, mesg, MESSAGE_BUILD);
}
static void
on_build_terminated (AnjutaLauncher *launcher,
gint child_pid, gint status, gulong time_taken,
gpointer data)
{
gchar *buff1;
g_signal_handlers_disconnect_by_func (launcher,
G_CALLBACK (on_build_terminated),
data);
buff1 = g_strdup_printf (_("Total time taken: %lu secs\n"), time_taken);
if (status)
{
an_message_manager_append (app->messages,
_("Completed... unsuccessful\n"),
MESSAGE_BUILD);
if (anjuta_preferences_get_int (ANJUTA_PREFERENCES (app->preferences),
DIALOG_ON_BUILD_COMPLETE))
anjuta_warning (_("Completed... unsuccessful"));
}
else
{
an_message_manager_append (app->messages,
_("Completed... successful\n"),
MESSAGE_BUILD);
if (anjuta_preferences_get_int (ANJUTA_PREFERENCES (app->preferences),
DIALOG_ON_BUILD_COMPLETE))
anjuta_status (_("Completed... successful"));
}
an_message_manager_append (app->messages, buff1, MESSAGE_BUILD);
if (anjuta_preferences_get_int (ANJUTA_PREFERENCES (app->preferences),
BEEP_ON_BUILD_COMPLETE))
gdk_beep ();
g_free (buff1);
anjuta_update_app_status (TRUE, NULL);
}
gboolean
build_execute_command (const gchar *command)
{
g_signal_connect (G_OBJECT (app->launcher), "child-exited",
G_CALLBACK (on_build_terminated), NULL);
return anjuta_launcher_execute (app->launcher, command,
on_build_mesg_arrived, NULL);
}
/*
build_file.h
Copyright (C) 2000 Kh. Naba Kumar Singh
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _BUILD_FILE_H_
#define _BUILD_FILE_H_
void build_file(void);
gboolean build_execute_command (const gchar *command);
#endif
/*
build_project.c
Copyright (C) 2000 Kh. Naba Kumar Singh
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/stat.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <signal.h>
#include <string.h>
#include <time.h>
#include <errno.h>
#include <gnome.h>
#include "anjuta.h"
#include "build_file.h"
#include "launcher.h"