parent
							
								
									7f4beb6e3f
								
							
						
					
					
						commit
						aca914ab02
					
				|  | @ -42,7 +42,7 @@ namespace Guru.Editor | |||
|          | ||||
|          | ||||
| 
 | ||||
|         [PostProcessBuild(45)] // MAX POD Process Order | ||||
|         [PostProcessBuild(47)] // MAX POD Process Order | ||||
|         public static void PostBuildFixPodDeps(BuildTarget target, string projPath) | ||||
|         { | ||||
|             if (target != BuildTarget.iOS) return; | ||||
|  | @ -74,7 +74,7 @@ namespace Guru.Editor | |||
|                 { | ||||
|                     if (line.Contains(libName)) | ||||
|                     { | ||||
|                         lines[i] =  FixOneFirebaseLibVersion(line, fixedVersion, minTargetSdk); | ||||
|                         lines[i] =  FixOneFirebaseLibVersion(line, fixedVersion); | ||||
|                         isDirty = true; | ||||
|                     } | ||||
|                 } | ||||
|  | @ -84,33 +84,31 @@ namespace Guru.Editor | |||
|                     if (line.Contains(libName)) | ||||
|                     { | ||||
|                         needAdded.Remove(libName); | ||||
|                         lines[i] =  FixOneFirebaseLibVersion(line, fixedVersion, minTargetSdk); | ||||
|                         isDirty = true; | ||||
|                     } | ||||
|                 } | ||||
| 
 | ||||
|                 if (needAdded.Count > 0) | ||||
|                 { | ||||
|                     //  pod 'Firebase/DynamicLinks', '10.20.0' | ||||
|                     foreach (var libName in needAdded) | ||||
|                     { | ||||
|                         idx++; | ||||
|                         idx = Mathf.Min(idx, lines.Count - 1); | ||||
|                         lines.Insert(idx, $"\tpod '{libName}', '{fixedVersion}'"); | ||||
|                         lines[i] =  FixOneFirebaseLibVersion(line, fixedVersion); | ||||
|                         isDirty = true; | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|              | ||||
|             if (needAdded.Count > 0) | ||||
|             { | ||||
|                 //  pod 'Firebase/DynamicLinks', '10.20.0' | ||||
|                 foreach (var libName in needAdded) | ||||
|                 { | ||||
|                     idx++; | ||||
|                     idx = Mathf.Min(idx, lines.Count - 1); | ||||
|                     lines.Insert(idx, $"\tpod '{libName}', '{fixedVersion}'"); | ||||
|                     isDirty = true; | ||||
|                 } | ||||
|             } | ||||
|              | ||||
|             if(isDirty) File.WriteAllLines(podfile, lines); | ||||
|         } | ||||
| 
 | ||||
|         private static string FixOneFirebaseLibVersion(string line, string fixedVersion, string minTargetSdk) | ||||
|         private static string FixOneFirebaseLibVersion(string line, string fixedVersion) | ||||
|         { | ||||
|             line = line.Replace("version =", "version="); | ||||
|             string fixedLine = ""; | ||||
| 
 | ||||
|             fixedLine = line.Substring(line.IndexOf("version=") + 9) + $"\"{fixedVersion}\" minTargetSdk=\"{minTargetSdk}\""; | ||||
| 
 | ||||
|             if(!line.Contains("', '") || !line.Contains("pod")) return line; | ||||
|             string fixedLine = line.Substring(0, line.IndexOf("', '") + 4) + $"{fixedVersion}'"; | ||||
|             return fixedLine; | ||||
|         } | ||||
|     } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue