Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class PodComponentDetector : FileComponentDetector

public override IEnumerable<ComponentType> SupportedComponentTypes { get; } = new[] { ComponentType.Pod, ComponentType.Git };

public override int Version { get; } = 1;
public override int Version { get; } = 2;

private class Pod : IYamlConvertible
{
Expand Down Expand Up @@ -300,10 +300,17 @@ private void ProcessPodfileLock(

foreach (var dependency in pod.Value)
{
var dependencyKey = podSpecs[dependency.Podspec];
if (dependencyKey != pod.Key)
if (podSpecs.TryGetValue(dependency.Podspec, out string dependencyKey))
{
dependenciesMap[pod.Key].Add(podSpecs[dependency.Podspec]);
if (dependencyKey != pod.Key)
{
var temp = podSpecs[dependency.Podspec];
dependenciesMap[pod.Key].Add(podSpecs[dependency.Podspec]);
}
}
else
{
Logger.LogWarning($"Missing podspec declaration. podspec={dependency.Podspec}, version={dependency.PodVersion}");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public async Task TestPodDetector_DetectorRecognizePodComponents()
- AzureData (= 0.5.0)
- KeychainAccess (3.2.1)
- Willow (5.2.1)
- Auth (1.44.1):
- MissingDep (= 5.0.0)

DEPENDENCIES:
- AzureMobile (~> 0.5.0)
Expand All @@ -73,13 +75,14 @@ public async Task TestPodDetector_DetectorRecognizePodComponents()
Assert.AreEqual(ProcessingResultCode.Success, scanResult.ResultCode);

var detectedComponents = componentRecorder.GetDetectedComponents();
Assert.AreEqual(5, detectedComponents.Count());
Assert.AreEqual(6, detectedComponents.Count());

AssertPodComponentNameAndVersion(detectedComponents, "AzureCore", "0.5.0");
AssertPodComponentNameAndVersion(detectedComponents, "AzureData", "0.5.0");
AssertPodComponentNameAndVersion(detectedComponents, "AzureMobile", "0.5.0");
AssertPodComponentNameAndVersion(detectedComponents, "KeychainAccess", "3.2.1");
AssertPodComponentNameAndVersion(detectedComponents, "Willow", "5.2.1");
AssertPodComponentNameAndVersion(detectedComponents, "Auth", "1.44.1");
}

[TestMethod]
Expand Down