cocoapods-meitu-swift-ast 0.0.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e2f752e5cceb336dc8855fe1a47f4810f81b9c6ae421af5950449ecf9d0e7304
4
- data.tar.gz: 19d9b19fa6a7c1c53ae8a15c0f4ac7c3e520ccb07107970ab28b5aa8dfefac6c
3
+ metadata.gz: 71a412833d8e28ba4001f186fdd440208621f7c438eb63661059da1e97ba9645
4
+ data.tar.gz: 5000511f9b8a52cf2cb5bc845d7c9a8de5769251e42b2c463f15fa17dbffa93e
5
5
  SHA512:
6
- metadata.gz: b6d42083d8e68519df79f4bf39f778c54b2fbab1bed8fb23fa46811776564735dae9c913421db1f3b04855647258515f7d88814f0a32022966399b7f06f19c65
7
- data.tar.gz: 0b59c40b487fd3062d4a4dfca3ebe255f6faa5078c01d73a7203ad87001b57029606a8e0fdb1ba865e3afb2f9ec66b05d01b2277361c6572733125bc071c1f5c
6
+ metadata.gz: 93730eaca6509086ab17f21706b3ffa1abcba5c0e1816d40f89c3b720c31557dbcab2ebccacfd2761c6464ab5e0c52aadda39a940dcb011f543f00bb96440cb2
7
+ data.tar.gz: ea10d879a8df97e5c17ef04f9ff6dd2c8b0dc509cab4f9653832ac7b328e6c10a8fed57d376f7386eeb970992776e6c818f7fc026fd3c78c39ef0f2e31ac237b
@@ -18,7 +18,7 @@ module Pod
18
18
  # in the `plugins.json` file, once your plugin is released.
19
19
  #
20
20
  class Ast < Command
21
- self.summary = 'Short description of cocoapods-meitu-swift-ast.'
21
+ self.summary = 'The cocoapods-meitu-swift-ast tool assists developers in resolving LLDB debugging issues when using Xcode 16 with CocoaPods-managed Swift components. It dynamically injects the -add_ast_path compiler flag during pod operations to enable proper object introspection during debug sessions.'
22
22
 
23
23
  self.description = <<-DESC
24
24
  Longer description of cocoapods-meitu-swift-ast.
@@ -1,5 +1,8 @@
1
1
  require 'cocoapods-meitu-swift-ast/command/ast'
2
2
  require 'cocoapods'
3
+ require 'json'
4
+ require 'timeout'
5
+ require 'net/http'
3
6
 
4
7
  # 使用常量定义颜色代码,提高可读性
5
8
  RED = "\e[31m"
@@ -21,6 +24,44 @@ def add_ast_path(installer,aggregate_targets)
21
24
  end
22
25
  end
23
26
  puts "#{GREEN}add_ast_path count: #{count}#{GREEN}"
27
+ begin
28
+ target = name.gsub("Pods-", "")
29
+ data = {
30
+ "add_ast_path_count": count,
31
+ "target": target
32
+ }
33
+ source = `git config user.email`
34
+ source = source.gsub("\n", "")
35
+ data_json = {
36
+ "subject" => "swift ast path",
37
+ "type" => "add_ast_path",
38
+ "source" => "/",
39
+ "source_path_segment_1" => source,
40
+ "source_path_segment_2" => target,
41
+ "data" => data
42
+ }
43
+ begin
44
+ Timeout.timeout(2) do
45
+ json_data = [data_json].to_json
46
+ api_url = "http://event-adapter-internal.prism.cloud.meitu-int.com/api/v1/http/send/batch"
47
+ headers = { "Content-Type" => "application/json" }
48
+ uri = URI(api_url)
49
+ http = Net::HTTP.new(uri.host, uri.port)
50
+ request = Net::HTTP::Post.new(uri.path, headers)
51
+ request.body = json_data
52
+ response = http.request(request)
53
+ # puts response.code
54
+ # puts response.body
55
+ # puts response.headers
56
+ # puts json_data
57
+ end
58
+ rescue Timeout::Error
59
+ puts "#{RED}Timeout: Request took too long to complete.#{RESET}"
60
+ end
61
+ rescue => error
62
+ puts "#{RED} data exception: #{error}.#{RESET}"
63
+ end
64
+
24
65
  xcconfig_new_ld_flags = <<~CONTENT
25
66
  OTHER_LDFLAGS = #{xcconfig_original_ld_flags} #{paths_str}
26
67
  CONTENT
@@ -34,9 +75,13 @@ module Pod
34
75
  class Installer
35
76
  alias sxl_run_plugins_post_install_hooks run_plugins_post_install_hooks
36
77
  def run_plugins_post_install_hooks
37
- add_ast_path(self,aggregate_targets)
78
+ # CI 打包不执行
79
+ if !ENV['NODE_NAME']
80
+ start_time = Time.now
81
+ add_ast_path(self,aggregate_targets)
82
+ puts "#{GREEN}add_ast_path Time: #{Time.now - start_time}s#{GREEN}"
83
+ end
38
84
  sxl_run_plugins_post_install_hooks
39
85
  end
40
-
41
86
  end
42
87
  end
@@ -1,3 +1,3 @@
1
1
  module CocoapodsMeituSwiftAst
2
- VERSION = "0.0.1"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-meitu-swift-ast
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sxl
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-02-17 00:00:00.000000000 Z
11
+ date: 2025-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler