+let publish_development_bstract build clean devel =
+ let matita_flags = "\"-system\"" in
+ HLog.message "cleaning the development before publishing";
+ if clean ~matita_flags:"" devel then
+ begin
+ HLog.message "rebuilding the development in 'system' space";
+ if build ~matita_flags devel then
+ begin
+ HLog.message "publishing succeded";
+ true
+ end
+ else
+ begin
+ HLog.error "building process failed, reverting";
+ if not (clean ~matita_flags devel) then
+ HLog.error "cleaning failed, end of the world (2)";
+ false
+ end
+ end
+ else
+ (HLog.error "unable to clean the development, publishing failed"; false)
+
+let publish_development devel =
+ publish_development_bstract
+ (fun ~matita_flags devel -> build_development ~matita_flags devel)
+ (fun ~matita_flags devel -> clean_development ~matita_flags devel) devel
+let publish_development_in_bg cb devel =
+ publish_development_bstract
+ (fun ~matita_flags devel -> build_development_in_bg cb ~matita_flags devel)
+ (fun ~matita_flags devel -> clean_development_in_bg cb ~matita_flags devel)
+ devel
+