Skip to content

Commit 5983bf0

Browse files
committed
Merge pull request #268 from danielctull-forks/documentation
[NEW] Generate documentation in machine.h files from entity, attribute, relationship, and fetched properties from `documentation` and `discussion` userinfo keys. (Daniel Tull)
2 parents 448e833 + ba69a61 commit 5983bf0

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

templates/machine.h.motemplate

+28
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,27 @@ extern const struct <$managedObjectClassName$>UserInfo {<$foreach UserInfo userI
4545
@interface <$managedObjectClassName$>ID : <$if hasSuperentity$><$customSuperentity$>ID<$else$>NSManagedObjectID<$endif$> {}
4646
@end
4747

48+
<$if userInfo.documentation$>
49+
/**
50+
* <$userInfo.documentation$>
51+
*
52+
* <$userInfo.discussion$>
53+
*/
54+
<$endif$>
4855
@interface _<$managedObjectClassName$> : <$customSuperentity$> {}
4956
+ (id)insertInManagedObjectContext:(NSManagedObjectContext*)moc_;
5057
+ (NSString*)entityName;
5158
+ (NSEntityDescription*)entityInManagedObjectContext:(NSManagedObjectContext*)moc_;
5259
@property (nonatomic, readonly, strong) <$managedObjectClassName$>ID* objectID;
5360

5461
<$foreach Attribute noninheritedAttributes do$>
62+
<$if Attribute.userInfo.documentation$>
63+
/**
64+
* <$Attribute.userInfo.documentation$>
65+
*
66+
* <$Attribute.userInfo.discussion$>
67+
*/
68+
<$endif$>
5569
<$if Attribute.hasDefinedAttributeType$>
5670
<$if TemplateVar.arc$>
5771
<$if Attribute.isReadonly$>
@@ -80,6 +94,13 @@ extern const struct <$managedObjectClassName$>UserInfo {<$foreach UserInfo userI
8094
<$endif$>
8195
<$endforeach do$>
8296
<$foreach Relationship noninheritedRelationships do$>
97+
<$if Relationship.userInfo.documentation$>
98+
/**
99+
* <$Relationship.userInfo.documentation$>
100+
*
101+
* <$Relationship.userInfo.discussion$>
102+
*/
103+
<$endif$>
83104
<$if Relationship.isToMany$>
84105
<$if TemplateVar.arc$>
85106
@property (nonatomic, strong) <$Relationship.immutableCollectionClassName$> *<$Relationship.name$>;
@@ -106,6 +127,13 @@ extern const struct <$managedObjectClassName$>UserInfo {<$foreach UserInfo userI
106127
<$endif$>
107128
<$endforeach do$>
108129
<$foreach FetchedProperty noninheritedFetchedProperties do$>
130+
<$if FetchedProperty.userInfo.documentation$>
131+
/**
132+
* <$FetchedProperty.userInfo.documentation$>
133+
*
134+
* <$FetchedProperty.userInfo.discussion$>
135+
*/
136+
<$endif$>
109137
@property (nonatomic, readonly) NSArray *<$FetchedProperty.name$>;
110138
<$endforeach do$>
111139
<$if TemplateVar.frc$>

0 commit comments

Comments
 (0)