@@ -40,20 +40,19 @@ void CreateAndInstallPodfile (Artifact artifact)
4040 var podfile = new List < string > ( ) ;
4141 var podfileBegin = new List < string > ( PODFILE_BEGIN ) ;
4242
43- podfileBegin [ 0 ] = string . Format ( podfileBegin [ 0 ] , artifact . MinimunSupportedVersion ) ;
43+ var minimunSupportedVersion = GetMinimunSupportedVersion ( artifact ) ;
44+ podfileBegin [ 0 ] = string . Format ( podfileBegin [ 0 ] , minimunSupportedVersion ) ;
4445 podfile . AddRange ( podfileBegin ) ;
4546
4647 if ( artifact . ExtraPodfileLines != null )
4748 podfile . AddRange ( artifact . ExtraPodfileLines ) ;
4849
4950 podfile . AddRange ( PODFILE_TARGET ) ;
51+ podfile . AddRange ( GetPodfileLines ( artifact ) ) ;
5052
51- foreach ( var podSpec in artifact . PodSpecs ) {
52- if ( podSpec . FrameworkSource != FrameworkSource . Pods )
53- continue ;
54-
55- podfile . AddRange ( podSpec . BuildPodLines ( ) ) ;
56- }
53+ if ( artifact . Dependencies != null )
54+ foreach ( var dependency in artifact . Dependencies )
55+ podfile . AddRange ( GetPodfileLines ( dependency ) ) ;
5756
5857 if ( podfile . Count == PODFILE_BEGIN . Length + PODFILE_TARGET . Length + ( artifact . ExtraPodfileLines ? . Length ?? 0 ) )
5958 return ;
@@ -67,6 +66,34 @@ void CreateAndInstallPodfile (Artifact artifact)
6766 CocoaPodInstall ( podfilePath ) ;
6867}
6968
69+ string GetMinimunSupportedVersion ( Artifact artifact )
70+ {
71+ var version = artifact . MinimunSupportedVersion ;
72+
73+ if ( artifact . Dependencies == null )
74+ return version ;
75+
76+ foreach ( var dependency in artifact . Dependencies )
77+ if ( string . Compare ( version , dependency . MinimunSupportedVersion ) == - 1 )
78+ version = dependency . MinimunSupportedVersion ;
79+
80+ return version ;
81+ }
82+
83+ List < string > GetPodfileLines ( Artifact artifact )
84+ {
85+ var podfileLines = new List < string > ( ) ;
86+
87+ foreach ( var podSpec in artifact . PodSpecs ) {
88+ if ( podSpec . FrameworkSource != FrameworkSource . Pods )
89+ continue ;
90+
91+ podfileLines . AddRange ( podSpec . BuildPodLines ( ) ) ;
92+ }
93+
94+ return podfileLines ;
95+ }
96+
7097void BuildSdkOnPodfile ( Artifact artifact )
7198{
7299 if ( artifact . PodSpecs ? . Length == 0 )
0 commit comments