From e9c535171c3c9c043b42818531b8e55ff6775ebc Mon Sep 17 00:00:00 2001 From: Gleb Linnik Date: Tue, 30 Apr 2024 17:26:02 +0300 Subject: [PATCH 01/14] Basic podspec implementation # Conflicts: # KSCrash.podspec --- KSCrash.podspec | 157 ++++++++++++++++-------------------------------- 1 file changed, 51 insertions(+), 106 deletions(-) diff --git a/KSCrash.podspec b/KSCrash.podspec index 995c5afd4..24eee6a36 100644 --- a/KSCrash.podspec +++ b/KSCrash.podspec @@ -16,123 +16,68 @@ Pod::Spec.new do |s| s.xcconfig = { 'GCC_ENABLE_CPP_EXCEPTIONS' => 'YES' } s.default_subspecs = 'Installations' + configure_subspec = lambda do |subs| + module_name = subs.name.gsub('/', '') + subs.source_files = "Sources/#{module_name}/**/*.{h,m,mm,c,cpp,def}" + subs.public_header_files = "Sources/#{module_name}/include/*.{h,def}" + end + s.subspec 'Recording' do |recording| - recording.compiler_flags = '-fno-optimize-sibling-calls' - recording.source_files = 'Source/KSCrash/Recording/**/*.{h,m,mm,c,cpp}', - 'Source/KSCrash/llvm/**/*.{h,m,mm,c,cpp}', - 'Source/KSCrash/swift/**/*.{h,m,mm,c,cpp,def}', - 'Source/KSCrash/Reporting/Filters/KSCrashReportFilter.h' - recording.public_header_files = 'Source/KSCrash/Recording/KSCrash.h', - 'Source/KSCrash/Recording/KSCrashC.h', - 'Source/KSCrash/Recording/KSCrashReportWriter.h', - 'Source/KSCrash/Recording/KSCrashReportFields.h', - 'Source/KSCrash/Recording/Monitors/KSCrashMonitorType.h', - 'Source/KSCrash/Reporting/Filters/KSCrashReportFilter.h' - - recording.subspec 'Tools' do |tools| - tools.source_files = 'Source/KSCrash/Recording/Tools/*.h' - tools.compiler_flags = '-fno-optimize-sibling-calls' - end - - recording.resource_bundles = { 'KSCrashPrivacy' => 'Source/KSCrash/Recording/PrivacyInfo.xcprivacy' } + recording.dependency 'KSCrash/RecordingCore' + + configure_subspec.call(recording) end - s.subspec 'Reporting' do |reporting| - reporting.dependency 'KSCrash/Recording' - - reporting.subspec 'Filters' do |filters| - filters.subspec 'Base' do |base| - base.source_files = 'Source/KSCrash/Reporting/Filters/Tools/**/*.{h,m,mm,c,cpp}', - 'Source/KSCrash/Reporting/Filters/KSCrashReportFilter.h' - base.public_header_files = 'Source/KSCrash/Reporting/Filters/KSCrashReportFilter.h' - end - - filters.subspec 'Alert' do |alert| - alert.dependency 'KSCrash/Reporting/Filters/Base' - alert.source_files = 'Source/KSCrash/Reporting/Filters/KSCrashReportFilterAlert.h', - 'Source/KSCrash/Reporting/Filters/KSCrashReportFilterAlert.m' - end - - filters.subspec 'AppleFmt' do |applefmt| - applefmt.dependency 'KSCrash/Reporting/Filters/Base' - applefmt.source_files = 'Source/KSCrash/Reporting/Filters/KSCrashReportFilterAppleFmt.h', - 'Source/KSCrash/Reporting/Filters/KSCrashReportFilterAppleFmt.m' - end - - filters.subspec 'Basic' do |basic| - basic.dependency 'KSCrash/Reporting/Filters/Base' - basic.source_files = 'Source/KSCrash/Reporting/Filters/KSCrashReportFilterBasic.h', - 'Source/KSCrash/Reporting/Filters/KSCrashReportFilterBasic.m' - end - - filters.subspec 'Stringify' do |stringify| - stringify.dependency 'KSCrash/Reporting/Filters/Base' - stringify.source_files = 'Source/KSCrash/Reporting/Filters/KSCrashReportFilterStringify.h', - 'Source/KSCrash/Reporting/Filters/KSCrashReportFilterStringify.m' - end - - filters.subspec 'GZip' do |gzip| - gzip.dependency 'KSCrash/Reporting/Filters/Base' - gzip.source_files = 'Source/KSCrash/Reporting/Filters/KSCrashReportFilterGZip.h', - 'Source/KSCrash/Reporting/Filters/KSCrashReportFilterGZip.m' - end - - filters.subspec 'JSON' do |json| - json.dependency 'KSCrash/Reporting/Filters/Base' - json.source_files = 'Source/KSCrash/Reporting/Filters/KSCrashReportFilterJSON.h', - 'Source/KSCrash/Reporting/Filters/KSCrashReportFilterJSON.m' - end - - filters.subspec 'Sets' do |sets| - sets.dependency 'KSCrash/Reporting/Filters/Base' - sets.dependency 'KSCrash/Reporting/Filters/AppleFmt' - sets.dependency 'KSCrash/Reporting/Filters/Basic' - sets.dependency 'KSCrash/Reporting/Filters/Stringify' - sets.dependency 'KSCrash/Reporting/Filters/GZip' - sets.dependency 'KSCrash/Reporting/Filters/JSON' - - sets.source_files = 'Source/KSCrash/Reporting/Filters/KSCrashReportFilterSets.h', - 'Source/KSCrash/Reporting/Filters/KSCrashReportFilterSets.m' - end - - filters.subspec 'Tools' do |tools| - tools.source_files = 'Source/KSCrash/Reporting/Filters/Tools/**/*.{h,m,mm,c,cpp}' - end - - end - - reporting.subspec 'Tools' do |tools| - tools.ios.frameworks = 'SystemConfiguration' - tools.tvos.frameworks = 'SystemConfiguration' - tools.osx.frameworks = 'SystemConfiguration' - tools.source_files = 'Source/KSCrash/Reporting/Tools/**/*.{h,m,mm,c,cpp}', - 'Source/KSCrash/Recording/KSSystemCapabilities.h' - end - - reporting.subspec 'MessageUI' do |messageui| - end - - reporting.subspec 'Sinks' do |sinks| - sinks.ios.frameworks = 'MessageUI' - sinks.dependency 'KSCrash/Reporting/Filters' - sinks.dependency 'KSCrash/Reporting/Tools' - sinks.source_files = 'Source/KSCrash/Reporting/Sinks/**/*.{h,m,mm,c,cpp}' - end + s.subspec 'Filters' do |filters| + filters.dependency 'KSCrash/Recording' + filters.dependency 'KSCrash/RecordingCore' + filters.dependency 'KSCrash/ReportingCore' + configure_subspec.call(filters) + end + + s.subspec 'Sinks' do |sinks| + sinks.dependency 'KSCrash/Recording' + sinks.dependency 'KSCrash/Filters' + + configure_subspec.call(sinks) end s.subspec 'Installations' do |installations| + installations.dependency 'KSCrash/Filters' + installations.dependency 'KSCrash/Sinks' installations.dependency 'KSCrash/Recording' - installations.dependency 'KSCrash/Reporting' - installations.source_files = 'Source/KSCrash/Installations/**/*.{h,m,mm,c,cpp}' + + configure_subspec.call(installations) + end + + s.subspec 'RecordingCore' do |recording_core| + recording_core.dependency 'KSCrash/Core' + recording_core.dependency 'KSCrash/Swift' + recording_core.dependency 'KSCrash/LLVM' + + configure_subspec.call(recording_core) + end + + s.subspec 'ReportingCore' do |reporting_core| + reporting_core.dependency 'KSCrash/Core' + reporting_core.dependency 'KSCrash/Swift' + reporting_core.dependency 'KSCrash/LLVM' + + configure_subspec.call(reporting_core) end s.subspec 'Core' do |core| - core.dependency 'KSCrash/Reporting/Filters/Basic' - core.source_files = 'Source/KSCrash/Installations/KSCrashInstallation.h', - 'Source/KSCrash/Installations/KSCrashInstallation.m', - 'Source/KSCrash/Installations/KSCrashInstallation+Private.h', - 'Source/KSCrash/Reporting/Tools/KSCString.{h,m}' + configure_subspec.call(core) end + s.subspec 'Swift' do |swift| + swift.dependency 'KSCrash/LLVM' + + configure_subspec.call(swift) + end + + s.subspec 'LLVM' do |llvm| + configure_subspec.call(llvm) + end end From 55c0dc0883cc1911698b632c220f435d96e994d6 Mon Sep 17 00:00:00 2001 From: Gleb Linnik Date: Tue, 30 Apr 2024 17:42:17 +0300 Subject: [PATCH 02/14] Update version to 2.0.0 # Conflicts: # KSCrash.podspec --- KSCrash.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/KSCrash.podspec b/KSCrash.podspec index 24eee6a36..ec7212288 100644 --- a/KSCrash.podspec +++ b/KSCrash.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| IOS_DEPLOYMENT_TARGET = '11.0' unless defined? IOS_DEPLOYMENT_TARGET s.name = "KSCrash" - s.version = "1.17.1" + s.version = "2.0.0" s.summary = "The Ultimate iOS Crash Reporter" s.homepage = "https://github.com/kstenerud/KSCrash" s.license = { :type => 'KSCrash license agreement', :file => 'LICENSE' } From c634ac7ea75a3ba346a09f98b9f7baf932be46a5 Mon Sep 17 00:00:00 2001 From: Gleb Linnik Date: Thu, 2 May 2024 16:30:58 +0300 Subject: [PATCH 03/14] Remove llvm ans Swift as a separate modules --- KSCrash.podspec | 18 ++------------- Package.swift | 22 +++++++------------ Sources/KSCrashLLVM/dummy.c | 1 - .../llvm/ADT}/KSOptional.h | 0 .../llvm/ADT}/None.h | 0 .../llvm/ADT}/StringRef.h | 0 .../llvm/Config}/llvm-config.h | 0 .../llvm}/LICENSE.TXT | 0 .../llvm/Support}/AlignOf.h | 0 .../llvm/Support}/Casting.h | 0 .../llvm/Support}/Compiler.h | 0 .../llvm/Support}/type_traits.h | 0 .../swift/Basic}/Config.h | 0 .../swift/Basic}/Context.cpp | 0 .../swift/Basic}/Demangle.cpp | 0 .../swift/Basic}/Demangle.h | 0 .../swift/Basic}/DemangleNodes.def | 0 .../swift/Basic}/DemangleNodes.h | 0 .../swift/Basic}/Demangler.cpp | 0 .../swift/Basic}/Demangler.h | 0 .../swift/Basic}/Fallthrough.h | 0 .../swift/Basic}/LLVM.h | 0 .../swift/Basic}/Malloc.h | 0 .../swift/Basic}/ManglingMacros.h | 0 .../swift/Basic}/ManglingUtils.cpp | 0 .../swift/Basic}/ManglingUtils.h | 0 .../swift/Basic}/NodePrinter.cpp | 0 .../swift/Basic}/OldDemangler.cpp | 0 .../swift/Basic}/Platform.h | 0 .../swift/Basic}/Punycode.cpp | 0 .../swift/Basic}/Punycode.h | 0 .../swift/Basic}/ReferenceStorage.def | 0 .../swift/Basic}/STLExtras.h | 0 .../swift/Basic}/StandardTypesMangling.def | 0 .../swift/Basic}/SwiftDemangle.h | 0 .../swift/Basic}/ValueWitnessMangling.def | 0 .../swift/Basic}/Visibility.h | 0 .../swift}/LICENSE.txt | 0 .../swift}/SwiftStrings.h | 0 39 files changed, 10 insertions(+), 31 deletions(-) delete mode 100644 Sources/KSCrashLLVM/dummy.c rename Sources/{KSCrashLLVM/include => KSCrashRecordingCore/llvm/ADT}/KSOptional.h (100%) rename Sources/{KSCrashLLVM/include => KSCrashRecordingCore/llvm/ADT}/None.h (100%) rename Sources/{KSCrashLLVM/include => KSCrashRecordingCore/llvm/ADT}/StringRef.h (100%) rename Sources/{KSCrashLLVM/include => KSCrashRecordingCore/llvm/Config}/llvm-config.h (100%) rename Sources/{KSCrashLLVM => KSCrashRecordingCore/llvm}/LICENSE.TXT (100%) rename Sources/{KSCrashLLVM/include => KSCrashRecordingCore/llvm/Support}/AlignOf.h (100%) rename Sources/{KSCrashLLVM/include => KSCrashRecordingCore/llvm/Support}/Casting.h (100%) rename Sources/{KSCrashLLVM/include => KSCrashRecordingCore/llvm/Support}/Compiler.h (100%) rename Sources/{KSCrashLLVM/include => KSCrashRecordingCore/llvm/Support}/type_traits.h (100%) rename Sources/{KSCrashSwift/include => KSCrashRecordingCore/swift/Basic}/Config.h (100%) rename Sources/{KSCrashSwift => KSCrashRecordingCore/swift/Basic}/Context.cpp (100%) rename Sources/{KSCrashSwift => KSCrashRecordingCore/swift/Basic}/Demangle.cpp (100%) rename Sources/{KSCrashSwift/include => KSCrashRecordingCore/swift/Basic}/Demangle.h (100%) rename Sources/{KSCrashSwift/include => KSCrashRecordingCore/swift/Basic}/DemangleNodes.def (100%) rename Sources/{KSCrashSwift/include => KSCrashRecordingCore/swift/Basic}/DemangleNodes.h (100%) rename Sources/{KSCrashSwift => KSCrashRecordingCore/swift/Basic}/Demangler.cpp (100%) rename Sources/{KSCrashSwift/include => KSCrashRecordingCore/swift/Basic}/Demangler.h (100%) rename Sources/{KSCrashSwift/include => KSCrashRecordingCore/swift/Basic}/Fallthrough.h (100%) rename Sources/{KSCrashSwift/include => KSCrashRecordingCore/swift/Basic}/LLVM.h (100%) rename Sources/{KSCrashSwift/include => KSCrashRecordingCore/swift/Basic}/Malloc.h (100%) rename Sources/{KSCrashSwift/include => KSCrashRecordingCore/swift/Basic}/ManglingMacros.h (100%) rename Sources/{KSCrashSwift => KSCrashRecordingCore/swift/Basic}/ManglingUtils.cpp (100%) rename Sources/{KSCrashSwift/include => KSCrashRecordingCore/swift/Basic}/ManglingUtils.h (100%) rename Sources/{KSCrashSwift => KSCrashRecordingCore/swift/Basic}/NodePrinter.cpp (100%) rename Sources/{KSCrashSwift => KSCrashRecordingCore/swift/Basic}/OldDemangler.cpp (100%) rename Sources/{KSCrashSwift/include => KSCrashRecordingCore/swift/Basic}/Platform.h (100%) rename Sources/{KSCrashSwift => KSCrashRecordingCore/swift/Basic}/Punycode.cpp (100%) rename Sources/{KSCrashSwift/include => KSCrashRecordingCore/swift/Basic}/Punycode.h (100%) rename Sources/{KSCrashSwift/include => KSCrashRecordingCore/swift/Basic}/ReferenceStorage.def (100%) rename Sources/{KSCrashSwift/include => KSCrashRecordingCore/swift/Basic}/STLExtras.h (100%) rename Sources/{KSCrashSwift/include => KSCrashRecordingCore/swift/Basic}/StandardTypesMangling.def (100%) rename Sources/{KSCrashSwift/include => KSCrashRecordingCore/swift/Basic}/SwiftDemangle.h (100%) rename Sources/{KSCrashSwift/include => KSCrashRecordingCore/swift/Basic}/ValueWitnessMangling.def (100%) rename Sources/{KSCrashSwift/include => KSCrashRecordingCore/swift/Basic}/Visibility.h (100%) rename Sources/{KSCrashSwift => KSCrashRecordingCore/swift}/LICENSE.txt (100%) rename Sources/{KSCrashSwift/include => KSCrashRecordingCore/swift}/SwiftStrings.h (100%) diff --git a/KSCrash.podspec b/KSCrash.podspec index ec7212288..008911528 100644 --- a/KSCrash.podspec +++ b/KSCrash.podspec @@ -18,8 +18,8 @@ Pod::Spec.new do |s| configure_subspec = lambda do |subs| module_name = subs.name.gsub('/', '') - subs.source_files = "Sources/#{module_name}/**/*.{h,m,mm,c,cpp,def}" - subs.public_header_files = "Sources/#{module_name}/include/*.{h,def}" + subs.source_files = "Sources/#{module_name}/**/*.{h,m,mm,c,cpp}" + subs.public_header_files = "Sources/#{module_name}/include/*.h" end s.subspec 'Recording' do |recording| @@ -53,16 +53,12 @@ Pod::Spec.new do |s| s.subspec 'RecordingCore' do |recording_core| recording_core.dependency 'KSCrash/Core' - recording_core.dependency 'KSCrash/Swift' - recording_core.dependency 'KSCrash/LLVM' configure_subspec.call(recording_core) end s.subspec 'ReportingCore' do |reporting_core| reporting_core.dependency 'KSCrash/Core' - reporting_core.dependency 'KSCrash/Swift' - reporting_core.dependency 'KSCrash/LLVM' configure_subspec.call(reporting_core) end @@ -70,14 +66,4 @@ Pod::Spec.new do |s| s.subspec 'Core' do |core| configure_subspec.call(core) end - - s.subspec 'Swift' do |swift| - swift.dependency 'KSCrash/LLVM' - - configure_subspec.call(swift) - end - - s.subspec 'LLVM' do |llvm| - configure_subspec.call(llvm) - end end diff --git a/Package.swift b/Package.swift index 9c577c918..443884348 100644 --- a/Package.swift +++ b/Package.swift @@ -103,10 +103,14 @@ let package = Package( .target( name: "KSCrashRecordingCore", - dependencies: [ - "KSCrashCore", - "KSCrashSwift", - "KSCrashLLVM", + dependencies: ["KSCrashCore"], + cSettings: [ + .headerSearchPath("swift"), + .headerSearchPath("swift/Basic"), + .headerSearchPath("llvm"), + .headerSearchPath("llvm/ADT"), + .headerSearchPath("llvm/Config"), + .headerSearchPath("llvm/Support"), ] ), .testTarget( @@ -115,8 +119,6 @@ let package = Package( "KSCrashTestTools", "KSCrashRecordingCore", "KSCrashCore", - "KSCrashSwift", - "KSCrashLLVM", ] ), @@ -144,14 +146,6 @@ let package = Package( name: "KSCrashTestTools", dependencies: ["KSCrashRecordingCore"] ), - //MARK: - Forks - .target( - name: "KSCrashSwift", - dependencies: ["KSCrashLLVM"] - ), - .target( - name: "KSCrashLLVM" - ), ], cxxLanguageStandard: .gnucxx11 ) diff --git a/Sources/KSCrashLLVM/dummy.c b/Sources/KSCrashLLVM/dummy.c deleted file mode 100644 index 48630b0fb..000000000 --- a/Sources/KSCrashLLVM/dummy.c +++ /dev/null @@ -1 +0,0 @@ -// dummy diff --git a/Sources/KSCrashLLVM/include/KSOptional.h b/Sources/KSCrashRecordingCore/llvm/ADT/KSOptional.h similarity index 100% rename from Sources/KSCrashLLVM/include/KSOptional.h rename to Sources/KSCrashRecordingCore/llvm/ADT/KSOptional.h diff --git a/Sources/KSCrashLLVM/include/None.h b/Sources/KSCrashRecordingCore/llvm/ADT/None.h similarity index 100% rename from Sources/KSCrashLLVM/include/None.h rename to Sources/KSCrashRecordingCore/llvm/ADT/None.h diff --git a/Sources/KSCrashLLVM/include/StringRef.h b/Sources/KSCrashRecordingCore/llvm/ADT/StringRef.h similarity index 100% rename from Sources/KSCrashLLVM/include/StringRef.h rename to Sources/KSCrashRecordingCore/llvm/ADT/StringRef.h diff --git a/Sources/KSCrashLLVM/include/llvm-config.h b/Sources/KSCrashRecordingCore/llvm/Config/llvm-config.h similarity index 100% rename from Sources/KSCrashLLVM/include/llvm-config.h rename to Sources/KSCrashRecordingCore/llvm/Config/llvm-config.h diff --git a/Sources/KSCrashLLVM/LICENSE.TXT b/Sources/KSCrashRecordingCore/llvm/LICENSE.TXT similarity index 100% rename from Sources/KSCrashLLVM/LICENSE.TXT rename to Sources/KSCrashRecordingCore/llvm/LICENSE.TXT diff --git a/Sources/KSCrashLLVM/include/AlignOf.h b/Sources/KSCrashRecordingCore/llvm/Support/AlignOf.h similarity index 100% rename from Sources/KSCrashLLVM/include/AlignOf.h rename to Sources/KSCrashRecordingCore/llvm/Support/AlignOf.h diff --git a/Sources/KSCrashLLVM/include/Casting.h b/Sources/KSCrashRecordingCore/llvm/Support/Casting.h similarity index 100% rename from Sources/KSCrashLLVM/include/Casting.h rename to Sources/KSCrashRecordingCore/llvm/Support/Casting.h diff --git a/Sources/KSCrashLLVM/include/Compiler.h b/Sources/KSCrashRecordingCore/llvm/Support/Compiler.h similarity index 100% rename from Sources/KSCrashLLVM/include/Compiler.h rename to Sources/KSCrashRecordingCore/llvm/Support/Compiler.h diff --git a/Sources/KSCrashLLVM/include/type_traits.h b/Sources/KSCrashRecordingCore/llvm/Support/type_traits.h similarity index 100% rename from Sources/KSCrashLLVM/include/type_traits.h rename to Sources/KSCrashRecordingCore/llvm/Support/type_traits.h diff --git a/Sources/KSCrashSwift/include/Config.h b/Sources/KSCrashRecordingCore/swift/Basic/Config.h similarity index 100% rename from Sources/KSCrashSwift/include/Config.h rename to Sources/KSCrashRecordingCore/swift/Basic/Config.h diff --git a/Sources/KSCrashSwift/Context.cpp b/Sources/KSCrashRecordingCore/swift/Basic/Context.cpp similarity index 100% rename from Sources/KSCrashSwift/Context.cpp rename to Sources/KSCrashRecordingCore/swift/Basic/Context.cpp diff --git a/Sources/KSCrashSwift/Demangle.cpp b/Sources/KSCrashRecordingCore/swift/Basic/Demangle.cpp similarity index 100% rename from Sources/KSCrashSwift/Demangle.cpp rename to Sources/KSCrashRecordingCore/swift/Basic/Demangle.cpp diff --git a/Sources/KSCrashSwift/include/Demangle.h b/Sources/KSCrashRecordingCore/swift/Basic/Demangle.h similarity index 100% rename from Sources/KSCrashSwift/include/Demangle.h rename to Sources/KSCrashRecordingCore/swift/Basic/Demangle.h diff --git a/Sources/KSCrashSwift/include/DemangleNodes.def b/Sources/KSCrashRecordingCore/swift/Basic/DemangleNodes.def similarity index 100% rename from Sources/KSCrashSwift/include/DemangleNodes.def rename to Sources/KSCrashRecordingCore/swift/Basic/DemangleNodes.def diff --git a/Sources/KSCrashSwift/include/DemangleNodes.h b/Sources/KSCrashRecordingCore/swift/Basic/DemangleNodes.h similarity index 100% rename from Sources/KSCrashSwift/include/DemangleNodes.h rename to Sources/KSCrashRecordingCore/swift/Basic/DemangleNodes.h diff --git a/Sources/KSCrashSwift/Demangler.cpp b/Sources/KSCrashRecordingCore/swift/Basic/Demangler.cpp similarity index 100% rename from Sources/KSCrashSwift/Demangler.cpp rename to Sources/KSCrashRecordingCore/swift/Basic/Demangler.cpp diff --git a/Sources/KSCrashSwift/include/Demangler.h b/Sources/KSCrashRecordingCore/swift/Basic/Demangler.h similarity index 100% rename from Sources/KSCrashSwift/include/Demangler.h rename to Sources/KSCrashRecordingCore/swift/Basic/Demangler.h diff --git a/Sources/KSCrashSwift/include/Fallthrough.h b/Sources/KSCrashRecordingCore/swift/Basic/Fallthrough.h similarity index 100% rename from Sources/KSCrashSwift/include/Fallthrough.h rename to Sources/KSCrashRecordingCore/swift/Basic/Fallthrough.h diff --git a/Sources/KSCrashSwift/include/LLVM.h b/Sources/KSCrashRecordingCore/swift/Basic/LLVM.h similarity index 100% rename from Sources/KSCrashSwift/include/LLVM.h rename to Sources/KSCrashRecordingCore/swift/Basic/LLVM.h diff --git a/Sources/KSCrashSwift/include/Malloc.h b/Sources/KSCrashRecordingCore/swift/Basic/Malloc.h similarity index 100% rename from Sources/KSCrashSwift/include/Malloc.h rename to Sources/KSCrashRecordingCore/swift/Basic/Malloc.h diff --git a/Sources/KSCrashSwift/include/ManglingMacros.h b/Sources/KSCrashRecordingCore/swift/Basic/ManglingMacros.h similarity index 100% rename from Sources/KSCrashSwift/include/ManglingMacros.h rename to Sources/KSCrashRecordingCore/swift/Basic/ManglingMacros.h diff --git a/Sources/KSCrashSwift/ManglingUtils.cpp b/Sources/KSCrashRecordingCore/swift/Basic/ManglingUtils.cpp similarity index 100% rename from Sources/KSCrashSwift/ManglingUtils.cpp rename to Sources/KSCrashRecordingCore/swift/Basic/ManglingUtils.cpp diff --git a/Sources/KSCrashSwift/include/ManglingUtils.h b/Sources/KSCrashRecordingCore/swift/Basic/ManglingUtils.h similarity index 100% rename from Sources/KSCrashSwift/include/ManglingUtils.h rename to Sources/KSCrashRecordingCore/swift/Basic/ManglingUtils.h diff --git a/Sources/KSCrashSwift/NodePrinter.cpp b/Sources/KSCrashRecordingCore/swift/Basic/NodePrinter.cpp similarity index 100% rename from Sources/KSCrashSwift/NodePrinter.cpp rename to Sources/KSCrashRecordingCore/swift/Basic/NodePrinter.cpp diff --git a/Sources/KSCrashSwift/OldDemangler.cpp b/Sources/KSCrashRecordingCore/swift/Basic/OldDemangler.cpp similarity index 100% rename from Sources/KSCrashSwift/OldDemangler.cpp rename to Sources/KSCrashRecordingCore/swift/Basic/OldDemangler.cpp diff --git a/Sources/KSCrashSwift/include/Platform.h b/Sources/KSCrashRecordingCore/swift/Basic/Platform.h similarity index 100% rename from Sources/KSCrashSwift/include/Platform.h rename to Sources/KSCrashRecordingCore/swift/Basic/Platform.h diff --git a/Sources/KSCrashSwift/Punycode.cpp b/Sources/KSCrashRecordingCore/swift/Basic/Punycode.cpp similarity index 100% rename from Sources/KSCrashSwift/Punycode.cpp rename to Sources/KSCrashRecordingCore/swift/Basic/Punycode.cpp diff --git a/Sources/KSCrashSwift/include/Punycode.h b/Sources/KSCrashRecordingCore/swift/Basic/Punycode.h similarity index 100% rename from Sources/KSCrashSwift/include/Punycode.h rename to Sources/KSCrashRecordingCore/swift/Basic/Punycode.h diff --git a/Sources/KSCrashSwift/include/ReferenceStorage.def b/Sources/KSCrashRecordingCore/swift/Basic/ReferenceStorage.def similarity index 100% rename from Sources/KSCrashSwift/include/ReferenceStorage.def rename to Sources/KSCrashRecordingCore/swift/Basic/ReferenceStorage.def diff --git a/Sources/KSCrashSwift/include/STLExtras.h b/Sources/KSCrashRecordingCore/swift/Basic/STLExtras.h similarity index 100% rename from Sources/KSCrashSwift/include/STLExtras.h rename to Sources/KSCrashRecordingCore/swift/Basic/STLExtras.h diff --git a/Sources/KSCrashSwift/include/StandardTypesMangling.def b/Sources/KSCrashRecordingCore/swift/Basic/StandardTypesMangling.def similarity index 100% rename from Sources/KSCrashSwift/include/StandardTypesMangling.def rename to Sources/KSCrashRecordingCore/swift/Basic/StandardTypesMangling.def diff --git a/Sources/KSCrashSwift/include/SwiftDemangle.h b/Sources/KSCrashRecordingCore/swift/Basic/SwiftDemangle.h similarity index 100% rename from Sources/KSCrashSwift/include/SwiftDemangle.h rename to Sources/KSCrashRecordingCore/swift/Basic/SwiftDemangle.h diff --git a/Sources/KSCrashSwift/include/ValueWitnessMangling.def b/Sources/KSCrashRecordingCore/swift/Basic/ValueWitnessMangling.def similarity index 100% rename from Sources/KSCrashSwift/include/ValueWitnessMangling.def rename to Sources/KSCrashRecordingCore/swift/Basic/ValueWitnessMangling.def diff --git a/Sources/KSCrashSwift/include/Visibility.h b/Sources/KSCrashRecordingCore/swift/Basic/Visibility.h similarity index 100% rename from Sources/KSCrashSwift/include/Visibility.h rename to Sources/KSCrashRecordingCore/swift/Basic/Visibility.h diff --git a/Sources/KSCrashSwift/LICENSE.txt b/Sources/KSCrashRecordingCore/swift/LICENSE.txt similarity index 100% rename from Sources/KSCrashSwift/LICENSE.txt rename to Sources/KSCrashRecordingCore/swift/LICENSE.txt diff --git a/Sources/KSCrashSwift/include/SwiftStrings.h b/Sources/KSCrashRecordingCore/swift/SwiftStrings.h similarity index 100% rename from Sources/KSCrashSwift/include/SwiftStrings.h rename to Sources/KSCrashRecordingCore/swift/SwiftStrings.h From 7fe275af5b5eadf631fa698b84e1b93775a962ba Mon Sep 17 00:00:00 2001 From: Gleb Linnik Date: Thu, 2 May 2024 16:43:28 +0300 Subject: [PATCH 04/14] return .def files back to sources --- KSCrash.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/KSCrash.podspec b/KSCrash.podspec index 008911528..4ea85c7dd 100644 --- a/KSCrash.podspec +++ b/KSCrash.podspec @@ -18,7 +18,7 @@ Pod::Spec.new do |s| configure_subspec = lambda do |subs| module_name = subs.name.gsub('/', '') - subs.source_files = "Sources/#{module_name}/**/*.{h,m,mm,c,cpp}" + subs.source_files = "Sources/#{module_name}/**/*.{h,m,mm,c,cpp,def}" subs.public_header_files = "Sources/#{module_name}/include/*.h" end From ad0300430cda3c7ea826730c34f3aa690cba9afc Mon Sep 17 00:00:00 2001 From: Gleb Linnik Date: Fri, 3 May 2024 00:26:16 +0300 Subject: [PATCH 05/14] Create a simple lint workflow --- .github/workflows/cocoapods-lint.yml | 59 ++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/cocoapods-lint.yml diff --git a/.github/workflows/cocoapods-lint.yml b/.github/workflows/cocoapods-lint.yml new file mode 100644 index 000000000..3b4071ac4 --- /dev/null +++ b/.github/workflows/cocoapods-lint.yml @@ -0,0 +1,59 @@ +name: CocoaPods Lint for Multiple Platforms and Configurations + +on: + pull_request: + +jobs: + lint: + runs-on: macos-latest + strategy: + fail-fast: false + matrix: + include: + - platform: iOS + config: '' + - platform: iOS + config: '--use-libraries' + - platform: iOS + config: '--use-libraries --use-modular-headers' + - platform: iOS + config: '--use-static-frameworks' + - platform: macOS + config: '' + - platform: macOS + config: '--use-libraries' + - platform: macOS + config: '--use-libraries --use-modular-headers' + - platform: macOS + config: '--use-static-frameworks' + - platform: tvOS + config: '' + - platform: tvOS + config: '--use-libraries' + - platform: tvOS + config: '--use-libraries --use-modular-headers' + - platform: tvOS + config: '--use-static-frameworks' + - platform: watchOS + config: '' + - platform: watchOS + config: '--use-libraries' + - platform: watchOS + config: '--use-libraries --use-modular-headers' + - platform: watchOS + config: '--use-static-frameworks' + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7 + + - name: Install CocoaPods + run: sudo gem install cocoapods + + - name: Lint Podspec + run: pod lib lint --verbose --platform=${{ matrix.platform }} ${{ matrix.config }} + shell: bash From 91903060ef9fad89c521769a8354d3e72123d131 Mon Sep 17 00:00:00 2001 From: Gleb Linnik Date: Fri, 3 May 2024 00:31:48 +0300 Subject: [PATCH 06/14] Update parameters --- .github/workflows/cocoapods-lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cocoapods-lint.yml b/.github/workflows/cocoapods-lint.yml index 3b4071ac4..637a48d5a 100644 --- a/.github/workflows/cocoapods-lint.yml +++ b/.github/workflows/cocoapods-lint.yml @@ -49,11 +49,11 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 2.7 + ruby-version: 3.0 - name: Install CocoaPods run: sudo gem install cocoapods - name: Lint Podspec - run: pod lib lint --verbose --platform=${{ matrix.platform }} ${{ matrix.config }} + run: pod lib lint --verbose --platforms=${{ matrix.platform }} ${{ matrix.config }} shell: bash From c286004ee57fd584e0700051633c0b166d814bae Mon Sep 17 00:00:00 2001 From: Gleb Linnik Date: Fri, 3 May 2024 03:08:54 +0300 Subject: [PATCH 07/14] Update action --- .github/workflows/cocoapods-lint.yml | 53 ++++++++++------------------ 1 file changed, 19 insertions(+), 34 deletions(-) diff --git a/.github/workflows/cocoapods-lint.yml b/.github/workflows/cocoapods-lint.yml index 637a48d5a..4766423d1 100644 --- a/.github/workflows/cocoapods-lint.yml +++ b/.github/workflows/cocoapods-lint.yml @@ -1,4 +1,4 @@ -name: CocoaPods Lint for Multiple Platforms and Configurations +name: CocoaPods Lint on: pull_request: @@ -9,39 +9,14 @@ jobs: strategy: fail-fast: false matrix: + platform: [iOS, macOS, tvOS, watchOS] + config: [''] include: - platform: iOS - config: '' - - platform: iOS - config: '--use-libraries' - - platform: iOS - config: '--use-libraries --use-modular-headers' - - platform: iOS - config: '--use-static-frameworks' - - platform: macOS - config: '' - - platform: macOS - config: '--use-libraries' - - platform: macOS - config: '--use-libraries --use-modular-headers' - - platform: macOS - config: '--use-static-frameworks' - - platform: tvOS - config: '' - - platform: tvOS - config: '--use-libraries' - - platform: tvOS - config: '--use-libraries --use-modular-headers' - - platform: tvOS - config: '--use-static-frameworks' - - platform: watchOS - config: '' - - platform: watchOS - config: '--use-libraries' - - platform: watchOS - config: '--use-libraries --use-modular-headers' - - platform: watchOS - config: '--use-static-frameworks' + config: ['--use-libraries', '--use-libraries --use-modular-headers', '--use-static-frameworks'] + # - platform: macOS + # config: '--allow-warnings' + steps: - name: Checkout Code uses: actions/checkout@v3 @@ -54,6 +29,16 @@ jobs: - name: Install CocoaPods run: sudo gem install cocoapods + - name: Create Validation Directory + run: mkdir -p validation-dir + - name: Lint Podspec - run: pod lib lint --verbose --platforms=${{ matrix.platform }} ${{ matrix.config }} - shell: bash + run: pod lib lint --verbose --platforms-=${{ matrix.platform }} ${{ matrix.config }} --no-clean --validation-dir=./validation-dir + # continue-on-error removed to ensure the workflow fails on lint errors + + - name: Upload Artifacts if Lint Fails + if: failure() # This step runs only if the previous step fails + uses: actions/upload-artifact@v3 + with: + name: lint-workspace-${{ matrix.platform }}-${{ github.run_id }} + path: ./validation-dir # This directory is where the lint artifacts are stored From 639e6969f299dc43f599c98c133c08cbaf3a853d Mon Sep 17 00:00:00 2001 From: Gleb Linnik Date: Fri, 3 May 2024 03:10:07 +0300 Subject: [PATCH 08/14] Fix platforms --- .github/workflows/cocoapods-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cocoapods-lint.yml b/.github/workflows/cocoapods-lint.yml index 4766423d1..9e23cce38 100644 --- a/.github/workflows/cocoapods-lint.yml +++ b/.github/workflows/cocoapods-lint.yml @@ -33,7 +33,7 @@ jobs: run: mkdir -p validation-dir - name: Lint Podspec - run: pod lib lint --verbose --platforms-=${{ matrix.platform }} ${{ matrix.config }} --no-clean --validation-dir=./validation-dir + run: pod lib lint --verbose --platforms=${{ matrix.platform }} ${{ matrix.config }} --no-clean --validation-dir=./validation-dir # continue-on-error removed to ensure the workflow fails on lint errors - name: Upload Artifacts if Lint Fails From 9f22ddfe9578ab57d90b401a412896d12d8936e9 Mon Sep 17 00:00:00 2001 From: Gleb Linnik Date: Fri, 3 May 2024 14:01:06 +0300 Subject: [PATCH 09/14] Try to fix action --- .github/workflows/cocoapods-lint.yml | 42 +++++++++++++++++----------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/.github/workflows/cocoapods-lint.yml b/.github/workflows/cocoapods-lint.yml index 9e23cce38..bc43a73d4 100644 --- a/.github/workflows/cocoapods-lint.yml +++ b/.github/workflows/cocoapods-lint.yml @@ -9,14 +9,21 @@ jobs: strategy: fail-fast: false matrix: - platform: [iOS, macOS, tvOS, watchOS] - config: [''] include: - platform: iOS - config: ['--use-libraries', '--use-libraries --use-modular-headers', '--use-static-frameworks'] - # - platform: macOS - # config: '--allow-warnings' - + config: '' + - platform: iOS + config: '--use-libraries' + - platform: iOS + config: '--use-libraries --use-modular-headers' + - platform: iOS + config: '--use-static-frameworks' + - platform: macOS + config: '' + - platform: tvOS + config: '' + - platform: watchOS + config: '' steps: - name: Checkout Code uses: actions/checkout@v3 @@ -29,16 +36,19 @@ jobs: - name: Install CocoaPods run: sudo gem install cocoapods - - name: Create Validation Directory - run: mkdir -p validation-dir - - name: Lint Podspec - run: pod lib lint --verbose --platforms=${{ matrix.platform }} ${{ matrix.config }} --no-clean --validation-dir=./validation-dir - # continue-on-error removed to ensure the workflow fails on lint errors - - - name: Upload Artifacts if Lint Fails - if: failure() # This step runs only if the previous step fails + run: | + validation_dir=$(mktemp -d) + pod lib lint --verbose --platforms=${{ matrix.platform }} ${{ matrix.config }} --no-clean --validation-dir="${validation_dir}" + if [ $? -ne 0 ]; then + echo "Lint failed. Archiving workspace for inspection." + zip -r workspace.zip "${validation_dir}" + fi + shell: bash + + - name: Upload Workspace Artifact uses: actions/upload-artifact@v3 + if: failure() with: - name: lint-workspace-${{ matrix.platform }}-${{ github.run_id }} - path: ./validation-dir # This directory is where the lint artifacts are stored + name: workspace-${{ matrix.platform }}-${{ matrix.config }} + path: workspace.zip From 7630c39cef17f730b03de77d21aba788ce58ba4a Mon Sep 17 00:00:00 2001 From: Gleb Linnik Date: Fri, 3 May 2024 15:15:20 +0300 Subject: [PATCH 10/14] Try to fix artifacts --- .github/workflows/cocoapods-lint.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/cocoapods-lint.yml b/.github/workflows/cocoapods-lint.yml index bc43a73d4..7d2083c34 100644 --- a/.github/workflows/cocoapods-lint.yml +++ b/.github/workflows/cocoapods-lint.yml @@ -40,10 +40,6 @@ jobs: run: | validation_dir=$(mktemp -d) pod lib lint --verbose --platforms=${{ matrix.platform }} ${{ matrix.config }} --no-clean --validation-dir="${validation_dir}" - if [ $? -ne 0 ]; then - echo "Lint failed. Archiving workspace for inspection." - zip -r workspace.zip "${validation_dir}" - fi shell: bash - name: Upload Workspace Artifact @@ -51,4 +47,4 @@ jobs: if: failure() with: name: workspace-${{ matrix.platform }}-${{ matrix.config }} - path: workspace.zip + path: ${validation_dir} From 35a19571fe383cb053ed3f2131919fd0af3daa10 Mon Sep 17 00:00:00 2001 From: Gleb Linnik Date: Fri, 3 May 2024 15:22:43 +0300 Subject: [PATCH 11/14] Pass validation dir as output --- .github/workflows/cocoapods-lint.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cocoapods-lint.yml b/.github/workflows/cocoapods-lint.yml index 7d2083c34..1fd4d74e5 100644 --- a/.github/workflows/cocoapods-lint.yml +++ b/.github/workflows/cocoapods-lint.yml @@ -37,8 +37,10 @@ jobs: run: sudo gem install cocoapods - name: Lint Podspec + id: lint run: | validation_dir=$(mktemp -d) + echo "validation_dir=${validation_dir}" >> $GITHUB_OUTPUT pod lib lint --verbose --platforms=${{ matrix.platform }} ${{ matrix.config }} --no-clean --validation-dir="${validation_dir}" shell: bash @@ -47,4 +49,4 @@ jobs: if: failure() with: name: workspace-${{ matrix.platform }}-${{ matrix.config }} - path: ${validation_dir} + path: ${{ steps.lint.outputs.validation_dir }} From 48cfe6203a7b88091d6e74d231079a6c3edb6472 Mon Sep 17 00:00:00 2001 From: Gleb Linnik Date: Fri, 3 May 2024 15:44:15 +0300 Subject: [PATCH 12/14] Update actions to use Node.js 20 --- .github/workflows/cocoapods-lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cocoapods-lint.yml b/.github/workflows/cocoapods-lint.yml index 1fd4d74e5..2229b4a02 100644 --- a/.github/workflows/cocoapods-lint.yml +++ b/.github/workflows/cocoapods-lint.yml @@ -26,7 +26,7 @@ jobs: config: '' steps: - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Ruby uses: ruby/setup-ruby@v1 @@ -45,7 +45,7 @@ jobs: shell: bash - name: Upload Workspace Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: workspace-${{ matrix.platform }}-${{ matrix.config }} From 099098778911121bfc36b9471185eba4166e586b Mon Sep 17 00:00:00 2001 From: Gleb Linnik Date: Fri, 3 May 2024 15:53:06 +0300 Subject: [PATCH 13/14] Remove dash from artifact name --- .github/workflows/cocoapods-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cocoapods-lint.yml b/.github/workflows/cocoapods-lint.yml index 2229b4a02..95e38feac 100644 --- a/.github/workflows/cocoapods-lint.yml +++ b/.github/workflows/cocoapods-lint.yml @@ -48,5 +48,5 @@ jobs: uses: actions/upload-artifact@v4 if: failure() with: - name: workspace-${{ matrix.platform }}-${{ matrix.config }} + name: workspace-${{ matrix.platform }}${{ matrix.config }} path: ${{ steps.lint.outputs.validation_dir }} From a7bd1316fdb56ecfcb6d1f490278d1527fe40459 Mon Sep 17 00:00:00 2001 From: Gleb Linnik Date: Sat, 4 May 2024 01:48:51 +0300 Subject: [PATCH 14/14] Update podspec with PR requirements --- KSCrash.podspec | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/KSCrash.podspec b/KSCrash.podspec index 4ea85c7dd..1a2ad7c60 100644 --- a/KSCrash.podspec +++ b/KSCrash.podspec @@ -1,19 +1,19 @@ Pod::Spec.new do |s| IOS_DEPLOYMENT_TARGET = '11.0' unless defined? IOS_DEPLOYMENT_TARGET s.name = "KSCrash" - s.version = "2.0.0" + s.version = "1.17.1" s.summary = "The Ultimate iOS Crash Reporter" s.homepage = "https://github.com/kstenerud/KSCrash" - s.license = { :type => 'KSCrash license agreement', :file => 'LICENSE' } + s.license = { :type => 'KSCrash license agreement', :file => 'LICENSE' } s.author = { "Karl Stenerud" => "kstenerud@gmail.com" } - s.ios.deployment_target = IOS_DEPLOYMENT_TARGET - s.osx.deployment_target = '10.13' - s.tvos.deployment_target = '11.0' - s.watchos.deployment_target = '4.0' + s.ios.deployment_target = IOS_DEPLOYMENT_TARGET + s.osx.deployment_target = '10.13' + s.tvos.deployment_target = '11.0' + s.watchos.deployment_target = '4.0' s.source = { :git => "https://github.com/kstenerud/KSCrash.git", :tag=>s.version.to_s } - s.frameworks = 'Foundation' - s.libraries = 'c++', 'z' - s.xcconfig = { 'GCC_ENABLE_CPP_EXCEPTIONS' => 'YES' } + s.frameworks = 'Foundation' + s.libraries = 'c++', 'z' + s.xcconfig = { 'GCC_ENABLE_CPP_EXCEPTIONS' => 'YES' } s.default_subspecs = 'Installations' configure_subspec = lambda do |subs| @@ -39,6 +39,7 @@ Pod::Spec.new do |s| s.subspec 'Sinks' do |sinks| sinks.dependency 'KSCrash/Recording' sinks.dependency 'KSCrash/Filters' + sinks.ios.frameworks = 'MessageUI' configure_subspec.call(sinks) end @@ -59,6 +60,9 @@ Pod::Spec.new do |s| s.subspec 'ReportingCore' do |reporting_core| reporting_core.dependency 'KSCrash/Core' + reporting_core.ios.frameworks = 'SystemConfiguration' + reporting_core.tvos.frameworks = 'SystemConfiguration' + reporting_core.osx.frameworks = 'SystemConfiguration' configure_subspec.call(reporting_core) end