Software project batch packaging method and device, equipment and storage medium

By uniformly migrating out of the code warehouse, analyzing and modifying software package references, and concurrently packaging software projects, the time consumption problem caused by package dependencies during batch packaging of software projects is solved, and an efficient development process is achieved.

CN119883351APending Publication Date: 2025-04-25SHENZHEN DIDATRAVEL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411811954.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

In the prior art, the batch packaging process of software projects is limited by the package dependency relationship, which leads to a long time consumption and is difficult to meet the needs of developers to improve development efficiency.

Method used

By migrating the code repository to the same directory according to the dependency tree structure diagram of the software project to be packaged, searching and parsing the project file, replacing the software package reference with the project code reference, and packaging multiple software projects in succession.

Benefits of technology

It realizes concurrent large-scale packaging without the limitation of package dependencies, saving time and cost of batch packaging, thereby improving development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119883351A_ABST
    Figure CN119883351A_ABST
Patent Text Reader

Abstract

The invention relates to a software project batch packaging method and device, computer equipment and a storage medium, and the method comprises the steps: uniformly migrating code warehouses where a plurality of to-be-packaged software projects are located to the same directory according to a dependency tree structure diagram of the plurality of to-be-packaged software projects; searching and analyzing a project file of each software project according to storage positions of a plurality of to-be-packaged software projects, and replacing reference of each software project to any software package with project reference to a corresponding project code; and concurrently packaging the plurality of software items. According to the packaging method provided by the invention, concurrent large-batch packaging can be carried out without being limited by a package dependency relationship, the time cost of batch packaging can be saved, and then the development efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software project processing, and in particular to a method, device, computer equipment and storage medium for batch packaging of software projects. Background Art

[0002] Code management of an organization's internal software development department is not only related to the setting of the organizational structure, but also directly affects the R&D efficiency and product quality assurance. In this process, package management of internal projects is a crucial function. In order to avoid the "DLL (Dynamic-Link Library) hell" problem and improve code synchronization efficiency, an effective method is to package and share common software projects, while ensuring that all internal package references are the latest versions. However, when the updates of the underlying software projects cannot achieve backward compatibility, a large number of software projects need to be processed at the same time. Therefore, the time required for packaging has a significant impact on accelerating code application and improving development efficiency.

[0003] In the packaging method provided by the related art, since the dependencies between the various software packages must be considered, the software packages with dependencies must first complete the packaging of the software projects they depend on and update the version numbers accordingly. Subsequently, the software projects that depend on these software packages need to update their references to the latest versions before they can package themselves and generate new versions. However, this packaging process is time-consuming and difficult to meet the needs of developers for improving development efficiency. Summary of the invention

[0004] The embodiments of the present application provide a method, apparatus, computer equipment and storage medium for batch packaging of software projects, aiming to solve the problem that batch packaging consumes a long time due to package dependency restrictions, so as to save the time cost of batch packaging and thus achieve the purpose of improving development efficiency.

[0005] In a first aspect, an embodiment of the present application provides a method for batch packaging of software projects, comprising: according to a dependency tree structure diagram of multiple software projects to be packaged, uniformly migrating the code repositories where the multiple software projects to be packaged are located to the same directory; according to the storage location of the multiple software projects to be packaged, searching and parsing the project file of each software project, and replacing each software project's reference to any software package with a project reference to the corresponding project code; and concurrently packaging the multiple software projects.

[0006] In a second aspect, an embodiment of the present application further provides a software project batch packaging device, which includes a unit for executing the above method.

[0007] In a third aspect, an embodiment of the present application further provides a computer device, which includes a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the above method when executing the computer program.

[0008] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program can implement the above method when executed by a processor.

[0009] The embodiments of the present application provide a method, device, computer equipment and storage medium for batch packaging of software projects. The method includes: according to the dependency tree structure diagram of the multiple software projects to be packaged, the code repositories where the multiple software projects to be packaged are located are uniformly migrated to the same directory; according to the storage location of the multiple software projects to be packaged, the project files of each software project are searched and parsed, and the reference of each software project to any software package is replaced with a project reference to the corresponding project code; and multiple software projects are packaged concurrently. The embodiments of the present application can achieve the technical effect of saving the time cost of batch packaging because the packaging method provided in the embodiments of the present application can perform concurrent large-scale packaging without being restricted by package dependencies. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0011] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0012] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0013] Figure 1 A flowchart of a method for batch packaging of software projects provided in an embodiment of the present application;

[0014] Figure 2 A schematic diagram of a directed acyclic graph provided in an embodiment of the present application;

[0015] Figure 3 A schematic diagram of a dependency tree structure diagram provided in an embodiment of the present application;

[0016] Figure 4A schematic block diagram of a software project batch packaging device provided in an embodiment of the present application;

[0017] Figure 5 A schematic diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0018] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0019] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0020] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0021] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0022] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0023] As used in this specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0024] In order to solve the technical problem that the packaging process in the packaging method of the related technology is time-consuming, the present application provides a method, device, computer equipment and storage medium for batch packaging of software projects, which can realize concurrent large-scale packaging without being restricted by package dependencies, save the time cost of batch packaging, and thus improve development efficiency.

[0025] Figure 1 A flowchart of a method for batch packaging of software projects provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the software project batch packaging method includes:

[0026] S101. According to a dependency tree structure diagram of multiple software projects to be packaged, the code repositories where the multiple software projects to be packaged are located are uniformly migrated out to the same directory.

[0027] Taking into account the batch packaging method provided in the relevant technology, under the premise of sufficient resources, the overall packaging time mainly depends on the maximum depth of the entire packaging dependency tree structure diagram, that is, the length of the longest dependency chain. Therefore, if the packaging time of a software project is T, and the depth of the dependency chain is 10, the minimum time required is 10T. Assuming that the average time of T is 3 minutes, then 10*3 minutes = 30 minutes, then under ideal circumstances, the minimum time required is 30 minutes. However, in reality, the time required usually exceeds this ideal value, because such packaging processes are time-consuming and difficult to meet the requirements of developers to improve development efficiency.

[0028] In this regard, the main focus of the application embodiment is the additional time cost caused by the limitation of the order of steps in the packaging process due to package dependencies. To this end, we propose an innovative method that can achieve concurrent large-scale packaging without being restricted by package dependencies, so that the overall packaging time cost is close to the packaging time cost of a single software project.

[0029] In a specific implementation, the embodiment of the present application first determines a simplified dependency tree structure diagram of multiple software projects to be packaged, analyzes the dependency tree structure diagram of multiple software projects to be packaged, and uniformly migrates the code repositories where all the multiple software projects to be packaged are located to the same directory. The dependency tree structure diagram includes project nodes corresponding to the multiple software projects, and the simplified dependency relationships between the project nodes.

[0030] S102: searching and parsing the project file of each software project according to the storage locations of the multiple software projects to be packaged, and replacing the reference of each software project to any software package with a project reference to the corresponding project code.

[0031] It can be understood that packaging is the process of combining the code, resources, etc. in a project into a publishable and deployable unit (such as a software package, library package, etc.). In a complex software system, a project often does not exist in isolation, but is composed of multiple interrelated parts. These parts can be divided into different packages, and there are dependencies between packages. When a package (we call it package A) depends on another package (package B), it means that package A needs to use certain functions, codes or resources in package B during the operation or build process. For example, in a web application, the package of the front-end interface may depend on the package of the back-end data processing, because the front-end needs to obtain the data provided by the back-end for display.

[0032] In this context, the embodiment of the present application searches and parses the project files of each software project according to the storage locations of the multiple software projects to be packaged, obtains the information of all the projects to be packaged, and moves all the code bases where these projects are located to the same directory. In this way, all the references to the internal software packages are references to the corresponding project codes. In this case, the dependency on the version of the internal software package is removed.

[0033] S103: Concurrently packaging the multiple software projects.

[0034] In a specific implementation, the root node project of the tree is compiled first, and then multiple software projects to be packaged are packaged concurrently.

[0035] For example, first, it is necessary to clarify the dependency structure of the project, that is, to form a "tree" structure, and determine the root node project at the top level. According to the programming language used by the project, select the appropriate compilation tool. When compiling the root node project, it is necessary to ensure that all its dependent external libraries and other modules can be correctly introduced. After the compilation is completed, it is necessary to verify whether the root node project is compiled successfully. At this point, the processing of the root node project of the compilation tree is completed. Secondly, the appropriate packaging tool should be selected according to the programming language of the project and its project management method. In order to achieve efficient operation, certain tools or functions can be used to support parallel processing, so as to realize concurrent packaging of all projects. In the process of concurrent packaging, it is necessary to ensure that the dependencies between projects are properly handled to avoid any conflicts. After the packaging is completed, the packaging results need to be verified to confirm their validity.

[0036] In a possible implementation, the dependency tree structure diagram of multiple software projects to be packaged is determined according to the following steps:

[0037] Step 101a: Generate a directed acyclic graph according to multiple software projects to be packaged and the dependency relationship between each software project and any software package.

[0038] Step 101b, recursively reduce the directed acyclic graph to obtain a simplified dependency tree structure graph.

[0039] Here, the data structure recursively composed of the dependency relationship between the software project to be packaged and the software packages it depends on can be a directed acyclic graph (DAG). The dependency relationship between the software packages must not form a ring structure, that is, there should be no circular dependency, otherwise it will be regarded as an error.

[0040] Among them, the directed acyclic graph is mainly composed of nodes and edges. Nodes are used to represent various objects or concepts and are the basic components of the graph. Edges are directional, connecting different nodes, indicating that there is a specific dependency or order relationship between nodes. For the embodiment of the present application, the nodes of the directed acyclic graph are project nodes, and the edges of the directed acyclic graph are used to characterize the dependency relationship between each project node. And there is no circular path in the entire graph, that is, starting from any project node and moving along the direction of the edge, you will not return to this starting node. In addition, each node also has in-degree and out-degree attributes. In-degree refers to the number of edges pointing to the node, representing how many other nodes' outputs depend on this node; out-degree refers to the number of edges starting from the node, meaning that the completion of this node depends on the output of how many other nodes.

[0041] For example, Figure 2 A schematic diagram of a directed acyclic graph provided in an embodiment of the present application; Figure 2As shown, the directed acyclic graph includes 5 project nodes, namely project nodes a, b, c, d, and e. There are mutual dependencies between the project nodes. For example, project node e depends on project nodes a, c, and d, and project node d depends on project nodes a, b, and c. The dependencies in the directed acyclic graph are relatively complex.

[0042] In a specific implementation, it is considered that the dependency relationship between each software project in a directed acyclic graph is relatively complex, and when each software project is packaged, for any software project, it is necessary to package the software project on which it depends before packaging it, and after completing the packaging of the dependent software project to obtain the software package, it can be packaged. To this end, the embodiment of the present application performs recursive reduction (transitive reduction) on the directed acyclic graph. Specifically, recursive reduction is an operation that processes a directed acyclic graph, and it simplifies the structure of the graph or extracts key information in the graph by constantly identifying and eliminating certain nodes (or substructures) in the graph. For the embodiment of the present application, by recursively reducing the directed acyclic graph, the complex graph structure can be gradually simplified, that is, the dependency relationship between the project nodes in the directed acyclic graph is simplified, so as to obtain a simplified dependency tree structure diagram.

[0043] For example, Figure 3 A schematic diagram of a dependency tree structure diagram provided in an embodiment of the present application; Figure 3 As shown, the dependency tree structure diagram is Figure 2 The dependency tree structure diagram is obtained by recursively reducing the directed acyclic graph in . The dependency tree structure diagram still includes 5 project nodes, namely project nodes a, b, c, d, and e. There are still dependencies between the project nodes, but the dependencies between the project nodes are simplified. For example, Figure 3 The project node e in the example only depends on the project node d, and the project node d depends on the project nodes b and c. Figure 3 The dependency tree structure diagram in Figure 2 Compared with the directed acyclic graph in , the dependency relationship between each project node is greatly simplified.

[0044] In a possible implementation, according to the dependency tree structure diagram of the multiple software projects to be packaged, the code repositories where the multiple software projects to be packaged are located are uniformly migrated to the same directory in S101, including: traversing the project nodes of each software project in the dependency tree structure diagram according to a preset traversal algorithm to obtain the project information of each software project to be packaged, and uniformly migrating the code repository where each software project is located to the same directory.

[0045] In a specific implementation, by traversing the project nodes of each software project in the entire dependency tree structure diagram, the project information of all software projects that need to be packaged can be obtained, and all the code libraries where these software projects are located can be migrated out to the same directory.

[0046] Specifically, it includes the following five steps:

[0047] Step 1: Choose a traversal algorithm

[0048] According to the characteristics of the dependency tree structure graph and actual needs, determine the appropriate preset traversal algorithm, for example, you can choose the depth-first traversal algorithm (Depth-First Search, DFS) or the breadth-first traversal algorithm (Breadth-First Search, BFS) and so on.

[0049] Step 2: Start traversing the dependency tree structure diagram

[0050] Using the selected traversal algorithm, starting from the root node of the dependency tree structure diagram (usually a node related to a certain software project at the beginning), the project nodes of each software project are visited in turn in the corresponding order.

[0051] Step 3: Get project information

[0052] When traversing to the project node of each software project, extract and record the project information corresponding to the software project, such as project name, version number, dependencies and other key contents, to ensure that the relevant details of each software project to be packaged are fully known.

[0053] Step 4: Determine the unified migration directory

[0054] Plan and set up the same directory for migrating the code base in advance. Make sure the directory has enough space and appropriate permissions so that subsequent migration operations can proceed smoothly.

[0055] Step 5: Perform the migration operation

[0056] For each software project, based on the storage location of the code library and other related information, use the corresponding code management tool (such as Git, etc., depending on the actual version control system used) to migrate the code library to the same pre-set directory. During the operation, pay attention to whether there are any abnormal situations such as errors in the migration process to ensure that the migration is complete and accurate.

[0057] Here, the preset traversal algorithm includes at least one of the following algorithms: a breadth-first traversal algorithm, a depth-first traversal algorithm, and a topological sorting traversal algorithm.

[0058] Among them, the topological sorting traversal algorithm can be a classic algorithm for topological sorting of directed acyclic graphs, such as Kahn's Algorithm. The basic idea is to achieve sorting by maintaining a node queue with an in-degree of 0. First, find all the nodes with an in-degree of 0 in the graph and put them in the queue. Then, each time a node is taken out of the queue, the node is output to the result sequence of topological sorting, and the in-degree of all successor nodes of this node is reduced by 1. If the in-degree of a successor node becomes 0, put it in the queue. Repeat this process until the queue is empty.

[0059] In a possible implementation, if the preset traversal algorithm is a depth-first traversal algorithm; traversing the project nodes of each software project in the dependency tree structure diagram according to the preset traversal algorithm includes: taking a software project to be packaged as a root node, and marking the root node as visited; for any adjacent node of the root node, if the adjacent node has not been visited, calling the depth-first traversal algorithm to visit the adjacent node; repeating the above steps until the project nodes of each software project in the dependency tree structure diagram are visited.

[0060] In the specific implementation, the following will take depth-first search as an example to elaborate on the corresponding steps:

[0061] First, a root node is selected and marked as visited. Next, each adjacent node of the starting node (i.e., the successor nodes connected to it by directed edges) is checked. If an adjacent node has not been visited, the depth-first search function is recursively called for this adjacent node. After that, the above steps are repeated until all nodes in the graph have been visited.

[0062] In one example, suppose there is a dependency tree structure diagram used to present task dependencies. In this diagram, task A has no predecessor dependency, that is, its in-degree is 0. The execution of task B depends on task A, and the execution of task C depends on task B, and so on, presenting a certain dependency chain. At this time, start with task A to conduct a depth-first search. First, visit task A and mark it as visited. Then you will find that the successor node of task A is task B. Then perform a depth-first search for task B. In this way, according to the principle of depth-first, traverse the entire dependency tree structure diagram in sequence.

[0063] In a possible implementation, the step of searching and parsing the project file of each software project according to the storage locations of the multiple software projects to be packaged in S102, and replacing the reference of each software project to any software package with a project reference to the corresponding project code, includes:

[0064] Step 1021: traverse each software project according to the storage location of the multiple software projects to be packaged;

[0065] Step 1022: for any of the software projects, analyzing whether any software package referenced by the software project is an internal project package;

[0066] Step 1023: If yes, then the software project is changed from referencing the software package to referencing the project code.

[0067] In the specific implementation, it is necessary to traverse each software project one by one. For each software project, the software packages it references must be parsed to identify which packages belong to internal projects. Once the software packages are determined to be internal projects, the reference method of these software packages must be modified to directly reference the corresponding project code. However, before this operation, a detailed list of all software packages must be obtained first. Only in this way can we accurately determine which software project corresponds to the software package project through comparative analysis. When the above operations are completed, all references to software packages are changed to references to the corresponding project code. In this case, the version-based dependencies between software packages are also released.

[0068] Here, compile the root node project. At this time, since all package references have been changed to project references, these referenced and recursively referenced projects will also be compiled. For example, if it is a C# project, use the msbuild.exe command.

[0069] In a possible implementation, the concurrently packaging the multiple software projects in S103 includes:

[0070] Step 1031: concurrently perform packaging operations on each software project;

[0071] Step 1032: by parsing the reference list, obtain the software projects that need to reference the software package, determine the current maximum version of the software package, and concurrently package the multiple software projects according to the maximum version.

[0072] In the specific implementation, a concurrent method is used to perform packaging operations for each project. By parsing the reference list, the projects to which the packages to be dependent belong are sorted out, and the maximum version of the current package is obtained. Then, on this basis, the version number is increased by one, and this is used as the new package version. Correspondingly, for the version number involved in the reference of the package, the new version determined in this way is also used. Only in this way can the packaged code be the latest. Finally, all the results of the packaging operation are uploaded to the source site. At this point, the packaging of multiple software projects to be packaged is completed.

[0073] It should be noted that this application has extremely significant scale advantages. The larger the number of projects to be packaged, the more significant the efficiency improvement that can be achieved. When the number of projects that need to be packaged at one time climbs to five hundred or even thousands, as the number of projects continues to increase, the marginal cost of time spent on packaging will decrease. This means that for each additional project packaged, the additional time investment is minimal. Compared with small-scale packaging scenarios, large-scale packaging can greatly reduce the overall time consumption.

[0074] Moreover, under ideal conditions with abundant resources, if the time required to package each package individually is set to T, then no matter how intricate the tree structure constructed by the dependencies between packages is, the actual packaging time cost of this application can be infinitely close to T. At its root, the conventional packaging process is often deeply restricted by the sequential execution steps derived from the package dependencies, which generates a lot of extra waiting time and increases the overall time cost; the innovative implementation example of this application cleverly resolves this problem, and with its unique design, it greatly reduces the delays caused by dependencies, allowing the packaging process to break free from the constraints of sequential steps, making the actual packaging time almost equal to the time cost of each individual step that is not restricted by the sequential steps in an idealized state. This not only reflects high efficiency, but also provides a groundbreaking solution for batch packaging of complex projects.

[0075] In an embodiment of the present application, according to the dependency tree structure diagram of multiple software projects to be packaged, the code repositories where the multiple software projects to be packaged are located are uniformly moved out to the same directory; according to the storage location of the multiple software projects to be packaged, the project files of each software project are searched and parsed, and the reference of each software project to any software package is replaced with a project reference to the corresponding project code; and multiple software projects are packaged concurrently. The packaging method provided by the present application can perform concurrent large-scale packaging without being restricted by package dependency relationships, which can save the time cost of batch packaging and thus improve development efficiency.

[0076] See also Figure 4 , Figure 4 A schematic block diagram of a software project batch packaging device 400 provided in an embodiment of the present application. Corresponding to the above software project batch packaging method, the present application also provides a software project batch packaging device 400. The software project batch packaging device 400 includes a unit for executing the above software project batch packaging method, and the software project batch packaging device 400 can be configured in a desktop computer, a tablet computer, a laptop computer, and other terminals. Specifically, the software project batch packaging device includes a migration unit 401, a search unit 402, and a packaging unit 403.

[0077] The migration unit 401 is used to migrate the code repositories where the multiple software projects to be packaged are located to the same directory according to the dependency tree structure diagram of the multiple software projects to be packaged.

[0078] The search unit 402 is used to search and parse the project file of each software project according to the storage locations of the multiple software projects to be packaged, and replace the reference of each software project to any software package with a project reference to the corresponding project code.

[0079] The packaging unit 403 is used to package the multiple software projects concurrently.

[0080] In one embodiment, the migration unit 401 is used to determine the dependency tree structure diagram of the multiple software projects to be packaged according to the following steps:

[0081] Generate a directed acyclic graph according to multiple software projects to be packaged and the dependency relationship between each software project and any software package;

[0082] The directed acyclic graph is recursively reduced to obtain a simplified dependency tree structure graph.

[0083] In one embodiment, the migration unit 401 is used to migrate the code repositories where the multiple software projects to be packaged are located to the same directory according to the following steps:

[0084] The project nodes of each software project in the dependency tree structure diagram are traversed according to a preset traversal algorithm to obtain the project information of each software project to be packaged, and the code base of each software project is uniformly migrated to the same directory.

[0085] In one embodiment, the preset traversal algorithm includes at least one of the following algorithms: a breadth-first traversal algorithm, a depth-first traversal algorithm, and a topological sorting traversal algorithm.

[0086] In one embodiment, the migration unit 401 is used to take a software project to be packaged as a root node and mark the root node as a visited state if the preset traversal algorithm is a depth-first traversal algorithm;

[0087] For any adjacent node of the root node, if the adjacent node has not been visited, call the depth-first traversal algorithm to visit the adjacent node;

[0088] Repeat the above steps until the access to the project nodes of each software project in the dependency tree structure diagram is completed.

[0089] In one embodiment, the search unit 402 is used to replace the project reference to the corresponding project code according to the following steps:

[0090] According to the storage location of the plurality of software projects to be packaged, traverse each software project;

[0091] For any of the software projects, analyzing whether any software package referenced by the software project is an internal project package;

[0092] If so, the software project is changed from referencing the software package to referencing the project code.

[0093] In one embodiment, the packaging unit 403 is used to concurrently package the multiple software projects according to the following steps:

[0094] Concurrently perform packaging operations on each software project;

[0095] By parsing the reference list, the software projects that need to reference the software package are obtained, and the current maximum version of the software package is determined, and the multiple software projects are packaged simultaneously according to the maximum version.

[0096] In an embodiment of the present application, according to the dependency tree structure diagram of multiple software projects to be packaged, the code repositories where the multiple software projects to be packaged are located are uniformly moved out to the same directory; according to the storage location of the multiple software projects to be packaged, the project files of each software project are searched and parsed, and the reference of each software project to any software package is replaced with a project reference to the corresponding project code; and multiple software projects are packaged concurrently. The packaging method provided by the present application can perform concurrent large-scale packaging without being restricted by package dependency relationships, which can save the time cost of batch packaging and thus improve development efficiency.

[0097] like Figure 5 As shown, the embodiment of the present application provides a computer device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.

[0098] Memory 113, used for storing computer programs;

[0099] In one embodiment of the present application, the processor 111 is used to execute the program stored in the memory 113 to implement the software project batch packaging method provided by any of the above method embodiments, including:

[0100] According to the dependency tree structure diagram of the multiple software projects to be packaged, the code repositories where the multiple software projects to be packaged are located are uniformly migrated out to the same directory;

[0101] According to the storage locations of the plurality of software projects to be packaged, searching and parsing the project file of each software project, and replacing the reference of each software project to any software package with a project reference to the corresponding project code;

[0102] The plurality of software projects are packaged concurrently.

[0103] It is understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.

[0104] Therefore, an embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for batch packaging of software projects provided in any of the aforementioned method embodiments are implemented.

[0105] The storage medium is a physical, non-transient storage medium, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which can store program codes. The computer-readable storage medium can be non-volatile or volatile.

[0106] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0107] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0108] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present application can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0109] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.

[0110] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0111] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

[0112] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for batch packaging of software projects, characterized in that: The method comprises: According to the dependency tree structure diagram of the multiple software projects to be packaged, the code repositories where the multiple software projects to be packaged are located are uniformly migrated out to the same directory; According to the storage locations of the plurality of software projects to be packaged, searching and parsing the project file of each software project, and replacing the reference of each software project to any software package with a project reference to the corresponding project code; The plurality of software projects are packaged concurrently.

2. The method according to claim 1, characterized in that Determine the dependency tree structure diagram of multiple software projects to be packaged according to the following steps: Generate a directed acyclic graph according to multiple software projects to be packaged and the dependency relationship between each software project and any software package; The directed acyclic graph is recursively reduced to obtain a simplified dependency tree structure graph.

3. The method according to claim 1, characterized in that: The step of uniformly migrating the code repositories where the multiple software projects to be packaged are located to the same directory according to the dependency tree structure diagram of the multiple software projects to be packaged includes: The project nodes of each software project in the dependency tree structure diagram are traversed according to a preset traversal algorithm to obtain the project information of each software project to be packaged, and the code base of each software project is uniformly migrated to the same directory.

4. The method according to claim 3, characterized in that The preset traversal algorithm includes at least one of the following algorithms: a breadth-first traversal algorithm, a depth-first traversal algorithm, and a topological sorting traversal algorithm.

5. The method according to claim 4, characterized in that If the preset traversal algorithm is a depth-first traversal algorithm; traversing the project nodes of each software project in the dependency tree structure diagram according to the preset traversal algorithm includes: Taking a software project to be packaged as a root node, and marking the root node as being in a visited state; For any adjacent node of the root node, if the adjacent node has not been visited, call the depth-first traversal algorithm to visit the adjacent node; Repeat the above steps until the access to the project nodes of each software project in the dependency tree structure diagram is completed.

6. The method according to claim 1, characterized in that The step of searching and parsing the project file of each software project according to the storage locations of the multiple software projects to be packaged, and replacing the reference of each software project to any software package with a project reference to the corresponding project code, comprises: According to the storage location of the plurality of software projects to be packaged, traverse each software project; For any of the software projects, analyzing whether any software package referenced by the software project is an internal project package; If so, the software project is changed from referencing the software package to referencing the project code.

7. The method according to claim 1, characterized in that The concurrent packaging of the multiple software projects includes: Concurrently perform packaging operations on each software project; By parsing the reference list, the software projects that need to reference the software package are obtained, and the current maximum version of the software package is determined, and the multiple software projects are packaged simultaneously according to the maximum version.

8. A software project batch packaging device, characterized in that: The method comprises a unit for executing the method according to any one of claims 1 to 7.

9. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 can be implemented.