[anjuta] am-project: Include project files as sources in the project tree
- From: Sebastien Granjoux <sgranjoux src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta] am-project: Include project files as sources in the project tree
- Date: Sat, 31 Mar 2012 20:54:35 +0000 (UTC)
commit 3e760752415d1d99906b4d35ba0110e52a864941
Author: SÃbastien Granjoux <seb sfo free fr>
Date: Sat Mar 24 16:58:02 2012 +0100
am-project: Include project files as sources in the project tree
libanjuta/anjuta-project.h | 1 +
plugins/am-project/ac-scanner.l | 4 ++++
plugins/am-project/am-project.c | 3 +++
plugins/am-project/am-scanner.l | 4 ++++
plugins/am-project/amp-group.c | 3 +++
5 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/libanjuta/anjuta-project.h b/libanjuta/anjuta-project.h
index 0db71dd..072a45d 100644
--- a/libanjuta/anjuta-project.h
+++ b/libanjuta/anjuta-project.h
@@ -116,6 +116,7 @@ typedef enum
ANJUTA_PROJECT_PRIMARY = 1 << 18,
ANJUTA_PROJECT_EXECUTABLE = 1 << 19,
ANJUTA_PROJECT_READ_ONLY = 1 << 20, /* Node cannot be created by the backend */
+ ANJUTA_PROJECT_FRAME= 1 << 21, /* Project configuration file */
ANJUTA_PROJECT_ID_MASK = 0xFFFF << 0,
ANJUTA_PROJECT_FLAG_MASK = 0xFF << 16,
ANJUTA_PROJECT_TYPE_MASK = 0xFF << 24,
diff --git a/plugins/am-project/ac-scanner.l b/plugins/am-project/ac-scanner.l
index 9347f25..7a9e3f7 100644
--- a/plugins/am-project/ac-scanner.l
+++ b/plugins/am-project/ac-scanner.l
@@ -21,6 +21,7 @@
#include "ac-scanner.h"
#include "ac-parser.h"
+#include "amp-source.h"
#include "libanjuta/anjuta-debug.h"
#include "libanjuta/anjuta-token-stream.h"
@@ -313,6 +314,7 @@ amp_ac_scanner_include (AmpAcScanner *scanner, AnjutaToken *list)
AnjutaToken *token;
AnjutaToken *name;
gchar *filename;
+ AnjutaProjectNode *source;
name = anjuta_token_first_item (list); /* m4_include macro */
name = anjuta_token_next_item (name); /* arguments list */
@@ -321,6 +323,8 @@ amp_ac_scanner_include (AmpAcScanner *scanner, AnjutaToken *list)
//g_message ("read include =%s=", filename);
file = g_file_resolve_relative_path (anjuta_token_stream_get_current_directory (scanner->stream), filename);
g_free (filename);
+ source = amp_source_node_new (file, ANJUTA_PROJECT_PROJECT | ANJUTA_PROJECT_FRAME | ANJUTA_PROJECT_READ_ONLY);
+ anjuta_project_node_append (ANJUTA_PROJECT_NODE (scanner->project), source);
include = anjuta_token_file_new (file);
token = anjuta_token_file_load (include, NULL);
amp_ac_scanner_parse_token (scanner, list, token, 0, file, NULL);
diff --git a/plugins/am-project/am-project.c b/plugins/am-project/am-project.c
index 3231611..4489dd2 100644
--- a/plugins/am-project/am-project.c
+++ b/plugins/am-project/am-project.c
@@ -1667,6 +1667,7 @@ amp_project_load_root (AmpProject *project, GError **error)
GFile *root_file;
GFile *configure_file;
AnjutaTokenFile *configure_token_file;
+ AnjutaProjectNode *source;
GError *err = NULL;
root_file = anjuta_project_node_get_file (ANJUTA_PROJECT_NODE (project));
@@ -1701,6 +1702,8 @@ amp_project_load_root (AmpProject *project, GError **error)
/* Parse configure */
configure_token_file = amp_project_set_configure (project, configure_file);
amp_project_add_file (project, configure_file, configure_token_file);
+ source = amp_source_node_new (configure_file, ANJUTA_PROJECT_PROJECT | ANJUTA_PROJECT_FRAME | ANJUTA_PROJECT_READ_ONLY);
+ anjuta_project_node_append (ANJUTA_PROJECT_NODE (project), source);
arg = anjuta_token_file_load (configure_token_file, NULL);
g_hash_table_remove_all (project->ac_variables);
scanner = amp_ac_scanner_new (project);
diff --git a/plugins/am-project/am-scanner.l b/plugins/am-project/am-scanner.l
index d285cc1..bcc77f5 100644
--- a/plugins/am-project/am-scanner.l
+++ b/plugins/am-project/am-scanner.l
@@ -24,6 +24,7 @@
#include "am-parser.h"
#include "amp-node.h"
#include "amp-target.h"
+#include "amp-source.h"
#include "libanjuta/anjuta-debug.h"
#include "libanjuta/anjuta-token-stream.h"
@@ -462,6 +463,7 @@ amp_am_scanner_include (AmpAmScanner *scanner, AnjutaToken *list)
AnjutaToken *token;
AnjutaToken *name;
gchar *filename;
+ AnjutaProjectNode *source;
name = anjuta_token_first_item (list);
name = anjuta_token_next_item (name);
@@ -469,6 +471,8 @@ amp_am_scanner_include (AmpAmScanner *scanner, AnjutaToken *list)
//g_message ("read include =%s=", filename);
file = g_file_resolve_relative_path (anjuta_token_stream_get_current_directory (scanner->stream), filename);
g_free (filename);
+ source = amp_source_node_new (file, ANJUTA_PROJECT_PROJECT | ANJUTA_PROJECT_FRAME | ANJUTA_PROJECT_READ_ONLY);
+ anjuta_project_node_append (ANJUTA_PROJECT_NODE (scanner->group), source);
include = anjuta_token_file_new (file);
token = anjuta_token_file_load (include, NULL);
amp_am_scanner_parse_token (scanner, list, token, file, NULL);
diff --git a/plugins/am-project/amp-group.c b/plugins/am-project/amp-group.c
index 2c194dc..fe8ea53 100644
--- a/plugins/am-project/amp-group.c
+++ b/plugins/am-project/amp-group.c
@@ -349,9 +349,12 @@ amp_group_node_set_makefile (AmpGroupNode *group, GFile *makefile, AmpProject *p
{
AnjutaToken *token;
AmpAmScanner *scanner;
+ AnjutaProjectNode *source;
group->makefile = g_object_ref (makefile);
group->tfile = anjuta_token_file_new (makefile);
+ source = amp_source_node_new (makefile, ANJUTA_PROJECT_PROJECT | ANJUTA_PROJECT_FRAME | ANJUTA_PROJECT_READ_ONLY);
+ anjuta_project_node_append (ANJUTA_PROJECT_NODE (group), source);
token = anjuta_token_file_load (group->tfile, NULL);
amp_project_add_file (project, makefile, group->tfile);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]