@@ -36,6 +36,9 @@ private class Settings {
36
36
internal bool autoPodToolInstallInEditorEnabled ;
37
37
internal bool verboseLoggingEnabled ;
38
38
internal int cocoapodsIntegrationMenuIndex ;
39
+ internal bool podfileAddUseFrameworks ;
40
+ internal bool podfileStaticLinkFrameworks ;
41
+ internal bool podfileAlwaysAddMainTarget ;
39
42
internal bool useProjectSettings ;
40
43
internal EditorMeasurement . Settings analyticsSettings ;
41
44
@@ -49,6 +52,9 @@ internal Settings() {
49
52
verboseLoggingEnabled = IOSResolver . VerboseLoggingEnabled ;
50
53
cocoapodsIntegrationMenuIndex = FindIndexFromCocoapodsIntegrationMethod (
51
54
IOSResolver . CocoapodsIntegrationMethodPref ) ;
55
+ podfileAddUseFrameworks = IOSResolver . PodfileAddUseFrameworks ;
56
+ podfileStaticLinkFrameworks = IOSResolver . PodfileStaticLinkFrameworks ;
57
+ podfileAlwaysAddMainTarget = IOSResolver . PodfileAlwaysAddMainTarget ;
52
58
useProjectSettings = IOSResolver . UseProjectSettings ;
53
59
analyticsSettings = new EditorMeasurement . Settings ( IOSResolver . analytics ) ;
54
60
}
@@ -63,6 +69,9 @@ internal void Save() {
63
69
IOSResolver . VerboseLoggingEnabled = verboseLoggingEnabled ;
64
70
IOSResolver . CocoapodsIntegrationMethodPref =
65
71
integrationMapping [ cocoapodsIntegrationMenuIndex ] ;
72
+ IOSResolver . PodfileAddUseFrameworks = podfileAddUseFrameworks ;
73
+ IOSResolver . PodfileStaticLinkFrameworks = podfileStaticLinkFrameworks ;
74
+ IOSResolver . PodfileAlwaysAddMainTarget = podfileAlwaysAddMainTarget ;
66
75
IOSResolver . UseProjectSettings = useProjectSettings ;
67
76
analyticsSettings . Save ( ) ;
68
77
}
@@ -95,7 +104,7 @@ private static int FindIndexFromCocoapodsIntegrationMethod(
95
104
}
96
105
97
106
public void Initialize ( ) {
98
- minSize = new Vector2 ( 400 , 400 ) ;
107
+ minSize = new Vector2 ( 400 , 650 ) ;
99
108
position = new Rect ( UnityEngine . Screen . width / 3 , UnityEngine . Screen . height / 3 ,
100
109
minSize . x , minSize . y ) ;
101
110
}
@@ -175,6 +184,48 @@ public void OnGUI() {
175
184
"Assets > External Dependency Manager > iOS Resolver > Install Cocoapods" ) ;
176
185
}
177
186
187
+ if ( settings . podfileGenerationEnabled ) {
188
+ GUILayout . Box ( "" , GUILayout . ExpandWidth ( true ) , GUILayout . Height ( 1 ) ) ;
189
+ GUILayout . Label ( "Podfile Configurations" , EditorStyles . largeLabel ) ;
190
+ EditorGUILayout . Separator ( ) ;
191
+
192
+ GUILayout . BeginHorizontal ( ) ;
193
+ GUILayout . Label ( "Add use_frameworks! to Podfile" , EditorStyles . boldLabel ) ;
194
+ settings . podfileAddUseFrameworks =
195
+ EditorGUILayout . Toggle ( settings . podfileAddUseFrameworks ) ;
196
+ GUILayout . EndHorizontal ( ) ;
197
+
198
+ GUILayout . Label ( "Add the following line to Podfile. Required if any third-party " +
199
+ "Unity packages depends on Swift frameworks." ) ;
200
+ if ( settings . podfileStaticLinkFrameworks ) {
201
+ GUILayout . Label ( " use_frameworks! :linkage => :static" ) ;
202
+ } else {
203
+ GUILayout . Label ( " use_frameworks!" ) ;
204
+ }
205
+
206
+ if ( settings . podfileAddUseFrameworks ) {
207
+ GUILayout . BeginHorizontal ( ) ;
208
+ GUILayout . Label ( "Link frameworks statically" , EditorStyles . boldLabel ) ;
209
+ settings . podfileStaticLinkFrameworks =
210
+ EditorGUILayout . Toggle ( settings . podfileStaticLinkFrameworks ) ;
211
+ GUILayout . EndHorizontal ( ) ;
212
+ }
213
+
214
+ if ( IOSResolver . MultipleXcodeTargetsSupported ) {
215
+ GUILayout . BeginHorizontal ( ) ;
216
+ GUILayout . Label ( "Always add the main target to Podfile" , EditorStyles . boldLabel ) ;
217
+ settings . podfileAlwaysAddMainTarget =
218
+ EditorGUILayout . Toggle ( settings . podfileAlwaysAddMainTarget ) ;
219
+ GUILayout . EndHorizontal ( ) ;
220
+
221
+ GUILayout . Label ( "Add the following lines to Podfile." ) ;
222
+ GUILayout . Label ( " target 'Unity-iPhone' do\n " +
223
+ " end" ) ;
224
+ }
225
+
226
+ GUILayout . Box ( "" , GUILayout . ExpandWidth ( true ) , GUILayout . Height ( 1 ) ) ;
227
+ }
228
+
178
229
settings . analyticsSettings . RenderGui ( ) ;
179
230
180
231
GUILayout . BeginHorizontal ( ) ;
@@ -223,6 +274,15 @@ public void OnGUI() {
223
274
new KeyValuePair < string , string > (
224
275
"cocoapodsIntegrationMethod" ,
225
276
IOSResolver . CocoapodsIntegrationMethodPref . ToString ( ) ) ,
277
+ new KeyValuePair < string , string > (
278
+ "podfileAddUseFrameworks" ,
279
+ IOSResolver . PodfileAddUseFrameworks . ToString ( ) ) ,
280
+ new KeyValuePair < string , string > (
281
+ "podfileStaticLinkFrameworks" ,
282
+ IOSResolver . PodfileStaticLinkFrameworks . ToString ( ) ) ,
283
+ new KeyValuePair < string , string > (
284
+ "podfileAlwaysAddMainTarget" ,
285
+ IOSResolver . PodfileAlwaysAddMainTarget . ToString ( ) ) ,
226
286
} ,
227
287
"Settings Save" ) ;
228
288
settings . Save ( ) ;
0 commit comments