objc2swift_assistant 0.3.0
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.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.idea/.name +1 -0
- data/.idea/.rakeTasks +7 -0
- data/.idea/compiler.xml +22 -0
- data/.idea/copyright/profiles_settings.xml +3 -0
- data/.idea/dictionaries/ckornher.xml +7 -0
- data/.idea/encodings.xml +4 -0
- data/.idea/misc.xml +4 -0
- data/.idea/modules.xml +8 -0
- data/.idea/objc2swift_assistant.iml +103 -0
- data/.idea/runConfigurations/Console.xml +26 -0
- data/.idea/runConfigurations/assistant.xml +28 -0
- data/.idea/runConfigurations/help_text.xml +28 -0
- data/.idea/scopes/scope_settings.xml +5 -0
- data/.idea/uiDesigner.xml +124 -0
- data/.idea/vcs.xml +6 -0
- data/.idea/workspace.xml +1484 -0
- data/.rspec +2 -0
- data/.travis.yml +3 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +8 -0
- data/LICENSE.txt +21 -0
- data/README.md +83 -0
- data/Rakefile +1 -0
- data/bin/console +14 -0
- data/bin/objc2swift_assistant +50 -0
- data/bin/setup +7 -0
- data/lib/assistant.rb +110 -0
- data/lib/objc2swift_assistant/code_recognizer.rb +220 -0
- data/lib/objc2swift_assistant/file_hierarchical_config.rb +168 -0
- data/lib/objc2swift_assistant/file_sets.rb +577 -0
- data/lib/objc2swift_assistant/logging.rb +19 -0
- data/lib/objc2swift_assistant/objc_2_swift.rb +734 -0
- data/lib/objc2swift_assistant/objc_2_swift_block_conversion.rb +106 -0
- data/lib/objc2swift_assistant/objc_2_swift_configuration.rb +108 -0
- data/lib/objc2swift_assistant/objc_2_swift_type_mapping.rb +64 -0
- data/lib/objc2swift_assistant/objc_variable_types.rb +76 -0
- data/lib/objc2swift_assistant/processing_element.rb +32 -0
- data/lib/objc2swift_assistant/recognizers/at_sign_directives_recognizer.rb +41 -0
- data/lib/objc2swift_assistant/recognizers/category_recognizer.rb +72 -0
- data/lib/objc2swift_assistant/recognizers/enum_recognizer.rb +0 -0
- data/lib/objc2swift_assistant/recognizers/implementation_recognizer.rb +31 -0
- data/lib/objc2swift_assistant/recognizers/interface_recognizer.rb +37 -0
- data/lib/objc2swift_assistant/recognizers/method_recognizer.rb +190 -0
- data/lib/objc2swift_assistant/recognizers/pragma_mark_recognizer.rb +41 -0
- data/lib/objc2swift_assistant/recognizers/property_declaration_recognizer.rb +78 -0
- data/lib/objc2swift_assistant/recognizers/protocol_recognizer.rb +40 -0
- data/lib/objc2swift_assistant/recognizers/recognizer_keys.rb +26 -0
- data/lib/objc2swift_assistant/settings_file.rb +23 -0
- data/lib/objc2swift_assistant/swift_file_generator.rb +27 -0
- data/lib/objc2swift_assistant/version.rb +3 -0
- data/objc2swift_assistant.gemspec +31 -0
- metadata +128 -0
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'json'
|
2
|
+
|
3
|
+
module Objc2SwiftAssistant
|
4
|
+
|
5
|
+
class Settings
|
6
|
+
attr_accessor :file_path
|
7
|
+
attr_accessor :file_hash
|
8
|
+
|
9
|
+
attr_accessor :global_settings
|
10
|
+
attr_accessor :settings_by_path
|
11
|
+
|
12
|
+
def initialize( path, root_path )
|
13
|
+
|
14
|
+
end
|
15
|
+
|
16
|
+
def load_settings
|
17
|
+
file_contents = @file_path.read()
|
18
|
+
@file_hash = JSON.parse(file_contents)
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Objc2SwiftAssistant
|
2
|
+
|
3
|
+
|
4
|
+
class SwiftFile_Generator
|
5
|
+
|
6
|
+
attr_accessor :destination_root
|
7
|
+
attr_accessor :source_file_set
|
8
|
+
attr_accessor :swift_file_set #SwiftFileSet
|
9
|
+
|
10
|
+
def initialize( destination_root, source_file_set )
|
11
|
+
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
|
+
def map_sources_to_destinations
|
16
|
+
@swift_file_set = SwiftFileSet.new( @destination_root )
|
17
|
+
@swift_file_set.mapFromObjCFileSet( @source_file_set )
|
18
|
+
end
|
19
|
+
|
20
|
+
# Just add the commented .h and .m files to the destination file
|
21
|
+
def concat_source_files
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'objc2swift_assistant/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "objc2swift_assistant"
|
8
|
+
spec.version = Objc2swiftAssistant::VERSION
|
9
|
+
spec.authors = ["Chris Kornher"]
|
10
|
+
spec.email = ["ckornher@mac.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Assists in the conversion of Objective-C code to Swift.}
|
13
|
+
spec.description = %q{Generates Swift skeletons from Objective-C code. Swift files with constructs are created to assist in porting from Objective-C to Swift.
|
14
|
+
This tool does not understand the intent of code. }
|
15
|
+
spec.homepage = ""
|
16
|
+
spec.license = "MIT"
|
17
|
+
|
18
|
+
spec.required_ruby_version = '>= 2.0.0'
|
19
|
+
|
20
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
21
|
+
spec.bindir = "exe"
|
22
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
|
+
spec.require_paths = ["lib"]
|
24
|
+
|
25
|
+
if spec.respond_to?(:metadata)
|
26
|
+
spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com' to prevent pushes to rubygems.org, or delete to allow pushes to any server."
|
27
|
+
end
|
28
|
+
|
29
|
+
spec.add_development_dependency "bundler", "~> 1.9"
|
30
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
31
|
+
end
|
metadata
ADDED
@@ -0,0 +1,128 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: objc2swift_assistant
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.3.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Chris Kornher
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-07-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.9'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.9'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
description: "Generates Swift skeletons from Objective-C code. Swift files with constructs
|
42
|
+
are created to assist in porting from Objective-C to Swift.\n This
|
43
|
+
tool does not understand the intent of code. "
|
44
|
+
email:
|
45
|
+
- ckornher@mac.com
|
46
|
+
executables: []
|
47
|
+
extensions: []
|
48
|
+
extra_rdoc_files: []
|
49
|
+
files:
|
50
|
+
- ".gitignore"
|
51
|
+
- ".idea/.name"
|
52
|
+
- ".idea/.rakeTasks"
|
53
|
+
- ".idea/compiler.xml"
|
54
|
+
- ".idea/copyright/profiles_settings.xml"
|
55
|
+
- ".idea/dictionaries/ckornher.xml"
|
56
|
+
- ".idea/encodings.xml"
|
57
|
+
- ".idea/misc.xml"
|
58
|
+
- ".idea/modules.xml"
|
59
|
+
- ".idea/objc2swift_assistant.iml"
|
60
|
+
- ".idea/runConfigurations/Console.xml"
|
61
|
+
- ".idea/runConfigurations/assistant.xml"
|
62
|
+
- ".idea/runConfigurations/help_text.xml"
|
63
|
+
- ".idea/scopes/scope_settings.xml"
|
64
|
+
- ".idea/uiDesigner.xml"
|
65
|
+
- ".idea/vcs.xml"
|
66
|
+
- ".idea/workspace.xml"
|
67
|
+
- ".rspec"
|
68
|
+
- ".travis.yml"
|
69
|
+
- CODE_OF_CONDUCT.md
|
70
|
+
- Gemfile
|
71
|
+
- LICENSE.txt
|
72
|
+
- README.md
|
73
|
+
- Rakefile
|
74
|
+
- bin/console
|
75
|
+
- bin/objc2swift_assistant
|
76
|
+
- bin/setup
|
77
|
+
- lib/assistant.rb
|
78
|
+
- lib/objc2swift_assistant/code_recognizer.rb
|
79
|
+
- lib/objc2swift_assistant/file_hierarchical_config.rb
|
80
|
+
- lib/objc2swift_assistant/file_sets.rb
|
81
|
+
- lib/objc2swift_assistant/logging.rb
|
82
|
+
- lib/objc2swift_assistant/objc_2_swift.rb
|
83
|
+
- lib/objc2swift_assistant/objc_2_swift_block_conversion.rb
|
84
|
+
- lib/objc2swift_assistant/objc_2_swift_configuration.rb
|
85
|
+
- lib/objc2swift_assistant/objc_2_swift_type_mapping.rb
|
86
|
+
- lib/objc2swift_assistant/objc_variable_types.rb
|
87
|
+
- lib/objc2swift_assistant/processing_element.rb
|
88
|
+
- lib/objc2swift_assistant/recognizers/at_sign_directives_recognizer.rb
|
89
|
+
- lib/objc2swift_assistant/recognizers/category_recognizer.rb
|
90
|
+
- lib/objc2swift_assistant/recognizers/enum_recognizer.rb
|
91
|
+
- lib/objc2swift_assistant/recognizers/implementation_recognizer.rb
|
92
|
+
- lib/objc2swift_assistant/recognizers/interface_recognizer.rb
|
93
|
+
- lib/objc2swift_assistant/recognizers/method_recognizer.rb
|
94
|
+
- lib/objc2swift_assistant/recognizers/pragma_mark_recognizer.rb
|
95
|
+
- lib/objc2swift_assistant/recognizers/property_declaration_recognizer.rb
|
96
|
+
- lib/objc2swift_assistant/recognizers/protocol_recognizer.rb
|
97
|
+
- lib/objc2swift_assistant/recognizers/recognizer_keys.rb
|
98
|
+
- lib/objc2swift_assistant/settings_file.rb
|
99
|
+
- lib/objc2swift_assistant/swift_file_generator.rb
|
100
|
+
- lib/objc2swift_assistant/version.rb
|
101
|
+
- objc2swift_assistant.gemspec
|
102
|
+
homepage: ''
|
103
|
+
licenses:
|
104
|
+
- MIT
|
105
|
+
metadata:
|
106
|
+
allowed_push_host: 'TODO: Set to ''http://mygemserver.com'' to prevent pushes to
|
107
|
+
rubygems.org, or delete to allow pushes to any server.'
|
108
|
+
post_install_message:
|
109
|
+
rdoc_options: []
|
110
|
+
require_paths:
|
111
|
+
- lib
|
112
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: 2.0.0
|
117
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
|
+
requirements:
|
119
|
+
- - ">="
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '0'
|
122
|
+
requirements: []
|
123
|
+
rubyforge_project:
|
124
|
+
rubygems_version: 2.4.5
|
125
|
+
signing_key:
|
126
|
+
specification_version: 4
|
127
|
+
summary: Assists in the conversion of Objective-C code to Swift.
|
128
|
+
test_files: []
|