Project compatibility method and related device based on cross-platform installation tool

By generating configuration files and installation dependencies for cross-platform installation tools, the technical problems of cross-platform project compatible calls are solved, and efficient calls of multi-platform projects are achieved.

CN115048114BActive Publication Date: 2025-09-02SHENZHEN SHANJIAN INTELLIGENT SCI & TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210626182.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-02
Publication Date
2025-09-02
Estimated Expiration
2042-06-02

AI Technical Summary

Technical Problem

In the cross-platform situation, how to achieve compatible calls of multi-platform projects to improve development efficiency.

Method used

Generate configuration files for cross-platform installation tools by obtaining information about the target project and the target platform, generate configuration programs, and install dependencies in the target platform to implement project calls.

Benefits of technology

It realizes multi-platform project compatible calls in cross-platform situations, improving development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115048114B_ABST
    Figure CN115048114B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of the Internet and discloses a project compatibility method based on a cross-platform installation tool and a related device. By obtaining a target project and a target platform, a configuration file of the cross-platform installation tool is generated according to project information in the target project and the target platform; a configuration program corresponding to the cross-platform installation tool is generated according to the configuration file of the cross-platform installation tool; after detecting that the configuration program has been generated, a dependency is installed in the target platform to enable the target project to be called by the cross-platform installation tool in the target platform, thereby achieving the technical effect of realizing multi-platform project compatibility calling in a cross-platform situation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of the Internet, and in particular to a project compatibility method based on a cross-platform installation tool and a related device. Background Art

[0002] With the advancement of technology, people's lives are becoming increasingly dependent on the internet. Most computer languages ​​are, in a strict sense, cross-platform: they issue instructions to the CPU in a high-level, human-readable format, eliminating the need to rely on any particular operating system. However, when faced with hybrid development scenarios, the differences in code across different platforms often limit project development efficiency.

[0003] Therefore, how to achieve multi-platform project compatible calling in a cross-platform situation has become a technical problem that needs to be solved urgently.

[0004] The above content is only used to assist in understanding the technical solution of the present invention and does not constitute an admission that the above content is prior art. Summary of the Invention

[0005] The main purpose of the present invention is to provide a project compatibility method and related devices based on a cross-platform installation tool, aiming to solve the technical problem of how to achieve multi-platform project compatibility calling in a cross-platform situation.

[0006] To achieve the above object, the present invention provides a project compatibility method based on a cross-platform installation tool, the method comprising the following steps:

[0007] Obtain a target project and a target platform, and generate a configuration file for a cross-platform installation tool based on project information in the target project and the target platform;

[0008] Generating a configuration program corresponding to the cross-platform installation tool according to a configuration file of the cross-platform installation tool;

[0009] After detecting that the configuration program is generated, the dependency is installed in the target platform to enable calling the target project in the target platform through the cross-platform installation tool.

[0010] Optionally, the acquiring the target project and the target platform, and generating a configuration file of the cross-platform installation tool according to the project information in the target project and the target platform includes:

[0011] Acquire a target project, where the target project includes an Objective-C-based project and the target project is managed by the cross-platform installation tool;

[0012] A target platform is obtained, and a configuration file of a cross-platform installation tool is generated according to the project information in the target project and the target platform.

[0013] Optionally, the configuration program corresponding to the cross-platform installation tool includes: an information calling program and an interface switching program;

[0014] Generating a configuration program corresponding to the cross-platform installation tool according to the configuration file of the cross-platform installation tool includes:

[0015] An information calling program is generated according to the configuration file of the cross-platform installation tool, and the information calling program is used to obtain header file information in a basic file corresponding to the cross-platform installation tool at a first target interface.

[0016] Optionally, the information calling program is generated according to the configuration file of the cross-platform installation tool, and after the information calling program obtains header file information in the basic file corresponding to the cross-platform installation tool through the first target interface, it further includes:

[0017] An interface switching program is generated according to a configuration file of the cross-platform installation tool, and the interface switching program is used to switch the target project in an environment of the cross-platform installation tool.

[0018] Optionally, generating an interface adapter program according to a configuration file of the cross-platform installation tool, wherein the interface adapter program is used to transfer the target project in the environment of the cross-platform installation tool, includes:

[0019] Generate an interface conversion program according to the configuration file of the cross-platform installation tool, wherein the interface conversion program is used to obtain the configuration information of the target project at the second target interface and generate a preset project file;

[0020] The interface conversion program is further used to associate the preset project file with the target platform at the third target interface.

[0021] Optionally, after detecting that the configuration program is generated, installing dependencies in the target platform to enable calling the target project through the cross-platform installation tool in the target platform includes:

[0022] After detecting that the configuration program is generated, installing interface dependencies in the target platform, the interface dependencies including a first interface dependency and a second interface dependency;

[0023] Obtain header file information in the basic file of the target project through the first interface dependency and the first target interface;

[0024] Obtaining configuration information of the target project through the second interface depending on the third target interface;

[0025] After obtaining the configuration information of the target project, the target project is called through the cross-platform installation tool.

[0026] Optionally, after detecting that the configuration program is generated, and after installing the dependencies in the target platform to enable calling the target project through the cross-platform installation tool in the target platform, the method further includes:

[0027] Saving the configuration file of the cross-platform installation tool and the project information of the target project as a historical compatibility record;

[0028] After detecting a project compatibility request based on a cross-platform installation tool, traversing the historical compatibility records to determine whether there is a historical compatibility record that matches the project compatibility request based on the cross-platform installation tool;

[0029] If so, a configuration file corresponding to the project compatibility request based on the cross-platform installation tool is generated according to the historical compatibility record.

[0030] In addition, to achieve the above-mentioned purpose, the present invention further proposes a project compatibility device based on a cross-platform installation tool, the project compatibility device based on a cross-platform installation tool comprising:

[0031] A configuration generation module is used to obtain a target project and a target platform, and generate a configuration file for a cross-platform installation tool based on the project information in the target project and the target platform;

[0032] A program generation module, configured to generate a configuration program corresponding to the cross-platform installation tool according to a configuration file of the cross-platform installation tool;

[0033] The dependency installation module is used to install the dependency in the target platform after detecting that the configuration program is generated, so as to enable the target project to be called by the cross-platform installation tool in the target platform.

[0034] In addition, to achieve the above-mentioned purpose, the present invention also proposes a project compatibility device based on a cross-platform installation tool, and the project compatibility device based on the cross-platform installation tool includes: a memory, a processor, and a project compatibility generation program based on the cross-platform installation tool stored on the memory and runnable on the processor, and the project compatibility program based on the cross-platform installation tool is configured to implement the steps of the project compatibility method based on the cross-platform installation tool as described above.

[0035] In addition, to achieve the above-mentioned purpose, the present invention also proposes a storage medium, on which a project compatibility program based on a cross-platform installation tool is stored. When the project compatibility program based on the cross-platform installation tool is executed by a processor, the steps of the project compatibility generation method based on the cross-platform installation tool as described above are implemented.

[0036] The present invention obtains a target project and a target platform, generates a configuration file of a cross-platform installation tool according to project information in the target project and the target platform; generates a configuration program corresponding to the cross-platform installation tool according to the configuration file of the cross-platform installation tool; after detecting the generation of the configuration program, installs dependencies in the target platform to implement calling of the target project through the cross-platform installation tool in the target platform, thereby achieving the technical effect of realizing multi-platform project compatible calling in a cross-platform situation. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 It is a schematic diagram of the structure of a project compatible device based on a cross-platform installation tool in the hardware operating environment involved in the embodiment of the present invention;

[0038] Figure 2 This is a flowchart of a first embodiment of a project compatibility method based on a cross-platform installation tool according to the present invention;

[0039] Figure 3 This is an OC configuration diagram of the first embodiment of the project compatibility method based on a cross-platform installation tool of the present invention;

[0040] Figure 4 The C module of the first embodiment of the project compatibility method based on the cross-platform installation tool of the present invention is integrated into the OC diagram:

[0041] Figure 5 This is a structural block diagram of the first embodiment of the project compatibility device based on the cross-platform installation tool of the present invention.

[0042] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION

[0043] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0044] Reference Figure 1 , Figure 1 This is a schematic diagram of a project compatible device structure based on a cross-platform installation tool in the hardware operating environment involved in the embodiment of the present invention.

[0045] like Figure 1As shown, the project compatible device based on the cross-platform installation tool may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0046] Those skilled in the art will understand that Figure 1 The structure shown in the does not constitute a limitation on the project-compatible device based on the cross-platform installation tool, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0047] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a data storage module, a network communication module, a user interface module, and a project compatible program based on a cross-platform installation tool.

[0048] exist Figure 1 In the project compatible device based on the cross-platform installation tool shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the project compatible device based on the cross-platform installation tool of the present invention can be set in the project compatible device based on the cross-platform installation tool, and the project compatible device based on the cross-platform installation tool calls the project compatible program based on the cross-platform installation tool stored in the memory 1005 through the processor 1001, and executes the project compatible method based on the cross-platform installation tool provided by the embodiment of the present invention.

[0049] The embodiment of the present invention provides a project compatibility method based on a cross-platform installation tool, referring to Figure 2 , Figure 2 This is a flowchart of a first embodiment of a project compatibility method based on a cross-platform installation tool according to the present invention.

[0050] In this embodiment, the project compatibility method based on the cross-platform installation tool includes the following steps:

[0051] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0052] Step S10: Obtain a target project and a target platform, and generate a configuration file of a cross-platform installation tool according to the project information in the target project and the target platform.

[0053] It should be noted that this embodiment uses a conversion method for a CMake project to support Cocoapods dependencies as an example for description.

[0054] It is understandable that CMake: an open source cross-platform build management tool, mainly used for the build management of C language programs, and its configuration file is CMakeList.txt; Cocoapods: a build management tool dedicated to OC, the configuration file extension is podspec, example: XXXModule.podspec.

[0055] It should be noted that CMake is a cross-platform installation (compilation) tool that can use simple statements to describe the installation (compilation process) of all platforms. It can output various makefiles or project files, and can test the C++ features supported by the compiler, similar to automake under UNIX. The only difference is that the CMake configuration file is named CMakeLists.txt. Cmake does not directly build the final software, but generates standard build files (such as Unix Makefile or Windows Visual C++ projects / workspaces), which are then used in the general build method. This allows developers who are familiar with a certain integrated development environment (IDE) to build their software in a standard way. The ability to use the native build system of each platform is what distinguishes CMake from other similar systems such as SCons.

[0056] It is understandable that Cocoapods is a tool used to help manage third-party dependency libraries. It can resolve dependencies between libraries, download library source code, and connect these third-party libraries to projects by creating an Xcode workspace.

[0057] In the specific implementation, obtain and prepare the OC project and C module, this embodiment document (OC:main C:module1module2module3), such as Figure 3 The configuration commands shown are for configuring the OC in this embodiment.

[0058] Furthermore, in order to be more precise in calling cross-platform projects, obtaining the target project and target platform, and generating a configuration file for the cross-platform installation tool based on the project information in the target project and the target platform includes: obtaining the target project, the target project including an Objective-C-based project, and the target project is managed by the cross-platform installation tool; obtaining the target platform, and generating a configuration file for the cross-platform installation tool based on the project information in the target project and the target platform.

[0059] Step S20: generating a configuration program corresponding to the cross-platform installation tool according to the configuration file of the cross-platform installation tool.

[0060] In the specific implementation, a CMake-to-Cocoapods program is written: cocoapods_cmake.rb. The cmake_pod interface is provided for adding C modules to Cocoapods. When adding a C module, the cmake command is used to generate an Xcode-type project from the CMake project and record the module name and path information in $modules. The pod_post interface is externally passed to the Cocoapods installer and the Objective-C project name, and the C module information is traversed from $modules to associate the Xcode-type project generated in the previous step with the Objective-C project. The corresponding code in this embodiment is as follows:

[0061] $modules = Hash.new

[0062] def cmake_pod(name,params)

[0063] path = params.delete(:path)

[0064] `cd#{path};rm-rf build;cmake-G Xcode-B build`

[0065] pod"#{name}",:path=>"#{path} / #{name}.podspec"

[0066] $modules[name]=path

[0067] end

[0068] def pod_post(installer,target_name)

[0069] puts$modules.to_s

[0070] $modules.each do |name, path|

[0071] _pod_post(installer, target_name, path, name)

[0072] end

[0073] $modules.clear

[0074] end

[0075] def _pod_post(installer, target_name, path, module_name)

[0076] pods_project = installer.pods_project

[0077] gen_project =

[0078] Xcodeproj::Project.open("#{path} / build / #{module_name}.xcodeproj")

[0079] pods_project.add_subproject_reference(gen_project, pods_project.main_group)

[0080] # Add the project

[0081] zTarget = get_project_target(gen_project, module_name)

[0082] pTarget = get_project_target(pods_project, target_name)

[0083] pTarget.add_dependency(zTarget)

[0084] # The build result of the cmake project participates in the linking

[0085] frameworks_group = pods_project.groups.find { |group| group.display_name ==

[0086] 'Products'}

[0087] gen_project.products_group.files.each do|product|

[0088] product_path=product.real_path.to_s

[0089] if product_path.include? (module_name)

[0090] product_ref=frameworks_group.new_reference(product_path)

[0091] pTarget.frameworks_build_phase.add_file_reference(product_ref)

[0092] end

[0093] end

[0094] end

[0095] def get_project_target(project,name)

[0096] project.targets.each do|target|

[0097] if target.name == name

[0098] return target

[0099] end

[0100] end

[0101] return nil

[0102] End.

[0103] Furthermore, in order to reduce the compatibility between different platforms in cross-platform project calls, the configuration program corresponding to the cross-platform installation tool includes: an information calling program and an interface adapter program; the configuration program corresponding to the cross-platform installation tool generated according to the configuration file of the cross-platform installation tool includes: generating an information calling program according to the configuration file of the cross-platform installation tool, and the information calling program is used to obtain the header file information in the basic file corresponding to the cross-platform installation tool at the first target interface.

[0104] In the specific implementation, write CMake to transfer the Cocoapods configuration generation program: transfer.cmake; gen_podspec interface: introduce and call in the CMakeList.txt configuration file of the C module, which can obtain the include header file information described in the configuration file and make it into a podspec configuration file that can be used by Cocoapods. The specific code in this embodiment is as follows:

[0105] #gen function

[0106] function(gen_podspec self_dir target)

[0107] #all includes

[0108] get_target_property(include_dirs${target}INCLUDE_DIRECTORIES)

[0109] list(APPEND include_dirs${CMAKE_CURRENT_SOURCE_DIR})

[0110] #header files

[0111] set(headers)

[0112] foreach(line${include_dirs})

[0113] file(GLOB_RECURSE header${line} / *.hpp${line} / *.h)

[0114] list(APPEND headers${header})

[0115] endforeach(line)

[0116] #header items

[0117] set(items)

[0118] foreach(line${headers})

[0119] message(STATUS "${line}")

[0120] string(REPLACE"${CMAKE_CURRENT_SOURCE_DIR} / """item${line})

[0121] list(APPEND items"\'${item}\'")

[0122] endforeach(line)

[0123] #env

[0124] string(JOIN","item_list${items})

[0125] message(STATUS"items=${item_list}")

[0126] set(LIB_NAME${target})

[0127] set(LIB_VER 1.0.0)

[0128] set(SOURCE_FILES"${item_list},'dummy.m'")

[0129] set(PUBLIC_HEADER_FILES${item_list})

[0130] #make configuration

[0131] configure_file(${self_dir} / pod.in

[0132] ${CMAKE_CURRENT_SOURCE_DIR} / ${target}.podspec)

[0133] configure_file(${self_dir} / dummy.in

[0134] ${CMAKE_CURRENT_SOURCE_DIR} / dummy.m)

[0135] endfunction(gen_podspec)。

[0136] In a specific implementation, the interface adapter program is generated according to the configuration file of the cross-platform installation tool, and the interface adapter program is used to transfer the target project in the environment of the cross-platform installation tool, including: generating an interface adapter program according to the configuration file of the cross-platform installation tool, and the interface adapter program is used to obtain the configuration information of the target project at the second target interface and generate a preset project file; the interface adapter program is also used to associate the preset project file with the target platform at the third target interface.

[0137] Step S30: After detecting that the configuration program is generated, the dependencies are installed in the target platform to enable the target project to be called by the cross-platform installation tool in the target platform.

[0138] Furthermore, in order to reduce errors in the cross-platform project calling process, after detecting that the configuration program has been generated, installing dependencies in the target platform to enable calling the target project through the cross-platform installation tool in the target platform includes: after detecting that the configuration program has been generated, installing interface dependencies in the target platform, the interface dependencies including a first interface dependency and a second interface dependency; obtaining header file information in the basic file of the target project through the first interface dependency and the first target interface; obtaining configuration information of the target project through the second interface dependency on the third target interface; and calling the target project through the cross-platform installation tool after obtaining the configuration information of the target project.

[0139] It should be noted that in this embodiment, the normal dependency installation process of Cocoapods is used: podinstall installs dependencies; podupdate updates dependencies, and the C module is integrated into OC as shown in the following example. Figure 4 shown.

[0140] In a specific implementation, after detecting that the configuration program is generated, installing the dependency in the target platform to implement calling the target project through the cross-platform installation tool in the target platform, it also includes: saving the configuration file of the cross-platform installation tool and the project information of the target project as a historical compatibility record; after detecting a project compatibility request based on the cross-platform installation tool, traversing the historical compatibility record to determine whether there is a historical compatibility record that matches the project compatibility request based on the cross-platform installation tool; if so, generating a configuration file corresponding to the project compatibility request based on the cross-platform installation tool according to the historical compatibility record.

[0141] This example obtains the target project and target platform, generates a configuration file of a cross-platform installation tool according to the project information in the target project and the target platform; generates a configuration program corresponding to the cross-platform installation tool according to the configuration file of the cross-platform installation tool; and after detecting the generation of the configuration program, installs dependencies in the target platform to enable the target project to be called by the cross-platform installation tool in the target platform, thereby achieving the technical effect of realizing multi-platform project compatible calling in a cross-platform situation.

[0142] Reference Figure 5 , Figure 5 This is a structural block diagram of the first embodiment of the project compatibility device based on the cross-platform installation tool of the present invention.

[0143] like Figure 5 As shown, the project compatibility device based on the cross-platform installation tool proposed in the embodiment of the present invention includes:

[0144] Configuration generation module 10, used to obtain a target project and a target platform, and generate a configuration file of a cross-platform installation tool according to project information in the target project and the target platform;

[0145] A program generating module 20, configured to generate a configuration program corresponding to the cross-platform installation tool according to the configuration file of the cross-platform installation tool;

[0146] The dependency installation module 30 is configured to install the dependency in the target platform after detecting that the configuration program is generated, so as to enable the target project to be called in the target platform through the cross-platform installation tool.

[0147] This example obtains the target project and target platform, generates a configuration file for a cross-platform installation tool based on the project information in the target project and the target platform; generates a configuration program corresponding to the cross-platform installation tool based on the configuration file of the cross-platform installation tool; after detecting the generation of the configuration program, installs dependencies in the target platform to enable the target project to be called by the cross-platform installation tool in the target platform, thereby achieving the technical effect of realizing compatible calling of projects on multiple platforms in a cross-platform situation.

[0148] In one embodiment, the configuration generation module 10 is further used to obtain a target project, which includes an Objective-C-based project and is managed by the cross-platform installation tool; obtain a target platform, and generate a configuration file for the cross-platform installation tool based on the project information in the target project and the target platform.

[0149] In one embodiment, the program generation module 20 is further configured to generate an information calling program based on a configuration file of the cross-platform installation tool, wherein the information calling program is configured to obtain header file information in a basic file corresponding to the cross-platform installation tool at a first target interface.

[0150] In one embodiment, the program generation module 20 is further configured to generate an interface switching program according to a configuration file of the cross-platform installation tool, wherein the interface switching program is configured to switch the target project in the environment of the cross-platform installation tool.

[0151] In one embodiment, the program generation module 20 is also used to generate an interface conversion program based on the configuration file of the cross-platform installation tool, and the interface conversion program is used to obtain the configuration information of the target project at the second target interface and generate a preset project file; the interface conversion program is also used to associate the preset project file with the target platform at the third target interface.

[0152] In one embodiment, the dependency installation module 30 is also used to install interface dependencies in the target platform after detecting that the configuration program has been generated, the interface dependencies including a first interface dependency and a second interface dependency; obtain header file information in the basic file of the target project through the first interface dependency and the first target interface; obtain configuration information of the target project through the second interface dependency and the third target interface; and call the target project through the cross-platform installation tool after obtaining the configuration information of the target project.

[0153] In one embodiment, the dependency installation module 30 is further configured to save the configuration file of the cross-platform installation tool and the project information of the target project as a historical compatibility record; after detecting a project compatibility request based on the cross-platform installation tool, the historical compatibility record is traversed to determine whether there is a historical compatibility record that matches the project compatibility request based on the cross-platform installation tool; if so, a configuration file corresponding to the project compatibility request based on the cross-platform installation tool is generated according to the historical compatibility record.

[0154] In one embodiment, the resource loading module 40 is also used to cancel the monitoring of the visual resource; determine whether there are still target resources that need to be loaded, and if so, continue to monitor the DOMContentLoaded event on the target page; if not, clear the uniform resource locator in the target resource of the loaded visual resource.

[0155] It should be understood that the above is only an example and does not constitute any limitation to the technical solution of the present invention. In specific applications, those skilled in the art can make settings as needed, and the present invention does not impose any limitation on this.

[0156] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present invention. In practical applications, technicians in this field can select part or all of it according to actual needs to achieve the purpose of the embodiment scheme, and no limitation is made here.

[0157] In addition, for technical details not fully described in this embodiment, please refer to the stream processing method provided in any embodiment of the present invention, and will not be repeated here.

[0158] In addition, it should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.

[0159] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.

[0160] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as read-only memory (ROM) / RAM, magnetic disk, optical disk), including a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0161] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A project compatibility method based on a cross-platform installation tool, characterized in that: The project compatibility method based on the cross-platform installation tool includes: Obtain a target project and a target platform, and generate a configuration file for a cross-platform installation tool based on project information in the target project and the target platform; Generating a configuration program corresponding to the cross-platform installation tool according to a configuration file of the cross-platform installation tool; After detecting that the configuration program is generated, installing dependencies in the target platform to enable calling the target project through the cross-platform installation tool in the target platform; After detecting that the configuration program is generated, and installing the dependencies in the target platform to enable calling the target project through the cross-platform installation tool in the target platform, the method further includes: Saving the configuration file of the cross-platform installation tool and the project information of the target project as a historical compatibility record; After detecting a project compatibility request based on a cross-platform installation tool, traversing the historical compatibility records to determine whether there is a historical compatibility record that matches the project compatibility request based on the cross-platform installation tool; If so, a configuration file corresponding to the project compatibility request based on the cross-platform installation tool is generated according to the historical compatibility record.

2. The project compatibility method based on a cross-platform installation tool according to claim 1, characterized in that: The acquiring of the target project and the target platform, and generating a configuration file of the cross-platform installation tool according to the project information in the target project and the target platform includes: Acquire a target project, where the target project includes an Objective-C-based project, and the target project is managed by the cross-platform installation tool; A target platform is obtained, and a configuration file of a cross-platform installation tool is generated according to the project information in the target project and the target platform.

3. The project compatibility method based on a cross-platform installation tool according to claim 1, characterized in that: The configuration program corresponding to the cross-platform installation tool includes: an information calling program and an interface switching program; Generating a configuration program corresponding to the cross-platform installation tool according to the configuration file of the cross-platform installation tool includes: An information calling program is generated according to the configuration file of the cross-platform installation tool, and the information calling program is used to obtain header file information in a basic file corresponding to the cross-platform installation tool at a first target interface.

4. The project compatibility method based on a cross-platform installation tool according to claim 3, characterized in that: The information calling program is generated according to the configuration file of the cross-platform installation tool, and the information calling program is used to obtain the header file information in the basic file corresponding to the cross-platform installation tool through the first target interface, and further includes: An interface switching program is generated according to a configuration file of the cross-platform installation tool, and the interface switching program is used to switch the target project in an environment of the cross-platform installation tool.

5. The project compatibility method based on a cross-platform installation tool according to claim 4, characterized in that: Generating an interface adapter program according to a configuration file of the cross-platform installation tool, wherein the interface adapter program is used to transfer the target project in the environment of the cross-platform installation tool, includes: Generate an interface conversion program according to the configuration file of the cross-platform installation tool, wherein the interface conversion program is used to obtain the configuration information of the target project at the second target interface and generate a preset project file; The interface conversion program is further used to associate the preset project file with the target platform at the third target interface.

6. The project compatibility method based on a cross-platform installation tool according to claim 5, characterized in that: After detecting that the configuration program is generated, installing the dependency in the target platform to enable calling the target project through the cross-platform installation tool in the target platform includes: After detecting that the configuration program is generated, installing interface dependencies in the target platform, the interface dependencies including a first interface dependency and a second interface dependency; Obtain header file information in the basic file of the target project through the first interface dependency and the first target interface; Obtaining configuration information of the target project through the second interface depending on the third target interface; After obtaining the configuration information of the target project, the target project is called through the cross-platform installation tool.

7. A project compatibility device based on a cross-platform installation tool, characterized in that: The project compatibility device based on the cross-platform installation tool includes: A configuration generation module is used to obtain a target project and a target platform, and generate a configuration file for a cross-platform installation tool based on the project information in the target project and the target platform; A program generation module, configured to generate a configuration program corresponding to the cross-platform installation tool according to a configuration file of the cross-platform installation tool; A dependency installation module, configured to install dependencies in the target platform after detecting that the configuration program is generated, so as to enable calling the target project in the target platform through the cross-platform installation tool; The dependent installation module is further configured to save the configuration file of the cross-platform installation tool and the project information of the target project as a historical compatibility record; after detecting a project compatibility request based on the cross-platform installation tool, the historical compatibility record is traversed to determine whether there is a historical compatibility record that matches the project compatibility request based on the cross-platform installation tool; if so, a configuration file corresponding to the project compatibility request based on the cross-platform installation tool is generated according to the historical compatibility record.

8. A project compatible device based on a cross-platform installation tool, characterized in that: The project compatibility device based on the cross-platform installation tool includes: a memory, a processor, and a project compatibility program based on the cross-platform installation tool stored on the memory and executable on the processor, wherein the project compatibility program based on the cross-platform installation tool is configured to implement the steps of the project compatibility method based on the cross-platform installation tool as described in any one of claims 1 to 6.

9. A storage medium, characterized in that: The storage medium stores a project compatibility program based on a cross-platform installation tool. When the project compatibility program based on the cross-platform installation tool is executed by the processor, the steps of the project compatibility generation method based on the cross-platform installation tool according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Cross-platform system compiling and building method

    CN103853589A

  • Method for deploying software quickly in linux environment

    CN106406960A

  • Cross-platform compiling method, device and equipment and readable storage medium

    CN111552480A