Method: TYCiCore::ConfigModules#module_lib?

Defined in:
lib/tuya/ci/core/config/config_modules.rb

#module_lib?(name) ⇒ Boolean

Returns:

  • (Boolean)


66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/tuya/ci/core/config/config_modules.rb', line 66

def module_lib?(name)

	puts "Name is #{name}".green

	lib_path =  "#{@pod_path}#{name}/#{name}*/lib#{name}.a"

	puts "File_path is #{lib_path}".yellow

	libs_path_result = Dir.glob(lib_path)

	puts("The path is#{libs_path_result}")

	if libs_path_result.length > 0

		file_path = libs_path_result[0]
		# find_command = "nm -gU #{file_path} | grep '_OBJC_CLASS_\\$_#{name}Impl'"
		#
		exists_impl = true
		# find_command_result = Action.sh(
		# 	find_command,
		# 	error_callback: ->(result) {
		# 		exists_impl = false
		# 	}
		# )

		# TODO exist?
		commands = %W(-gU #{file_path} | grep '_OBJC_CLASS_\\$_#{name}Impl')

		find_result = EXE.exe('nm', commands)

		if exists_impl && !find_result.empty?
			puts "Static lib #{name} has #{name}mpl".green
			true
		else
			puts "Static lib #{name} can not find #{name}mpl".red
			false
		end
	end

	false
end