cocoapods-prune-localizations 0.2.1 → 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 +4 -4
- data/.gitignore +1 -0
- data/.rspec +3 -0
- data/Gemfile +2 -1
- data/Gemfile.lock +15 -2
- data/Rakefile +1 -1
- data/lib/cocoapods-prune-localizations.rb +1 -1
- data/lib/cocoapods_plugin.rb +2 -2
- data/lib/pruner.rb +23 -11
- data/lib/utils.rb +3 -3
- data/spec/fixtures/Dummy Targets/Dummy Targets.xcodeproj/project.pbxproj +352 -0
- data/spec/fixtures/Dummy Targets/Dummy Targets.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/spec/fixtures/Dummy Targets/Dummy Targets.xcodeproj/project.xcworkspace/xcuserdata/warorface.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- data/spec/fixtures/Dummy Targets/Dummy Targets.xcodeproj/xcuserdata/warorface.xcuserdatad/xcschemes/iOSTarget.xcscheme +80 -0
- data/spec/fixtures/Dummy Targets/Dummy Targets.xcodeproj/xcuserdata/warorface.xcuserdatad/xcschemes/osxTarget.xcscheme +80 -0
- data/spec/fixtures/Dummy Targets/Dummy Targets.xcodeproj/xcuserdata/warorface.xcuserdatad/xcschemes/xcschememanagement.plist +32 -0
- data/spec/fixtures/Dummy Targets/iOSTarget/iOSTarget.h +13 -0
- data/spec/fixtures/Dummy Targets/iOSTarget/iOSTarget.m +13 -0
- data/spec/fixtures/Dummy Targets/osxTarget/osxTarget.h +13 -0
- data/spec/fixtures/Dummy Targets/osxTarget/osxTarget.m +13 -0
- data/spec/plain_resources_spec.rb +153 -0
- data/spec/pruner_spec.rb +11 -0
- data/spec/spec_helper.rb +89 -0
- metadata +30 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b55b113b9b8c4733b88d061a22c3eb2527ead263
|
4
|
+
data.tar.gz: 35788ce4159961349c5fd02cbb98edc19edbfce4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c571fa37add233e8894eaca1d42795caff14d2a26f838942158aaf18a25f8ca04c6e27c6359cce94b688922519adb9adc59c925498c407578529ff38510eb7b1
|
7
|
+
data.tar.gz: 16d546570dc78f2f2e443c75a1e3cd4c4d9ca04d0859c5c2b2089b871b7038bd170336d9261263faa54e51b4d05d5bb3e531a0d7a7a724b4a7d6c93970b8915f
|
data/.gitignore
CHANGED
data/.rspec
ADDED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -12,7 +12,6 @@ GEM
|
|
12
12
|
minitest (~> 5.1)
|
13
13
|
thread_safe (~> 0.3, >= 0.3.4)
|
14
14
|
tzinfo (~> 1.1)
|
15
|
-
bacon (1.2.0)
|
16
15
|
claide (1.0.0)
|
17
16
|
cocoapods (1.0.0)
|
18
17
|
activesupport (>= 4.0.2)
|
@@ -46,6 +45,7 @@ GEM
|
|
46
45
|
netrc (= 0.7.8)
|
47
46
|
cocoapods-try (1.0.0)
|
48
47
|
colored (1.2)
|
48
|
+
diff-lcs (1.2.5)
|
49
49
|
escape (0.0.4)
|
50
50
|
fourflusher (0.3.0)
|
51
51
|
fuzzy_match (2.0.4)
|
@@ -56,6 +56,18 @@ GEM
|
|
56
56
|
nap (1.1.0)
|
57
57
|
netrc (0.7.8)
|
58
58
|
rake (11.1.2)
|
59
|
+
rspec (3.1.0)
|
60
|
+
rspec-core (~> 3.1.0)
|
61
|
+
rspec-expectations (~> 3.1.0)
|
62
|
+
rspec-mocks (~> 3.1.0)
|
63
|
+
rspec-core (3.1.7)
|
64
|
+
rspec-support (~> 3.1.0)
|
65
|
+
rspec-expectations (3.1.2)
|
66
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
67
|
+
rspec-support (~> 3.1.0)
|
68
|
+
rspec-mocks (3.1.3)
|
69
|
+
rspec-support (~> 3.1.0)
|
70
|
+
rspec-support (3.1.2)
|
59
71
|
thread_safe (0.3.5)
|
60
72
|
tzinfo (1.2.2)
|
61
73
|
thread_safe (~> 0.1)
|
@@ -68,11 +80,12 @@ PLATFORMS
|
|
68
80
|
ruby
|
69
81
|
|
70
82
|
DEPENDENCIES
|
71
|
-
bacon
|
72
83
|
bundler (~> 1.3)
|
73
84
|
cocoapods
|
85
|
+
cocoapods-deintegrate
|
74
86
|
cocoapods-prune-localizations!
|
75
87
|
rake
|
88
|
+
rspec (~> 3.1.0)
|
76
89
|
|
77
90
|
BUNDLED WITH
|
78
91
|
1.10.6
|
data/Rakefile
CHANGED
data/lib/cocoapods_plugin.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require_relative 'pruner'
|
2
2
|
module CocoapodsPruneLocalizations
|
3
|
-
Pod::HooksManager.register('cocoapods-prune-localizations', :
|
4
|
-
Pruner.new(context, user_options)
|
3
|
+
Pod::HooksManager.register('cocoapods-prune-localizations', :pre_install) do |context, user_options|
|
4
|
+
Pruner.new(context, user_options)
|
5
5
|
end
|
6
6
|
end
|
data/lib/pruner.rb
CHANGED
@@ -3,29 +3,42 @@ require_relative 'utils'
|
|
3
3
|
module CocoapodsPruneLocalizations
|
4
4
|
class Pruner
|
5
5
|
def initialize(context, user_options)
|
6
|
-
@sandbox_root = Pathname.new context.sandbox_root
|
7
|
-
@pod_project = Xcodeproj::Project.open File.join(context.sandbox_root, 'Pods.xcodeproj')
|
8
6
|
@user_options = self.class.user_options(context, user_options)
|
9
7
|
@pruned_bundles_path = File.join(context.sandbox_root, "Pruned Localized Bundles")
|
10
8
|
FileUtils.mkdir @pruned_bundles_path unless Dir.exist? @pruned_bundles_path
|
9
|
+
|
10
|
+
inject_podfile_post_install_hook(context)
|
11
11
|
end
|
12
12
|
|
13
13
|
def self.user_options(context, orig_user_opts = {})
|
14
14
|
user_options = {}
|
15
15
|
if orig_user_opts["localizations"]
|
16
16
|
user_options["localizations"] = orig_user_opts["localizations"].map do |loc|
|
17
|
-
|
18
|
-
|
19
|
-
else
|
20
|
-
loc + ".lproj"
|
21
|
-
end
|
17
|
+
loc = loc + ".lproj" unless loc.end_with? ".lproj"
|
18
|
+
loc
|
22
19
|
end
|
23
20
|
else
|
24
|
-
user_options["localizations"] = Utils.user_project_localizations(context.
|
21
|
+
user_options["localizations"] = Utils.user_project_localizations(context.podfile.target_definition_list)
|
25
22
|
end
|
26
23
|
user_options
|
27
24
|
end
|
28
25
|
|
26
|
+
#Because the pre_install hook is executed before anything at all is generated
|
27
|
+
#The plugin hooks to the Podfile's post_install hook, which (as documented)
|
28
|
+
#happens after the Project is generated but before is saved, a perfect spot for this
|
29
|
+
def inject_podfile_post_install_hook(context)
|
30
|
+
podfile = context.podfile
|
31
|
+
previous_block = podfile.instance_variable_get(:@post_install_callback)
|
32
|
+
|
33
|
+
podfile.post_install do |installer|
|
34
|
+
|
35
|
+
@pod_project = installer.pods_project
|
36
|
+
@sandbox_root = installer.sandbox.root
|
37
|
+
prune!
|
38
|
+
previous_block.call(installer) if previous_block
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
29
42
|
def resources_scripts(group)
|
30
43
|
file_references = []
|
31
44
|
group.children.objects.each do |children|
|
@@ -49,8 +62,8 @@ module CocoapodsPruneLocalizations
|
|
49
62
|
|
50
63
|
#Group all the Pods
|
51
64
|
pod_groups = []
|
52
|
-
pod_items = @pod_project
|
53
|
-
dev_pod_items = @pod_project
|
65
|
+
pod_items = @pod_project.pods
|
66
|
+
dev_pod_items = @pod_project.development_pods
|
54
67
|
pod_groups += pod_items.children.objects if pod_items
|
55
68
|
pod_groups += dev_pod_items.children.objects if dev_pod_items
|
56
69
|
|
@@ -142,7 +155,6 @@ module CocoapodsPruneLocalizations
|
|
142
155
|
end
|
143
156
|
fd.close
|
144
157
|
end
|
145
|
-
@pod_project.save
|
146
158
|
end
|
147
159
|
end
|
148
160
|
|
data/lib/utils.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
module CocoapodsPruneLocalizations
|
2
2
|
class Utils
|
3
|
-
def self.user_project_localizations(
|
3
|
+
def self.user_project_localizations(targets)
|
4
4
|
localizations = []
|
5
|
-
user_projects =
|
6
|
-
user_projects.uniq!
|
5
|
+
user_projects = targets.map { |target| target.user_project_path }
|
6
|
+
user_projects.uniq!.compact!
|
7
7
|
|
8
8
|
user_projects.each do |project_path|
|
9
9
|
project = Xcodeproj::Project.open project_path
|
@@ -0,0 +1,352 @@
|
|
1
|
+
// !$*UTF8*$!
|
2
|
+
{
|
3
|
+
archiveVersion = 1;
|
4
|
+
classes = {
|
5
|
+
};
|
6
|
+
objectVersion = 46;
|
7
|
+
objects = {
|
8
|
+
|
9
|
+
/* Begin PBXBuildFile section */
|
10
|
+
5A21034F1CF33C2900CE9AA2 /* iOSTarget.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5A21034E1CF33C2900CE9AA2 /* iOSTarget.h */; };
|
11
|
+
5A2103511CF33C2900CE9AA2 /* iOSTarget.m in Sources */ = {isa = PBXBuildFile; fileRef = 5A2103501CF33C2900CE9AA2 /* iOSTarget.m */; };
|
12
|
+
5A21035E1CF33C5900CE9AA2 /* osxTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 5A21035D1CF33C5900CE9AA2 /* osxTarget.h */; };
|
13
|
+
5A2103601CF33C5900CE9AA2 /* osxTarget.m in Sources */ = {isa = PBXBuildFile; fileRef = 5A21035F1CF33C5900CE9AA2 /* osxTarget.m */; };
|
14
|
+
/* End PBXBuildFile section */
|
15
|
+
|
16
|
+
/* Begin PBXCopyFilesBuildPhase section */
|
17
|
+
5A2103491CF33C2900CE9AA2 /* CopyFiles */ = {
|
18
|
+
isa = PBXCopyFilesBuildPhase;
|
19
|
+
buildActionMask = 2147483647;
|
20
|
+
dstPath = "include/$(PRODUCT_NAME)";
|
21
|
+
dstSubfolderSpec = 16;
|
22
|
+
files = (
|
23
|
+
5A21034F1CF33C2900CE9AA2 /* iOSTarget.h in CopyFiles */,
|
24
|
+
);
|
25
|
+
runOnlyForDeploymentPostprocessing = 0;
|
26
|
+
};
|
27
|
+
/* End PBXCopyFilesBuildPhase section */
|
28
|
+
|
29
|
+
/* Begin PBXFileReference section */
|
30
|
+
5A21034B1CF33C2900CE9AA2 /* libiOSTarget.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libiOSTarget.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
31
|
+
5A21034E1CF33C2900CE9AA2 /* iOSTarget.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = iOSTarget.h; sourceTree = "<group>"; };
|
32
|
+
5A2103501CF33C2900CE9AA2 /* iOSTarget.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = iOSTarget.m; sourceTree = "<group>"; };
|
33
|
+
5A21035B1CF33C5900CE9AA2 /* libosxTarget.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libosxTarget.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
34
|
+
5A21035D1CF33C5900CE9AA2 /* osxTarget.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = osxTarget.h; sourceTree = "<group>"; };
|
35
|
+
5A21035F1CF33C5900CE9AA2 /* osxTarget.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = osxTarget.m; sourceTree = "<group>"; };
|
36
|
+
/* End PBXFileReference section */
|
37
|
+
|
38
|
+
/* Begin PBXFrameworksBuildPhase section */
|
39
|
+
5A2103481CF33C2900CE9AA2 /* Frameworks */ = {
|
40
|
+
isa = PBXFrameworksBuildPhase;
|
41
|
+
buildActionMask = 2147483647;
|
42
|
+
files = (
|
43
|
+
);
|
44
|
+
runOnlyForDeploymentPostprocessing = 0;
|
45
|
+
};
|
46
|
+
5A2103581CF33C5900CE9AA2 /* Frameworks */ = {
|
47
|
+
isa = PBXFrameworksBuildPhase;
|
48
|
+
buildActionMask = 2147483647;
|
49
|
+
files = (
|
50
|
+
);
|
51
|
+
runOnlyForDeploymentPostprocessing = 0;
|
52
|
+
};
|
53
|
+
/* End PBXFrameworksBuildPhase section */
|
54
|
+
|
55
|
+
/* Begin PBXGroup section */
|
56
|
+
5A2103421CF33C2900CE9AA2 = {
|
57
|
+
isa = PBXGroup;
|
58
|
+
children = (
|
59
|
+
5A21034D1CF33C2900CE9AA2 /* iOSTarget */,
|
60
|
+
5A21035C1CF33C5900CE9AA2 /* osxTarget */,
|
61
|
+
5A21034C1CF33C2900CE9AA2 /* Products */,
|
62
|
+
);
|
63
|
+
sourceTree = "<group>";
|
64
|
+
};
|
65
|
+
5A21034C1CF33C2900CE9AA2 /* Products */ = {
|
66
|
+
isa = PBXGroup;
|
67
|
+
children = (
|
68
|
+
5A21034B1CF33C2900CE9AA2 /* libiOSTarget.a */,
|
69
|
+
5A21035B1CF33C5900CE9AA2 /* libosxTarget.a */,
|
70
|
+
);
|
71
|
+
name = Products;
|
72
|
+
sourceTree = "<group>";
|
73
|
+
};
|
74
|
+
5A21034D1CF33C2900CE9AA2 /* iOSTarget */ = {
|
75
|
+
isa = PBXGroup;
|
76
|
+
children = (
|
77
|
+
5A21034E1CF33C2900CE9AA2 /* iOSTarget.h */,
|
78
|
+
5A2103501CF33C2900CE9AA2 /* iOSTarget.m */,
|
79
|
+
);
|
80
|
+
path = iOSTarget;
|
81
|
+
sourceTree = "<group>";
|
82
|
+
};
|
83
|
+
5A21035C1CF33C5900CE9AA2 /* osxTarget */ = {
|
84
|
+
isa = PBXGroup;
|
85
|
+
children = (
|
86
|
+
5A21035D1CF33C5900CE9AA2 /* osxTarget.h */,
|
87
|
+
5A21035F1CF33C5900CE9AA2 /* osxTarget.m */,
|
88
|
+
);
|
89
|
+
path = osxTarget;
|
90
|
+
sourceTree = "<group>";
|
91
|
+
};
|
92
|
+
/* End PBXGroup section */
|
93
|
+
|
94
|
+
/* Begin PBXHeadersBuildPhase section */
|
95
|
+
5A2103591CF33C5900CE9AA2 /* Headers */ = {
|
96
|
+
isa = PBXHeadersBuildPhase;
|
97
|
+
buildActionMask = 2147483647;
|
98
|
+
files = (
|
99
|
+
5A21035E1CF33C5900CE9AA2 /* osxTarget.h in Headers */,
|
100
|
+
);
|
101
|
+
runOnlyForDeploymentPostprocessing = 0;
|
102
|
+
};
|
103
|
+
/* End PBXHeadersBuildPhase section */
|
104
|
+
|
105
|
+
/* Begin PBXNativeTarget section */
|
106
|
+
5A21034A1CF33C2900CE9AA2 /* iOSTarget */ = {
|
107
|
+
isa = PBXNativeTarget;
|
108
|
+
buildConfigurationList = 5A2103541CF33C2900CE9AA2 /* Build configuration list for PBXNativeTarget "iOSTarget" */;
|
109
|
+
buildPhases = (
|
110
|
+
5A2103471CF33C2900CE9AA2 /* Sources */,
|
111
|
+
5A2103481CF33C2900CE9AA2 /* Frameworks */,
|
112
|
+
5A2103491CF33C2900CE9AA2 /* CopyFiles */,
|
113
|
+
);
|
114
|
+
buildRules = (
|
115
|
+
);
|
116
|
+
dependencies = (
|
117
|
+
);
|
118
|
+
name = iOSTarget;
|
119
|
+
productName = iOSTarget;
|
120
|
+
productReference = 5A21034B1CF33C2900CE9AA2 /* libiOSTarget.a */;
|
121
|
+
productType = "com.apple.product-type.library.static";
|
122
|
+
};
|
123
|
+
5A21035A1CF33C5900CE9AA2 /* osxTarget */ = {
|
124
|
+
isa = PBXNativeTarget;
|
125
|
+
buildConfigurationList = 5A2103611CF33C5900CE9AA2 /* Build configuration list for PBXNativeTarget "osxTarget" */;
|
126
|
+
buildPhases = (
|
127
|
+
5A2103571CF33C5900CE9AA2 /* Sources */,
|
128
|
+
5A2103581CF33C5900CE9AA2 /* Frameworks */,
|
129
|
+
5A2103591CF33C5900CE9AA2 /* Headers */,
|
130
|
+
);
|
131
|
+
buildRules = (
|
132
|
+
);
|
133
|
+
dependencies = (
|
134
|
+
);
|
135
|
+
name = osxTarget;
|
136
|
+
productName = osxTarget;
|
137
|
+
productReference = 5A21035B1CF33C5900CE9AA2 /* libosxTarget.a */;
|
138
|
+
productType = "com.apple.product-type.library.static";
|
139
|
+
};
|
140
|
+
/* End PBXNativeTarget section */
|
141
|
+
|
142
|
+
/* Begin PBXProject section */
|
143
|
+
5A2103431CF33C2900CE9AA2 /* Project object */ = {
|
144
|
+
isa = PBXProject;
|
145
|
+
attributes = {
|
146
|
+
LastUpgradeCheck = 0730;
|
147
|
+
ORGANIZATIONNAME = "Diego Torres";
|
148
|
+
TargetAttributes = {
|
149
|
+
5A21034A1CF33C2900CE9AA2 = {
|
150
|
+
CreatedOnToolsVersion = 7.3.1;
|
151
|
+
};
|
152
|
+
5A21035A1CF33C5900CE9AA2 = {
|
153
|
+
CreatedOnToolsVersion = 7.3.1;
|
154
|
+
};
|
155
|
+
};
|
156
|
+
};
|
157
|
+
buildConfigurationList = 5A2103461CF33C2900CE9AA2 /* Build configuration list for PBXProject "Dummy Targets" */;
|
158
|
+
compatibilityVersion = "Xcode 3.2";
|
159
|
+
developmentRegion = English;
|
160
|
+
hasScannedForEncodings = 0;
|
161
|
+
knownRegions = (
|
162
|
+
en,
|
163
|
+
);
|
164
|
+
mainGroup = 5A2103421CF33C2900CE9AA2;
|
165
|
+
productRefGroup = 5A21034C1CF33C2900CE9AA2 /* Products */;
|
166
|
+
projectDirPath = "";
|
167
|
+
projectRoot = "";
|
168
|
+
targets = (
|
169
|
+
5A21034A1CF33C2900CE9AA2 /* iOSTarget */,
|
170
|
+
5A21035A1CF33C5900CE9AA2 /* osxTarget */,
|
171
|
+
);
|
172
|
+
};
|
173
|
+
/* End PBXProject section */
|
174
|
+
|
175
|
+
/* Begin PBXSourcesBuildPhase section */
|
176
|
+
5A2103471CF33C2900CE9AA2 /* Sources */ = {
|
177
|
+
isa = PBXSourcesBuildPhase;
|
178
|
+
buildActionMask = 2147483647;
|
179
|
+
files = (
|
180
|
+
5A2103511CF33C2900CE9AA2 /* iOSTarget.m in Sources */,
|
181
|
+
);
|
182
|
+
runOnlyForDeploymentPostprocessing = 0;
|
183
|
+
};
|
184
|
+
5A2103571CF33C5900CE9AA2 /* Sources */ = {
|
185
|
+
isa = PBXSourcesBuildPhase;
|
186
|
+
buildActionMask = 2147483647;
|
187
|
+
files = (
|
188
|
+
5A2103601CF33C5900CE9AA2 /* osxTarget.m in Sources */,
|
189
|
+
);
|
190
|
+
runOnlyForDeploymentPostprocessing = 0;
|
191
|
+
};
|
192
|
+
/* End PBXSourcesBuildPhase section */
|
193
|
+
|
194
|
+
/* Begin XCBuildConfiguration section */
|
195
|
+
5A2103521CF33C2900CE9AA2 /* Debug */ = {
|
196
|
+
isa = XCBuildConfiguration;
|
197
|
+
buildSettings = {
|
198
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
199
|
+
CLANG_ANALYZER_NONNULL = YES;
|
200
|
+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
201
|
+
CLANG_CXX_LIBRARY = "libc++";
|
202
|
+
CLANG_ENABLE_MODULES = YES;
|
203
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
204
|
+
CLANG_WARN_BOOL_CONVERSION = YES;
|
205
|
+
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
206
|
+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
207
|
+
CLANG_WARN_EMPTY_BODY = YES;
|
208
|
+
CLANG_WARN_ENUM_CONVERSION = YES;
|
209
|
+
CLANG_WARN_INT_CONVERSION = YES;
|
210
|
+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
211
|
+
CLANG_WARN_UNREACHABLE_CODE = YES;
|
212
|
+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
213
|
+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
214
|
+
COPY_PHASE_STRIP = NO;
|
215
|
+
DEBUG_INFORMATION_FORMAT = dwarf;
|
216
|
+
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
217
|
+
ENABLE_TESTABILITY = YES;
|
218
|
+
GCC_C_LANGUAGE_STANDARD = gnu99;
|
219
|
+
GCC_DYNAMIC_NO_PIC = NO;
|
220
|
+
GCC_NO_COMMON_BLOCKS = YES;
|
221
|
+
GCC_OPTIMIZATION_LEVEL = 0;
|
222
|
+
GCC_PREPROCESSOR_DEFINITIONS = (
|
223
|
+
"DEBUG=1",
|
224
|
+
"$(inherited)",
|
225
|
+
);
|
226
|
+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
227
|
+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
228
|
+
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
229
|
+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
230
|
+
GCC_WARN_UNUSED_FUNCTION = YES;
|
231
|
+
GCC_WARN_UNUSED_VARIABLE = YES;
|
232
|
+
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
|
233
|
+
MTL_ENABLE_DEBUG_INFO = YES;
|
234
|
+
ONLY_ACTIVE_ARCH = YES;
|
235
|
+
SDKROOT = iphoneos;
|
236
|
+
};
|
237
|
+
name = Debug;
|
238
|
+
};
|
239
|
+
5A2103531CF33C2900CE9AA2 /* Release */ = {
|
240
|
+
isa = XCBuildConfiguration;
|
241
|
+
buildSettings = {
|
242
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
243
|
+
CLANG_ANALYZER_NONNULL = YES;
|
244
|
+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
245
|
+
CLANG_CXX_LIBRARY = "libc++";
|
246
|
+
CLANG_ENABLE_MODULES = YES;
|
247
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
248
|
+
CLANG_WARN_BOOL_CONVERSION = YES;
|
249
|
+
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
250
|
+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
251
|
+
CLANG_WARN_EMPTY_BODY = YES;
|
252
|
+
CLANG_WARN_ENUM_CONVERSION = YES;
|
253
|
+
CLANG_WARN_INT_CONVERSION = YES;
|
254
|
+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
255
|
+
CLANG_WARN_UNREACHABLE_CODE = YES;
|
256
|
+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
257
|
+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
258
|
+
COPY_PHASE_STRIP = NO;
|
259
|
+
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
260
|
+
ENABLE_NS_ASSERTIONS = NO;
|
261
|
+
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
262
|
+
GCC_C_LANGUAGE_STANDARD = gnu99;
|
263
|
+
GCC_NO_COMMON_BLOCKS = YES;
|
264
|
+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
265
|
+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
266
|
+
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
267
|
+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
268
|
+
GCC_WARN_UNUSED_FUNCTION = YES;
|
269
|
+
GCC_WARN_UNUSED_VARIABLE = YES;
|
270
|
+
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
|
271
|
+
MTL_ENABLE_DEBUG_INFO = NO;
|
272
|
+
SDKROOT = iphoneos;
|
273
|
+
VALIDATE_PRODUCT = YES;
|
274
|
+
};
|
275
|
+
name = Release;
|
276
|
+
};
|
277
|
+
5A2103551CF33C2900CE9AA2 /* Debug */ = {
|
278
|
+
isa = XCBuildConfiguration;
|
279
|
+
buildSettings = {
|
280
|
+
OTHER_LDFLAGS = "$(inherited)";
|
281
|
+
PRODUCT_NAME = "$(TARGET_NAME)";
|
282
|
+
SKIP_INSTALL = YES;
|
283
|
+
};
|
284
|
+
name = Debug;
|
285
|
+
};
|
286
|
+
5A2103561CF33C2900CE9AA2 /* Release */ = {
|
287
|
+
isa = XCBuildConfiguration;
|
288
|
+
buildSettings = {
|
289
|
+
OTHER_LDFLAGS = "$(inherited)";
|
290
|
+
PRODUCT_NAME = "$(TARGET_NAME)";
|
291
|
+
SKIP_INSTALL = YES;
|
292
|
+
};
|
293
|
+
name = Release;
|
294
|
+
};
|
295
|
+
5A2103621CF33C5900CE9AA2 /* Debug */ = {
|
296
|
+
isa = XCBuildConfiguration;
|
297
|
+
buildSettings = {
|
298
|
+
CODE_SIGN_IDENTITY = "-";
|
299
|
+
EXECUTABLE_PREFIX = lib;
|
300
|
+
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
301
|
+
OTHER_LDFLAGS = "$(inherited)";
|
302
|
+
PRODUCT_NAME = "$(TARGET_NAME)";
|
303
|
+
SDKROOT = macosx;
|
304
|
+
};
|
305
|
+
name = Debug;
|
306
|
+
};
|
307
|
+
5A2103631CF33C5900CE9AA2 /* Release */ = {
|
308
|
+
isa = XCBuildConfiguration;
|
309
|
+
buildSettings = {
|
310
|
+
CODE_SIGN_IDENTITY = "-";
|
311
|
+
EXECUTABLE_PREFIX = lib;
|
312
|
+
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
313
|
+
OTHER_LDFLAGS = "$(inherited)";
|
314
|
+
PRODUCT_NAME = "$(TARGET_NAME)";
|
315
|
+
SDKROOT = macosx;
|
316
|
+
};
|
317
|
+
name = Release;
|
318
|
+
};
|
319
|
+
/* End XCBuildConfiguration section */
|
320
|
+
|
321
|
+
/* Begin XCConfigurationList section */
|
322
|
+
5A2103461CF33C2900CE9AA2 /* Build configuration list for PBXProject "Dummy Targets" */ = {
|
323
|
+
isa = XCConfigurationList;
|
324
|
+
buildConfigurations = (
|
325
|
+
5A2103521CF33C2900CE9AA2 /* Debug */,
|
326
|
+
5A2103531CF33C2900CE9AA2 /* Release */,
|
327
|
+
);
|
328
|
+
defaultConfigurationIsVisible = 0;
|
329
|
+
defaultConfigurationName = Release;
|
330
|
+
};
|
331
|
+
5A2103541CF33C2900CE9AA2 /* Build configuration list for PBXNativeTarget "iOSTarget" */ = {
|
332
|
+
isa = XCConfigurationList;
|
333
|
+
buildConfigurations = (
|
334
|
+
5A2103551CF33C2900CE9AA2 /* Debug */,
|
335
|
+
5A2103561CF33C2900CE9AA2 /* Release */,
|
336
|
+
);
|
337
|
+
defaultConfigurationIsVisible = 0;
|
338
|
+
defaultConfigurationName = Release;
|
339
|
+
};
|
340
|
+
5A2103611CF33C5900CE9AA2 /* Build configuration list for PBXNativeTarget "osxTarget" */ = {
|
341
|
+
isa = XCConfigurationList;
|
342
|
+
buildConfigurations = (
|
343
|
+
5A2103621CF33C5900CE9AA2 /* Debug */,
|
344
|
+
5A2103631CF33C5900CE9AA2 /* Release */,
|
345
|
+
);
|
346
|
+
defaultConfigurationIsVisible = 0;
|
347
|
+
defaultConfigurationName = Release;
|
348
|
+
};
|
349
|
+
/* End XCConfigurationList section */
|
350
|
+
};
|
351
|
+
rootObject = 5A2103431CF33C2900CE9AA2 /* Project object */;
|
352
|
+
}
|
Binary file
|
@@ -0,0 +1,80 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<Scheme
|
3
|
+
LastUpgradeVersion = "0730"
|
4
|
+
version = "1.3">
|
5
|
+
<BuildAction
|
6
|
+
parallelizeBuildables = "YES"
|
7
|
+
buildImplicitDependencies = "YES">
|
8
|
+
<BuildActionEntries>
|
9
|
+
<BuildActionEntry
|
10
|
+
buildForTesting = "YES"
|
11
|
+
buildForRunning = "YES"
|
12
|
+
buildForProfiling = "YES"
|
13
|
+
buildForArchiving = "YES"
|
14
|
+
buildForAnalyzing = "YES">
|
15
|
+
<BuildableReference
|
16
|
+
BuildableIdentifier = "primary"
|
17
|
+
BlueprintIdentifier = "5A21034A1CF33C2900CE9AA2"
|
18
|
+
BuildableName = "libiOSTarget.a"
|
19
|
+
BlueprintName = "iOSTarget"
|
20
|
+
ReferencedContainer = "container:Dummy Targets.xcodeproj">
|
21
|
+
</BuildableReference>
|
22
|
+
</BuildActionEntry>
|
23
|
+
</BuildActionEntries>
|
24
|
+
</BuildAction>
|
25
|
+
<TestAction
|
26
|
+
buildConfiguration = "Debug"
|
27
|
+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
28
|
+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
29
|
+
shouldUseLaunchSchemeArgsEnv = "YES">
|
30
|
+
<Testables>
|
31
|
+
</Testables>
|
32
|
+
<AdditionalOptions>
|
33
|
+
</AdditionalOptions>
|
34
|
+
</TestAction>
|
35
|
+
<LaunchAction
|
36
|
+
buildConfiguration = "Debug"
|
37
|
+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
38
|
+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
39
|
+
launchStyle = "0"
|
40
|
+
useCustomWorkingDirectory = "NO"
|
41
|
+
ignoresPersistentStateOnLaunch = "NO"
|
42
|
+
debugDocumentVersioning = "YES"
|
43
|
+
debugServiceExtension = "internal"
|
44
|
+
allowLocationSimulation = "YES">
|
45
|
+
<MacroExpansion>
|
46
|
+
<BuildableReference
|
47
|
+
BuildableIdentifier = "primary"
|
48
|
+
BlueprintIdentifier = "5A21034A1CF33C2900CE9AA2"
|
49
|
+
BuildableName = "libiOSTarget.a"
|
50
|
+
BlueprintName = "iOSTarget"
|
51
|
+
ReferencedContainer = "container:Dummy Targets.xcodeproj">
|
52
|
+
</BuildableReference>
|
53
|
+
</MacroExpansion>
|
54
|
+
<AdditionalOptions>
|
55
|
+
</AdditionalOptions>
|
56
|
+
</LaunchAction>
|
57
|
+
<ProfileAction
|
58
|
+
buildConfiguration = "Release"
|
59
|
+
shouldUseLaunchSchemeArgsEnv = "YES"
|
60
|
+
savedToolIdentifier = ""
|
61
|
+
useCustomWorkingDirectory = "NO"
|
62
|
+
debugDocumentVersioning = "YES">
|
63
|
+
<MacroExpansion>
|
64
|
+
<BuildableReference
|
65
|
+
BuildableIdentifier = "primary"
|
66
|
+
BlueprintIdentifier = "5A21034A1CF33C2900CE9AA2"
|
67
|
+
BuildableName = "libiOSTarget.a"
|
68
|
+
BlueprintName = "iOSTarget"
|
69
|
+
ReferencedContainer = "container:Dummy Targets.xcodeproj">
|
70
|
+
</BuildableReference>
|
71
|
+
</MacroExpansion>
|
72
|
+
</ProfileAction>
|
73
|
+
<AnalyzeAction
|
74
|
+
buildConfiguration = "Debug">
|
75
|
+
</AnalyzeAction>
|
76
|
+
<ArchiveAction
|
77
|
+
buildConfiguration = "Release"
|
78
|
+
revealArchiveInOrganizer = "YES">
|
79
|
+
</ArchiveAction>
|
80
|
+
</Scheme>
|
@@ -0,0 +1,80 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<Scheme
|
3
|
+
LastUpgradeVersion = "0730"
|
4
|
+
version = "1.3">
|
5
|
+
<BuildAction
|
6
|
+
parallelizeBuildables = "YES"
|
7
|
+
buildImplicitDependencies = "YES">
|
8
|
+
<BuildActionEntries>
|
9
|
+
<BuildActionEntry
|
10
|
+
buildForTesting = "YES"
|
11
|
+
buildForRunning = "YES"
|
12
|
+
buildForProfiling = "YES"
|
13
|
+
buildForArchiving = "YES"
|
14
|
+
buildForAnalyzing = "YES">
|
15
|
+
<BuildableReference
|
16
|
+
BuildableIdentifier = "primary"
|
17
|
+
BlueprintIdentifier = "5A21035A1CF33C5900CE9AA2"
|
18
|
+
BuildableName = "libosxTarget.a"
|
19
|
+
BlueprintName = "osxTarget"
|
20
|
+
ReferencedContainer = "container:Dummy Targets.xcodeproj">
|
21
|
+
</BuildableReference>
|
22
|
+
</BuildActionEntry>
|
23
|
+
</BuildActionEntries>
|
24
|
+
</BuildAction>
|
25
|
+
<TestAction
|
26
|
+
buildConfiguration = "Debug"
|
27
|
+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
28
|
+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
29
|
+
shouldUseLaunchSchemeArgsEnv = "YES">
|
30
|
+
<Testables>
|
31
|
+
</Testables>
|
32
|
+
<AdditionalOptions>
|
33
|
+
</AdditionalOptions>
|
34
|
+
</TestAction>
|
35
|
+
<LaunchAction
|
36
|
+
buildConfiguration = "Debug"
|
37
|
+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
38
|
+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
39
|
+
launchStyle = "0"
|
40
|
+
useCustomWorkingDirectory = "NO"
|
41
|
+
ignoresPersistentStateOnLaunch = "NO"
|
42
|
+
debugDocumentVersioning = "YES"
|
43
|
+
debugServiceExtension = "internal"
|
44
|
+
allowLocationSimulation = "YES">
|
45
|
+
<MacroExpansion>
|
46
|
+
<BuildableReference
|
47
|
+
BuildableIdentifier = "primary"
|
48
|
+
BlueprintIdentifier = "5A21035A1CF33C5900CE9AA2"
|
49
|
+
BuildableName = "libosxTarget.a"
|
50
|
+
BlueprintName = "osxTarget"
|
51
|
+
ReferencedContainer = "container:Dummy Targets.xcodeproj">
|
52
|
+
</BuildableReference>
|
53
|
+
</MacroExpansion>
|
54
|
+
<AdditionalOptions>
|
55
|
+
</AdditionalOptions>
|
56
|
+
</LaunchAction>
|
57
|
+
<ProfileAction
|
58
|
+
buildConfiguration = "Release"
|
59
|
+
shouldUseLaunchSchemeArgsEnv = "YES"
|
60
|
+
savedToolIdentifier = ""
|
61
|
+
useCustomWorkingDirectory = "NO"
|
62
|
+
debugDocumentVersioning = "YES">
|
63
|
+
<MacroExpansion>
|
64
|
+
<BuildableReference
|
65
|
+
BuildableIdentifier = "primary"
|
66
|
+
BlueprintIdentifier = "5A21035A1CF33C5900CE9AA2"
|
67
|
+
BuildableName = "libosxTarget.a"
|
68
|
+
BlueprintName = "osxTarget"
|
69
|
+
ReferencedContainer = "container:Dummy Targets.xcodeproj">
|
70
|
+
</BuildableReference>
|
71
|
+
</MacroExpansion>
|
72
|
+
</ProfileAction>
|
73
|
+
<AnalyzeAction
|
74
|
+
buildConfiguration = "Debug">
|
75
|
+
</AnalyzeAction>
|
76
|
+
<ArchiveAction
|
77
|
+
buildConfiguration = "Release"
|
78
|
+
revealArchiveInOrganizer = "YES">
|
79
|
+
</ArchiveAction>
|
80
|
+
</Scheme>
|
@@ -0,0 +1,32 @@
|
|
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>SchemeUserState</key>
|
6
|
+
<dict>
|
7
|
+
<key>iOSTarget.xcscheme</key>
|
8
|
+
<dict>
|
9
|
+
<key>orderHint</key>
|
10
|
+
<integer>0</integer>
|
11
|
+
</dict>
|
12
|
+
<key>osxTarget.xcscheme</key>
|
13
|
+
<dict>
|
14
|
+
<key>orderHint</key>
|
15
|
+
<integer>1</integer>
|
16
|
+
</dict>
|
17
|
+
</dict>
|
18
|
+
<key>SuppressBuildableAutocreation</key>
|
19
|
+
<dict>
|
20
|
+
<key>5A21034A1CF33C2900CE9AA2</key>
|
21
|
+
<dict>
|
22
|
+
<key>primary</key>
|
23
|
+
<true/>
|
24
|
+
</dict>
|
25
|
+
<key>5A21035A1CF33C5900CE9AA2</key>
|
26
|
+
<dict>
|
27
|
+
<key>primary</key>
|
28
|
+
<true/>
|
29
|
+
</dict>
|
30
|
+
</dict>
|
31
|
+
</dict>
|
32
|
+
</plist>
|
@@ -0,0 +1,153 @@
|
|
1
|
+
require 'cocoapods'
|
2
|
+
require 'claide/command/plugin_manager'
|
3
|
+
|
4
|
+
CLAide::Command::PluginManager.load_plugins('cocoapods')
|
5
|
+
Pod::Config.instance.silent = true
|
6
|
+
|
7
|
+
def generate_podfile(localizations = [], used_pods = [])
|
8
|
+
Pod::Podfile.new do
|
9
|
+
opts = {}
|
10
|
+
opts[:localizations] = localizations unless localizations.empty?
|
11
|
+
platform :ios, '9.0'
|
12
|
+
plugin 'cocoapods-prune-localizations', opts
|
13
|
+
|
14
|
+
target 'iOSTarget' do
|
15
|
+
used_pods.each do |pod_dict|
|
16
|
+
name = pod_dict[:name]
|
17
|
+
opts = {}
|
18
|
+
opts[:path] ||= pod_dict[:path]
|
19
|
+
|
20
|
+
pod name, opts
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def lproj_in_bundle(bundle_path)
|
27
|
+
lprojs = []
|
28
|
+
Dir.foreach(bundle_path) do |filename|
|
29
|
+
if filename.end_with? ".lproj"
|
30
|
+
lprojs << File.basename(filename)
|
31
|
+
elsif filename.end_with? ".bundle"
|
32
|
+
lprojs += lproj_in_bundle(File.join(bundle_path, filename))
|
33
|
+
end
|
34
|
+
end
|
35
|
+
lprojs
|
36
|
+
end
|
37
|
+
|
38
|
+
def resource_files(group)
|
39
|
+
resGroups = group.recursive_children_groups.select do |group|
|
40
|
+
group.name == "Resources"
|
41
|
+
end
|
42
|
+
|
43
|
+
resGroups.each do |resGroup|
|
44
|
+
resGroup.files.each do |file|
|
45
|
+
yield file
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
describe 'Podfile integration' do
|
51
|
+
before(:each) do
|
52
|
+
@test_dir = Dir.mktmpdir("prune-loc")
|
53
|
+
@sandbox = Pod::Sandbox.new File.join(@test_dir, "/Pods");
|
54
|
+
FileUtils.cp_r 'spec/fixtures/Dummy Targets', @test_dir
|
55
|
+
end
|
56
|
+
|
57
|
+
after(:each) do
|
58
|
+
FileUtils.rm_r @sandbox.root
|
59
|
+
end
|
60
|
+
|
61
|
+
it 'calls original post_install hook' do
|
62
|
+
Dir.chdir(@test_dir) do
|
63
|
+
podfile = generate_podfile
|
64
|
+
|
65
|
+
called = false
|
66
|
+
podfile.post_install do |installer|
|
67
|
+
called = true
|
68
|
+
end
|
69
|
+
|
70
|
+
installer = Pod::Installer.new(@sandbox, podfile, nil)
|
71
|
+
installer.installation_options.integrate_targets = false
|
72
|
+
|
73
|
+
installer.install!
|
74
|
+
|
75
|
+
expect(called).to be_truthy
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
it 'keeps only specified languages in Resources' do
|
80
|
+
|
81
|
+
pods_to_use = [{:name => "FormatterKit"}]
|
82
|
+
|
83
|
+
Dir.chdir(@test_dir) do
|
84
|
+
langs = ["es.lproj", "en.lproj"]
|
85
|
+
podfile = generate_podfile(langs, pods_to_use)
|
86
|
+
|
87
|
+
installer = Pod::Installer.new(@sandbox, podfile, nil)
|
88
|
+
installer.installation_options.integrate_targets = false
|
89
|
+
|
90
|
+
installer.install!
|
91
|
+
|
92
|
+
project = installer.pods_project
|
93
|
+
group = project.pod_group(pods_to_use[0][:name])
|
94
|
+
|
95
|
+
found_langs = Set.new
|
96
|
+
|
97
|
+
resource_files(group) do |file|
|
98
|
+
found_langs.add File.basename(file.path) if file.path.end_with? ".lproj"
|
99
|
+
end
|
100
|
+
|
101
|
+
expect(found_langs).to eq langs.to_set
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
def verify_group(group, langs)
|
106
|
+
found_bundles = []
|
107
|
+
|
108
|
+
resource_files(group) do |file|
|
109
|
+
found_bundles << file.real_path if file.path.end_with? ".bundle"
|
110
|
+
end
|
111
|
+
|
112
|
+
found_langs = found_bundles.map {|path| lproj_in_bundle(path)}.flatten!.to_set
|
113
|
+
expect(found_langs).to eq langs.to_set
|
114
|
+
end
|
115
|
+
|
116
|
+
it 'keeps only specified languages in Bundles' do
|
117
|
+
|
118
|
+
pods_to_use = [{:name => "DateTools"}]
|
119
|
+
|
120
|
+
Dir.chdir(@test_dir) do
|
121
|
+
langs = ["es.lproj", "en.lproj"]
|
122
|
+
podfile = generate_podfile(langs, pods_to_use)
|
123
|
+
|
124
|
+
installer = Pod::Installer.new(@sandbox, podfile, nil)
|
125
|
+
installer.installation_options.integrate_targets = false
|
126
|
+
|
127
|
+
installer.install!
|
128
|
+
|
129
|
+
project = installer.pods_project
|
130
|
+
|
131
|
+
verify_group(project.pod_group(pods_to_use[0][:name]), langs)
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
it 'keeps only specified languages in nested bundles' do
|
136
|
+
pods_to_use = [{:name => "googleplus-ios-sdk"}]
|
137
|
+
|
138
|
+
Dir.chdir(@test_dir) do
|
139
|
+
langs = ["it.lproj", "ja.lproj"]
|
140
|
+
podfile = generate_podfile(langs, pods_to_use)
|
141
|
+
|
142
|
+
installer = Pod::Installer.new(@sandbox, podfile, nil)
|
143
|
+
installer.installation_options.integrate_targets = false
|
144
|
+
|
145
|
+
installer.install!
|
146
|
+
|
147
|
+
project = installer.pods_project
|
148
|
+
|
149
|
+
verify_group(project.pod_group(pods_to_use[0][:name]), langs)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
end
|
data/spec/pruner_spec.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
require_relative '../lib/pruner'
|
2
|
+
|
3
|
+
describe CocoapodsPruneLocalizations do
|
4
|
+
describe 'Pruner' do
|
5
|
+
it "normalizes localizations" do
|
6
|
+
normal_opts = CocoapodsPruneLocalizations::Pruner.user_options(nil, "localizations" => ["es", "en.lproj", "de", "it.lproj"])
|
7
|
+
expect(normal_opts["localizations"]).to eq ["es.lproj", "en.lproj", "de.lproj", "it.lproj"]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
2
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause this
|
4
|
+
# file to always be loaded, without a need to explicitly require it in any files.
|
5
|
+
#
|
6
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
7
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
8
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
9
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
10
|
+
# a separate helper file that requires the additional dependencies and performs
|
11
|
+
# the additional setup, and require it from the spec files that actually need it.
|
12
|
+
#
|
13
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
14
|
+
# users commonly want.
|
15
|
+
#
|
16
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
17
|
+
RSpec.configure do |config|
|
18
|
+
# rspec-expectations config goes here. You can use an alternate
|
19
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
20
|
+
# assertions if you prefer.
|
21
|
+
config.expect_with :rspec do |expectations|
|
22
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
23
|
+
# and `failure_message` of custom matchers include text for helper methods
|
24
|
+
# defined using `chain`, e.g.:
|
25
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
26
|
+
# # => "be bigger than 2 and smaller than 4"
|
27
|
+
# ...rather than:
|
28
|
+
# # => "be bigger than 2"
|
29
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
30
|
+
end
|
31
|
+
|
32
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
33
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
34
|
+
config.mock_with :rspec do |mocks|
|
35
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
36
|
+
# a real object. This is generally recommended, and will default to
|
37
|
+
# `true` in RSpec 4.
|
38
|
+
mocks.verify_partial_doubles = true
|
39
|
+
end
|
40
|
+
|
41
|
+
# The settings below are suggested to provide a good initial experience
|
42
|
+
# with RSpec, but feel free to customize to your heart's content.
|
43
|
+
=begin
|
44
|
+
# These two settings work together to allow you to limit a spec run
|
45
|
+
# to individual examples or groups you care about by tagging them with
|
46
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
47
|
+
# get run.
|
48
|
+
config.filter_run :focus
|
49
|
+
config.run_all_when_everything_filtered = true
|
50
|
+
|
51
|
+
# Limits the available syntax to the non-monkey patched syntax that is recommended.
|
52
|
+
# For more details, see:
|
53
|
+
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
54
|
+
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
55
|
+
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
56
|
+
config.disable_monkey_patching!
|
57
|
+
|
58
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
59
|
+
# be too noisy due to issues in dependencies.
|
60
|
+
config.warnings = true
|
61
|
+
|
62
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
63
|
+
# file, and it's useful to allow more verbose output when running an
|
64
|
+
# individual spec file.
|
65
|
+
if config.files_to_run.one?
|
66
|
+
# Use the documentation formatter for detailed output,
|
67
|
+
# unless a formatter has already been configured
|
68
|
+
# (e.g. via a command-line flag).
|
69
|
+
config.default_formatter = 'doc'
|
70
|
+
end
|
71
|
+
|
72
|
+
# Print the 10 slowest examples and example groups at the
|
73
|
+
# end of the spec run, to help surface which specs are running
|
74
|
+
# particularly slow.
|
75
|
+
config.profile_examples = 10
|
76
|
+
|
77
|
+
# Run specs in random order to surface order dependencies. If you find an
|
78
|
+
# order dependency and want to debug it, you can fix the order by providing
|
79
|
+
# the seed, which is printed after each run.
|
80
|
+
# --seed 1234
|
81
|
+
config.order = :random
|
82
|
+
|
83
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
84
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
85
|
+
# test failures related to randomization by passing the same `--seed` value
|
86
|
+
# as the one that triggered the failure.
|
87
|
+
Kernel.srand config.seed
|
88
|
+
=end
|
89
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-prune-localizations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Diego Torres
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -47,6 +47,7 @@ extra_rdoc_files: []
|
|
47
47
|
files:
|
48
48
|
- .bundle/config
|
49
49
|
- .gitignore
|
50
|
+
- .rspec
|
50
51
|
- Gemfile
|
51
52
|
- Gemfile.lock
|
52
53
|
- LICENSE.txt
|
@@ -57,6 +58,19 @@ files:
|
|
57
58
|
- lib/cocoapods_plugin.rb
|
58
59
|
- lib/pruner.rb
|
59
60
|
- lib/utils.rb
|
61
|
+
- spec/fixtures/Dummy Targets/Dummy Targets.xcodeproj/project.pbxproj
|
62
|
+
- spec/fixtures/Dummy Targets/Dummy Targets.xcodeproj/project.xcworkspace/contents.xcworkspacedata
|
63
|
+
- spec/fixtures/Dummy Targets/Dummy Targets.xcodeproj/project.xcworkspace/xcuserdata/warorface.xcuserdatad/UserInterfaceState.xcuserstate
|
64
|
+
- spec/fixtures/Dummy Targets/Dummy Targets.xcodeproj/xcuserdata/warorface.xcuserdatad/xcschemes/iOSTarget.xcscheme
|
65
|
+
- spec/fixtures/Dummy Targets/Dummy Targets.xcodeproj/xcuserdata/warorface.xcuserdatad/xcschemes/osxTarget.xcscheme
|
66
|
+
- spec/fixtures/Dummy Targets/Dummy Targets.xcodeproj/xcuserdata/warorface.xcuserdatad/xcschemes/xcschememanagement.plist
|
67
|
+
- spec/fixtures/Dummy Targets/iOSTarget/iOSTarget.h
|
68
|
+
- spec/fixtures/Dummy Targets/iOSTarget/iOSTarget.m
|
69
|
+
- spec/fixtures/Dummy Targets/osxTarget/osxTarget.h
|
70
|
+
- spec/fixtures/Dummy Targets/osxTarget/osxTarget.m
|
71
|
+
- spec/plain_resources_spec.rb
|
72
|
+
- spec/pruner_spec.rb
|
73
|
+
- spec/spec_helper.rb
|
60
74
|
homepage: https://github.com/dtorres/cocoapods-prune-localizations
|
61
75
|
licenses:
|
62
76
|
- MIT
|
@@ -82,4 +96,17 @@ signing_key:
|
|
82
96
|
specification_version: 4
|
83
97
|
summary: Upon running pod install, this plugin will remove unused localizations by
|
84
98
|
your project
|
85
|
-
test_files:
|
99
|
+
test_files:
|
100
|
+
- spec/fixtures/Dummy Targets/Dummy Targets.xcodeproj/project.pbxproj
|
101
|
+
- spec/fixtures/Dummy Targets/Dummy Targets.xcodeproj/project.xcworkspace/contents.xcworkspacedata
|
102
|
+
- spec/fixtures/Dummy Targets/Dummy Targets.xcodeproj/project.xcworkspace/xcuserdata/warorface.xcuserdatad/UserInterfaceState.xcuserstate
|
103
|
+
- spec/fixtures/Dummy Targets/Dummy Targets.xcodeproj/xcuserdata/warorface.xcuserdatad/xcschemes/iOSTarget.xcscheme
|
104
|
+
- spec/fixtures/Dummy Targets/Dummy Targets.xcodeproj/xcuserdata/warorface.xcuserdatad/xcschemes/osxTarget.xcscheme
|
105
|
+
- spec/fixtures/Dummy Targets/Dummy Targets.xcodeproj/xcuserdata/warorface.xcuserdatad/xcschemes/xcschememanagement.plist
|
106
|
+
- spec/fixtures/Dummy Targets/iOSTarget/iOSTarget.h
|
107
|
+
- spec/fixtures/Dummy Targets/iOSTarget/iOSTarget.m
|
108
|
+
- spec/fixtures/Dummy Targets/osxTarget/osxTarget.h
|
109
|
+
- spec/fixtures/Dummy Targets/osxTarget/osxTarget.m
|
110
|
+
- spec/plain_resources_spec.rb
|
111
|
+
- spec/pruner_spec.rb
|
112
|
+
- spec/spec_helper.rb
|