diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-09-05 11:12:52 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-09-05 11:45:41 +0100 |
commit | 3d84ca76fec491015030daa53e9122b03032ddfd (patch) | |
tree | 322bb535f9745fc0efced977402be4db9469d835 /generator/main.ml | |
parent | 169ac913e9930f7e4a27f395e6c06901f7c849c3 (diff) | |
download | libguestfs-3d84ca76fec491015030daa53e9122b03032ddfd.tar.gz libguestfs-3d84ca76fec491015030daa53e9122b03032ddfd.tar.xz libguestfs-3d84ca76fec491015030daa53e9122b03032ddfd.zip |
generator: Remove generated and unused files from previous runs of the generator.
If you go back in time in git (eg. git reset, git bisect) then you can
end up in a situation where a file that was generated by a later
version is left around unused in the earlier version.
This isn't a problem for most things, but gobject documentation
generation picks up any file in a directory, even unreferenced ones,
and breaks. So the correct thing to do is to remove these files.
Diffstat (limited to 'generator/main.ml')
-rw-r--r-- | generator/main.ml | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/generator/main.ml b/generator/main.ml index 74419f10..4cb3c7c0 100644 --- a/generator/main.ml +++ b/generator/main.ml @@ -126,8 +126,11 @@ Run it from the top source directory using the command fun (typ, jtyp) -> let cols = cols_of_struct typ in let filename = sprintf "java/com/redhat/et/libguestfs/%s.java" jtyp in - output_to filename (generate_java_struct jtyp cols); + output_to filename (generate_java_struct jtyp cols) ) camel_structs; + delete_except_generated + ~skip:["java/com/redhat/et/libguestfs/LibGuestFSException.java"] + "java/com/redhat/et/libguestfs/*.java"; output_to "java/Makefile.inc" generate_java_makefile_inc; output_to "java/com_redhat_et_libguestfs_GuestFS.c" generate_java_c; @@ -156,6 +159,8 @@ Run it from the top source directory using the command let filename = sprintf "gobject/src/%s.c" short in output_to filename (generate_gobject_struct_source short typ cols) ) structs; + delete_except_generated "gobject/include/guestfs-gobject/struct-*.h"; + delete_except_generated "gobject/src/struct-*.c"; List.iter ( function @@ -170,6 +175,8 @@ Run it from the top source directory using the command (generate_gobject_optargs_source short name optargs f) | { style = _, _, [] } -> () ) all_functions; + delete_except_generated "gobject/include/guestfs-gobject/optargs-*.h"; + delete_except_generated "gobject/src/optargs-*.c"; output_to "gobject/include/guestfs-gobject/tristate.h" generate_gobject_tristate_header; |