Project construction method, system, terminal equipment and storage medium

By determining the version type and querying the directory path during the multi-module project construction process, the API module release is automatically determined, which solves the error-prone problem of API module management and improves the construction efficiency and accuracy.

CN111966390BActive Publication Date: 2024-10-22SHENZHEN KEMAI TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010651438.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-08
Publication Date
2024-10-22
Estimated Expiration
2040-07-08

AI Technical Summary

Technical Problem

During the construction process of multi-module projects, the API modules built from the project version need to be frequently released to the designated project warehouse, which leads to error-prone API module management.

Method used

By determining the version type of the project to be built and performing directory query in the specified project warehouse, it automatically determines whether the API module needs to be released, and only releases it when the version type is a snapshot version or the directory path is not queried, reducing repeated releases and preventing management errors. .

Benefits of technology

It effectively reduces the number of API module releases, prevents management errors, ensures the project release process, and improves research and development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111966390B_ABST
    Figure CN111966390B_ABST
Patent Text Reader

Abstract

The present application provides a project construction method, system, terminal device and storage medium, the method comprising: constructing a project version in a local project warehouse according to a configuration file of a project to be constructed, obtaining an API module and at least one project module, and determining the version type of the project to be constructed; if the version type of the project to be constructed is a snapshot version, the API module is published to a designated project warehouse; if the version type of the project to be constructed is not a snapshot version, a directory query is performed on the designated project warehouse according to the configuration file; if the directory path corresponding to the API module is not found in the designated project warehouse, the API module is published to the designated project warehouse; if the directory path corresponding to the API module is found in the designated project warehouse, a published prompt is sent for the project to be constructed. The present application can automatically determine whether it is necessary to publish the API module obtained by the project version construction to the designated project warehouse, thereby reducing the number of times the API module is published.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer technology, and in particular, relates to a project construction method, system, terminal device and storage medium. Background Art

[0002] Continuous Integration is a software development practice. During the continuous integration process, software engineers frequently integrate their work results. The project built after each integration will be tested by automatic build to discover integration errors as soon as possible. Continuous integration can effectively reduce the number of errors and bugs in the project release version.

[0003] In the existing continuous integration process, when building a multi-module project, the API (Application Programming Interface) module obtained by the project version construction needs to be published to the designated project warehouse, which makes the management of the API module in the designated project warehouse cumbersome and easily leads to management errors. Summary of the invention

[0004] The embodiments of the present application provide a project construction method, system, terminal device and storage medium, which aim to solve the problem of error-prone API module management caused by the need to publish the API module obtained from each project version construction to a designated project repository during the existing multi-module project construction process.

[0005] In a first aspect, an embodiment of the present application provides a project construction method, the method comprising:

[0006] Receive a configuration file of a project to be built, build a project version in a local project repository according to the configuration file, obtain an API module and at least one project module, and determine a version type of the project to be built, wherein the project module is used to implement a project function of the project to be built;

[0007] If the version type of the project to be built is a snapshot version, the API module is published to the designated project repository;

[0008] If the version type of the project to be built is not a snapshot version, a directory query is performed on the designated project warehouse according to the configuration file, wherein the directory query is used to query whether the designated project warehouse stores a directory path corresponding to the API module;

[0009] If the directory path corresponding to the API module is not found in the designated project warehouse, the API module is published to the designated project warehouse;

[0010] If the directory path corresponding to the API module is found in the designated project repository, a published prompt is sent for the project to be built.

[0011] Compared with the prior art, the beneficial effect of the embodiment of the present application is that: through the determination of the version type of the project to be built and the design of the directory query in the designated project warehouse, it can automatically determine whether it is necessary to publish the API module obtained by the project version construction to the designated project warehouse. That is, since the API module is only published when the version type of the project to be built is a snapshot version or the directory path corresponding to the configuration file is not queried in the designated project warehouse, and when the version type of the project to be built is not a snapshot version and the directory path corresponding to the API module is queried, it is only necessary to send a published prompt, thereby reducing the number of releases of the API module, and preventing the API module management from being prone to errors due to the need to publish the API module obtained by each project version construction to the designated project warehouse. In addition, since the API module is published to the designated project warehouse when it is detected that the version type of the project to be built is a snapshot version, or the directory path is not queried in the designated project warehouse, the release of the project to be built can also be effectively guaranteed.

[0012] Furthermore, the step of publishing the API module to a designated project repository includes:

[0013] Obtaining the warehouse address of the designated project warehouse in the configuration file, and establishing a communication connection with the designated project warehouse according to the warehouse address;

[0014] Obtaining a project identifier of the project to be built in the configuration file, and locating a directory in the specified project repository according to the project identifier to obtain a located directory;

[0015] The API module is stored according to the path of the positioning directory.

[0016] Furthermore, the project version is constructed in the local project repository according to the configuration file to obtain an API module and at least one project module, including:

[0017] Obtaining the API source code and the project source code in the configuration file, and performing source code compilation on the API source code and the project source code in the local project repository to obtain an API execution file and a project execution file;

[0018] The API execution file and the project execution file are packaged to obtain the API module and the project module.

[0019] Further, determining the version type of the project to be built includes:

[0020] Obtain the project version number of the project to be built in the configuration file;

[0021] If the project version number includes a version snapshot identifier, determining that the version type of the project to be built is a snapshot version;

[0022] If the project version number does not include a version snapshot identifier, it is determined that the version type of the project to be built is not a snapshot version.

[0023] Furthermore, after the API source code and the project source code are source-compiled in the local project repository to obtain the API execution file and the project execution file, the process further includes:

[0024] Performing unit testing on the API execution file and the project execution file;

[0025] If the API execution file or the project execution unit test fails, a build error prompt is given for the unqualified API execution file or the project execution file.

[0026] Further, the sending of a published reminder for the project to be constructed includes:

[0027] Obtaining the project version number of the project to be built and the module version number of the API module, and generating published prompt information according to the project version number and the module version number;

[0028] Obtaining the user address of the configuration file sender and obtaining the communication address of the designated project warehouse;

[0029] The published prompt information is sent to the user address and the communication address.

[0030] Further, performing a directory query on the designated project warehouse according to the configuration file includes:

[0031] Obtaining a project identifier of the project to be constructed in the configuration file, and generating a directory query instruction according to the project identifier;

[0032] The directory query instruction is sent to the designated project warehouse to instruct the designated project warehouse to perform the directory query according to the project identifier.

[0033] In a second aspect, an embodiment of the present application provides a project construction system, including:

[0034] A version building module, used to receive a configuration file of a project to be built, build a project version in a local project repository according to the configuration file, obtain an API module and at least one project module, and determine a version type of the project to be built, wherein the project module is used to implement a project function of the project to be built;

[0035] A project publishing module, used for publishing the API module to a designated project repository if the version type of the project to be built is a snapshot version;

[0036] A directory query module is used to perform a directory query on the designated project warehouse according to the configuration file if the version type of the project to be built is not a snapshot version. The directory query is used to query whether the directory path corresponding to the API module is stored in the designated project warehouse. If the directory path corresponding to the API module is not found in the designated project warehouse, the API module is published to the designated project warehouse. If the directory path corresponding to the API module is found in the designated project warehouse, a published prompt is sent for the project to be built.

[0037] In a third aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above method when executing the computer program.

[0038] In a fourth aspect, an embodiment of the present application provides a storage medium, wherein the storage medium stores a computer program, and the computer program implements the above method when executed by a processor.

[0039] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute the project construction method described in any one of the above-mentioned first aspects.

[0040] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art.

[0042] Figure 1 is a flowchart of the project construction method provided in the first embodiment of the present application;

[0043] Figure 2 is a flowchart of a project construction method provided in the second embodiment of the present application;

[0044] Figure 3 is a flowchart of a project construction method provided in the third embodiment of the present application;

[0045] Figure 4 is a schematic diagram of the structure of a project construction system provided in the fourth embodiment of the present application;

[0046] Figure 5 It is a structural diagram of the terminal device provided in the fifth embodiment of the present application. DETAILED DESCRIPTION

[0047] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0048] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

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

[0050] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0051] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0052] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0053] Embodiment 1

[0054] See also Figure 1 , is a flowchart of a project construction method provided in the first embodiment of the present application, comprising the steps of:

[0055] Step S10, receiving a configuration file of a project to be constructed, constructing a project version in a local project repository according to the configuration file, obtaining an API module and at least one project module, and determining a version type of the project to be constructed;

[0056] Among them, the configuration file can be received based on the designated port, and the designated port can set the port address according to the needs. The designated port is used to trigger the project construction for the received configuration file. The project module is used to implement the project function of the project to be built. For example, the project module can be used to query order information, video playback information or query video information in local data.

[0057] Specifically, the project to be built is a multi-module project, and the configuration file stores API source code and at least one project source code. The API source code and the project source code are used to build the API module and the project module respectively. In this step, the continuous integration of the local project repository is effectively guaranteed by designing the project version construction in the local project repository according to the configuration file.

[0058] In this step, the version type includes snapshot version and non-snapshot version (official version). The snapshot version is a test version during the software project development process, which is used to test the functions of the project to be built. The non-snapshot version is the official version determined after the software project is developed, and the official version is the version released to users for use.

[0059] Step S20: if the version type of the project to be built is a snapshot version, the API module is published to a designated project repository;

[0060] Among them, the designated project warehouse can be set according to needs, and in this step, the API module can be published to multiple different designated project warehouses. The designated project warehouse can be a private server or a remote warehouse, etc. The designated project warehouse is used to provide users with built projects.

[0061] In this step, if the version type of the project to be built is a snapshot version, it is determined that the construction of the project to be built is used to test the project functions. Therefore, by publishing the API module constructed in step S10 to the design of the designated project warehouse, the functional testing of the project to be built is effectively guaranteed, thereby improving the project development efficiency.

[0062] Step S30: if the version type of the project to be built is not a snapshot version, a directory query is performed on the designated project repository according to the configuration file;

[0063] In this embodiment, the configuration file stores the project identifier of the project to be built. The project identifier can be used to locate the directory location in the specified project warehouse to obtain the directory path. The directory path is used for data storage during the release of the API module to the specified project warehouse, that is, when the API module is released to the specified project warehouse, the API module is stored in the corresponding directory path.

[0064] In this step, if the version type of the project to be built is not a snapshot version, the project to be built is determined to be a formal version. When the API module is stored in the designated project warehouse, the directory path corresponding to the API module is stored in the designated project warehouse, and the API module is stored in the corresponding directory path;

[0065] Therefore, by designing a directory query for the specified project warehouse according to the configuration file, it is possible to query whether the directory path corresponding to the API module is stored in the specified project warehouse, that is, to query whether the specified project warehouse stores the same module as the API module constructed in step S10.

[0066] Step S40: if the directory path corresponding to the API module is not found in the designated project warehouse, the API module is published to the designated project warehouse;

[0067] Among them, if the directory path corresponding to the API module is not found in the specified project warehouse, it is determined that the API module is not stored in the specified project warehouse. By publishing the API module to the specified project warehouse, the functional testing of the project to be built is effectively guaranteed, and the project development efficiency is improved.

[0068] Step S50, if the directory path corresponding to the API module is found in the designated project repository, a published prompt is sent for the project to be built;

[0069] Among them, if the directory path corresponding to the API module is queried in the specified project warehouse, it is determined that the API module is stored in the specified project warehouse, and there is no need to publish the API module to the specified project warehouse, thereby preventing repeated publication of the API module and reducing the number of API module publications.

[0070] Optionally, in this embodiment, the sending of a published reminder for the project to be constructed includes:

[0071] Obtaining the project version number of the project to be built and the module version number of the API module, and generating published prompt information according to the project version number and the module version number;

[0072] Obtaining the user address of the configuration file sender, obtaining the communication address of the designated project repository, and sending the published prompt information to the user address and the communication address;

[0073] Among them, by sending the published prompt information containing the project version number and the module version number to the user address and the communication address, the corresponding user and the designated project warehouse are prompted respectively. If the API module of the project to be built is stored in the designated project warehouse, there is no need to publish the API module to the designated project warehouse, thereby preventing the repeated publication of the API module and reducing the number of publications of the API module.

[0074] In the present embodiment, by determining the version type of the project to be constructed and designing the directory query in the designated project warehouse, it can be automatically determined whether it is necessary to publish the API module obtained by the project version construction to the designated project warehouse. That is, since the API module is only published when the version type of the project to be constructed is a snapshot version or the directory path corresponding to the configuration file is not queried in the designated project warehouse, and when the version type of the project to be constructed is not a snapshot version and the directory path corresponding to the API module is queried, it is only necessary to send a published prompt, thereby reducing the number of releases of the API module, and preventing the API module management from being prone to errors due to the need to publish the API module obtained by each project version construction to the designated project warehouse. In addition, since the API module is published to the designated project warehouse when it is detected that the version type of the project to be constructed is a snapshot version, or when the directory path is not queried in the designated project warehouse, the release of the project to be constructed can also be effectively guaranteed.

[0075] Embodiment 2

[0076] See also Figure 2, is a flowchart of a project construction method provided in a second embodiment of the present application, and the second embodiment is used to refine step S20 or S40 in the first embodiment to refine the steps of how to publish the API module to the designated project warehouse, including the steps of:

[0077] Step S21, obtaining the warehouse address of the designated project warehouse in the configuration file, and establishing a communication connection with the designated project warehouse according to the warehouse address;

[0078] The warehouse address may be a MAC address (Media Access Control Address) or an IP address (Internet Protocol Address). The warehouse address may be set as required, and the warehouse address is used to point to a designated project warehouse pre-set by a user.

[0079] Specifically, in this step, a connection request is sent to the designated project warehouse through the obtained warehouse address to establish a communication session with the designated project warehouse, thereby effectively ensuring the release of subsequent API modules.

[0080] Step S22, obtaining the project identifier of the project to be constructed in the configuration file, and locating a directory in the designated project repository according to the project identifier to obtain a located directory;

[0081] The project identifier includes a combination of one or more of a groupId element, an artifactId element, and a version element. The groupId element is a unique identifier of the organization to which the project to be built belongs. The artifactId element is a unique identifier of the project to be built. The artifactId element corresponds to the name of the project to be built, which is the name of the root directory in the project to be built. The version element is the current version of the project to be built.

[0082] Specifically, in this embodiment, the project identifier is used to locate the directory position in the specified project warehouse. Different project identifiers have corresponding directory positions in the specified project warehouse. Therefore, different configuration files have corresponding location directories in the specified project warehouse that are all different. The design of the location directory is obtained by locating the directory in the specified project warehouse according to the project identifier, which effectively improves the accuracy of subsequent API module and project module releases.

[0083] Step S23, storing the API module according to the path of the positioning directory;

[0084] Among them, by designing the storage of the API module according to the path of the positioning directory, the release of the API module is guaranteed, thereby achieving the release effect of the project to be built.

[0085] In this embodiment, the design of locating the directory by locating the directory in the specified project warehouse according to the project identifier effectively improves the accuracy of API module release. The design of obtaining the warehouse address of the project warehouse specified in the configuration file and communicating with the specified project warehouse according to the warehouse address effectively guarantees the release of the API module.

[0086] Embodiment 3

[0087] See also Figure 3 , is a flowchart of a project construction method provided by a third embodiment of the present application, and the third embodiment is used to refine step S10 in the first embodiment to further describe how to build a project version in a local project repository according to the configuration file, obtain an API module and at least one project module, and determine the version type of the project to be built, including the steps of:

[0088] Step S11, obtaining the API source code and the project source code in the configuration file, and performing source code compilation on the API source code and the project source code in the local project repository to obtain an API execution file and a project execution file;

[0089] The deploy plug-in may be used to directly locate the API source code and the project source code in the configuration file, and the API source code and the project source code may be obtained based on the location result of the source code.

[0090] In this step, the API source code and the project source code can be compiled into binary code that can be directly recognized by the CPU through a compiler, and the binary code is code-linked to obtain the API execution file and the project execution file accordingly.

[0091] Step S12, packaging the API execution file and the project execution file to obtain the API module and the project module, and obtaining the project version number of the project to be built in the configuration file;

[0092] Among them, the packaging format of the API execution file and the project execution file can be set according to needs. For example, the API execution file and the project execution file can be packaged into a jar format package or an arr format package. The data after the API execution file is packaged is the API module, and the data after the project execution file is packaged is the project module.

[0093] Step S13, if the project version number includes a version snapshot identifier, determining that the version type of the project to be built is a snapshot version;

[0094] The version snapshot identifier may be "-SNAPSHOT". Specifically, whether the version type of the project to be built is a snapshot version is determined by judging whether the end of the project version number is "-SNAPSHOT".

[0095] In this step, if the end of the project version number is "-SNAPSHOT", it is determined that the version type of the project to be built is a snapshot version.

[0096] Step S14: if the project version number does not include a version snapshot identifier, it is determined that the version type of the project to be built is not a snapshot version;

[0097] If the end of the project version number is not "-SNAPSHOT", it is determined that the version type of the project to be built is not a snapshot version.

[0098] In addition, in this embodiment, after the API source code and the project source code are source-compiled in the local project repository to obtain the API execution file and the project execution file, the method further includes:

[0099] Performing unit testing on the API execution file and the project execution file;

[0100] If the API execution file or the project execution unit test fails, a build error prompt is given for the unqualified API execution file or the project execution file;

[0101] Among them, the unit test is used to detect the correctness of the code in the API execution file and the project execution file. By designing a build error prompt for unqualified API execution files or project execution files, the user is prompted to view or modify the unqualified API execution files or project execution files, thereby effectively improving the accuracy of the project version build.

[0102] Optionally, in this embodiment, performing a directory query on the designated project warehouse according to the configuration file includes:

[0103] Obtaining a project identifier of the project to be constructed in the configuration file, and generating a directory query instruction according to the project identifier;

[0104] Sending the catalog query instruction to the designated project warehouse to instruct the designated project warehouse to perform the catalog query according to the project identifier;

[0105] Among them, the project identifier includes a combination of one or more of the groupId element, the artifactId element and the version element. The directory query instruction is used to query whether the specified project repository stores the same API module as the project to be built, so as to effectively determine whether the API module needs to be released.

[0106] In this embodiment, through the design of source code compilation of API source code and project source code, the API source code and project source code can be effectively compiled into binary code that can be directly recognized by the CPU, and the binary code is code-connected to obtain the corresponding API execution file and project execution file. Through the design of packaging the API execution file and the project execution file, the release of the API execution file and the project execution file is effectively facilitated. By detecting whether the project version number of the project to be built contains a version snapshot identifier, it is determined whether the version type of the project to be built is a snapshot version, thereby improving the accuracy of API module release.

[0107] Embodiment 4

[0108] Corresponding to the project construction method described in the above embodiment, Figure 4 A schematic diagram of the structure of a project construction system 100 provided in a fourth embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0109] Reference Figure 4 The system includes: a version building module 10, a project publishing module 11 and a catalog query module 12, wherein:

[0110] The version construction module 10 is used to receive the configuration file of the project to be constructed, construct the project version in the local project repository according to the configuration file, obtain the API module and at least one project module, and determine the version type of the project to be constructed. The project module is used to implement the project function of the project to be constructed.

[0111] The version building module 10 is further used to: obtain the API source code and the project source code in the configuration file, and perform source code compilation on the API source code and the project source code in the local project repository to obtain an API execution file and a project execution file;

[0112] The API execution file and the project execution file are packaged to obtain the API module and the project module.

[0113] Optionally, the version building module 10 is further used to: obtain the project version number of the project to be built in the configuration file;

[0114] If the project version number includes a version snapshot identifier, determining that the version type of the project to be built is a snapshot version;

[0115] If the project version number does not include a version snapshot identifier, it is determined that the version type of the project to be built is not a snapshot version.

[0116] Furthermore, the version building module 10 is also used to: perform unit testing on the API execution file and the project execution file;

[0117] If the API execution file or the project execution unit test fails, a build error prompt is given for the unqualified API execution file or the project execution file.

[0118] The project publishing module 11 is used to publish the API module to a designated project repository if the version type of the project to be built is a snapshot version.

[0119] The project publishing module 11 is further used to: obtain the warehouse address of the designated project warehouse in the configuration file, and establish a communication connection with the designated project warehouse according to the warehouse address;

[0120] Obtaining a project identifier of the project to be built in the configuration file, and locating a directory in the specified project repository according to the project identifier to obtain a located directory;

[0121] The API module is stored according to the path of the positioning directory.

[0122] The directory query module 12 is used to perform a directory query on the designated project warehouse according to the configuration file if the version type of the project to be built is not a snapshot version. The directory query is used to query whether the directory path corresponding to the API module is stored in the designated project warehouse. If the directory path corresponding to the API module is not found in the designated project warehouse, the API module is published to the designated project warehouse. If the directory path corresponding to the API module is found in the designated project warehouse, a published prompt is sent for the project to be built.

[0123] The directory query module 12 is further used to: obtain the project version number of the project to be built and the module version number of the API module, and generate published prompt information according to the project version number and the module version number;

[0124] Obtaining the user address of the configuration file sender and obtaining the communication address of the designated project warehouse;

[0125] The published prompt information is sent to the user address and the communication address.

[0126] Optionally, the directory query module 12 is further used to: obtain the project identifier of the project to be constructed in the configuration file, and generate a directory query instruction according to the project identifier;

[0127] The directory query instruction is sent to the designated project warehouse to instruct the designated project warehouse to perform the directory query according to the project identifier.

[0128] In the present embodiment, by determining the version type of the project to be constructed and designing the directory query in the designated project warehouse, it can be automatically determined whether it is necessary to publish the API module obtained by the project version construction to the designated project warehouse. That is, since the API module is only published when the version type of the project to be constructed is a snapshot version or the directory path corresponding to the configuration file is not queried in the designated project warehouse, and when the version type of the project to be constructed is not a snapshot version and the directory path corresponding to the API module is queried, it is only necessary to send a published prompt, thereby reducing the number of releases of the API module, and preventing the API module management from being prone to errors due to the need to publish the API module obtained by each project version construction to the designated project warehouse. In addition, since the API module is published to the designated project warehouse when it is detected that the version type of the project to be constructed is a snapshot version, or when the directory path is not queried in the designated project warehouse, the release of the project to be constructed can also be effectively guaranteed.

[0129] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / modules are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0130] Figure 5 This is a schematic diagram of the structure of the terminal device 2 provided in the fifth embodiment of the present application. Figure 5 As shown, the terminal device 2 of this embodiment includes: at least one processor 20 ( Figure 5 Only one processor is shown in the figure), a memory 21, and a computer program 22 stored in the memory 21 and executable on the at least one processor 20, wherein the processor 20 implements the steps in any of the above-mentioned method embodiments when executing the computer program 22.

[0131] The terminal device 2 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device may include, but is not limited to, a processor 20 and a memory 21. Those skilled in the art will appreciate that Figure 5It is only an example of the terminal device 2 and does not constitute a limitation on the terminal device 2. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.

[0132] The processor 20 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0133] In some embodiments, the memory 21 may be an internal storage unit of the terminal device 2, such as a hard disk or memory of the terminal device 2. In other embodiments, the memory 21 may also be an external storage device of the terminal device 2, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 2. Further, the memory 21 may also include both an internal storage unit and an external storage device of the terminal device 2. The memory 21 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 21 may also be used to temporarily store data that has been output or is to be output.

[0134] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0135] An embodiment of the present application also provides a network device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor implements the steps in any of the above-mentioned method embodiments when executing the computer program.

[0136] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0137] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0138] 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 computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

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

[0140] 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, or a combination of computer software and electronic hardware. 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.

[0141] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0142] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0143] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A project construction method, characterized in that: The method comprises: Receive a configuration file of a project to be built, build a project version in a local project repository according to the configuration file, obtain an API module and at least one project module, and determine a version type of the project to be built, wherein the project module is used to implement a project function of the project to be built; If the version type of the project to be built is a snapshot version, the API module is published to the designated project repository; If the version type of the project to be built is not a snapshot version, a directory query is performed on the designated project warehouse according to the configuration file, wherein the directory query is used to query whether the designated project warehouse stores a directory path corresponding to the API module; If the directory path corresponding to the API module is not found in the designated project warehouse, the API module is published to the designated project warehouse; If the directory path corresponding to the API module is found in the designated project warehouse, the API module is not published to the designated project warehouse, and a published prompt is sent to the project to be built.

2. The project construction method according to claim 1, characterized in that: The step of publishing the API module to the designated project repository includes: Obtaining the warehouse address of the designated project warehouse in the configuration file, and establishing a communication connection with the designated project warehouse according to the warehouse address; Obtaining a project identifier of the project to be built in the configuration file, and locating a directory in the specified project repository according to the project identifier to obtain a located directory; The API module is stored according to the path of the positioning directory.

3. The project construction method according to claim 1, characterized in that: The step of building a project version in a local project repository according to the configuration file to obtain an API module and at least one project module includes: Obtaining the API source code and the project source code in the configuration file, and performing source code compilation on the API source code and the project source code in the local project repository to obtain an API execution file and a project execution file; The API execution file and the project execution file are packaged to obtain the API module and the project module.

4. The project construction method according to claim 1, characterized in that: Determining the version type of the project to be built includes: Obtain the project version number of the project to be built in the configuration file; If the project version number includes a version snapshot identifier, determining that the version type of the project to be built is a snapshot version; If the project version number does not include a version snapshot identifier, it is determined that the version type of the project to be built is not a snapshot version.

5. The project construction method according to claim 3, characterized in that: After the API source code and the project source code are compiled in the local project repository to obtain the API execution file and the project execution file, the method further includes: Performing unit testing on the API execution file and the project execution file; If the API execution file or the project execution unit test fails, a build error prompt is given for the unqualified API execution file or the project execution file.

6. The project construction method according to claim 1, characterized in that: The sending of a published prompt for the project to be constructed includes: Obtaining the project version number of the project to be built and the module version number of the API module, and generating published prompt information according to the project version number and the module version number; Obtaining the user address of the configuration file sender and obtaining the communication address of the designated project warehouse; The published prompt information is sent to the user address and the communication address.

7. The project construction method according to claim 1, characterized in that: The performing a directory query on the designated project warehouse according to the configuration file includes: Obtaining a project identifier of the project to be constructed in the configuration file, and generating a directory query instruction according to the project identifier; The directory query instruction is sent to the designated project warehouse to instruct the designated project warehouse to perform the directory query according to the project identifier.

8. A project construction system, characterized in that: include: A version building module, used to receive a configuration file of a project to be built, build a project version in a local project repository according to the configuration file, obtain an API module and at least one project module, and determine a version type of the project to be built, wherein the project module is used to implement a project function of the project to be built; A project publishing module, used for publishing the API module to a designated project repository if the version type of the project to be built is a snapshot version; A directory query module is used to perform a directory query on the designated project warehouse according to the configuration file if the version type of the project to be built is not a snapshot version. The directory query is used to query whether the directory path corresponding to the API module is stored in the designated project warehouse. If the directory path corresponding to the API module is not found in the designated project warehouse, the API module is published to the designated project warehouse. If the directory path corresponding to the API module is found in the designated project warehouse, the API module is not published to the designated project warehouse, and a published prompt is sent for the project to be built.

9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

10. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.