Skip to content

Commit

Permalink
Added pod generator
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadmssm committed Aug 7, 2018
1 parent dbf6b82 commit 6a047eb
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ enum FileNames : String {
case environments = "Environment"
case globalConf = "Global configuration"
case globalKeys = "GlobalKeys"
case podFile = "Podfile"

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,30 @@ class ProjectBaseGenerator: BaseViewController {
// Create root folder
let mainFolder = try? fileSystem.createFolder(at: helpers.getUserDesktopPath() + "/" + projectNameTextField.stringValue)
// Assets, strings files, etc..
let _ = try? mainFolder?.createSubfolder(named: FileNames.resources.rawValue)
let resourcesFolder = try? mainFolder?.createSubfolder(named: FileNames.resources.rawValue)
let localizableFile = try? resourcesFolder??.createFile(named: FileNames.localizable.rawValue + ".strings")
let localizableStr = helpers.buildClassIHeaderText(className: FileNames.localizable.rawValue + ".strings")
try? localizableFile??.write(string: localizableStr)
//
//
let podFile = try? resourcesFolder??.createFile(named: FileNames.podFile.rawValue)
let podFileStr = "platform :ios, '9.1'\n" + "use_frameworks!\n\n" +
"target '" + projectNameTextField.stringValue + "' do\n" +
" # Add your pods below\n\n" + "\nend\n\n\n" +
"# The purpose of the following code is to solve a bug in Cocoapods that prevent the storyboard to render when a Designable &/or Inspetable component(s) from a different module is used\n\n" +
"# Ref : https://github.com/CocoaPods/CocoaPods/issues/7606#issuecomment-381279098\n" +
"post_install do |installer|\n" +
" installer.pods_project.targets.each do |target|\n" +
" target.build_configurations.each do |config|\n" +
" config.build_settings.delete('CODE_SIGNING_ALLOWED')\n" +
" config.build_settings.delete('CODE_SIGNING_REQUIRED')\n" +
" end\n" +
" end\n" +
" installer.pods_project.build_configurations.each do |config|\n" +
" config.build_settings.delete('CODE_SIGNING_ALLOWED')\n" +
" config.build_settings.delete('CODE_SIGNING_REQUIRED')\n" +
" end\n" + "end\n"
try? podFile??.write(string: podFileStr)
//
let uiFolder = try? mainFolder?.createSubfolder(named: FileNames.ui.rawValue)
//
Expand Down Expand Up @@ -149,18 +172,13 @@ class ProjectBaseGenerator: BaseViewController {
" }()\n\n" + "}"
try? globalKeysFile??.write(string: globalKeysClassStr)
//
let localizableFile = try? globalConfFolder??.createFile(named: FileNames.localizable.rawValue + ".strings")
let localizableStr = helpers.buildClassIHeaderText(className: FileNames.localizable.rawValue + ".strings")
try? localizableFile??.write(string: localizableStr)
//
let _ = try? mainFolder?.createSubfolder(named: FileNames.models.rawValue)
//
let _ = try? mainFolder?.createSubfolder(named: FileNames.adapters.rawValue)
//
let _ = try? mainFolder?.createSubfolder(named: FileNames.utils.rawValue)
//
let _ = try? mainFolder?.createSubfolder(named: FileNames.supportingFiles.rawValue)
//
}
}

Expand Down

0 comments on commit 6a047eb

Please sign in to comment.