From ec655647e4e2c3718e0bfaad2017bc8b58696902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ritzl?= Date: Fri, 27 Oct 2023 10:21:44 +0200 Subject: [PATCH] Review fixes --- .../java/com/defold/extender/Extender.java | 1 - .../extender/services/CocoaPodsService.java | 21 ++++--------------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/server/src/main/java/com/defold/extender/Extender.java b/server/src/main/java/com/defold/extender/Extender.java index 97e7971c..5f7086e5 100644 --- a/server/src/main/java/com/defold/extender/Extender.java +++ b/server/src/main/java/com/defold/extender/Extender.java @@ -868,7 +868,6 @@ else if (platform.contains("osx")) { File o = addCompileFileSwift(pod, i, src, mergedContextWithPodsForC, compileSwiftCommands); objs.add(ExtenderUtil.getRelativePath(jobDirectory, o)); } - // compilePodSwiftFilesToModule(pod, mergedContextWithPodsForC, compileSwiftCommands); ProcessExecutor.executeCommands(processExecutor, compileSwiftCommands); // in parallel } diff --git a/server/src/main/java/com/defold/extender/services/CocoaPodsService.java b/server/src/main/java/com/defold/extender/services/CocoaPodsService.java index 4fb49405..0c609556 100644 --- a/server/src/main/java/com/defold/extender/services/CocoaPodsService.java +++ b/server/src/main/java/com/defold/extender/services/CocoaPodsService.java @@ -230,7 +230,7 @@ public class PodSpec { public String osxversion = ""; public String iosModuleMap = null; public String osxModuleMap = null; - // Set to true if this Pod contains at least on .xcframework + // Set to true if this Pod contains at least one .xcframework public Boolean containsFramework = false; // The Swift source file header (ModuleName-Swift.h) // This file is referenced from the modulemap and generated in @@ -817,26 +817,13 @@ private void createModuleMap(PodSpec pod, Set headerPatterns, File modul } } - private File createModuleMapFile(PodSpec pod, String platform) { - String filename = null; - if (pod.parentSpec != null) { - filename = pod.parentSpec.moduleName + "-" + pod.moduleName; - } - else { - filename = pod.moduleName; - } - filename += "-" + platform + ".modulemap"; - filename = "module.modulemap"; - return new File(pod.generatedDir, filename); - } - private String createIosModuleMap(PodSpec pod, File jobDir) throws ExtenderException { - File moduleMapFile = createModuleMapFile(pod, "ios"); + File moduleMapFile = new File(pod.generatedDir, "module.modulemap"); createModuleMap(pod, pod.publicHeaders.ios, moduleMapFile, jobDir); return moduleMapFile.getAbsolutePath(); } private String createOsxModuleMap(PodSpec pod, File jobDir) throws ExtenderException { - File moduleMapFile = createModuleMapFile(pod, "osx"); + File moduleMapFile = new File(pod.generatedDir, "module.modulemap"); createModuleMap(pod, pod.publicHeaders.osx, moduleMapFile, jobDir); return moduleMapFile.getAbsolutePath(); } @@ -849,7 +836,7 @@ private PodSpec createPodSpec(JSONObject specJson, PodSpec parent, File podsDir, spec.moduleName = (String)specJson.get("module_name"); } else { - // NSData+zlib -> NSData_zlib + // NSData+zlib -> NSData spec.moduleName = ((String)specJson.get("name")).replaceAll("[\\+].*", ""); } spec.version = (parent == null) ? (String)specJson.get("version") : parent.version;