nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge: Fix qualified imports
[nit.git]
/
src
/
loader.nit
diff --git
a/src/loader.nit
b/src/loader.nit
index
07ae180
..
6d7bbe7
100644
(file)
--- a/
src/loader.nit
+++ b/
src/loader.nit
@@
-367,6
+367,13
@@
redef class ModelBuilder
mgroup.filepath = path
mproject.root = mgroup
toolcontext.info("found singleton project `{pn}` at {path}", 2)
mgroup.filepath = path
mproject.root = mgroup
toolcontext.info("found singleton project `{pn}` at {path}", 2)
+
+ # Attach homonymous `ini` file to the project
+ var inipath = path.dirname / "{pn}.ini"
+ if inipath.file_exists then
+ var ini = new ConfigTree(inipath)
+ mproject.ini = ini
+ end
end
var res = new ModulePath(pn, path, mgroup)
end
var res = new ModulePath(pn, path, mgroup)
@@
-453,7
+460,8
@@
redef class ModelBuilder
var mgroup
if parent == null then
# no parent, thus new project
var mgroup
if parent == null then
# no parent, thus new project
- if ini != null and ini.has_key("name") then pn = ini["name"]
+ var namekey = "project.name"
+ if ini != null and ini.has_key(namekey) then pn = ini[namekey]
var mproject = new MProject(pn, model)
mgroup = new MGroup(pn, mproject, null) # same name for the root group
mproject.root = mgroup
var mproject = new MProject(pn, model)
mgroup = new MGroup(pn, mproject, null) # same name for the root group
mproject.root = mgroup
@@
-833,7
+841,7
@@
redef class ModelBuilder
mmodule.set_visibility_for(sup, mvisibility)
end
if stdimport then
mmodule.set_visibility_for(sup, mvisibility)
end
if stdimport then
- var mod_name = "standard"
+ var mod_name = "core"
var sup = self.get_mmodule_by_name(nmodule, null, mod_name)
if sup == null then
nmodule.mmodule = null # invalidate the module
var sup = self.get_mmodule_by_name(nmodule, null, mod_name)
if sup == null then
nmodule.mmodule = null # invalidate the module
@@
-892,9
+900,9
@@
redef class ModelBuilder
self.toolcontext.info("{mmodule} imports {mmodule.in_importation.direct_greaters.join(", ")}", 3)
self.toolcontext.info("{mmodule} imports {mmodule.in_importation.direct_greaters.join(", ")}", 3)
- # Force standard to be public if imported
+ # Force `core` to be public if imported
for sup in mmodule.in_importation.greaters do
for sup in mmodule.in_importation.greaters do
- if sup.name == "standard" then
+ if sup.name == "core" then
mmodule.set_visibility_for(sup, public_visibility)
end
end
mmodule.set_visibility_for(sup, public_visibility)
end
end