nitc :: AppProject
app.nit
projectnitc :: AppProject :: _mainmodule
nitc :: AppProject :: _modelbuilder
nitc :: AppProject :: _namespace
Namespace/package used to identify the applicationnitc :: AppProject :: _short_name
Short project name used innamespace
and configuration files
nitc :: AppProject :: _version_code
Numerical version code of the applicationnitc :: AppProject :: defaultinit
nitc :: AppProject :: mainmodule
nitc :: AppProject :: mainmodule=
nitc :: AppProject :: modelbuilder
nitc :: AppProject :: modelbuilder=
nitc :: AppProject :: name=
Pretty name of the resulting applicationnitc :: AppProject :: namespace
Namespace/package used to identify the applicationnitc :: AppProject :: namespace=
Namespace/package used to identify the applicationnitc :: AppProject :: short_name
Short project name used innamespace
and configuration files
nitc :: AppProject :: short_name=
Short project name used innamespace
and configuration files
nitc :: AppProject :: version_code=
Numerical version code of the applicationnitc $ AppProject :: SELF
Type of this instance, automatically specialized in every classnitc $ AppProject :: init
nitc :: AppProject :: _mainmodule
nitc :: AppProject :: _modelbuilder
nitc :: AppProject :: _namespace
Namespace/package used to identify the applicationnitc :: AppProject :: _short_name
Short project name used innamespace
and configuration files
nitc :: AppProject :: _version_code
Numerical version code of the applicationcore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
core :: Object :: defaultinit
nitc :: AppProject :: defaultinit
core :: 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.
nitc :: AppProject :: mainmodule
nitc :: AppProject :: mainmodule=
nitc :: AppProject :: modelbuilder
nitc :: AppProject :: modelbuilder=
nitc :: AppProject :: name=
Pretty name of the resulting applicationnitc :: AppProject :: namespace
Namespace/package used to identify the applicationnitc :: AppProject :: namespace=
Namespace/package used to identify the applicationcore :: 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 :: AppProject :: short_name
Short project name used innamespace
and configuration files
nitc :: AppProject :: short_name=
Short project name used innamespace
and configuration files
nitc :: AppProject :: version_code=
Numerical version code of the application
# Metadata associated to an `app.nit` project
class AppProject
# Pretty name of the resulting application
var name: String = mainmodule.first_real_mmodule.name is lazy
# Short project name used in `namespace` and configuration files
var short_name: String = mainmodule.name.replace("-", "_") is lazy
# Namespace/package used to identify the application
var namespace = "org.nitlanguage.{short_name}" is lazy
# Version of the application
var version = "0.1"
# Numerical version code of the application
var version_code: Int is lazy do
# Get the date and time (down to the minute) as string
var gmtime = new Tm.gmtime
var local_time_s = gmtime.strftime("%y%m%d%H%M")
return local_time_s.to_i
end
# Extra folders where to find platform specific resource files
var files = new Array[String]
private var modelbuilder: ModelBuilder
private var mainmodule: MModule
init
do
var annot = modelbuilder.lookup_annotation_on_modules("app_name", mainmodule)
if annot != null then
var val = annot.arg_as_string(modelbuilder)
if val != null then name = val
end
annot = modelbuilder.lookup_annotation_on_modules("app_version", mainmodule)
if annot != null then version = annot.as_version(modelbuilder)
annot = modelbuilder.lookup_annotation_on_modules("app_namespace", mainmodule)
if annot != null then
var val = annot.arg_as_string(modelbuilder)
if val != null then namespace = val
end
var annots = modelbuilder.collect_annotations_on_modules("app_files", mainmodule)
for a in annots do files.add_all a.as_relative_paths(modelbuilder)
modelbuilder.toolcontext.check_errors
end
redef fun to_s do return """
name: {{{name}}}
namespace: {{{namespace}}}
version: {{{version}}}"""
end
src/platform/app_annotations.nit:24,1--80,3