yk_command 0.6.2 → 0.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. checksums.yaml +4 -4
  2. data/.DS_Store +0 -0
  3. data/.idea/inspectionProfiles/Project_Default.xml +6 -0
  4. data/.idea/sonarlint/issuestore/index.pb +39 -33
  5. data/.idea/vcs.xml +2 -0
  6. data/.idea/yk_command.iml +58 -65
  7. data/.ruby-version +1 -1
  8. data/Gemfile +6 -3
  9. data/Gemfile.lock +11 -26
  10. data/debugProject/.DS_Store +0 -0
  11. data/lib/.DS_Store +0 -0
  12. data/lib/yk_command/.DS_Store +0 -0
  13. data/lib/yk_command/commands.rb +38 -20
  14. data/lib/yk_command/config/yk_config.rb +6 -7
  15. data/lib/yk_command/module/.DS_Store +0 -0
  16. data/lib/yk_command/module/module_handler.rb +48 -69
  17. data/lib/yk_command/module/template/.DS_Store +0 -0
  18. data/lib/yk_command/module/template/objc/.DS_Store +0 -0
  19. data/{.idea/sonarlint/issuestore/2/2/2264693887a1513e6c4ed16a6231e00d3045ec4e → lib/yk_command/module/template/objc/BusinessHeader.h} +0 -0
  20. data/lib/yk_command/module/template/objc/CategoryHeader.h +0 -2
  21. data/lib/yk_command/module/template/objc/Helper.h +16 -0
  22. data/lib/yk_command/module/template/objc/Helper.m +41 -0
  23. data/lib/yk_command/module/template/objc/RouterRegister.m +8 -15
  24. data/lib/yk_command/module/template/objc/ServiceRegister.m +4 -8
  25. data/lib/yk_command/module/template/swift/.DS_Store +0 -0
  26. data/lib/yk_command/module/template/swift/PrefixHeader_swift.swift +10 -0
  27. data/lib/yk_command/module/template/swift/RouterRegisterSwift.swift +23 -0
  28. data/lib/yk_command/module/template/swift/ServiceRegisterSwift.swift +20 -0
  29. data/lib/yk_command/module/template/swift/Tool.swift +53 -0
  30. data/lib/yk_command/module/yk_module.rb +2 -2
  31. data/lib/yk_command/project/.DS_Store +0 -0
  32. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/.gitignore +0 -0
  33. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/.travis.yml +0 -0
  34. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/CODE_OF_CONDUCT.md +0 -0
  35. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/LICENSE +0 -0
  36. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/NAME-osx.podspec +0 -0
  37. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/NAME.podspec +15 -15
  38. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/POD_LICENSE +0 -0
  39. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/POD_README.md +0 -0
  40. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/Pod/Assets/.gitkeep +0 -0
  41. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/Pod/Classes/.gitkeep +0 -0
  42. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/README.md +0 -0
  43. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/configure +0 -0
  44. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/ios/Example/PROJECT/Base.lproj/LaunchScreen.storyboard +0 -0
  45. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/ios/Example/PROJECT/Base.lproj/Main.storyboard +0 -0
  46. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/ios/Example/PROJECT/CPDAppDelegate.h +0 -0
  47. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/ios/Example/PROJECT/CPDAppDelegate.m +0 -0
  48. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/ios/Example/PROJECT/CPDViewController.h +0 -0
  49. data/lib/yk_command/project/full_component_demo_template/templates/ios/Example/PROJECT/CPDViewController.m +47 -0
  50. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/ios/Example/PROJECT/Images.xcassets/AppIcon.appiconset/Contents.json +0 -0
  51. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/ios/Example/PROJECT/PROJECT-Info.plist +0 -0
  52. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/ios/Example/PROJECT/PROJECT-Prefix.pch +0 -0
  53. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/ios/Example/PROJECT/en.lproj/InfoPlist.strings +0 -0
  54. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/ios/Example/PROJECT/main.m +0 -0
  55. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/ios/Example/PROJECT.xcodeproj/project.pbxproj +0 -0
  56. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/ios/Example/PROJECT.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
  57. data/lib/yk_command/project/full_component_demo_template/templates/ios/Example/PROJECT.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  58. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/ios/Example/PROJECT.xcodeproj/xcshareddata/xcschemes/PROJECT.xcscheme +0 -0
  59. data/lib/yk_command/project/full_component_demo_template/templates/ios/Example/Podfile +34 -0
  60. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/ios/Example/Tests/Tests-Info.plist +0 -0
  61. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/ios/Example/Tests/Tests-Prefix.pch +0 -0
  62. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/ios/Example/Tests/Tests.m +0 -0
  63. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/ios/Example/Tests/en.lproj/InfoPlist.strings +0 -0
  64. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/macos-swift/Example/PROJECT/AppDelegate.swift +0 -0
  65. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/macos-swift/Example/PROJECT/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -0
  66. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/macos-swift/Example/PROJECT/Base.lproj/Main.storyboard +0 -0
  67. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/macos-swift/Example/PROJECT/Info.plist +0 -0
  68. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/macos-swift/Example/PROJECT/PROJECT.entitlements +0 -0
  69. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/macos-swift/Example/PROJECT/ViewController.swift +0 -0
  70. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/macos-swift/Example/PROJECT.xcodeproj/project.pbxproj +0 -0
  71. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/macos-swift/Example/PROJECT.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
  72. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/macos-swift/Example/PROJECT.xcodeproj/xcshareddata/xcschemes/PROJECT.xcscheme +0 -0
  73. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/macos-swift/Example/Podfile +0 -0
  74. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/macos-swift/Example/Tests/Info.plist +0 -0
  75. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/macos-swift/Example/Tests/Tests.swift +0 -0
  76. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/swift/Example/PROJECT/AppDelegate.swift +0 -0
  77. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/swift/Example/PROJECT/Base.lproj/LaunchScreen.xib +0 -0
  78. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/swift/Example/PROJECT/Base.lproj/Main.storyboard +0 -0
  79. data/lib/yk_command/project/full_component_demo_template/templates/swift/Example/PROJECT/Example-Bridging-Header.h +4 -0
  80. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/swift/Example/PROJECT/Images.xcassets/AppIcon.appiconset/Contents.json +0 -0
  81. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/swift/Example/PROJECT/Info.plist +0 -0
  82. data/lib/yk_command/project/full_component_demo_template/templates/swift/Example/PROJECT/STTestAppDelegate.swift +16 -0
  83. data/lib/yk_command/project/full_component_demo_template/templates/swift/Example/PROJECT/Tests-Bridging-Header.h +4 -0
  84. data/lib/yk_command/project/full_component_demo_template/templates/swift/Example/PROJECT/ViewController.swift +51 -0
  85. data/lib/yk_command/project/full_component_demo_template/templates/swift/Example/PROJECT/YKEmptyOcFile.m +9 -0
  86. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/swift/Example/PROJECT.xcodeproj/project.pbxproj +41 -20
  87. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/swift/Example/PROJECT.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
  88. data/lib/yk_command/project/full_component_demo_template/templates/swift/Example/PROJECT.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  89. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/swift/Example/PROJECT.xcodeproj/xcshareddata/xcschemes/PROJECT.xcscheme +0 -0
  90. data/lib/yk_command/project/full_component_demo_template/templates/swift/Example/Podfile +35 -0
  91. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/swift/Example/Tests/Info.plist +0 -0
  92. data/lib/yk_command/project/{YKProjectTemplate → full_component_demo_template}/templates/swift/Example/Tests/Tests.swift +0 -0
  93. data/lib/yk_command/project/setup/ConfigureMacOSSwift.rb +1 -1
  94. data/lib/yk_command/project/setup/ConfigureiOS.rb +1 -2
  95. data/lib/yk_command/project/setup/TemplateConfigurator.rb +4 -4
  96. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/.gitignore +0 -0
  97. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/.travis.yml +0 -0
  98. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/CODE_OF_CONDUCT.md +0 -0
  99. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/LICENSE +0 -0
  100. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/NAME-osx.podspec +0 -0
  101. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/NAME.podspec +1 -1
  102. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/POD_LICENSE +0 -0
  103. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/POD_README.md +0 -0
  104. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/Pod/Assets/.gitkeep +0 -0
  105. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/Pod/Classes/.gitkeep +0 -0
  106. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/README.md +0 -0
  107. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/configure +0 -0
  108. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/ios/Example/PROJECT/Base.lproj/LaunchScreen.storyboard +0 -0
  109. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/ios/Example/PROJECT/Base.lproj/Main.storyboard +0 -0
  110. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/ios/Example/PROJECT/CPDAppDelegate.h +0 -0
  111. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/ios/Example/PROJECT/CPDAppDelegate.m +0 -0
  112. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/ios/Example/PROJECT/CPDViewController.h +0 -0
  113. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/ios/Example/PROJECT/CPDViewController.m +0 -0
  114. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/ios/Example/PROJECT/Images.xcassets/AppIcon.appiconset/Contents.json +0 -0
  115. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/ios/Example/PROJECT/PROJECT-Info.plist +0 -0
  116. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/ios/Example/PROJECT/PROJECT-Prefix.pch +0 -0
  117. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/ios/Example/PROJECT/en.lproj/InfoPlist.strings +0 -0
  118. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/ios/Example/PROJECT/main.m +0 -0
  119. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/ios/Example/PROJECT.xcodeproj/project.pbxproj +0 -0
  120. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/ios/Example/PROJECT.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
  121. data/lib/yk_command/project/simple_component_demo_template/templates/ios/Example/PROJECT.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  122. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/ios/Example/PROJECT.xcodeproj/xcshareddata/xcschemes/PROJECT.xcscheme +0 -0
  123. data/lib/yk_command/project/{YKProjectTemplate → simple_component_demo_template}/templates/ios/Example/Podfile +0 -0
  124. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/ios/Example/Tests/Tests-Info.plist +0 -0
  125. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/ios/Example/Tests/Tests-Prefix.pch +0 -0
  126. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/ios/Example/Tests/Tests.m +0 -0
  127. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/ios/Example/Tests/en.lproj/InfoPlist.strings +0 -0
  128. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/macos-swift/Example/PROJECT/AppDelegate.swift +0 -0
  129. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/macos-swift/Example/PROJECT/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -0
  130. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/macos-swift/Example/PROJECT/Base.lproj/Main.storyboard +0 -0
  131. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/macos-swift/Example/PROJECT/Info.plist +0 -0
  132. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/macos-swift/Example/PROJECT/PROJECT.entitlements +0 -0
  133. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/macos-swift/Example/PROJECT/ViewController.swift +0 -0
  134. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/macos-swift/Example/PROJECT.xcodeproj/project.pbxproj +0 -0
  135. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/macos-swift/Example/PROJECT.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
  136. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/macos-swift/Example/PROJECT.xcodeproj/xcshareddata/xcschemes/PROJECT.xcscheme +0 -0
  137. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/macos-swift/Example/Podfile +0 -0
  138. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/macos-swift/Example/Tests/Info.plist +0 -0
  139. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/macos-swift/Example/Tests/Tests.swift +0 -0
  140. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/swift/Example/PROJECT/AppDelegate.swift +0 -0
  141. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/swift/Example/PROJECT/Base.lproj/LaunchScreen.xib +0 -0
  142. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/swift/Example/PROJECT/Base.lproj/Main.storyboard +19 -2
  143. data/lib/yk_command/project/simple_component_demo_template/templates/swift/Example/PROJECT/EmptyOcFile.m +9 -0
  144. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/swift/Example/PROJECT/Images.xcassets/AppIcon.appiconset/Contents.json +0 -0
  145. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/swift/Example/PROJECT/Info.plist +0 -0
  146. data/lib/yk_command/project/simple_component_demo_template/templates/swift/Example/PROJECT/PROJECT_Example-Bridging-Header.h +4 -0
  147. data/lib/yk_command/project/simple_component_demo_template/templates/swift/Example/PROJECT/PROJECT_Tests-Bridging-Header.h +4 -0
  148. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/swift/Example/PROJECT/ViewController.swift +3 -1
  149. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/swift/Example/PROJECT.xcodeproj/project.pbxproj +41 -20
  150. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/swift/Example/PROJECT.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
  151. data/lib/yk_command/project/simple_component_demo_template/templates/swift/Example/PROJECT.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  152. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/swift/Example/PROJECT.xcodeproj/xcshareddata/xcschemes/PROJECT.xcscheme +0 -0
  153. data/lib/yk_command/project/{YKProjectTemplate → simple_component_demo_template}/templates/swift/Example/Podfile +0 -0
  154. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/swift/Example/Tests/Info.plist +0 -0
  155. data/lib/yk_command/project/{simple_project_template → simple_component_demo_template}/templates/swift/Example/Tests/Tests.swift +0 -0
  156. data/lib/yk_command/project/yk_project.rb +7 -2
  157. data/lib/yk_command/version.rb +1 -1
  158. metadata +141 -129
  159. data/.idea/sonarlint/issuestore/2/4/2461a61a84d866812e64ff95d40bd7836fb136ea +0 -0
  160. data/.idea/sonarlint/issuestore/2/e/2e113f2d3dc9bee6a98073d85966fbd9773c044f +0 -0
  161. data/.idea/sonarlint/issuestore/7/1/71fc201a1096db97453882ad1da5120a71f77bb5 +0 -0
  162. data/.idea/sonarlint/issuestore/7/e/7ed8a0c3d2507e911337de44fdef07f89e35091a +0 -0
  163. data/.idea/sonarlint/issuestore/9/5/95a45210972238034e9fed522811176fe20117d3 +0 -0
  164. data/.idea/sonarlint/issuestore/9/7/97c2c9c7adeb7fa2e6ffbf07cba2418868ac9739 +0 -0
  165. data/.idea/sonarlint/issuestore/a/d/ad7bffefc6248a8f673a10e668a82bdbbe38a3e3 +0 -0
  166. data/.idea/sonarlint/issuestore/e/5/e5580d669a0c327c5b0897ba7dd8465a3d4db45a +0 -0
  167. data/lib/yk_command/module/template/objc/RouterDefine.h +0 -14
  168. data/lib/yk_command/module/template/objc/ServiceProtocol.h +0 -15
  169. data/lib/yk_command/module/template/objc/demo/DemoViewController.h +0 -17
  170. data/lib/yk_command/module/template/objc/demo/DemoViewController.m +0 -28
  171. data/lib/yk_command/module/template/objc/demo/DemoViewModel.h +0 -14
  172. data/lib/yk_command/module/template/objc/demo/DemoViewModel.m +0 -19
  173. data/lib/yk_command/module/template/swift/RouterDefine.swift +0 -28
  174. data/lib/yk_command/project/YKProjectTemplate/templates/ios/Example/PROJECT/CPDViewController.m +0 -60
  175. data/lib/yk_command/project/YKProjectTemplate/templates/swift/Example/PROJECT/ViewController.swift +0 -37
  176. data/lib/yk_command/project/simple_project_template/templates/ios/Example/Podfile +0 -19
  177. data/lib/yk_command/project/simple_project_template/templates/swift/Example/Podfile +0 -20
@@ -17,93 +17,72 @@ module YkCommand
17
17
 
18
18
  no_commands do
19
19
  def yk_module_folders
20
- class_folder_path = "#{@final_path}/#{@name}/Classes"
21
20
 
22
- first_level_folders = %w[Public Private]
21
+ end
23
22
 
24
- # public_level_folders = ['Register']
25
- # public_level_folders.each do |folder|
26
- # path = "#{class_folder_path}/Public/#{folder}"
27
- # empty_directory path
28
- # end
23
+ YkCommand::ModuleHandler.source_root(File.dirname(__FILE__))
29
24
 
30
- private_level_folders = %w[Business Category Vendor Tools]
25
+ def yk_template_files
31
26
 
32
- first_level_folders.each do |folder|
33
- path = "#{class_folder_path}/#{folder}"
34
- empty_directory path
35
- end
27
+ module_root_path = File.join(@final_path, @name)
28
+ module_classes_path = File.join(module_root_path, "Classes")
29
+ file_root_path = File.join(__dir__, "template")
36
30
 
37
- private_level_folders.each do |folder|
38
- path = "#{class_folder_path}/Private/#{folder}"
39
- empty_directory path
40
- end
41
- end
31
+ # assets bundle
32
+ FileUtils.mkdir(File.join(module_root_path, "Assets", "Images.xcassets"))
33
+ # resources directory
34
+ FileUtils.mkdir(File.join(module_root_path,"Resources"))
42
35
 
43
- YkCommand::ModuleHandler.source_root(File.dirname(__FILE__))
36
+ dest_dir_business = "Work/Business"
37
+ dest_dir_category = "Work/Category"
38
+ dest_dir_vendor = "Work/Vendor"
39
+ dest_dir_tools = "Work/Tools"
44
40
 
45
- def yk_template_files
41
+ dest_dir_register_oc = "Work/RegisterOC"
42
+ dest_dir_register_swift = "Work/RegisterSwift"
46
43
 
47
- register_path = "#{@final_path}/#{@name}/Classes/Private/Register"
48
- registger = {
49
- 'RouterRegister.h' => 'RouterRegister',
50
- 'RouterRegister.m' => 'RouterRegister',
51
- 'ServiceRegister.h' => 'ServiceRegister',
52
- 'ServiceRegister.m' => 'ServiceRegister'
44
+ dest_dir_pch = "."
45
+ # pch file
46
+ file_dir_pch = File.join(file_root_path, "objc")
47
+ file_arr_pch = {
48
+ 'PrefixHeader.pch' => dest_dir_pch,
53
49
  }
54
50
 
55
- registger.each do |file_name, _folder|
56
- final_file = "#{register_path}/#{@prefixed_module}#{file_name}"
57
- template "#{__dir__}/template/objc/#{file_name}", final_file
51
+ file_arr_pch.each do |file, folder|
52
+ template(File.join(file_dir_pch, file), File.join(module_classes_path, folder, "#{@project}#{file}"))
58
53
  end
59
54
 
60
- public_folder_path = "#{@final_path}/#{@name}/Classes/Public"
55
+ # objc files
56
+ file_dir_oc = File.join(file_root_path, "objc")
57
+ file_arr_oc = {
58
+ 'RouterRegister.h' => dest_dir_register_oc,
59
+ 'RouterRegister.m' => dest_dir_register_oc,
60
+ 'ServiceRegister.h' => dest_dir_register_oc,
61
+ 'ServiceRegister.m' => dest_dir_register_oc,
62
+ 'CategoryHeader.h' => dest_dir_category,
63
+ 'ToolsHeader.h' => dest_dir_tools,
64
+ 'Helper.h' => dest_dir_tools,
65
+ 'Helper.m' => dest_dir_tools,
66
+ 'VendorHeader.h' => dest_dir_vendor,
67
+ 'BusinessHeader.h' => dest_dir_business,
68
+ }
61
69
 
62
- template_code_filename = ['ServiceProtocol.h', 'RouterDefine.h']
63
- template_code_filename.each do |file_name|
64
- final_file = "#{public_folder_path}/#{@prefixed_module}#{file_name}"
65
- source = "#{__dir__}/template/objc/#{file_name}"
66
- template source, final_file
70
+ file_arr_oc.each do |file, folder|
71
+ template(File.join(file_dir_oc, file), File.join(module_classes_path, folder, "#{@prefixed_module}#{file}"))
67
72
  end
68
73
 
69
- swift_template_code_filename = ['RouterDefine.swift']
70
- swift_template_code_filename.each do |file_name|
71
- final_file = "#{public_folder_path}/#{@prefixed_module}_Swift_#{file_name}"
72
- source = "#{__dir__}/template/swift/#{file_name}"
73
- template source, final_file
74
- end
74
+ # swift files
75
+ file_dir_swift = File.join(file_root_path, "swift")
76
+ file_arr_swift = {
77
+ 'RouterRegisterSwift.swift' => dest_dir_register_swift,
78
+ 'ServiceRegisterSwift.swift' => dest_dir_register_swift,
75
79
 
76
- private_folder_path = "#{@final_path}/#{@name}/Classes/Private"
77
- #pch file
78
- # pch_file_name = "PrefixHeader.pch"
79
- # final_file = "#{private_folder_path}/#{@prefixed_module}#{pch_file_name}"
80
- # source = "#{__dir__}/template/objc/#{pch_file_name}"
81
- # template source, final_file
82
-
83
- private_level_folder_files = {
84
- 'PrefixHeader.pch' => 'Business',
85
- 'CategoryHeader.h' => 'Category',
86
- 'ToolsHeader.h' => 'Tools',
87
- 'vendorHeader.h' => 'Vendor'
80
+ 'PrefixHeader_swift.swift' => dest_dir_pch,
81
+ 'Tool.swift' => dest_dir_tools,
88
82
  }
89
83
 
90
- private_level_folder_files.each do |file_name, folder|
91
- final_prefix = @prefixed_module
92
- if file_name == 'PrefixHeader.pch'
93
- final_prefix = @name
94
- end
95
-
96
- final_file = "#{private_folder_path}/#{folder}/#{final_prefix}#{file_name}"
97
- source = "#{__dir__}/template/objc/#{file_name}"
98
- template source, final_file
99
- end
100
-
101
- business_demo_path = "#{@final_path}/#{@name}/Classes/Private/Business"
102
- demo_replace_file = ['DemoViewController.h', 'DemoViewController.m', 'DemoViewModel.h', 'DemoViewModel.m']
103
- demo_replace_file.each do |file_name|
104
- final_file = "#{business_demo_path}/Demo/#{@prefixed_module}#{file_name}"
105
- source = "#{__dir__}/template/objc/demo/#{file_name}"
106
- template source, final_file
84
+ file_arr_swift.each do |file, folder|
85
+ template(File.join(file_dir_swift, file), File.join(module_classes_path, folder, "#{@prefixed_module}#{file}"))
107
86
  end
108
87
 
109
88
 
@@ -9,6 +9,4 @@
9
9
  #ifndef <%= @prefixed_module %>CategoryHeader_h
10
10
  #define <%= @prefixed_module %>CategoryHeader_h
11
11
 
12
- #import <YKCategoryComponent/YKCategoriesComponentHeader.h>
13
-
14
12
  #endif /* <%= @prefixed_module %>CategoryHeader_h */
@@ -0,0 +1,16 @@
1
+ //
2
+ // <%= @prefixed_module %>Helper.h
3
+ // <%= @project %>
4
+ //
5
+ // Created by <%= @author %> on <%= @date %>.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+
10
+ NS_ASSUME_NONNULL_BEGIN
11
+
12
+ NSBundle * kModuleBundle_<%= @project %>(void);
13
+ NSBundle * kModuleResourceBundle_<%= @project %>(void);
14
+ UIImage * __nullable kModuleResourceImage_<%= @project %>(NSString *name);
15
+
16
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,41 @@
1
+ //
2
+ // <%= @prefixed_module %>Helper.m
3
+ // <%= @project %>
4
+ //
5
+ // Created by <%= @author %> on <%= @date %>.
6
+ //
7
+
8
+ #import "<%= @prefixed_module %>Helper.h"
9
+
10
+ @interface <%= @prefixed_module %>HelperPrivate: NSObject
11
+ @end
12
+
13
+ @implementation <%= @prefixed_module %>HelperPrivate
14
+ @end
15
+
16
+
17
+ NSString * const kModuleName<%= @project %> = @"<%= @project %>";
18
+
19
+ NSBundle * kModuleBundle_<%= @project %>(void) {
20
+ return [NSBundle bundleForClass:[<%= @prefixed_module %>HelperPrivate class]];
21
+ }
22
+
23
+ NSString * __nullable kModuleResourceBundlePath_<%= @project %>(void) {
24
+ NSString *bundlePath = [kModuleBundle_<%= @project %>() pathForResource:kModuleName<%= @project %> ofType:@"bundle"];
25
+ if (bundlePath.length == 0) { //bundle 不存在
26
+ return nil;
27
+ }
28
+ return bundlePath;
29
+ }
30
+
31
+ NSBundle * kModuleResourceBundle_<%= @project %>(void) {
32
+ NSString *path = kModuleResourceBundlePath_<%= @project %>();
33
+ return path.length ? [NSBundle bundleWithPath:path] : kModuleBundle_<%= @project %>();
34
+ }
35
+
36
+ UIImage * __nullable kModuleResourceImage_<%= @project %>(NSString *name) {
37
+ return [UIImage imageNamed:name inBundle:kModuleResourceBundle_<%= @project %>() compatibleWithTraitCollection:nil];
38
+ }
39
+
40
+
41
+
@@ -10,23 +10,16 @@
10
10
 
11
11
  #import <YKRouterComponent/YKRouterComponentHeader.h>
12
12
 
13
- #import "<%= @prefixed_module %>RouterDefine.h"
14
-
15
- #import "<%= @prefixed_module %>DemoViewController.h"
16
-
17
- #import <<%= @name %>/<%= @name %>-Swift.h>
18
-
13
+ @interface <%= @prefixed_module %>RouterRegister()<YKRouterComponentRegisterProtocol>
14
+ @end
19
15
  @implementation <%= @prefixed_module %>RouterRegister
20
16
 
21
- @YKRouterRegister() {
22
-
23
- [[YKRouterComponent shareInstance] ykRegisterUrlPartterns:kDemoRouterString error:nil action:^(YKRouterUrlRequest * _Nonnull urlRequest, YKRouterUrlCompletion _Nonnull completetion) {
24
-
25
- <%= @prefixed_module %>DemoViewController *vc = [[<%= @prefixed_module %>DemoViewController alloc] init];
26
- [[UIViewController yk_topViewController].navigationController pushViewController:vc animated:YES];
27
-
28
- }];
29
-
17
+ + (void)ykRouterRegisterExecute {
18
+ // [[YKRouterComponent shareInstance] ykRegisterUrlPartterns:@"kDemoRouterString" error:nil action:^(YKRouterUrlRequest * _Nonnull urlRequest, YKRouterUrlCompletion _Nonnull completetion) {
19
+ //
20
+ // UIViewController *vc = [[UIViewController alloc] init];
21
+ // [urlRequest.fromVC.navigationController pushViewController:vc animated:YES];
22
+ // }];
30
23
  }
31
24
 
32
25
 
@@ -9,17 +9,13 @@
9
9
  #import "<%= @prefixed_module %>ServiceRegister.h"
10
10
  #import <YKModuleServiceComponent/YKModuleServiceComponentHeader.h>
11
11
 
12
- #import "<%= @prefixed_module %>ServiceProtocol.h"
13
-
14
-
15
- #import "<%= @prefixed_module %>DemoViewModel.h"
16
-
12
+ @interface <%= @prefixed_module %>ServiceRegister()<YKModuleServiceRegisterProtocol>
13
+ @end
17
14
 
18
15
  @implementation <%= @prefixed_module %>ServiceRegister
19
16
 
20
- @YKModuleServiceRegister(){
21
- YKModuleServiceRegisterExecute(<%= @prefixed_module %>DemoViewModel.class, @protocol(<%= @prefixed_module %>ServiceProtocol), nil);
17
+ + (void)ykModuleServiceRegistAction {
18
+ // YKModuleServiceRegisterExecute(XXXX.class, @protocol(XXXProtocol), nil);
22
19
  }
23
20
 
24
-
25
21
  @end
@@ -0,0 +1,10 @@
1
+ //
2
+ // POD_NAMEPrefixHeader_swift.swift
3
+ // Pods
4
+ //
5
+ // Created by PROJECT_OWNER on TODAYS_DATE.
6
+ // Copyright (c) TODAYS_YEAR PROJECT_ORGANIZATIONNAME. All rights reserved.
7
+ //
8
+
9
+ //swift 版本的prefix 文件
10
+ // @_exported import SwiftyJSON
@@ -0,0 +1,23 @@
1
+ // <%= @prefixed_module %>RouterRegisterSwift.swift
2
+ //
3
+ // <%= @project %>
4
+ //
5
+ // Created by <%= @author %> on <%= @date %>.
6
+ //
7
+
8
+ import UIKit
9
+
10
+ import YKRouterComponent
11
+
12
+ class <%= @prefixed_module %>RouterRegisterSwift: NSObject {
13
+ }
14
+
15
+ extension <%= @prefixed_module %>RouterRegisterSwift: YKRouterComponentRegisterProtocol {
16
+ static func ykRouterRegisterExecute() {
17
+ //注册路由 kRouter_example_POD_NAME_swift
18
+ //YKRouterRegisterUrlParttern("routerUrl", nil) { (urlRequest: YKRouterUrlRequest, complete: YKRouterUrlCompletion?) in
19
+ //let vc = UIViewController()
20
+ //urlRequest.fromVC?.navigationController?.pushViewController(vc, animated: true)
21
+ //}
22
+ }
23
+ }
@@ -0,0 +1,20 @@
1
+ //
2
+ // <%= @prefixed_module %>ServiceRegisterSwift.swift
3
+ // <%= @project %>
4
+ //
5
+ // Created by <%= @author %> on <%= @date %>.
6
+ //
7
+
8
+ import Foundation
9
+
10
+ import YKModuleServiceComponentSwift
11
+
12
+ class <%= @prefixed_module %>ServiceRegisterSwift: NSObject, YKModuleServiceRegisterProtocol {
13
+ static func ykModuleServiceRegistAction() {
14
+ //注册服务 NSObject --> NSObjectProtocol NSObjectProtocol为 swift 协议
15
+ //YKModuleServiceComponent().ykRegistModuleService(service: NSObject.self, protocol: NSObjectProtocol.self, err: nil)
16
+
17
+ //注册服务 NSObject --> NSObjectProtocol NSObjectProtocol为 OC 协议
18
+ //YKService().ykRegisterModuleService_oc(NSObject.self, protocol: NSObjectProtocol.self, err: nil)
19
+ }
20
+ }
@@ -0,0 +1,53 @@
1
+ //
2
+ // <%= @prefixed_module %>Tool.swift
3
+ // <%= @project %>
4
+ //
5
+ // Created by <%= @author %> on <%= @date %>.
6
+ //
7
+
8
+ import UIKit
9
+
10
+ @objc
11
+ open class <%= @prefixed_module %>Tool: NSObject {
12
+ static let kModuleName = "<%= @project %>"
13
+
14
+ private class func kResourceBundlePath() -> String? {
15
+ let bundlePath: String? = kModuleBundle().path(forResource: kModuleName, ofType: "bundle")
16
+ if bundlePath == nil { //bundle 不存在
17
+ print("\nPOD_NAME xcassets bundle not exist:\(kModuleName)\n")
18
+ }
19
+ return bundlePath
20
+ }
21
+
22
+ /// 组件bundle
23
+ @objc public class func kModuleBundle() -> Bundle{
24
+ let result = Bundle.init(for: <%= @prefixed_module %>Tool.self)
25
+ return result
26
+ }
27
+
28
+ /// 组件 素材bundle
29
+ @objc public class func kModuleResourceBundle() -> Bundle {
30
+ let path: String? = self.kResourceBundlePath()
31
+ var result = Bundle.main
32
+ if path != nil {
33
+ result = Bundle.init(path: path!)!
34
+ if result.isLoaded == false {
35
+ do {
36
+ try result.loadAndReturnError()
37
+ }
38
+ catch {
39
+
40
+ }
41
+ }
42
+ }
43
+
44
+ return result
45
+ }
46
+
47
+ ///资源组件 获取xcasserts 中图片
48
+ @objc public class func kResourceImage(name: String?) -> UIImage? {
49
+ let imgName = name ?? ""
50
+ let result = UIImage.init(named: imgName, in: kModuleResourceBundle(), compatibleWith: nil)
51
+ return result
52
+ }
53
+ }
@@ -201,11 +201,11 @@ module YkCommand
201
201
 
202
202
  # host_a = 'yeah'
203
203
  # host_b = 'ka'
204
- # template_repo_url = "http://gitlab.#{host_a}#{host_b}.com/App/iOS/YKComponents/YKProjectTemplate.git"
204
+ # template_repo_url = "http://gitlab.#{host_a}#{host_b}.com/App/iOS/YKComponents/full_component_demo_template.git"
205
205
  # system("git clone #{template_repo_url} #{@final_path}")
206
206
 
207
207
  # FileUtils.remove_dir(@final_path, true)
208
- # FileUtils.cp_r('/Users/imacn24/Documents/dev/YKProjectTemplate', @final_path)
208
+ # FileUtils.cp_r('/Users/imacn24/Documents/dev/full_component_demo_template', @final_path)
209
209
  # FileUtils.remove_dir("#{@final_path}/.git", true)
210
210
  # end
211
211
 
Binary file
@@ -91,15 +91,13 @@ Pod::Spec.new do |spec|
91
91
  # Not including the public_header_files will make all headers public.
92
92
  #
93
93
 
94
- spec.source_files = '${POD_NAME}/Classes/**/*'
95
- spec.exclude_files = "Classes/Exclude"
96
- spec.prefix_header_file = '${POD_NAME}/Classes/Private/Business/${POD_NAME}PrefixHeader.pch'
97
- spec.public_header_files = '${POD_NAME}/Classes/Public/**/*.h'
98
-
99
- # spec.public_header_files = "Classes/**/*.h"
100
-
94
+ spec.source_files = '${POD_NAME}/Classes/**/*.{h,m,mm,c,cpp,swift,pch}'
95
+ # spec.exclude_files = "Classes/Exclude" #排除文件
101
96
 
97
+ spec.prefix_header_file = '${POD_NAME}/Classes/${POD_NAME}PrefixHeader.pch'
102
98
 
99
+ spec.project_header_files = '${POD_NAME}/Classes/{Category,Register,Tools,Vendor,Business}/**/*.{h}'
100
+ #spec.public_header_files = '${POD_NAME}/Classes/Public/**/*.h' #此处放置组件的对外暴漏的头文件
103
101
 
104
102
  # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
105
103
  #
@@ -110,10 +108,12 @@ Pod::Spec.new do |spec|
110
108
  #
111
109
 
112
110
  # spec.resource = "icon.png"
113
- # spec.resources = "Resources/*.png"
114
- # spec.resource_bundles = {
115
- # '${POD_NAME}' => ['${POD_NAME}/**/*.{xib,png,json}']
116
- # }
111
+ # 放置 json,font,jpg,png等资源
112
+ spec.resources = "${POD_NAME}/{Classes,Resources}/**/*.{png,jpg,font,json,xib}"
113
+
114
+ spec.resource_bundles = {
115
+ '${POD_NAME}' => ['${POD_NAME}/Assets/**/*.xcassets']
116
+ }
117
117
  # spec.preserve_paths = "FilesToSave", "MoreFilesToSave"
118
118
 
119
119
 
@@ -141,11 +141,11 @@ Pod::Spec.new do |spec|
141
141
  # spec.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" }
142
142
  # spec.dependency "JSONKit", "~> 1.4"
143
143
 
144
-
145
-
146
- spec.dependency "YKCategoryComponent"
144
+ # 组件化架构中间件
147
145
  spec.dependency "YKModuleLifeCircleComponent"
148
146
  spec.dependency "YKRouterComponent"
149
- spec.dependency "YKModuleServiceComponent"
147
+ spec.dependency "YKModuleServiceComponent" # oc 服务中间件
148
+ spec.dependency "YKModuleServiceComponent.swift" #swift 服务中间件, 如果是纯oc组件,请注释此中间件
150
149
 
150
+ # 其他依赖pod
151
151
  end
@@ -0,0 +1,47 @@
1
+ //
2
+ // CPDViewController.m
3
+ // PROJECT
4
+ //
5
+ // Created by PROJECT_OWNER on TODAYS_DATE.
6
+ // Copyright (c) TODAYS_YEAR PROJECT_OWNER. All rights reserved.
7
+ //
8
+
9
+ #import "CPDViewController.h"
10
+
11
+ #import <YKRouterComponent/YKRouterComponentHeader.h>
12
+ #import <YKModuleServiceComponent/YKModuleServiceComponentHeader.h>
13
+
14
+ @interface CPDViewController ()
15
+
16
+ @end
17
+ @implementation CPDViewController
18
+
19
+ - (void)viewDidLoad
20
+ {
21
+ [super viewDidLoad];
22
+ // Do any additional setup after loading the view, typically from a nib.
23
+ self.navigationItem.title = [NSString stringWithFormat:@"%@",@"PROJECT Demo"];
24
+ }
25
+
26
+ - (IBAction)routerEvent:(id)sender {
27
+ NSLog(@"这里调用模块的路由");
28
+ // YKRouterUrlRequest* request = [YKRouterUrlRequest instanceWithBuilder:^(YKRouterUrlRequest * _Nonnull builder) {
29
+ // builder.url = @"url";
30
+ // builder.parameter = @{};
31
+ // }];
32
+ // return [[YKRouterComponent shareInstance] ykOpenUrl:request complete:^(YKRouterUrlResponse * _Nonnull urlResponse) {
33
+ //
34
+ // }];
35
+ }
36
+
37
+ - (IBAction)serviceEvent:(id)sender {
38
+ NSLog(@"这里调用模块的服务");
39
+ // NSError *err;
40
+ // __kindof Class<NSObject> cls =YKModuleServiceWithProtocol(@protocol(CPDPROJECTServiceProtocol), &err);
41
+ // if (!err) {
42
+ // NSObject <CPDPROJECTServiceProtocol>* obj = [[cls alloc] init];
43
+ // [obj replaceThisMethod];
44
+ // }
45
+ }
46
+
47
+ @end
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>IDEDidComputeMac32BitWarning</key>
6
+ <true/>
7
+ </dict>
8
+ </plist>
@@ -0,0 +1,34 @@
1
+
2
+ platform :ios, '10.0'
3
+
4
+ inhibit_all_warnings!
5
+ use_modular_headers!
6
+ use_frameworks! :linkage => :static
7
+
8
+
9
+ #pod_install hook
10
+ post_install do |installer|
11
+
12
+ # 单个target编辑配置
13
+ installer.pods_project.targets.each do |target|
14
+ target.build_configurations.each do |config|
15
+ #config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
16
+
17
+ config.build_settings['PRODUCT_BUNDLE_IDENTIFIER'] = "org.cocoapods.${PRODUCT_NAME}"
18
+ config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
19
+ config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
20
+ config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
21
+ end
22
+ end
23
+
24
+ end
25
+
26
+ target '${POD_NAME}_Example' do
27
+ pod '${POD_NAME}', :path => '../'
28
+
29
+ target '${POD_NAME}_Tests' do
30
+ inherit! :search_paths
31
+
32
+ ${INCLUDED_PODS}
33
+ end
34
+ end