I am a bit confused with new codegen functionality.
While developing, you could lookup all files that exist in projects. But not with codegen.
However, it worked well. But it doesn't fit new framework-oriented programming paradigm.
Scenario: I have completely separate framework Database. It could be embedded in application or could not. It depends. But it is completely separated.
Now I would like to use codegen feature. It describes automagic. It spawns in DerivedData all Core Data headers and it switch core data models development to categories-oriented paradigm ( hello, swift! )
Ok, everything works fine and compile until I want to expose all files with public access. It is obvious that all model files ( nearly all except, for example, hidden entities or abstract entities if necessary ) have public access level.
However, Xcode doesn't find template for codegen files.
It doesn't work, for example, in case of missing Map.modulemap file. Ok.
In this scenario it looks like:
framework module DBDatabaseBeaver {
umbrella header "DBDatabaseBeaver.h"
export *
module * { export * }
}
But if I am right, this modulemap file doesn't lookup in correct Xcode CodeGen CoreData directory ( DerivedData ).
Also, it is hard to know which access level do these codegen headers have.
I have only one setting that could change something: Module setting in codegen.
But if I change it to something different from Global Namespace, it makes tricks with me and codegen file like:
// $(DatabaseModelName).h
#import ".DBDatabaseEntity+CoreDataClass.h"
#import ".DBDatabaseEntity2+CoreDataClass.h"
...
Take a look at this file.
It somehow put dots at the beginning of filename.
It relies on
$(DatabaseModelName)
, not on$(DatabaseModuleName)
.See 2.
ModelName
isxcodemodel filename
.ModuleName
is a framework target module name. It uses first, not second.
Could anybody explain a solution for scenario and add comments/(documentation links?) about all codegen features?
I thought that this scenario could be solved by fixing modulemap file and by adding correct Module name for entities in Model ( codegen setting ).
However, I don't know which paths should I add to modulemap to point to codegen files.