Parallel multi-component development method and device, computer equipment and storage medium
By splitting the main project in mobile application development into multiple independent functional modules and adopting a parallel multi-component development method, the inefficient development efficiency and project management complexity caused by traditional single architecture are solved, and efficient R&D processes and simplified team collaboration are achieved.
Patent Information
- Application Number
- CN202411745065.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-25
AI Technical Summary
In mobile application development, traditional monolithic architecture leads to low development efficiency, long compilation time, and high code maintenance costs. Multiple development teams are prone to conflicts and duplicate work when modifying the same code base at the same time, which increases the complexity of project management.
By splitting the main project into multiple independent functional modules (components) and adopting a parallel multi-component development method, avoiding frequent switching of components and main projects, and achieving simultaneous development of multiple components and main projects. The specific steps include decoupling the main project, determining the source code files and binary files of each component, determining the configuration files and target dependencies of the main project based on these files, determining the introduction type of the component, and linking the compiled product to the main project.
It greatly improves R&D efficiency, reduces code coupling, improves compilation speed, simplifies the team collaboration process, avoids mutual interference and conflicts between components, and reduces the complexity of project management.
Smart Images

Figure CN119690500A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of mobile development technology, and in particular to a parallel multi-component development method, apparatus, computer equipment, storage medium and computer program product. Background Art
[0002] In mobile application development, as the project scale expands and the functional complexity increases, the code volume and complexity of the project are also increasing significantly. Especially in large-scale team collaborative development, traditional monolithic architecture projects have problems such as low development efficiency, long compilation time, and high code maintenance costs due to their highly coupled code structure and complex dependencies between modules. In addition, under the traditional monolithic architecture, when multiple development teams modify the same code base at the same time, conflicts and unnecessary duplication of work are prone to occur, increasing the complexity of project management. In order to solve these problems, the componentized development model came into being. This development model splits the main project into multiple independent functional modules (i.e. components) and develops them.
[0003] In traditional technology, after developing a component, the component needs to be compiled, built and released, and then it is necessary to switch from the component to the main project and rely on the component compilation product for secondary development.
[0004] However, in the traditional method, after building and releasing a component, the developer needs to return to the main project (shell project) and add the compiled product of the component to the main project to complete the integration. That is, R&D personnel need to constantly switch between components and the main project, and complete the development and integration of each component by manually switching between different development environments. This method is not only time-consuming, but also easily leads to inefficient context switching, reducing R&D efficiency. Summary of the invention
[0005] Based on this, it is necessary to provide a parallel multi-component development method, device, computer equipment, computer-readable storage medium and computer program product that no longer requires frequent switching of components and main projects, thereby greatly improving R&D efficiency, in response to the above technical problems.
[0006] In a first aspect, the present application provides a parallel multi-component development method, comprising:
[0007] Decouple the main project to obtain multiple components; determine the source code files and binary files corresponding to each component;
[0008] Determine a first configuration file and a second configuration file of the main project according to the source code files and binary files corresponding to each component, and determine a target dependent file of the main project according to the first configuration file and the second configuration file;
[0009] Determine the import type of each component based on the target dependency file;
[0010] When the import type of a component is source code import, the compilation product of the component is determined according to the source code file of the component, and the compilation product is linked to the main project.
[0011] In one embodiment, when the import type of a component is source code import, determining a compilation product of the component according to the source code file of the component, and linking the compilation product to the main project includes:
[0012] When the component import type is source code import, add the source code file corresponding to the component to the workspace of the main project;
[0013] Compile the source code file of the component to generate a compilation product of the component;
[0014] Link the compiled product to the main project as a local dependency.
[0015] In one embodiment, determining the target dependent file of the main project according to the first configuration file and the second configuration file includes:
[0016] Determine an initial dependency file of the main project according to the first configuration file and the second configuration file, wherein the initial dependency file includes an initial dependency relationship of the main project;
[0017] Use script automation to dynamically adjust the initial dependencies and determine the target dependencies of the main project;
[0018] The initial dependency file is adjusted according to the target dependency relationship and the second configuration file to obtain the target dependency file of the main project.
[0019] In one embodiment, the method further comprises:
[0020] Determine the external dependencies of each component based on the target dependency file;
[0021] Use shared dependency applications to adjust the external dependencies of each component.
[0022] In one embodiment, determining the source code files and binary files corresponding to each component includes:
[0023] Develop source code for each component and determine the source code files corresponding to each component;
[0024] Generate a binary library corresponding to each component according to the source code file corresponding to each component, and determine the binary file corresponding to each component.
[0025] In one embodiment, the method further comprises:
[0026] When the component import type is binary import, the component is linked to the main project according to the binary file corresponding to the component.
[0027] In a second aspect, the present application also provides a parallel multi-component development device, comprising:
[0028] The decoupling module is used to decouple the main project to obtain multiple components; determine the source code files and binary files corresponding to each component;
[0029] A first determination module is used to determine a first configuration file and a second configuration file of the main project according to the source code files and binary files corresponding to each component, and determine a target dependent file of the main project according to the first configuration file and the second configuration file;
[0030] The second determination module is used to determine the import type of each component according to the target dependency file;
[0031] The link module is used to determine the compilation product of the component according to the source code file of the component when the import type of the component is source code import, and link the compilation product to the main project.
[0032] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0033] Decouple the main project to obtain multiple components; determine the source code files and binary files corresponding to each component;
[0034] Determine a first configuration file and a second configuration file of the main project according to the source code files and binary files corresponding to each component, and determine a target dependent file of the main project according to the first configuration file and the second configuration file;
[0035] Determine the import type of each component based on the target dependency file;
[0036] When the import type of a component is source code import, the compilation product of the component is determined according to the source code file of the component, and the compilation product is linked to the main project.
[0037] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the following steps are implemented:
[0038] Decouple the main project to obtain multiple components; determine the source code files and binary files corresponding to each component;
[0039] Determine a first configuration file and a second configuration file of the main project according to the source code files and binary files corresponding to each component, and determine a target dependent file of the main project according to the first configuration file and the second configuration file;
[0040] Determine the import type of each component based on the target dependency file;
[0041] When the import type of a component is source code import, the compilation product of the component is determined according to the source code file of the component, and the compilation product is linked to the main project.
[0042] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0043] Decouple the main project to obtain multiple components; determine the source code files and binary files corresponding to each component;
[0044] Determine a first configuration file and a second configuration file of the main project according to the source code files and binary files corresponding to each component, and determine a target dependent file of the main project according to the first configuration file and the second configuration file;
[0045] Determine the import type of each component based on the target dependency file;
[0046] When the import type of a component is source code import, the compilation product of the component is determined according to the source code file of the component, and the compilation product is linked to the main project.
[0047] The above-mentioned parallel multi-component development method, device, computer equipment, storage medium and computer program product decouple the main project to obtain multiple components; determine the source code files and binary files corresponding to each component; determine the first configuration file and the second configuration file of the main project according to the source code files and binary files corresponding to each component, and determine the target dependency file of the main project according to the first configuration file and the second configuration file; determine the introduction type of each component according to the target dependency file; when the introduction type of the component is source code introduction, determine the compilation product of the component according to the source code file of the component, and link the compilation product to the main project. The present application can realize the simultaneous development of multiple components and the main project, avoid frequent switching between multiple components and the main project, and greatly improve the research and development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0049] Figure 1 An application environment diagram of a parallel multi-component development method in one embodiment;
[0050] Figure 2 A flowchart of a parallel multi-component development method in one embodiment;
[0051] Figure 3 A schematic diagram of a flow chart of a step of determining a target dependent file of a main project in one embodiment;
[0052] Figure 4 A structural block diagram of a parallel multi-component development device in one embodiment;
[0053] Figure 5 A schematic diagram of functional modules of a parallel multi-component development device in one embodiment;
[0054] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0056] The parallel multi-component development method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The terminal 102 sends a parallel multi-component development request to the server 104, and the server 104 receives the parallel multi-component development request, decouples the main project, and obtains multiple components; determines the source code files and binary files corresponding to each component; determines the first configuration file and the second configuration file of the main project according to the source code files and binary files corresponding to each component, and determines the target dependency file of the main project according to the first configuration file and the second configuration file; determines the introduction type of each component according to the target dependency file; when the introduction type of the component is source code introduction, determines the compilation product of the component according to the source code file of the component, and links the compilation product to the main project. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices, and the Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. The portable wearable device may be a smart watch, a smart bracelet, a head-mounted device, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0057] In the development of mobile applications, the architecture of mobile application projects is becoming more and more bloated, and the code volume and complexity of the project are also increasing significantly. Under the traditional monolithic architecture, when multiple development teams modify the same code base at the same time, conflicts and unnecessary duplication of work are likely to occur, increasing the complexity of project management. In order to solve the problems of bloated architecture of mobile application projects and team collaborative development, this application proposes a parallel multi-component development method, which is optimized by component splitting, and the mobile application project (main project) is decomposed into independent functional modules (components). Each functional module is independently maintained and developed, which can reduce code coupling; the responsibilities and functional scope of each functional module are clarified, which can improve the compilation speed; the use of incremental compilation and caching technology can speed up the compilation process; by defining clear interfaces of each component and the dependencies between components and between components and the main project, it can ensure that each collaborative team only needs to care about its own components and their external interfaces, thereby simplifying the team collaboration process; an independent packaging process is implemented for each component, so that each component can be built and tested in an independent environment to avoid mutual interference between components; by managing code changes in a componentized manner, the scope of changes can be limited to the component, which is convenient for subsequent tracking and evaluation of impact.
[0058] In an exemplary embodiment, Figure 2 As shown, a parallel multi-component development method is provided, which is applied to Figure 1The server in the example is used to illustrate, including the following steps 202 to 208. Among them:
[0059] Step 202, decouple the main project to obtain multiple components; determine the source code files and binary files corresponding to each component.
[0060] Among them, the main project (also called shell project) refers to a complete application or product project, which includes the main functions, logic, resources and other contents of the application. For example, the main project can be an application developed for the mobile operating system (International Operating System, iOS), such as social software, shopping applications, news clients, games and other applications running on iOS. Component refers to a functional module, which is usually a relatively independent sub-project responsible for completing a specific function or a group of functions. The component can be reused in multiple main projects without repeated development, that is, the component is an independent functional module in the main project, such as the "login" functional module, the "payment" functional module, the "user information" module, etc. The source code file is a compilable file, and the source code file may include the source code of the component, the source code dependent files, the source code location and other information. The binary file is a compiled file, which is a file that can be directly executed by the machine. The binary file may include binary libraries, binary dependent files, binary library location and other information.
[0061] Optionally, the iOS application (main project) can be split into components, that is, the iOS application can be decoupled to obtain multiple functional modules (components). Each module is responsible for only one specific function, and each module is relatively independent and can be independently developed, tested, and maintained, reducing the dependencies between different functional modules. And determine the source code files and binary files corresponding to each component.
[0062] The iOS application is decomposed into multiple independent functional modules (components) that can be developed and maintained separately in a componentized way. Each module has its own source code and binary library and can run independently. Developers only need to care about the components they are responsible for and do not need to understand the internal implementation of other components. That is, multiple team members can develop different components at the same time through parallel development. Different developers or teams can develop on different components at the same time without waiting for the completion of other components, thus avoiding the inefficiency of "serial development". At the same time, team members who develop multiple components can focus on their own modules, thus avoiding the situation where the development progress is slowed down by a single component, thereby improving R&D efficiency.
[0063] Step 204 , determining a first configuration file and a second configuration file of the main project according to the source code files and binary files corresponding to each component, and determining a target dependent file of the main project according to the first configuration file and the second configuration file.
[0064] The first and second configuration files of the main project refer to the configuration files defined for the main project, which are used for subsequent reading by the main project. The configuration file is a file used by the main project to record and manage information about all components and component dependencies. The configuration files also provide the required parameters and data for subsequent script automation and build processes. Through these configuration files, the main project can flexibly switch the types of components and dependencies introduced. The target dependency file of the main project may include the target dependency of the main project on the component, the third-party dependency library (external dependency library) corresponding to each component (dependent component) in the target dependency, the source code location and binary library location of the dependent component, and other information. Among them, the dependent component refers to the component that the main project depends on in the target dependency.
[0065] Optionally, the first configuration file of the main project is a binary library address and source code address configuration file. The binary library address configuration file is used to store the path of the compiled binary library of each component, and the source code address configuration file is used to store the path of the source code of each component. The main project can determine how to obtain the binary library or source code of each component from the remote warehouse or local library based on the first configuration file, so as to introduce the binary library or source code of each component into the main project. The second configuration file of the main project is the component dependency library configuration file, which records the third-party dependency library (external dependency library) required by the component. Specifically, it can include the name, version, and acquisition address of the third-party dependency library required by the component. The main project can understand the third-party dependency libraries required by each component through the component dependency library configuration file. At the same time, the main project can perform the installation and management operations of the corresponding third-party dependency libraries based on these configuration files, thereby ensuring that the third-party dependency libraries required by each component can be automatically downloaded and integrated.
[0066] Step 206: Determine the import type of each component according to the target dependency file.
[0067] The import type of each component refers to the type of each component introduced into the main project. The import type can include binary import and source code import.
[0068] Optionally, extract relevant configuration information from the target dependency file to determine whether a component is based on source code introduction or binary introduction in the current build environment, which can achieve flexible dependency management. Binary introduction refers to the direct introduction of the compiled binary library corresponding to the component into the main project. Binary introduction is usually suitable for components with stable functions and can greatly improve the compilation speed. Source code introduction directly introduces the source code corresponding to the component into the main project. Source code introduction is suitable for components that need to be frequently modified or debugged during the development stage, which can provide greater flexibility and debuggability. According to the target dependency file, the introduction type of each component is determined, so that developers can easily switch the introduction (dependency) method of the component to meet the needs of different development stages, thereby improving the flexibility and efficiency of the project.
[0069] Step 208: When the import type of the component is source code import, the compilation product of the component is determined according to the source code file of the component, and the compilation product is linked to the main project.
[0070] Optionally, when the component import type is source code import, the component can be added to the workspace of the main project as an independent project, and the source code of the component can be automatically compiled through a script to obtain the compilation product of the component.
[0071] In the above parallel multi-component development method, the main project is decoupled to obtain multiple components; the source code files and binary files corresponding to each component are determined, each component can run independently, and the developer only needs to care about the component he is responsible for, and does not need to understand the internal implementation of other components. Different developers or teams can develop on different components at the same time, without waiting for the development of other components to be completed, avoiding the inefficiency of "serial development". The first configuration file and the second configuration file of the main project are determined according to the source code files and binary files corresponding to each component, and the target dependency file of the main project is determined according to the first configuration file and the second configuration file; through the first configuration file and the second configuration file, the main project can flexibly switch the type and dependency of the introduced components. According to the target dependency file, the introduction type of each component is determined, so that the developer can easily switch the introduction (dependency) method of the component to meet the needs of different development stages, thereby improving the flexibility and efficiency of the project. When the introduction type of the component is source code introduction, the compilation product of the component is determined according to the source code file of the component, and the compilation product is linked to the main project. The use of this method can realize the simultaneous development of multiple components and the main project, avoid frequent switching between multiple components and the main project, and greatly improve the research and development efficiency.
[0072] In an exemplary embodiment, before developing source code for each component and determining the source code file corresponding to each component, an externally exposed header file is configured for each component, and in each component, the dependent libraries involved in each component are installed and managed.
[0073] Split the main project into components, that is, decouple the main project to obtain multiple functional modules (components), and generate corresponding header files for each component for external interface exposure. Develop the source code for each component, implement the functional logic of each component independently in code form, and ensure that the code structure is clear and modular for easy maintenance and integration. For example, assuming that a component is responsible for the user login function module, the source code of this component may include multiple source files for logical implementations such as user verification, interface requests, and error handling. After developing the source code for each component, use the build tool to compile and package the source code of each component to generate the corresponding binary library.
[0074] For example, taking the main project as an iOS application, the codes of different functional modules in the main project project are separated into independent components, and each component is managed with an independent repository. And use the framework template provided by Xcode to create an independent Xcode project for each component. Among them, Xcode is an integrated development environment for creating applications on the platform. Framework refers to a set of pre-written codes, tools and interfaces that provide developers with specific functions or services and can be easily integrated and used. Developers can use framework templates in Xcode to speed up the development process, avoid duplication of work, and improve code reusability.
[0075] Put the code split from the main project into the corresponding component, and configure an external header file for each component. The header file (.h file) contains the interface exposed by the component, clarifies the external function of the component, and allows other projects (other components or main engineering projects) to use the component through the interface, which can reduce code coupling and improve the collaboration efficiency between components.
[0076] In each component, CocoaPods is used to manage the private pod dependencies involved in each component, and the podinstall command is executed to complete the installation of the private pod dependencies and develop components. Among them, CocoaPods is a dependency library management tool. Private pod refers to a library maintained by the developer himself and stored in a private repository. Pod install is a command provided by CocoaPods, which is used to install and configure dependencies. Optionally, when a component has private pod dependencies or third-party dependency libraries (external dependency libraries), these dependencies can be specified through the podspec file, and pod install can be executed to install and manage these dependencies to ensure the integrity of the component development environment. The podspec file is a configuration file used by CocoaPods to describe a library or framework. In the podspec file, other libraries, files, and resources that the component depends on can be listed.
[0077] In the previous exemplary embodiment, the source code files and binary files corresponding to each component are determined, including: performing source code development on each component and determining the source code files corresponding to each component; generating binary libraries corresponding to each component based on the source code files corresponding to each component, and determining the binary files corresponding to each component.
[0078] After source code development is performed on each component and the source code is determined, a source code file (source code podspec file) is written for each component. The source code podspec file includes the source code of the component. The source code dependency directory and dependency files of each component are specified through the source code podspec file. Specifically, the source code podspec file involves how to set the source code path of each component and the dependencies of each component. The source code podspec file allows CocoaPods to correctly identify and introduce each component and all necessary dependencies of each component.
[0079] Compile the source code of each component into a binary library so that each component can be directly used by other projects, avoiding the need to recompile the source code every time it is used. Exemplarily, write a Shell script (such as build.sh), which is responsible for calling the Xcode tool to compile the source code of each component, and then generate the corresponding binary library, so that it can be directly used by other projects, avoiding the need to recompile the source code every time it is used. After compiling the source code of each component and generating the corresponding binary library, the binary library is stored in the specified directory / output, which can avoid confusion between the binary library and the source code, thereby affecting management and version control, and enter the / output directory, and create a corresponding binary file (binary podspec file) based on the binary library. The binary podspec file includes the binary library of the component, and the binary podspec file specifies the dependent library and external dependencies of the component. Through the binary podspec files corresponding to each component, CocoaPods can correctly identify and introduce each component and all necessary dependencies of each component.
[0080] Execute the Shell script (such as build.sh) again to upload the generated binary library to the remote code repository so that other developers can download and import the binary library by accessing the remote code repository. At the same time, upload the source code of each component to the corresponding component repository.
[0081] In this embodiment, by writing an automated build script (such as build.sh), the binary library can be automatically built, packaged, and released, reducing manual intervention. This automated process improves efficiency and reduces the risk of build errors. The developed components are packaged, the binary library is generated, and uploaded to the remote code repository for subsequent use and distribution. By creating and uploading source code files and binary files, the development and release efficiency can be improved, allowing team members to use these components more easily.
[0082] In an exemplary embodiment, Figure 3 As shown, determining the target dependent file of the main project according to the first configuration file and the second configuration file includes steps 302 to 306. Among them:
[0083] Step 302: Determine the initial dependency file of the main project according to the first configuration file and the second configuration file, where the initial dependency file includes the initial dependency relationship of the main project.
[0084] Step 304: dynamically adjust the initial dependency relationship using script automation to determine the target dependency relationship of the main project.
[0085] Step 306, adjusting the initial dependency file according to the target dependency relationship and the second configuration file to obtain the target dependency file of the main project.
[0086] For example, in order to conveniently obtain and manage each component in the main project, it is first necessary to create a first configuration file for each component. The first configuration file includes the binary library address and source code address configuration file of the component. The binary library address configuration file is used to store the path of the compiled binary library of each component, and the source code address configuration file is used to store the path of the source code of each component. In the main project, multiple components may have third-party dependent libraries, and the third-party dependent libraries also need to be configured in the file so that they can be correctly loaded and integrated in the main project. Therefore, the second configuration file of the main project is set to the component dependent library configuration file, which records the third-party dependent libraries (external dependent libraries) required by the components.
[0087] Optionally, read the Podfile file of the main project project, determine whether each component of the main project is introduced by source code or binary, and modify the Podfile file according to the introduction type of each component, the first configuration file and the second configuration file to obtain the initial dependency file of the main project, and record the initial dependency file of the main project as the first Podfile file. It can be seen that the initial dependency file of the main project includes the initial dependency relationship of the main project, and the initial dependency relationship of the main project includes the introduction type of each component introduced by the main project, including source code introduction and binary introduction. Developers can specify the required libraries in the Podfile, and CocoaPods will automatically download, compile and link these libraries. Podfile is a configuration file used to manage and integrate dependent libraries in iOS and macOS projects. Podfile can be used to declare the libraries and components that the project depends on, and specify the versions, sources and other related configurations of these libraries.
[0088] Modify the first Podfile file and use script automation to dynamically adjust the initial dependencies, that is, hook the pod intsall command of cocoapods, insert custom code (that is, automatically insert some custom code in the first Podfile file before executing the pod install command) to automatically perform some additional operations when installing dependent libraries (binary libraries or source code corresponding to components), such as adjusting dependent libraries (switching the import type of components introduced by the main project), pulling, modifying, downloading other files, etc., and then obtain the target dependency of the main project, which includes the target import type of components introduced by the main project. Among them, pod install is a command provided by CocoaPods, which is used to install and configure all components (libraries corresponding to components) according to the dependencies listed in the Podfile. When executing pod install, CocoaPods will read the libraries corresponding to all components specified in the Podfile (whether in source code form or binary libraries), download the source code or binary files of these libraries, and introduce them into the project.
[0089] According to the target introduction type of the component introduced by the main project, the component dependency library configuration file of the main project is read, and the third-party dependency library (external dependency library) required by the introduced component is written into the first Podfile file to obtain the target dependency file of the main project, and the target dependency file is recorded as the second Podfile file. Among them, the target dependency file of the main project may include the target dependency relationship of the main project to the component, the third-party dependency library (external dependency library) corresponding to each component (dependent component) in the target dependency relationship, the source code location and binary library location of the dependent component, and other information.
[0090] In this implementation, script automation is used to dynamically adjust the initial dependencies and determine the target dependencies of the main project. The dependency library can be dynamically adjusted according to different environments or requirements to enhance flexibility. At the same time, script automation can avoid errors during manual operations (such as version number errors, missing dependencies) and make dependency updates more convenient.
[0091] In an exemplary embodiment, the method further includes: determining the external dependencies of each component according to the target dependency file; and adjusting the external dependencies of each component using a shared dependency application.
[0092] Modify the target structure in the second podfile file to obtain the third Podfile file, and use the abstract_target abstract target to manage multiple targets. For example, in the main project, each component can correspond to a target, and the dependent libraries they need can be configured for each target. Through abstract_target, the dependent libraries of multiple components can be managed uniformly to reduce repeated configurations. That is, when multiple (targets) have the same dependent library, the dependent library can be defined once through abstract_target, and then the dependent library can be shared to each actual target, that is, a dependent library can be shared between multiple components, which can avoid the repeated listing of the component's dependent library in the Podfile, thereby reducing redundancy and repeated configuration.
[0093] In an exemplary embodiment, when the import type of a component is source code import, the compilation product of the component is determined based on the source code file of the component, and the compilation product is linked to the main project, including: when the import type of a component is source code import, the source code file corresponding to the component is added to the workspace of the main project; the source code file of the component is compiled to generate the compilation product of the component; and the compilation product is linked to the main project as a local dependency.
[0094] Read the source code configuration identifier of each component in the third Podfile file, use remote binary introduction or source code introduction for a single target, execute the shell script for the source code introduction component, clone the private repository, and read the dependencies. Exemplarily, the third Podfile file will define the introduction type of the introduced component (source code introduction or binary introduction). By reading the configuration identifier of the introduced component in the third Podfile file, determine whether the introduced component is introduced using source code or binary introduction. For each target (introduced component), determine the introduction type of the introduced component. When the introduction type of the introduced component is source code introduction, execute a custom shell script to pull (clone / clone) the source code of the component from the component repository, ensuring that when using source code introduction, the source code of the component repository can be automatically pulled to avoid manual operation, thereby simplifying the introduction process.
[0095] Write a Ruby script, use xcodeproj to modify the shell project workspace and project, add the source code component project to the workspace, and modify the shell project to locally depend on the build product of the source code component. Optionally, write a Ruby script, through which, using the xcodeproj library, automatically add the xcodeproj file of the component project introduced by the source code to the shell project workspace (workspace). At the same time, adjust the configuration of the main project so that it directly depends on the compilation product (build product) of the component introduced by the source code, to ensure the linkage of local development and debugging, and to automatically adjust the structure of the main project project, avoiding manual configuration of the main project's workspace and components, improving development efficiency and ensuring integration consistency. Among them, project (Xcode project) is the basic unit used to manage an application or component in Xcode. The xcodeproj file refers to the configuration file of the Xcode project, which includes all the configurations of the project, such as the project's structure, source code, resources, build settings, and dependencies.
[0096] In this embodiment, the Ruby script is used to automatically modify the Xcode project, so that the structure of the main project can be automatically adjusted, avoiding the manual configuration of the workspace and components of the main project, improving development efficiency and ensuring the consistency of integration. The source code file of the component is compiled to generate the compilation product of the component, and the compilation product of the component is linked to the main project, so that the construction environment can be isolated, the intrusion to the component is reduced, and the efficiency and stability of the construction are improved.
[0097] In an exemplary embodiment, the method further includes: when the import type of the component is binary import, linking the component to the main project according to the binary file corresponding to the component.
[0098] When the import type of the imported component is binary import, the main project can automatically link the binary library of the imported component, call the interface of the imported component, and then complete the import (integration) of the imported component.
[0099] In this embodiment, when the import type of the imported component is binary import, the binary library can be used directly, avoiding the time waste of compiling source code, thereby improving research and development efficiency.
[0100] In an exemplary embodiment, multiple team members adjust the component configuration identifiers in the Podfile file according to their respective local warehouse account permissions to ensure that they can access and use the components they have permission to. Optionally, each developer needs to configure the terminal's warehouse account to ensure that each developer has access rights to the relevant component warehouse. Next, the developer modifies the corresponding component configuration identifier in the Podfile, specifies which components are available, and ensures that the configuration matches their permissions. Subsequently, the developer executes pod install in the root directory of the main project. By executing a line of command, CocoaPods will automatically parse and install all the external dependency libraries of the components. In this way, the external dependency libraries of all components will be integrated into the main project, and the developer can open the workspace in Xcode and start parallel development. In this way, team members can flexibly configure dependencies according to permissions and efficiently carry out parallel development of multiple components in the same project.
[0101] In another embodiment, a parallel multi-component development method is provided, the method comprising:
[0102] Decouple the main project to obtain multiple components; develop source code for each component and determine the source code file corresponding to each component; generate the binary library corresponding to each component based on the source code file corresponding to each component, and determine the binary file corresponding to each component.
[0103] The first configuration file and the second configuration file of the main project are determined according to the source code files and the binary files corresponding to the components.
[0104] According to the first configuration file and the second configuration file, the initial dependency file of the main project is determined, and the initial dependency file includes the initial dependency relationship of the main project; the initial dependency relationship is dynamically adjusted by script automation to determine the target dependency relationship of the main project; the initial dependency file is adjusted according to the target dependency relationship and the second configuration file to obtain the target dependency file of the main project.
[0105] Determine the external dependencies of each component based on the target dependency file; use shared dependency applications to adjust the external dependencies of each component.
[0106] Determine the import type of each component based on the target dependency file.
[0107] When the component import type is source code import, add the source code file corresponding to the component to the workspace of the main project; compile the source code file of the component to generate the compilation product of the component; link the compilation product to the main project as a local dependency.
[0108] When the component import type is binary import, the component is linked to the main project according to the binary file corresponding to the component.
[0109] In this embodiment, by writing an automated build script (such as build.sh), the automatic construction, packaging and release of the binary library can be realized, reducing manual intervention. This automated process improves efficiency and reduces the risk of build errors. The developed components are packaged, the binary library is generated and uploaded to the remote code repository for subsequent use and distribution. By creating and uploading source code files and binary files, the development and release efficiency can be improved, allowing team members to use these components more easily. The initial dependency relationship is dynamically adjusted by script automation to determine the target dependency relationship of the main project. The dependency library can be dynamically adjusted according to different environments or requirements to enhance flexibility. At the same time, the script automation can avoid errors during manual operation (such as version number errors, missing dependencies), and make the update of dependencies more convenient. By automatically modifying the Xcode project through the Ruby script, the structure of the main project project can be automatically adjusted, avoiding manual configuration of the workspace and components of the main project, improving development efficiency and ensuring the consistency of integration. The source code file of the component is compiled to generate the compiled product of the component, and the compiled product of the component is linked to the main project, which can achieve construction environment isolation, reduce the invasiveness of the component, and improve the efficiency and stability of the build. When the import type of the imported component is binary import, the binary library can be used directly, avoiding the time wasted on compiling the source code and thus improving R&D efficiency.
[0110] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0111] Based on the same inventive concept, the embodiment of the present application also provides a parallel multi-component development device for implementing the parallel multi-component development method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more parallel multi-component development device embodiments provided below can refer to the limitations of the parallel multi-component development method above, and will not be repeated here.
[0112] In an exemplary embodiment, Figure 4 and Figure 5 As shown, Figure 4 Develop device block diagram for parallel multi-component development, Figure 5 The figure is a functional module diagram of a parallel multi-component development device, which provides a parallel multi-component development device, including: a decoupling module 402, a first determination module 404, a second determination module 406 and a linking module 408, wherein:
[0113] The decoupling module 402 is used to decouple the main project to obtain multiple components; determine the source code files and binary files corresponding to each component;
[0114] A first determination module 404 is used to determine a first configuration file and a second configuration file of the main project according to the source code files and binary files corresponding to each component, and determine a target dependent file of the main project according to the first configuration file and the second configuration file;
[0115] The second determination module 406 is used to determine the import type of each component according to the target dependency file;
[0116] The linking module 408 is used to determine the compilation product of the component according to the source code file of the component when the import type of the component is source code import, and link the compilation product to the main project.
[0117] In an exemplary embodiment, the link module 408 is also used to add the source code file corresponding to the component to the workspace of the main project when the import type of the component is source code import; compile the source code file of the component to generate the compiled product of the component; and link the compiled product to the main project as a local dependency.
[0118] In an exemplary embodiment, the first determination module 404 is also used to determine the initial dependency file of the main project based on the first configuration file and the second configuration file, the initial dependency file including the initial dependency relationship of the main project; dynamically adjust the initial dependency relationship using script automation to determine the target dependency relationship of the main project; adjust the initial dependency file according to the target dependency relationship and the second configuration file to obtain the target dependency file of the main project.
[0119] In an exemplary embodiment, the parallel multi-component development apparatus further includes:
[0120] The shared module is used to determine the external dependencies of each component based on the target dependency file; the shared dependency application is used to adjust the external dependencies of each component.
[0121] In an exemplary embodiment, the decoupling module 402 is also used to develop source code for each component and determine the source code file corresponding to each component; generate a binary library corresponding to each component according to the source code file corresponding to each component, and determine the binary file corresponding to each component.
[0122] In an exemplary embodiment, the linking module 408 is further configured to link the component to the main project according to the binary file corresponding to the component when the import type of the component is binary import.
[0123] Each module in the above parallel multi-component development device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0124] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 6 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store source code files and binary files. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a parallel multi-component development method is implemented.
[0125] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0126] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0127] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0128] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0129] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0130] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0131] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0132] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A parallel multi-component development method, characterized in that: The method comprises: Decouple the main project to obtain multiple components; determine the source code files and binary files corresponding to each component; Determine a first configuration file and a second configuration file of the main project according to the source code files and binary files corresponding to each component, and determine a target dependent file of the main project according to the first configuration file and the second configuration file; Determining the import type of each component according to the target dependency file; When the import type of the component is source code import, the compilation product of the component is determined according to the source code file of the component, and the compilation product is linked to the main project.
2. The method according to claim 1, characterized in that When the import type of the component is source code import, determining the compilation product of the component according to the source code file of the component, and linking the compilation product to the main project, includes: When the import type of the component is source code import, the source code file corresponding to the component is added to the workspace of the main project; Compile the source code file of the component to generate a compilation product of the component; The compiled product is used as a local dependency and linked to the main project.
3. The method according to claim 1, characterized in that: The determining the target dependent file of the main project according to the first configuration file and the second configuration file includes: Determine an initial dependency file of a main project according to the first configuration file and the second configuration file, wherein the initial dependency file includes an initial dependency relationship of the main project; Dynamically adjust the initial dependency relationship by using script automation to determine the target dependency relationship of the main project; The initial dependency file is adjusted according to the target dependency relationship and the second configuration file to obtain the target dependency file of the main project.
4. The method according to claim 3, characterized in that The method further comprises: Determine the external dependencies of each of the components according to the target dependency file; The external dependencies of each of the components are adjusted using a shared dependency application.
5. The method according to claim 1, characterized in that The step of determining the source code files and binary files corresponding to each component includes: Develop source code for each of the components and determine the source code files corresponding to each of the components; A binary library corresponding to each component is generated according to the source code file corresponding to each component, and a binary file corresponding to each component is determined.
6. The method according to claim 1, characterized in that The method further comprises: When the import type of the component is binary import, the component is linked to the main project according to the binary file corresponding to the component.
7. A parallel multi-component development device, characterized in that: The device comprises: The decoupling module is used to decouple the main project to obtain multiple components; determine the source code files and binary files corresponding to each component; A first determination module, used to determine a first configuration file and a second configuration file of the main project according to the source code files and binary files respectively corresponding to the components, and determine a target dependent file of the main project according to the first configuration file and the second configuration file; A second determination module, used to determine the import type of each component according to the target dependency file; The linking module is used to determine the compilation product of the component according to the source code file of the component when the import type of the component is source code import, and link the compilation product to the main project.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Dynamic working area management method, device and equipment for Go language development
CN119902746A