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 @@ -421,7 +421,11 @@ public ResolvedPods resolveDependencies(PlatformConfig config, ExtenderBuildStat

PodBuildSpec buildSpec = null;
if (!tmpRegistry.containsKey(podName)) {
buildSpec = new PodBuildSpec(args, podSpec.parentSpec != null ? podSpec.parentSpec : podSpec);
PodSpec mainSpec = podSpec;
while (mainSpec.parentSpec != null) {
mainSpec = mainSpec.parentSpec;
}
buildSpec = new PodBuildSpec(args, mainSpec);
tmpRegistry.put(podName, buildSpec);
pods.add(buildSpec);
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.defold.extender.services.cocoapods;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.io.File;
Expand Down Expand Up @@ -102,4 +103,29 @@ public void testCompilationFlags() throws IOException, ExtenderException {
assertTrue(buildSpec.flags.swift.contains(String.format("-I%s/Sentry/Sources/Sentry/include", this.podsDir.toString())));
}

@Test
public void testNestedPodSpecName() throws IOException, ExtenderException {
String jsonSpec = Files.readString(Path.of("test-data/pod_specs/YandexMobileMetrica.json"));
XCConfigParser parser = new XCConfigParser(this.buildDir, this.podsDir, PodUtils.Platform.IPHONEOS, "Debug", "arm64");
File sentryTargetFolder = Path.of(this.podsDir.toString(), "Target Support Files", "YandexMobileMetrica").toFile();
sentryTargetFolder.mkdirs();
Files.copy(Path.of("test-data/xcconfigs/YandexMobileMetrica.xcconfig"), Path.of(sentryTargetFolder.toString(), "YandexMobileMetrica.debug.xcconfig"), StandardCopyOption.REPLACE_EXISTING);

PodSpec podSpec = PodSpecParser.createPodSpec(PodSpecParser.parseJson(jsonSpec), PodUtils.Platform.IPHONEOS, null);
CocoaPodsServiceBuildState cocoapodsState = new CocoaPodsServiceBuildState();
cocoapodsState.workingDir = this.workingDir;
cocoapodsState.podsDir = this.podsDir;
cocoapodsState.selectedPlatform = PodUtils.Platform.IPHONEOS;

CreateBuildSpecArgs args = new CreateBuildSpecArgs.Builder()
.setConfigParser(parser)
.setCocoapodsBuildState(cocoapodsState)
.setJobContext(this.jobContext)
.build();
args.buildDir = this.buildDir;
args.configuration = "Debug";

PodBuildSpec buildSpec = new PodBuildSpec(args, podSpec);
assertEquals(buildSpec.name, "YandexMobileMetrica");
}
}
105 changes: 105 additions & 0 deletions server/test-data/pod_specs/YandexMobileMetrica.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
{
"name": "YandexMobileMetrica",
"version": "4.5.2",
"summary": "This library is designed to be a part of mobile apps and provide app usage stats to Yandex AppMetrica",
"homepage": "https://appmetrica.yandex.com/",
"license": {
"type": "PROPRIETARY",
"file": "LICENSE.md"
},
"authors": {
"Yandex LLC": "appmetrica@yandex-team.com"
},
"source": {
"http": "https://storage.mds.yandex.net/get-appmetrica-mobile-sdk/175948/YandexMobileMetrica-4.5.2-ios-d70f8cb3-2746-4c3d-aa5f-dcd6acaaa5d8.zip",
"sha1": "2b015941841fca10652cc1dc38a4cda3687c6bce"
},
"platforms": {
"ios": "9.0",
"tvos": "9.0"
},
"libraries": [
"c++",
"z",
"sqlite3"
],
"frameworks": [
"UIKit",
"Foundation",
"CoreLocation",
"CoreGraphics",
"AdSupport",
"SystemConfiguration"
],
"ios": {
"frameworks": [
"CoreTelephony",
"WebKit"
],
"weak_frameworks": [

]
},
"requires_arc": true,
"default_subspecs": "Static",
"subspecs": [
{
"name": "Static",
"subspecs": [
{
"name": "Core",
"preserve_paths": [
"static/YandexMobileMetrica.xcframework"
],
"vendored_frameworks": "static/YandexMobileMetrica.xcframework",
"source_files": "static/YandexMobileMetrica.xcframework/**/YandexMobileMetrica.framework/Versions/A/Headers/*.h",
"public_header_files": "static/YandexMobileMetrica.xcframework/**/YandexMobileMetrica.framework/Versions/A/Headers/*.h"
},
{
"name": "Crashes",
"preserve_paths": [
"static/YandexMobileMetricaCrashes.xcframework",
"helper"
],
"vendored_frameworks": "static/YandexMobileMetricaCrashes.xcframework",
"source_files": "static/YandexMobileMetricaCrashes.xcframework/**/YandexMobileMetricaCrashes.framework/Versions/A/Headers/*.h",
"public_header_files": "static/YandexMobileMetricaCrashes.xcframework/**/YandexMobileMetricaCrashes.framework/Versions/A/Headers/*.h",
"dependencies": {
"YandexMobileMetrica/Static/Core": [

]
}
}
]
},
{
"name": "Dynamic",
"subspecs": [
{
"name": "Core",
"preserve_paths": [
"dynamic/YandexMobileMetrica.xcframework"
],
"vendored_frameworks": "dynamic/YandexMobileMetrica.xcframework",
"source_files": "dynamic/YandexMobileMetrica.xcframework/**/YandexMobileMetrica.framework/Headers/*.h",
"public_header_files": "dynamic/YandexMobileMetrica.xcframework/**/YandexMobileMetrica.framework/Headers/*.h"
},
{
"name": "Crashes",
"preserve_paths": [
"dynamic/YandexMobileMetricaCrashes.xcframework",
"helper"
],
"vendored_frameworks": "dynamic/YandexMobileMetricaCrashes.xcframework",
"source_files": "dynamic/YandexMobileMetricaCrashes.xcframework/**/YandexMobileMetricaCrashes.framework/Headers/*.h",
"public_header_files": "dynamic/YandexMobileMetricaCrashes.xcframework/**/YandexMobileMetricaCrashes.framework/Headers/*.h",
"dependencies": {
"YandexMobileMetrica/Dynamic/Core": [

]
}
}
]
}
]
}
14 changes: 14 additions & 0 deletions server/test-data/xcconfigs/YandexMobileMetrica.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/YandexMobileMetrica
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/YandexMobileMetrica/static" "${PODS_XCFRAMEWORKS_BUILD_DIR}/YandexMobileMetrica/Static/Core" "${PODS_XCFRAMEWORKS_BUILD_DIR}/YandexMobileMetrica/Static/Crashes"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
OTHER_LDFLAGS = $(inherited) -l"c++" -l"sqlite3" -l"z" -framework "AdSupport" -framework "CoreGraphics" -framework "CoreLocation" -framework "CoreTelephony" -framework "Foundation" -framework "SystemConfiguration" -framework "UIKit" -framework "WebKit"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_DEVELOPMENT_LANGUAGE = ${DEVELOPMENT_LANGUAGE}
PODS_ROOT = ${SRCROOT}
PODS_TARGET_SRCROOT = ${PODS_ROOT}/YandexMobileMetrica
PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES