A component processing method and related device

By using the self-developed qcc command-line tool to automate the configuration of dependencies and management processes, the cumbersome problem of component creation and management has been solved, efficient and accurate component creation and management have been achieved, and the development efficiency of iOS component-based projects has been improved.

CN119493562BActive Publication Date: 2025-09-05BEIJING SOHU NEW MOMENTUM INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510076575.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-17
Publication Date
2025-09-05
Estimated Expiration
2045-01-17

AI Technical Summary

Technical Problem

The component creation and management process in the existing technology is cumbersome and error-prone, resulting in low efficiency in iOS component-based engineering development.

Method used

We use the self-developed qcc command-line tool to automatically configure dependencies and create component projects through the "qcc create" command. We also integrate the component creation and management processes, including automated operations for private libraries and index libraries.

Benefits of technology

It improves the efficiency of component creation and management, reduces the probability of errors, simplifies the process, reduces the complexity of manual operations, and improves development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119493562B_ABST
    Figure CN119493562B_ABST
Patent Text Reader

Abstract

The present application provides a component processing method and related devices, which relate to the field of component creation and management. In the present application, it is possible to respond to a component processing instruction, create an initial component, configure the basic library dependency of the initial component, integrate the basic library dependency into the initial component to obtain a target component, push the code and configuration file of the target component to the newly created component private library, configure the component version number of the target component, push the component version number to the component private library, create a component index library on the local server, verify the environmental indicators of the component index library, and if the verification passes, adjust the configuration file to establish an association relationship between the component index library and the component private library, and push the adjusted configuration file to the component index library. That is, through the present invention, automatic creation and management of components can be achieved, which can improve efficiency compared to manual methods.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of component creation and management, and more specifically, to a component processing method and related devices. Background Art

[0002] With the development of iOS app development, large-scale projects are increasingly adopting a component-based architecture. By splitting functional modules into independent components, they achieve code isolation, reuse, and facilitate team collaboration. In component-based engineering practices, component creation and management are critical factors affecting development efficiency. This process is cumbersome and prone to bottlenecks. Therefore, how to automate component creation and management to improve processing efficiency is a technical problem that professionals in this field urgently need to solve. Summary of the Invention

[0003] In view of this, the present application provides a component processing method and related devices to solve the urgent need to realize automatic creation and management of components to improve processing efficiency.

[0004] To solve the above technical problems, this application adopts the following technical solutions:

[0005] A component processing method, comprising:

[0006] Respond to component processing instructions and create initial components;

[0007] Configuring the basic library dependency of the initial component, integrating the basic library dependency into the initial component, and obtaining a target component;

[0008] Push the target component's code and configuration file to the newly created component private library; the configuration file includes the target component's basic configuration information;

[0009] Configuring the component version number of the target component, and pushing the component version number to the component private library;

[0010] Create a component index library on the local server;

[0011] Verifying the environmental indicators of the component index library;

[0012] If the verification passes, the configuration file is adjusted to establish an association relationship between the component index library and the component private library;

[0013] Push the adjusted configuration file to the component index library.

[0014] Optionally, configure the basic library dependencies of the initial component, including:

[0015] Set dependent component information and add basic component library dependencies.

[0016] Optionally, pushing the target component's code and configuration files to a newly created component private library includes:

[0017] Using the warehouse name in the component processing instruction and the pre-configured private library address, create a component private library with the same name as the warehouse name on the remote server;

[0018] Push the code of the target component to the component private library;

[0019] Performing basic information configuration on the target component to obtain a configuration file including the basic configuration information;

[0020] Push the configuration file to the component private library.

[0021] Optionally, configuring the component version number of the target component includes:

[0022] The version number parameter in the component processing instruction is used to automatically perform a labeling operation to obtain the component version number.

[0023] Optionally, create a component index library on the local server, including:

[0024] Create a component index library on the local server using the pre-configured index library name and index library address.

[0025] Optionally, verifying the environmental indicators of the component index library includes:

[0026] Calling a remote verification index instruction to verify the environmental indicators of the component index library; the environmental indicators include at least one of the following:

[0027] File format, dependency declaration, and version information accuracy.

[0028] Optionally, pushing the adjusted configuration file to the component index library includes:

[0029] A first push instruction is called to push the adjusted configuration file to the component index library.

[0030] After pushing the adjusted configuration file to the component index library, it also includes:

[0031] A second push instruction is called to push the adjusted configuration file to the component private library.

[0032] A component processing device, comprising:

[0033] The component creation module is used to respond to component processing instructions and create initial components;

[0034] A configuration module, configured to configure the basic library dependencies of the initial component, integrate the basic library dependencies into the initial component, and obtain a target component;

[0035] A first push module is used to push the code and configuration file of the target component to the newly created component private library; the configuration file includes basic configuration information of the target component;

[0036] A second push module is used to configure the component version number of the target component and push the component version number to the component private library;

[0037] An index library creation module is used to create a component index library on a local server;

[0038] A verification module, used to verify the environmental indicators of the component index library;

[0039] An adjustment module, configured to adjust the configuration file if the verification passes, so as to establish an association relationship between the component index library and the component private library;

[0040] The third pushing module is used to push the adjusted configuration file to the component index library.

[0041] An electronic device comprising at least one processor and a memory connected to the processor, wherein:

[0042] The memory is used to store computer programs;

[0043] The processor is used to execute the computer program so that the electronic device can implement the above-mentioned component processing method.

[0044] A computer storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement the above-mentioned component processing method.

[0045] The present application provides a component processing method and related devices, in which a component processing instruction can be responded to, an initial component can be created, the basic library dependency of the initial component can be configured, the basic library dependency can be integrated into the initial component to obtain a target component, the code and configuration file of the target component can be pushed to the newly created component private library, the component version number of the target component can be configured, the component version number can be pushed to the component private library, a component index library can be created on a local server, the environmental indicators of the component index library can be verified, and if the verification passes, the configuration file can be adjusted to establish an association relationship between the component index library and the component private library, and the adjusted configuration file can be pushed to the component index library. That is, through the present invention, automatic creation and management of components can be achieved, which can improve efficiency compared to manual methods. In addition, the present invention can avoid the error-prone problems caused by manual methods and improve the accuracy of component creation and management. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.

[0047] Figure 1 A flowchart of a component processing method provided by an embodiment of the present invention;

[0048] Figure 2 A flowchart of a method for processing a private library provided by an embodiment of the present invention;

[0049] Figure 3 A schematic structural diagram of a component processing device provided by an embodiment of the present invention;

[0050] Figure 4 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0051] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0052] In order to enable those skilled in the art to better understand the present invention, the professional terms in the present invention are now explained.

[0053] iOS component engineering: A development architecture that splits iOS project code into multiple reusable components to facilitate parallel development, reduce coupling, and facilitate expansion and maintenance.

[0054] CocoaPods: An iOS dependency management tool that automatically downloads and configures libraries using a Podfile. This article uses CocoaPods to create component projects and manage dependencies, such as using "pod lib create" and configuring podspec dependencies. "pod lib create" is the component creation command.

[0055] podspec file: CocoaPods configuration file that describes the component, including name, version, author, code source, dependencies, description, adaptation version and other information, and the automatic configuration dependencies and related information of the present invention.

[0056] Private library: A code repository used within the development team to store components or private code. This paper uses the self-developed "qcc" tool to automatically create and push component engineering code to it, associate podspec files with private libraries, and facilitate internal management and reuse.

[0057] Index library: A repository for storing and managing component podspec files, similar to a directory. The present invention creates a remote index library and pushes verified podspec files, which facilitates the sharing and reuse of components in different projects, improving discoverability and ease of use.

[0058] Code version control tool git repository: a code repository based on the git version control system. The private library and index library in this invention use it to implement code storage, version management and collaborative development, remote private library creation, code push backup sharing, etc.

[0059] With the development of iOS app development, large-scale projects are increasingly adopting a component-based architecture. By splitting functional modules into independent components, they achieve code isolation, reuse, and facilitate team collaboration. In component-based engineering practices, component creation and management become critical factors affecting development efficiency. This cumbersome process can easily lead to efficiency bottlenecks.

[0060] Currently, you can manually use the CocoaPods built-in command, which generates a component project using the "pod libcreate" command. Subsequent podspec, git, and repository processing must be done manually by the developer, which presents the following issues:

[0061] 1. Component creation and configuration are complex and error-prone: When creating iOS component-based project components using the existing CocoaPods command, after generating the component project using CocoaPods' built-in "pod lib create" command, dependency configuration must be manually filled in the s.dependency field of the component dependency configuration item in the podspec file. This requires developers to have a clear understanding of the numerous components and their dependencies. Dependency errors and inaccurate version numbers can easily occur during operation. Furthermore, other general configuration items such as the podspec description and author also rely heavily on manual completion, increasing the chance of errors. Furthermore, due to the numerous manual configuration tasks described above, developers need to spend a significant amount of time and effort to complete each setup, making the component creation phase more time-consuming and inefficient.

[0062] 2. Component management is costly and prone to errors: After creating a component in the traditional way, git and CocoaPods management is manually performed. For example, git management requires managing and associating two repositories: the private library and the index library, as well as handling git-related commands and operations related to component version tags. This process is repetitive and cumbersome. CocoaPods management requires configuring multiple key fields in the podspec file, and publishing to the index library requires local verification, push, and other steps. Each link is closely linked, and a component with an error in one place will hinder the entire process. Manual operations are prone to errors, fragmented processes, and time-consuming. In addition, once an error occurs in the component management link, troubleshooting and correcting the error requires additional time and effort, hindering the development progress of the iOS componentization project.

[0063] The existing component creation and management methods affect the efficiency of the iOS component-based engineering development process due to the above-mentioned problems. Therefore, an efficient and convenient method is urgently needed to optimize them to ensure that iOS component-based engineering can be carried out more smoothly and efficiently, thereby improving overall development efficiency.

[0064] To this end, the present application provides a component processing method and related devices, which use the self-developed qcc command line tool to connect related tasks in series, reduce management costs and shorten time consumption to solve the above problems. Specifically:

[0065] 1. Solve the problem of cumbersome component creation and configuration.

[0066] The present invention supports automated configuration dependencies and improvements. After receiving the "qcc create" command, the qcc command-line tool first calls "pod lib create" to create a component project, then automatically configures the s.dependency field of the podspec file to add basic library dependencies, executes the component dependency integration command "pod install" to integrate dependencies, and automatically improves other contents of podspec, simplifying the creation and configuration process and improving efficiency.

[0067] 2. Solve the problem of high component management costs.

[0068] Automated multi-step management: After the component project is created, the qcc tool automatically creates a remote private library and pushes the code, sets the s.source field of the podspec to associate with the private library address, automatically tags and updates the s.version field, creates an index library, and completes operations such as adding, verifying, and pushing podspec files, reducing manual errors and reducing management costs and time.

[0069] 3. Solve the problem of affected development process efficiency.

[0070] Process integration and efficient advancement: The qcc tool integrates all aspects of component creation and management. Developers enter the "qcccreate" command and related parameters, and the tool completes the operations in sequence without switching back and forth and coordinating. This reduces time waste and error troubleshooting costs, and improves development efficiency.

[0071] This paper uses the self-developed "qcc" command line tool, especially the automated execution process with "qcc create" as the main command, to realize the creation and management of components. The specific effects are as follows:

[0072] 1. Intelligent component creation configuration mechanism: During component creation, the podspec file is intelligently configured according to preset values. It also covers base library dependencies and automatically executes the pod install command to complete dependency integration.

[0073] 2. The automated private library management process enables fully automated operations from private library creation to association and management, avoiding common parameter errors and process connection issues in manual operations;

[0074] 3. Index library automated operation link: A complete index library automated operation link has been built to ensure the smooth release and reuse of components in the index library, and improve the efficiency and accuracy of component management in the index library link.

[0075] Based on the above content, an embodiment of the present invention provides a component processing method, and the execution subject can be an electronic device such as a processor or a controller. Figure 1, a component processing method may include:

[0076] S11. Respond to component processing instructions and create initial components.

[0077] In this embodiment, the qcc command-line tool for component creation and management must be pre-configured. The "qcc" command-line tool of the present invention is designed to utilize the "qcc create" command as its core. By inputting "qcc create" and parameters, multiple operations can be completed. This streamlines the numerous steps and configuration tasks involved in creating component projects in iOS component-based projects, creating a streamlined and convenient component creation system that significantly shortens development cycles and improves project efficiency. Through automated operations and related parameter configuration, efficient process integration is achieved, reducing operational complexity and error probability, ultimately improving the efficiency of the entire component development process. Furthermore, since no human intervention is required, automated operations reduce errors caused by human oversight and lack of operational expertise, such as configuration dependencies and errors in library operations. Standardized version management ensures consistent component configurations and facilitates stable reuse. Furthermore, embodiments of the present invention provide a one-stop operation portal, eliminating the need to switch between multiple tools, files, and systems, reducing learning costs and facilitating team use. Furthermore, the existing framework allows for easy functional expansion to accommodate future changes in requirements. Standardized automated processes simplify maintenance, facilitate problem identification and resolution, and reduce costs and complexity.

[0078] In one implementation, the qcc command-line tool includes multiple commands, such as the "qcc create" command, the "qccrepo index repository name index repository url (uniform resource locator, Uniform Resource Locator)" command, the "qccgit private repository address" command, and the "qcc global username user name" command. Each command can be called later during the component creation and management process.

[0079] The "qcc create" command is a core command. In one implementation, the "qcc create" command can be:

[0080] "qcc create repository name tag (optional) components (optional, multiple basic components are separated by English commas) --lint (optional, whether to automatically verify the correctness of podspec)".

[0081] For example, if you want to create a component named "MyComponent" in the repository, set the initial version to "0.1.0", depend on the "AFNetworking" and "SVUploadManager" components, and require automatic verification, the "qcc create" command is:

[0082] "qcc create MyComponent 0.1.0 AFNetworking,SDWebImage --lint" command.

[0083] In actual scenarios, if a "qcc create" command is received, it is considered that a component processing instruction has been received. At this time, the component processing instruction can be responded to to create the initial component.

[0084] The process of creating the initial component can be:

[0085] After executing the "qcc create" command, first call the "pod lib create" command that comes with CocoaPods to create the component engineering basic framework and obtain the component. In this embodiment, in order to facilitate the distinction between components in different processing flows, the component created in this step is called the initial component.

[0086] S12. Configure the basic library dependency of the initial component, integrate the basic library dependency into the initial component, and obtain the target component.

[0087] In this embodiment, configuring the base library dependencies of the initial component is to ensure that the component has complete dependency support for functional implementation. The base library dependencies are subsequently integrated into the initial component to obtain the target component so that each dependent library can be correctly combined with the newly created initial component, ensuring that the functions of each dependent library can be successfully called when the component is subsequently run.

[0088] In an implementation of the invention, the basic library dependency for configuring the initial component may be:

[0089] Set dependent component information and add basic component library dependencies.

[0090] Specifically, the s.dependency field in the podspec file of the initial component is automatically configured. During configuration, not only are component dependencies specified via the "components" parameter, such as "AFNetworking" and "SVUploadManager," set, but also the base component library dependencies required by the project are added to ensure the component has complete dependency support for functional implementation. After configuration is complete, the "pod install" command is executed to automatically integrate the base library dependencies into the initial component, resulting in the target component.

[0091] S13: Push the target component's code and configuration file to the newly created component private library.

[0092] The configuration file includes basic configuration information of the target component.

[0093] Specifically, to ensure that the podspec file is complete and compliant, the target component must be configured to obtain a configuration file. This configuration file specifically refers to the podspec file. This configuration is performed on the podspec file in this embodiment of the present invention. Component-related configuration is automatically completed, eliminating the need for extensive manual intervention by developers, greatly simplifying the creation process and improving accuracy.

[0094] After obtaining the target component code and configuration file, the target component code and configuration file need to be pushed to the newly created component private library so that the component private library stores the target component code and configuration file for easy subsequent component calls.

[0095] S14. Configure the component version number of the target component, and push the component version number to the component private library.

[0096] In this embodiment, in order to manage component versions clearly and in a standardized manner and to avoid problems such as forgetting to tag during manual operations, the component version number of the target component is automatically configured in this embodiment.

[0097] In a specific configuration process, in one implementation, the version number parameter in the component processing instruction can be used to automatically perform a labeling operation to obtain the component version number.

[0098] The component processing instruction is the aforementioned "qcc create" command, and the version number parameter is the aforementioned tag parameter. As in the aforementioned embodiment, the value of the tag parameter at this time is 0.1.0.

[0099] Specifically, the tagging operation is automatically performed according to the "tag" parameter passed in the "qcc create" command. For example, the "git tag 0.1.0" tag is generated. This tag is the component version number in the embodiment of the present invention, and the "git pushtag" command is executed to push the tag to the remote component private library, so as to clearly and standardizedly manage the component version and avoid problems such as forgetting to tag during manual operation.

[0100] It should be noted that since the "tag" parameter in the "qcc create" command is optional, there may be a situation where the value of the "tag" parameter in the "qcccreate" command is empty. In this case, it is considered that the "tag" parameter is not passed in, and the value of the "tag" parameter is determined according to the default rule, which is generally 0.1.0 by default.

[0101] S15. Create a component index library on the local server.

[0102] In this embodiment, the component index library is created on the local server so that subsequent users can use the index library to call components in the above-mentioned component private library to implement component calling.

[0103] In one implementation, a component index library may be created on a local server using a pre-configured index library name and index library address.

[0104] The index repository name and index repository address must be pre-configured before the "qcc create" command is executed. The index repository name and index repository address can be called index repository information. When configuring index repository information, you can use the "qccrepo index repository name index repository url" command, such as "qcc repo PrivateRepos ", inform the qcc tool of the corresponding index library information to facilitate subsequent interaction with the index library. Operations such as pushing component podspec files rely on this configuration.

[0105] After pre-configuring the index repository name and address, run the "pod repo add index repository name index repository url" command, where "index repository name" and "index repository url" are the same as the repository name and address you entered when configuring the index repository. This command creates an index repository with the same name as the component on the local index repository server, thus associating the corresponding index repository locally. This facilitates subsequent operations such as index lookups and prepares for publishing the component to the index repository.

[0106] S16: Check whether the environmental indicators of the component index library are passed; if the verification is passed, execute step S17.

[0107] In this embodiment, the environmental indicators of the component index library are verified to ensure that the file complies with the specifications and requirements set by the CocoaPods index library, thereby avoiding a series of problems caused by errors or non-standardization of the podspec file, such as component reference failure, compatibility errors, etc.

[0108] In one implementation, a remote verification index instruction may be called to verify the environmental indicators of the component index library; the environmental indicators include at least one of the following:

[0109] File format, dependency declaration, and version information accuracy.

[0110] Specifically, the remote index verification instruction can be the "pod spec lint --private" command used for remote verification. Before submitting a component's podspec file to the index, the "pod spec lint --private" command is executed. This command performs a comprehensive and detailed check of the podspec file's various environment indicators in the index environment, including but not limited to the file format, dependency declarations, and version information accuracy.

[0111] If the verification is passed, the subsequent steps can be continued. If the verification is not passed, an abnormal prompt message can be output to enable maintenance personnel to perform manual operations.

[0112] S17: Adjust the configuration file to establish an association relationship between the component index library and the component private library.

[0113] Specifically, when adjusting the configuration file, you can associate the component private library with the component index library by configuring the podspec file. In this configuration, set the s.source field in the podspec file to the Git address of the created component private library. This establishes an association between the component index library and the component private library, ensuring that the component index library can successfully retrieve code resources with corresponding tags from the private library during subsequent use.

[0114] S18. Push the adjusted configuration file to the component index library.

[0115] In this embodiment, pushing the adjusted configuration file to the component index library refers to storing the configuration file in the component index library.

[0116] In one implementation, a first push instruction is called to push the adjusted configuration file to the component index library.

[0117] The first push command can be "pod repo push index repository name xx.podspec" . After the "pod spec lint --private" command passes verification, the "pod repo push index repository name xx.podspec" command is executed immediately. Here, "index repository name" is the one you entered when configuring the index repository. This command pushes the component's podspec file to the index repository's Git repository, making it easier for other projects in iOS component-based projects to discover and reference the component. This enables effective sharing and circulation of component resources across the entire project system, improving overall project development efficiency and collaboration.

[0118] Through the above steps, the qcc command-line tool has orderly integrated and automated all key links in the component creation and management process. Developers only need to enter the "qcc create" command as required and properly configure the relevant parameters to drive the entire process smoothly, reducing the complexity and error risks of manual operations, and improving the overall efficiency of component-related operations in iOS component-based projects.

[0119] In another implementation, after pushing the adjusted configuration file to the component index repository, a second push instruction may be invoked to push the adjusted configuration file to the component private repository to update the configuration file in the component private repository and achieve consistency between the configuration files in the component private repository and the component index repository. The second push instruction may be, for example, a git push command, depending on actual configuration.

[0120] In this embodiment, in order to address the problems in the prior art that dependency configurations need to be manually filled in when creating components, which is prone to errors, and that manual completion of other configuration items is tedious and time-consuming, the present invention aims to achieve automated configuration of dependencies and various conventional configurations during the component creation process by creating a convenient command line tool, thereby reducing manual operations, lowering the probability of errors, and allowing developers to quickly and accurately create component projects, thereby significantly improving the overall efficiency of the component creation process.

[0121] In addition, considering the existing technology in component management, the cumbersome and error-prone Git management operations and the complex and problem-prone processes when CocoaPods management involves private libraries and index libraries, the present invention is committed to creating an integrated management mechanism. Through the command line tool of the present invention, multiple scattered and error-prone links such as the automation of private library use in Git management, the configuration of private library addresses in CocoaPods management, and publishing to the index library are integrated to achieve automated operation, reduce manual intervention, avoid various errors caused by human error, make the component management process more concise and smooth, reduce error correction costs, and ensure that components can be efficiently managed and reused in the entire iOS componentization project.

[0122] In another implementation of the present invention, referring to Figure 2 , pushing the target component's code and configuration files to the newly created component private library, which may include:

[0123] S21. Using the warehouse name in the component processing instruction and the pre-configured private library address, create a component private library with the same name as the warehouse name on the remote server.

[0124] Specifically, when creating a component private library, you need to use the "warehouse name" parameter and the "private library address". The "warehouse name" parameter can be the "warehouse name" parameter passed into the "qcc create" command when creating the component.

[0125] The private library address needs to be pre-configured. Specifically, before using the "qcc create" command, you need to perform some basic configuration, such as configuring the index library information, private library information, user information, and system version information.

[0126] Configuring private library information means: executing the "qcc git private library address" command, for example, "qcc git / privateRepo". Among them, is the server address, and privateRepo is the private library group path; let the qcc tool specify the remote private library address. The subsequent creation of component repositories will be completed under the group of this address, and the component code will be pushed to this repository to ensure the correct execution of related processes.

[0127] Configuring user information also involves using the "qcc global username username" command, such as "qcc globalusername John," to set the developer's username for tool use. This is used for Git operations, component configuration, and remote repository authentication. Using the "qcc global email email address" command, such as "qcc global emailjohn@example.com," sets the developer's email address, which serves as a contact identifier in Git operations, component configuration, and other scenarios.

[0128] Configuring system version information means using the "qcc global plat system version" command, for example, the "qcc globalplat iOS16.0" command, to let the qcc tool know the iOS system version that the project is adapted for. This helps accurately configure the adaptation version range in the podspec file when creating components, ensuring the normal operation and reuse of components.

[0129] After the "Private Library Address" configuration is completed, based on the "Warehouse Name" parameter passed in when creating the component and the "Private Library Address" in the configuration phase, the qcc tool will open the " / privateRepo" creates a git repository with the same name as "repository name" and uses it as the component's private repository.

[0130] S22. Push the code of the target component to the component private library.

[0131] In this embodiment, the code of the target component generated previously is automatically pushed to the newly created component private library through the git push command.

[0132] In this embodiment, the creation of a component private library and code push can be automatically implemented. The entire process does not require developers to manually operate git creation and code push related commands, saving manpower.

[0133] S23. Perform basic information configuration on the target component to obtain a configuration file including the basic configuration information.

[0134] In this embodiment, the basic information fields of the podspec file are automatically configured. For example, component description information is filled in according to the default format, author information is filled in according to the pre-configured user name information, and the adapted iOS version range is accurately set with reference to the system version configuration. This ensures that the content of the podspec file is complete and meets the specification requirements. Component-related configuration does not require extensive manual intervention by developers, which greatly simplifies the creation process and improves accuracy.

[0135] S24. Push the configuration file to the component private library.

[0136] Specifically, after the basic information configuration is completed, the configuration file, that is, the above-mentioned podspec file, is pushed to the private library corresponding to the component through the gitpush command.

[0137] In this embodiment, the automated management process of component private libraries is utilized to achieve fully automated operations from creation to association and management of private libraries, thus avoiding common parameter errors and process connection problems in manual operations.

[0138] Based on the embodiment of the above-mentioned component processing method, another embodiment of the present invention provides a component processing device, referring to Figure 3 , which may include:

[0139] The component creation module 11 is used to respond to the component processing instruction and create the initial component;

[0140] A configuration module 12 is used to configure the basic library dependency of the initial component and integrate the basic library dependency into the initial component to obtain a target component;

[0141] The first push module 13 is used to push the code and configuration file of the target component to the newly created component private library; the configuration file includes the basic configuration information of the target component;

[0142] The second push module 14 is used to configure the component version number of the target component and push the component version number to the component private library;

[0143] An index library creation module 15 is used to create a component index library on a local server;

[0144] A verification module 16, configured to verify the environmental indicators of the component index library;

[0145] An adjustment module 17 is configured to adjust the configuration file if the verification is passed, so as to establish an association relationship between the component index library and the component private library;

[0146] The third pushing module 18 is configured to push the adjusted configuration file to the component index library.

[0147] In one implementation, when the configuration module 12 is used to configure the basic library dependency of the initial component, it is specifically used to:

[0148] Set dependent component information and add basic component library dependencies.

[0149] In one implementation, the first push module 13 includes:

[0150] Create a submodule for creating a component private library with the same name as the warehouse name on a remote server using the warehouse name in the component processing instruction and a pre-configured private library address;

[0151] A first push submodule, configured to push the code of the target component to the component private library;

[0152] A configuration submodule, configured to perform basic information configuration on the target component and obtain a configuration file including the basic configuration information;

[0153] The second push submodule is used to push the configuration file to the component private library.

[0154] In one implementation, when the second push module 14 is used to configure the component version number of the target component, it is specifically used to:

[0155] The version number parameter in the component processing instruction is used to automatically perform a labeling operation to obtain the component version number.

[0156] In one implementation, the index library creation module 15 is specifically configured to:

[0157] Create a component index library on the local server using the pre-configured index library name and index library address.

[0158] In one implementation, the verification module 16 is specifically configured to:

[0159] Calling a remote verification index instruction to verify the environmental indicators of the component index library; the environmental indicators include at least one of the following:

[0160] File format, dependency declaration, and version information accuracy.

[0161] In one implementation, the third push module 18 is specifically configured to:

[0162] A first push instruction is called to push the adjusted configuration file to the component index library.

[0163] The component processing device also includes:

[0164] The fourth push module is used to call the second push instruction to push the adjusted configuration file to the component private library.

[0165] In this embodiment, a component processing instruction can be responded to, an initial component can be created, the basic library dependency of the initial component can be configured, the basic library dependency can be integrated into the initial component to obtain a target component, the code and configuration file of the target component can be pushed to the newly created component private library, the component version number of the target component can be configured, the component version number can be pushed to the component private library, a component index library can be created on a local server, the environmental indicators of the component index library can be verified, and if the verification passes, the configuration file can be adjusted to establish an association relationship between the component index library and the component private library, and the adjusted configuration file can be pushed to the component index library. That is, through the present invention, automatic creation and management of components can be achieved, which can improve efficiency compared to manual methods.

[0166] It should be noted that, for the working process of each module and sub-module in this embodiment, please refer to the corresponding description in the above embodiment, which will not be repeated here.

[0167] An embodiment of the present application further provides an electronic device, including at least one processor and a memory connected to the processor, wherein:

[0168] The memory is used to store computer programs;

[0169] The processor is used to execute the computer program so that the electronic device can implement the above-mentioned component processing method.

[0170] refer to Figure 4 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application. The electronic device in the embodiments of the present application may include, but is not limited to, fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 4 The electronic device shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.

[0171] like Figure 4 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes based on programs stored in a read-only memory (ROM) 602 or programs loaded from a storage device 608 into a random access memory (RAM) 603. When the electronic device is powered on, the RAM 603 also stores various programs and data required for the operation of the electronic device. The processing device 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0172] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a memory card, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Figure 4 The electronic device is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.

[0173] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any component processing method provided in the embodiment of the present application.

[0174] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any component processing method provided in the embodiment of the present application.

[0175] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A component processing method, characterized in that: include: In response to the "qcc create" command, call the "pod lib create" command provided by the iOS dependency management tool CocoaPods to create the basic framework of the component project and obtain the initial component; Automatically configure the s.dependency field in the podspec file of the initial component. During the configuration process, set the dependent component information specified by the components parameter, add the basic component library dependency required by the project, and implement the configuration of the basic library dependency of the initial component. After the configuration is complete, execute the pod install command to automatically integrate the dependency, integrate the basic library dependency into the initial component, and obtain the target component. Push the target component's code and configuration file to the newly created component private library; the configuration file includes the target component's basic configuration information; Configuring the component version number of the target component, and pushing the component version number to the component private library; Create a component index library on the local server; Call the remote index verification instruction pod spec lint --private command to verify the environmental indicators of the file in the index library environment. The environmental indicators include at least one of the following: file format, dependency declaration, and version information accuracy; If the verification passes, the s.source field in the configuration file is set to the git address of the created component private library to establish an association relationship between the component index library and the component private library; Push the adjusted configuration file to the component index library.

2. The component processing method according to claim 1, characterized in that: Push the target component's code and configuration files to the newly created component private library, including: Using the warehouse name in the component processing instruction and the pre-configured private library address, create a component private library with the same name as the warehouse name on the remote server; Push the code of the target component to the component private library; Performing basic information configuration on the target component to obtain a configuration file including the basic configuration information; Push the configuration file to the component private library.

3. The component processing method according to claim 1, characterized in that: Configure the component version number of the target component, including: Use the version number parameter in the component processing instruction to automatically perform the labeling operation to obtain the component version number.

4. The component processing method according to claim 1, characterized in that: Create a component index library on the local server, including: Create a component index library on the local server using the pre-configured index library name and index library address.

5. The component processing method according to claim 1, characterized in that: Push the adjusted configuration file to the component index library, including: Invoking a first push instruction to push the adjusted configuration file to the component index library; After pushing the adjusted configuration file to the component index library, it also includes: A second push instruction is called to push the adjusted configuration file to the component private library.

6. A component processing device, characterized in that: include: The component creation module responds to the "qcc create" command and calls the "pod lib create" command provided by the iOS dependency management tool CocoaPods to create the basic framework of the component project and obtain the initial component. A configuration module is used to automatically configure the s.dependency field in the podspec file of the initial component. During the configuration process, the dependent component information specified by the components parameter is set, and the basic component library dependency required by the project is added to implement the configuration of the basic library dependency of the initial component. After the configuration is completed, the pod install command is executed to automatically integrate the dependency, integrate the basic library dependency into the initial component, and obtain the target component; A first push module is used to push the code and configuration file of the target component to the newly created component private library; the configuration file includes basic configuration information of the target component; A second push module is used to configure the component version number of the target component and push the component version number to the component private library; An index library creation module is used to create a component index library on a local server; A verification module is used to call the remote verification index instruction pod spec lint --private command to verify the environmental indicators of the file in the index library environment; the environmental indicators include at least one of the following: file format, dependency declaration, and version information accuracy; An adjustment module, configured to set the s.source field in the configuration file to the git address of the created component private library if the verification passes, so as to establish an association relationship between the component index library and the component private library; The third pushing module is used to push the adjusted configuration file to the component index library.

7. An electronic device, characterized in that: comprising at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is configured to execute the computer program so as to enable the electronic device to implement the component processing method according to any one of claims 1 to 5.

8. A computer storage medium, characterized in that The storage medium carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement the component processing method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • System component processing method and device, equipment and storage medium

    CN116489228A

  • Progressive component sharing management method and device

    CN118132167A