nitc :: NitPackagePhase :: defaultinit
nitc :: NitPackagePhase :: extract_mpackages
Extract the list of packages from the mmodules passed as argumentsnitc $ NitPackagePhase :: SELF
Type of this instance, automatically specialized in every classnitc $ NitPackagePhase :: process_mainmodule
Specific action to execute on the whole program.nitc :: Phase :: _in_hierarchy
The dependence relation of the phase with the other phasesnitc :: Phase :: _toolcontext
The toolcontext instance attached to the phasecore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
core :: Object :: defaultinit
nitc :: NitPackagePhase :: defaultinit
nitc :: Phase :: defaultinit
nitc :: NitPackagePhase :: extract_mpackages
Extract the list of packages from the mmodules passed as argumentsnitc :: Phase :: in_hierarchy
The dependence relation of the phase with the other phasesnitc :: Phase :: in_hierarchy=
The dependence relation of the phase with the other phasescore :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).nitc :: Phase :: process_annotated_node
Specific actions to execute on annotated nodesnitc :: Phase :: process_mainmodule
Specific action to execute on the whole program.nitc :: Phase :: process_nclassdef
Specific actions to execute on the tree of a class definitionnitc :: Phase :: process_nmodule
Specific actions to execute on the whole tree of a modulenitc :: Phase :: process_nmodule_after
Specific actions to execute on the whole tree of a modulenitc :: Phase :: process_npropdef
Specific actions to execute on the tree of a propertynitc :: Phase :: toolcontext
The toolcontext instance attached to the phasenitc :: Phase :: toolcontext=
The toolcontext instance attached to the phase
private class NitPackagePhase
super Phase
redef fun process_mainmodule(mainmodule, mmodules) do
var mpackages = extract_mpackages(mmodules)
for mpackage in mpackages do
# Fictive and buggy packages are ignored
if not mpackage.has_source then
toolcontext.warning(mpackage.location, "no-source",
"Warning: `{mpackage}` has no source file")
continue
end
# Check package INI files
if toolcontext.opt_check_ini.value then
mpackage.check_ini(toolcontext)
continue
end
# Check package Makefiles
if toolcontext.opt_check_makefile.value then
mpackage.check_makefile(toolcontext, mainmodule)
continue
end
# Check manpages
if toolcontext.opt_check_man.value then
mpackage.check_man(toolcontext, mainmodule)
continue
end
# Check README.md
if toolcontext.opt_check_readme.value then
mpackage.check_readme(toolcontext)
continue
end
# Expand packages
if toolcontext.opt_expand.value and not mpackage.is_expanded then
var path = mpackage.expand
toolcontext.info("{mpackage} moved to {path}", 0)
end
if not mpackage.is_expanded then
toolcontext.warning(mpackage.location, "no-dir",
"Warning: `{mpackage}` has no package directory")
continue
end
# Create INI file
if toolcontext.opt_gen_ini.value then
if not mpackage.has_ini or toolcontext.opt_force.value then
var path = mpackage.gen_ini
toolcontext.info("generated INI file `{path}`", 0)
end
end
# Create Makefile
if toolcontext.opt_gen_makefile.value then
if not mpackage.has_makefile or toolcontext.opt_force.value then
var path = mpackage.gen_makefile(toolcontext.modelbuilder.model, mainmodule)
if path != null then
toolcontext.info("generated Makefile `{path}`", 0)
end
end
end
# Create manpages
if toolcontext.opt_gen_man.value then
mpackage.gen_man(toolcontext, mainmodule)
end
end
end
# Extract the list of packages from the mmodules passed as arguments
fun extract_mpackages(mmodules: Collection[MModule]): Collection[MPackage] do
var mpackages = new ArraySet[MPackage]
for mmodule in mmodules do
var mpackage = mmodule.mpackage
if mpackage == null then continue
mpackages.add mpackage
end
return mpackages.to_a
end
end
src/nitpackage.nit:63,1--147,3