This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
def add_group_to_project(parentGroup, groupName, project) | |
puts "Inside add_group_to_project" | |
childGroup = parentGroup.new_group(groupName,groupName, :group) | |
fileReferenceArray = [] | |
Dir.foreach("#{parentGroup.real_path}/#{@proto_group_name}") do |child| | |
if (child == "." || child == "..") | |
puts "Ignoring file #{child}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
def copy_files_to_folder(group) | |
puts "Current directory is #{group.path} and real path is #{group.real_path}" | |
FileUtils.cp_r(File.join(Dir.home, "Documents", "GitClone", "SwiftProtoFiles"), group.real_path) | |
if Dir.exists?(File.join(group.real_path, @proto_group_name)) | |
add_group_to_project(group, @proto_group_name, @project) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
def find_proto_group(parentGroup) | |
puts "Number of groups in parent is #{parentGroup.groups.count()}" | |
if parentGroup.groups.count() > 0 | |
parentGroup.groups.each do |group| | |
if group.name == @proto_group_name | |
delete_group_and_files(group) | |
return | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
def recursively_look_for_group(group) | |
puts "Printing name of group #{group.path}" | |
if group.path == @parent_group_name | |
@parent_group = group | |
return | |
elsif group.groups.count > 0 | |
group.groups.each do |internalGroup| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
def get_targets(project, config_options) | |
targets_in_config = config_options["targetsToAdd"] | |
puts "#{targets_in_config}" | |
project.native_targets.each do |target| | |
puts "target name is #{target.name}" | |
if targets_in_config.include?(target.name) | |
puts "about to insert #{target}" | |
puts "Targets array is #{@targets.count}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
parentGroupName: "TrackingV3" | |
protoGroupName: "SwiftProtoFiles" | |
targetsToAdd: | |
- swiggy | |
- swiggyTests | |
- SwiggyUITests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
def initialize(project_path) | |
config_options = YAML.load_file("#{__dir__}/config.yml") | |
@parent_group_name = config_options['parentGroupName'] | |
@proto_group_name = config_options['protoGroupName'] | |
@project = Xcodeproj::Project.open(project_path) | |
@targets = [] | |
get_targets(@project, config_options) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'xcodeproj' | |
require 'fileutils' | |
require 'yaml' | |
class Update_Project_Settings | |
@parent_group_name = nil | |
@proto_group_name = nil | |
@project = nil | |
@parent_group = nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
def delete_proto_files | |
if File.directory?("SwiftProtoFiles") | |
FileUtils.remove_dir("SwiftProtoFiles") | |
puts "SwiftProtoFiles directory deleted" | |
Dir.mkdir("SwiftProtoFiles") | |
else | |
Dir.mkdir("SwiftProtoFiles") | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
value = syscall("git tag --sort=committerdate") | |
tags_in_repo = value.split("\n").reverse() | |
tags_in_repo.each do |repo| | |
if repo.to_f == @tag_to_be_checkout | |
puts "Tag found alreay in #{repo}" | |
checkout_specifc_tag(repo) | |
return | |
end |
NewerOlder