maybe you should mention in NEWS that eio is a new dependency Vincent
On Tue, May 8, 2012 at 12:35 PM, Enlightenment SVN <no-re...@enlightenment.org> wrote: > Log: > edje: add edje_watch. > > edje_watch call edje_cc and monitor all the source file (edc, font > image, sound). If any of them change, it call edje_cc, update its > watching list and so on. edje_watch as the same command line as > edje_cc. > Still a little bit rought, but it's the beginning of an interesting > experiment. > > > Author: cedric > Date: 2012-05-08 03:35:57 -0700 (Tue, 08 May 2012) > New Revision: 70872 > Trac: http://trac.enlightenment.org/e/changeset/70872 > > Added: > trunk/edje/src/bin/edje_watch.c > Modified: > trunk/edje/ChangeLog trunk/edje/NEWS trunk/edje/configure.ac > trunk/edje/src/bin/ trunk/edje/src/bin/Makefile.am > trunk/edje/src/bin/edje_cc.c trunk/edje/src/bin/edje_cc.h > trunk/edje/src/bin/edje_cc_out.c trunk/edje/src/bin/edje_cc_parse.c > trunk/edje/src/bin/epp/cpplib.c trunk/edje/src/bin/epp/cpplib.h > > Modified: trunk/edje/ChangeLog > =================================================================== > --- trunk/edje/ChangeLog 2012-05-08 10:31:12 UTC (rev 70871) > +++ trunk/edje/ChangeLog 2012-05-08 10:35:57 UTC (rev 70872) > @@ -423,3 +423,7 @@ > 2012-05-02 Cedric Bail > > * Doing less allocation and reuse Evas_Map does help. > + > +2012-05-08 Cedric Bail > + > + * Add edje_watch tools to automatically rebuild edc. > > Modified: trunk/edje/NEWS > =================================================================== > --- trunk/edje/NEWS 2012-05-08 10:31:12 UTC (rev 70871) > +++ trunk/edje/NEWS 2012-05-08 10:35:57 UTC (rev 70872) > @@ -3,6 +3,9 @@ > Changes since Edje 1.2.0: > ------------------------- > > +Additions: > + * Add edje_watch to monitore change on edje source. > + > Improvements: > * Allocate once and reuse Evas_Map. > > > Modified: trunk/edje/configure.ac > =================================================================== > --- trunk/edje/configure.ac 2012-05-08 10:31:12 UTC (rev 70871) > +++ trunk/edje/configure.ac 2012-05-08 10:35:57 UTC (rev 70872) > @@ -104,6 +104,7 @@ > EFL_ENABLE_BIN([edje-player]) > EFL_ENABLE_BIN([edje-inspector]) > EFL_ENABLE_BIN([edje-external-inspector]) > +EFL_ENABLE_BIN([edje-watch]) > > # Optional EDJE_PROGRAM_CACHE (use much more ram, but increase speed in some > cases) > want_edje_program_cache="no" > @@ -292,6 +293,18 @@ > ], > [have_ecore_imf="no"]) > > +have_eio="no" > +PKG_CHECK_MODULES([EIO], > + [ > + eio >= 1.0.0 > + ], > + [ > + AC_DEFINE([HAVE_EIO], [1], [Eio is available for monitoring file > assynchronously]) > + have_eio="yes" > + requirement_edje="eio >= 1.0.0 ${requirement_edje}" > + ], > + [have_eio="no"]) > + > # Enable Multisense use > want_multisense="yes" > AC_ARG_ENABLE([multisense], > @@ -467,6 +480,9 @@ > PKG_CHECK_MODULES([EDJE_EXTERNAL_INSPECTOR], [ecore >= 1.2.0 evas >= 1.2.0 > eina >= 1.2.0]) > fi > > +if test "x$have_edje_watch" = "xyes"; then > + PKG_CHECK_MODULES([EDJE_WATCH], [ecore >= 1.2.0 eina >= 1.2.0 eio >= > 1.0.0]) > +fi > > ### Checks for header files > AC_CHECK_HEADERS([locale.h sys/resource.h]) > @@ -614,6 +630,7 @@ > echo " Build edje_player............: $have_edje_player" > echo " Build edje_inspector.........: $have_edje_inspector" > echo " Build edje_external_inspector: $have_edje_external_inspector" > +echo " Build edje_watch.............: $have_edje_watch" > echo > echo "Compilation............: make (or gmake)" > echo " CPPFLAGS.............: $CPPFLAGS" > > > Property changes on: trunk/edje/src/bin > ___________________________________________________________________ > Modified: svn:ignore > - .deps > .libs > Makefile > Makefile.in > edje_cc_parse.c > edje > edje_ls > edje_cc > edje_decc > edje_player > edje_convert > edje_inspector > edje_external_inspector > *.exe > *.gcno > > + .deps > .libs > Makefile > Makefile.in > edje_cc_parse.c > edje > edje_ls > edje_cc > edje_decc > edje_player > edje_convert > edje_inspector > edje_external_inspector > edje_watch > *.exe > *.gcno > > > Modified: trunk/edje/src/bin/Makefile.am > =================================================================== > --- trunk/edje/src/bin/Makefile.am 2012-05-08 10:31:12 UTC (rev 70871) > +++ trunk/edje/src/bin/Makefile.am 2012-05-08 10:35:57 UTC (rev 70872) > @@ -6,9 +6,9 @@ > > bin_SCRIPTS = @EDJE_RECC_PRG@ > > -bin_PROGRAMS = @EDJE_CC_PRG@ @EDJE_DECC_PRG@ @EDJE_PLAYER_PRG@ > @EDJE_INSPECTOR_PRG@ @EDJE_EXTERNAL_INSPECTOR_PRG@ > +bin_PROGRAMS = @EDJE_CC_PRG@ @EDJE_DECC_PRG@ @EDJE_PLAYER_PRG@ > @EDJE_INSPECTOR_PRG@ @EDJE_EXTERNAL_INSPECTOR_PRG@ @EDJE_WATCH_PRG@ > > -EXTRA_PROGRAMS = edje_cc edje_decc edje_player edje_inspector > edje_external_inspector > +EXTRA_PROGRAMS = edje_cc edje_decc edje_player edje_inspector > edje_external_inspector edje_watch > > edje_cc_SOURCES = \ > edje_cc.c \ > @@ -26,11 +26,21 @@ > -DPACKAGE_LIB_DIR=\"$(libdir)\" \ > -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ > -DEPP_DIR=\"$(libdir)/$(PACKAGE)/utils\" \ > -@EDJE_CFLAGS@ @EDJE_CC_CFLAGS@ @EVIL_CFLAGS@ @SNDFILE_CFLAGS@ > +@EDJE_CFLAGS@ @EDJE_CC_CFLAGS@ @EIO_CFLAGS@ @EVIL_CFLAGS@ @SNDFILE_CFLAGS@ > edje_cc_LDADD = $(top_builddir)/src/lib/libedje.la @EDJE_CC_LIBS@ > @EVIL_LIBS@ @VORBISENC_LIBS@ @FLAC_LIBS@ @SNDFILE_LIBS@ -lm > edje_cc_LDFLAGS = @lt_enable_auto_import@ > > +edje_watch_SOURCES = \ > +edje_watch.c > > +edje_watch_CPPFLAGS = \ > +-I$(top_srcdir)/src/bin \ > +-I$(top_srcdir)/src/lib \ > +-DPACKAGE_BIN_DIR=\"$(bindir)\" \ > +@EDJE_CFLAGS@ @EDJE_CC_CFLAGS@ @EIO_CFLAGS@ @EVIL_CFLAGS@ @EDJE_WATCH_CFLAGS@ > +edje_watch_LDADD = $(top_builddir)/src/lib/libedje.la @EDJE_WATCH_LIBS@ > +edje_watch_LDFLAGS = @lt_enable_auto_import@ > + > edje_decc_SOURCES = \ > edje_decc.c \ > edje_decc.h \ > @@ -40,7 +50,7 @@ > edje_decc_CPPFLAGS = \ > -I$(top_srcdir)/src/bin \ > -I$(top_srcdir)/src/lib \ > -@EDJE_CFLAGS@ @EDJE_DECC_CFLAGS@ @EVIL_CFLAGS@ > +@EDJE_CFLAGS@ @EDJE_DECC_CFLAGS@ @EIO_CFLAGS@ @EVIL_CFLAGS@ > edje_decc_LDADD = $(top_builddir)/src/lib/libedje.la @EDJE_DECC_LIBS@ > @VORBISENC_LIBS@ @FLAC_LIBS@ @SNDFILE_LIBS@ > edje_decc_LDFLAGS = @lt_enable_auto_import@ > > @@ -48,7 +58,7 @@ > edje_player_CPPFLAGS = \ > -I$(top_srcdir)/src/bin \ > -I$(top_srcdir)/src/lib \ > -@EDJE_PLAYER_CFLAGS@ @EVIL_CFLAGS@ > +@EDJE_PLAYER_CFLAGS@ @EVIL_CFLAGS@ @EIO_CFLAGS@ > edje_player_LDADD = $(top_builddir)/src/lib/libedje.la @EDJE_PLAYER_LIBS@ > @EVIL_LIBS@ @VORBISENC_LIBS@ @FLAC_LIBS@ @SNDFILE_LIBS@ > edje_player_LDFLAGS = @lt_enable_auto_import@ > > @@ -56,7 +66,7 @@ > edje_inspector_CPPFLAGS = \ > -I$(top_srcdir)/src/bin \ > -I$(top_srcdir)/src/lib \ > -@EDJE_INSPECTOR_CFLAGS@ > +@EDJE_INSPECTOR_CFLAGS@ @EIO_CFLAGS@ > edje_inspector_LDADD = $(top_builddir)/src/lib/libedje.la > @EDJE_INSPECTOR_LIBS@ @VORBISENC_LIBS@ @FLAC_LIBS@ > edje_inspector_LDFLAGS = @lt_enable_auto_import@ > > @@ -64,7 +74,7 @@ > edje_external_inspector_CPPFLAGS = \ > -I$(top_srcdir)/src/bin \ > -I$(top_srcdir)/src/lib \ > -@EDJE_EXTERNAL_INSPECTOR_CFLAGS@ > +@EDJE_EXTERNAL_INSPECTOR_CFLAGS@ @EIO_CFLAGS@ > edje_external_inspector_LDADD = $(top_builddir)/src/lib/libedje.la > @EDJE_EXTERNAL_INSPECTOR_LIBS@ @VORBISENC_LIBS@ @FLAC_LIBS@ @SNDFILE_LIBS@ > edje_external_inspector_LDFLAGS = @lt_enable_auto_import@ > > > Modified: trunk/edje/src/bin/edje_cc.c > =================================================================== > --- trunk/edje/src/bin/edje_cc.c 2012-05-08 10:31:12 UTC (rev 70871) > +++ trunk/edje/src/bin/edje_cc.c 2012-05-08 10:35:57 UTC (rev 70872) > @@ -20,6 +20,7 @@ > char *tmp_dir = NULL; > char *file_out = NULL; > char *progname = NULL; > +char *watchfile = NULL; > int verbose = 0; > > int no_lossy = 0; > @@ -38,6 +39,7 @@ > "\n" > "Where OPTIONS is one or more of:\n" > "\n" > + "-w files.txt Dump all sources files path into files.txt\n" > "-id image/directory Add a directory to look in for relative path > images\n" > "-fd font/directory Add a directory to look in for relative path > fonts\n" > "-sd sound/directory Add a directory to look in for relative path > sounds samples\n" > @@ -151,6 +153,12 @@ > i++; > file_out = argv[i]; > } > + else if ((!strcmp(argv[i], "-w")) && (i < (argc - 1))) > + { > + i++; > + watchfile = argv[i]; > + unlink(watchfile); > + } > else if (!file_in) > file_in = argv[i]; > else if (!file_out) > > Modified: trunk/edje/src/bin/edje_cc.h > =================================================================== > --- trunk/edje/src/bin/edje_cc.h 2012-05-08 10:31:12 UTC (rev 70871) > +++ trunk/edje/src/bin/edje_cc.h 2012-05-08 10:35:57 UTC (rev 70872) > @@ -194,6 +194,8 @@ > char *mem_strdup(const char *s); > #define SZ sizeof > > +void using_file(const char *filename); > + > void error_and_abort(Eet_File *ef, const char *fmt, ...); > > /* global vars */ > @@ -205,6 +207,7 @@ > extern char *tmp_dir; > extern char *file_out; > extern char *progname; > +extern char *watchfile; > extern int verbose; > extern int no_lossy; > extern int no_comp; > > Modified: trunk/edje/src/bin/edje_cc_out.c > =================================================================== > --- trunk/edje/src/bin/edje_cc_out.c 2012-05-08 10:31:12 UTC (rev 70871) > +++ trunk/edje/src/bin/edje_cc_out.c 2012-05-08 10:35:57 UTC (rev 70872) > @@ -323,6 +323,7 @@ > { > long pos; > > + using_file(fn->file); > fseek(f, 0, SEEK_END); > pos = ftell(f); > rewind(f); > @@ -350,6 +351,7 @@ > { > long pos; > > + using_file(buf); > fseek(f, 0, SEEK_END); > pos = ftell(f); > rewind(f); > @@ -533,7 +535,10 @@ > evas_object_image_file_set(im, buf, NULL); > load_err = evas_object_image_load_error_get(im); > if (load_err == EVAS_LOAD_ERROR_NONE) > - break; > + { > + using_file(buf); > + break; > + } > evas_object_del(im); > im = NULL; > if (load_err != EVAS_LOAD_ERROR_DOES_NOT_EXIST) > @@ -552,6 +557,7 @@ > evas_object_del(im); > im = NULL; > } > + if (im) using_file(img->entry); > } > } > if (im) > @@ -716,8 +722,10 @@ > stat(enc_info->file, &st); > size = st.st_size; > fp = fopen(enc_info->file, "rb"); > + if (fp) using_file(enc_info->file); > #else > fp = fopen(snd_path, "rb"); > + if (fp) using_file(snd_path); > #endif > if (!fp) > { > @@ -2167,3 +2175,15 @@ > strncpy(cl->ptr, buf, n); > } > } > + > +void > +using_file(const char *filename) > +{ > + FILE *f; > + > + f = fopen(watchfile, "a"); > + if (!f) return ; > + fputs(filename, f); > + fputc('\n', f); > + fclose(f); > +} > > Modified: trunk/edje/src/bin/edje_cc_parse.c > =================================================================== > --- trunk/edje/src/bin/edje_cc_parse.c 2012-05-08 10:31:12 UTC (rev 70871) > +++ trunk/edje/src/bin/edje_cc_parse.c 2012-05-08 10:35:57 UTC (rev 70872) > @@ -739,8 +739,8 @@ > eina_prefix_lib_get(pfx)); > if (ecore_file_exists(buf2)) > { > - snprintf(buf, sizeof(buf), "%s %s -I%s %s -o %s", > - buf2, file_in, inc, def, tmpn); > + snprintf(buf, sizeof(buf), "%s -a %s %s -I%s %s -o %s", > + buf2, watchfile ? watchfile : "/dev/null", file_in, > inc, def, tmpn); > ret = system(buf); > } > else > > Modified: trunk/edje/src/bin/epp/cpplib.c > =================================================================== > --- trunk/edje/src/bin/epp/cpplib.c 2012-05-08 10:31:12 UTC (rev 70871) > +++ trunk/edje/src/bin/epp/cpplib.c 2012-05-08 10:35:57 UTC (rev 70872) > @@ -5489,6 +5489,7 @@ > && !strncmp(searchptr->fname, filename, p - filename)) > { > /* FILENAME is in SEARCHPTR, which we've already checked. */ > + using_file(filename); > return open(filename, O_RDONLY | O_BINARY, 0666); > } > if (p == filename) > @@ -5508,8 +5509,12 @@ > } > for (map = read_name_map(pfile, dir); map; map = map->map_next) > if (!strcmp(map->map_from, from)) > - return open(map->map_to, O_RDONLY | O_BINARY, 0666); > + { > + using_file(map->map_to); > + return open(map->map_to, O_RDONLY | O_BINARY, 0666); > + } > > + using_file(filename); > return open(filename, O_RDONLY | O_BINARY, 0666); > } > > @@ -5519,6 +5524,7 @@ > open_include_file(cpp_reader * pfile __UNUSED__, char *filename, > file_name_list * searchptr __UNUSED__) > { > + using_file(filename); > return open(filename, O_RDONLY | O_BINARY, 0666); > } > > @@ -6561,6 +6567,20 @@ > i++, push_pending(pfile, "-D", argv[i]); > break; > > + case 'a': > + { > + if (!strcmp(argv[i], "-a")) > + { > + if (i + 1 == argc) > + cpp_fatal("Filename missing after `-a` option"); > + else if (strcmp(argv[++i], "/dev/null")) > + { > + opts->watchfile = argv[i]; > + } > + } > + break; > + } > + > case 'A': > { > char *p = NULL; > @@ -7425,3 +7445,17 @@ > * > * Support for_lint flag. > */ > + > +extern cpp_options options; > + > +void > +using_file(const char *filename) > +{ > + FILE *f; > + > + f = fopen(options.watchfile, "a"); > + if (!f) return ; > + fputs(filename, f); > + fputc('\n', f); > + fclose(f); > +} > > Modified: trunk/edje/src/bin/epp/cpplib.h > =================================================================== > --- trunk/edje/src/bin/epp/cpplib.h 2012-05-08 10:31:12 UTC (rev 70871) > +++ trunk/edje/src/bin/epp/cpplib.h 2012-05-08 10:35:57 UTC (rev 70872) > @@ -473,6 +473,9 @@ > > /* Target-name to write with the dependency information. */ > char *deps_target; > + > + /* Target file to write all include file */ > + const char *watchfile; > }; > > #define CPP_TRADITIONAL(PFILE) (CPP_OPTIONS(PFILE)-> traditional) > @@ -636,6 +639,8 @@ > void *xrealloc(void *old, unsigned size); > void *xcalloc(unsigned number, unsigned size); > > +void using_file(const char *filename); > + > #ifdef __EMX__ > #define PATH_SEPARATOR ';' > #endif > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > enlightenment-svn mailing list > enlightenment-...@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-svn ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel