File tree Expand file tree Collapse file tree
resources-generator/src/main/kotlin/dev/icerock/gradle/generator Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,7 +37,9 @@ internal class ResourceTypeGenerator<T : ResourceMetadata>(
3737 parentObjectName : String ,
3838 resources : List <ResourceMetadata >,
3939 ): GenerationResult ? {
40- val typeMetadata: List <T > = resources.filterClass(typeClass = metadataClass)
40+ val typeMetadata: List <T > = resources
41+ .filterClass(typeClass = metadataClass)
42+ .sortedBy { it.key }
4143
4244 // if we not have any resources of our type at all - not generate object
4345 if (typeMetadata.isEmpty()) return null
@@ -128,7 +130,9 @@ internal class ResourceTypeGenerator<T : ResourceMetadata>(
128130 parentObjectName : String ,
129131 resources : List <ResourceMetadata >,
130132 ): GenerationResult ? {
131- val typeResources: List <T > = resources.filterClass(metadataClass)
133+ val typeResources: List <T > = resources
134+ .filterClass(typeClass = metadataClass)
135+ .sortedBy { it.key }
132136
133137 // if we not have any resources of our type at all - not generate object
134138 if (typeResources.isEmpty()) return null
You can’t perform that action at this time.
0 commit comments