Dependency processing method, device and equipment in code development and storage medium

By automatically adjusting local dependencies to remote dependencies, the compilation failure problem caused by manually modifying dependencies during code development is solved, thus improving development efficiency.

CN114756236BActive Publication Date: 2025-12-30BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110026214.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-08
Publication Date
2025-12-30
Estimated Expiration
2041-06-25

AI Technical Summary

Technical Problem

In code development, manually modifying dependencies in Podfile.lock is prone to omissions or errors, causing submitted dependency files to fail to compile on other members of the project, thus affecting the progress of the development project.

Method used

This paper provides a dependency handling method that automatically injects the local path of the component in the local code repository into the external dependency list, generates a dependency artifact file, adjusts the local dependency to a remote dependency, and commits the dependency artifact file.

Benefits of technology

It effectively reduced the error rate when manually modifying dependencies and reduced the compilation failure issues of submitted dependency artifacts at other project members' sites.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114756236B_ABST
    Figure CN114756236B_ABST
Patent Text Reader

Abstract

The present disclosure provides a dependency processing method, device and equipment in code development and a storage medium. The method comprises the following steps: obtaining a local path of a component in a local code repository; when detecting an acquisition operation of an external dependency, injecting the local path of the component into an external dependency list; calling the component to generate a dependency product file of a dependent component according to the local path of the component in the external dependency list; and submitting the dependency product file after adjusting the local dependency relationship in the dependency product file into a remote dependency relationship. It can be seen that the present disclosure can automatically adjust the local dependency relationship in the dependency product file into a remote dependency relationship, effectively reducing the error rate when manually modifying the dependency relationship; and further, reducing the compilation failure problem of the submitted dependency product file at other members of the project.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data processing, and more particularly to a method, apparatus, device, and storage medium for handling dependencies in code development. Background Technology

[0002] As programming languages ​​evolve to a new stage, corresponding dependency management tools typically emerge, such as Maven for Java and npm for Node.js. With the increasing number of iOS developers, CocoaPods, a tool providing dependency management for iOS development, has also appeared in the industry.

[0003] CocoaPods can analyze the dependency table of an iOS development project and download the dependencies from the table to the local machine for use in code writing. After the code is written and a Podfile.lock artifact file is generated, CocoaPods needs to commit and upload it. However, before committing, the dependencies in the Podfile.lock generated based on local dependencies need to be modified to depend on the remote code repository to ensure that the committed Podfile.lock can be successfully compiled by other members of the project.

[0004] Currently, before submitting Podfile.lock, the dependencies in Podfile.lock are usually modified manually by the programmer. This is prone to omissions or errors, causing the submitted Podfile.lock to fail to compile on other members of the project, thus affecting the progress of the entire development project. Summary of the Invention

[0005] To solve the above-mentioned technical problems, or at least partially solve them, this disclosure provides a method, apparatus, device, and storage medium for handling dependencies in code development.

[0006] In a first aspect, this disclosure provides a method for handling dependencies in code development. The method includes: obtaining the local path of a component in a local code repository; when an external dependency acquisition operation is detected, injecting the local path of the component into the external dependency list; based on the local path of the component in the external dependency list, calling the component to generate a dependency artifact file that depends on the component; adjusting the local dependencies in the dependency artifact file to remote dependencies, and then committing the dependency artifact file; wherein the local dependencies include the dependency of the dependency artifact file on the component, and the remote dependencies include the dependency of the dependency artifact file on a remote component on a remote server corresponding to the component.

[0007] Optionally, before calling the component to generate a dependency artifact file that depends on the component based on the local path of the component in the external dependency list, the method further includes: when a dependency analysis operation is detected, determining whether there is a component in the local code repository corresponding to the component to be analyzed; if it is determined that there is a component in the local code repository corresponding to the component to be analyzed, then redirecting the component to be analyzed to the component in the local code repository corresponding to the component to be analyzed.

[0008] Optionally, before redirecting the component to be analyzed to a component corresponding to the component in the local code repository, the method further includes: when it is detected that the version of the component does not match that of the component to be analyzed, forcing the use of the component.

[0009] Optionally, the step of adjusting the local dependency of the artifact file to a remote dependency and then submitting the dependent artifact file includes: obtaining the original file corresponding to the dependent artifact file; the original file is pre-pulled from a remote server and used as the development base file for the dependent artifact file; based on the remote dependency in the original file, adjusting the local dependency of the dependent artifact file to the remote dependency and then submitting the dependent artifact file.

[0010] Optionally, obtaining the local path of a component in the local code repository includes: scanning a list of local repositories to determine the local path of the local code repository, the component in the local code repository, and the path of the component in the local code repository; determining the local path of the component in the local code repository based on the path of the component in the local code repository and the local path of the local code repository; the local path of the component is used to uniquely identify the component.

[0011] Secondly, this disclosure provides a dependency handling apparatus in code development, the apparatus comprising: a path acquisition module for acquiring the local path of a component in a local code repository; a path injection module for injecting the local path of the component into the external dependency list when an external dependency acquisition operation is detected; a file generation module for calling the component to generate a dependency artifact file that depends on the component based on the local path of the component in the external dependency list; and a dependency adjustment module for adjusting the local dependencies in the dependency artifact file to remote dependencies and then submitting the dependency artifact file; wherein the local dependencies include the dependency relationship of the dependency artifact file to the component, and the remote dependencies include the dependency relationship of the dependency artifact file to a remote component on a remote server corresponding to the component.

[0012] Optionally, the device further includes a dependency analysis module; the dependency analysis module is configured to, when a dependency analysis operation is detected, determine whether there is a component in the local code repository corresponding to the component to be analyzed; and if it is determined that there is a component in the local code repository corresponding to the component to be analyzed, redirect the component to be analyzed to the component in the local code repository corresponding to the component to be analyzed.

[0013] Optionally, the dependency analysis module is further configured to force the use of the component when it is detected that the version of the component does not match that of the component to be analyzed.

[0014] Thirdly, this disclosure provides a computer program product including a computer program / instructions that, when executed by a processor, implement the steps of the method described in the first aspect.

[0015] Fourthly, this disclosure provides an apparatus comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method of the first aspect described above.

[0016] The technical solution provided in this disclosure has the following advantages compared with the prior art:

[0017] This disclosure provides a method, apparatus, device, and storage medium for handling dependencies in code development. The method first obtains the local path of a component in the local code repository. When an external dependency acquisition operation is detected, the local path of the component is injected into the external dependency list. Then, based on the local path of the component in the external dependency list, the component is called to generate a dependency artifact file for the dependent component. Finally, the local dependencies in the dependency artifact file are adjusted to remote dependencies, and the dependency artifact file is committed. The local dependencies include the dependency relationship of the dependency artifact file to the component, and the remote dependencies include the dependency relationship of the dependency artifact file to the remote component corresponding to the component on a remote server.

[0018] As can be seen, this disclosure can automatically adjust the local dependencies in the dependency file artifacts to remote dependencies, effectively reducing the error rate when manually modifying dependencies; and thus, reducing the compilation failure problem caused by the submitted dependency artifact files in other members of the project. Attached Figure Description

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

[0020] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without creative effort.

[0021] Figure 1 A flowchart illustrating a dependency handling method in code development provided by an embodiment of this disclosure;

[0022] Figure 2 A flowchart illustrating another method for handling dependencies in code development provided in this disclosure embodiment;

[0023] Figure 3 A schematic diagram of a dependency handling device in code development provided in this embodiment of the disclosure;

[0024] Figure 4 This is a schematic diagram of the structure of a dependency processing device in code development provided in an embodiment of the present disclosure. Detailed Implementation

[0025] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.

[0026] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.

[0027] Considering that manually modifying dependencies in Podfile.lock by programmers is prone to omissions or errors, causing the submitted Podfile.lock to fail to compile on other project members' machines, thus affecting the progress of the entire development project. Therefore, this disclosure provides a method, apparatus, device, and storage medium for handling dependencies in code development. This technology can be applied to any device that supports code development, such as a computer. For ease of understanding, the dependency handling method for code development provided in this disclosure will first be described in detail.

[0028] This disclosure provides a method for handling dependencies in code development, referencing... Figure 1 The flowchart below illustrates a dependency handling method in code development provided by an embodiment of this disclosure. The method includes the following steps S102 to S108:

[0029] Step S102: Obtain the local path of the component in the local code repository.

[0030] Generally, a local code repository is a code repository pre-downloaded from a remote repository to the local machine. A local workspace may contain multiple local code repositories, and each local code repository can contain at least one component. A component is a data package that encapsulates functionality or methods, used by different projects to implement corresponding functions. For example, a component encapsulating email functionality can be called when developing an email app and a chat app to implement their respective email sending and receiving functions. Since projects are developed based on components, there is a dependency relationship between the project and the components used in its development process; these components can be called dependent components.

[0031] In this embodiment, the local path of a component can be determined based on the path of the project in the local code repository and the local path of the local code repository in the local workspace; and the local path of a component is used to uniquely identify the component. It should be noted that, unless otherwise specified, in this embodiment, "component" or "local component" refers to a component in the local code repository.

[0032] Step S104: When an external dependency acquisition operation is detected, the local path of the component is injected into the external dependency list.

[0033] In this embodiment, when developing a project using CocoaPods, it is necessary to obtain the components that the project depends on through CocoaPods. The storage path of these dependent components can be referred to as external dependencies. CocoaPods performs an external dependency retrieval operation to obtain the components that the project depends on from the external dependency list and installs the obtained components. The external dependency list is a list that records external dependencies. Considering that in practical applications, a large portion of external dependencies may correspond to remote paths such as remote servers, using these external dependencies to develop a project would result in a large number of undesirable modifications to the components, affecting other users' use of the components.

[0034] In this scenario, this embodiment can detect external dependency acquisition operations, and when such operations are detected, inject the local path of the component acquired in step S102 into the external dependency list. Thus, CocoaPods can acquire components from the local code repository and use those components to develop projects.

[0035] Step S106: Based on the local paths of the components in the external dependency list, call the component to generate the dependency artifact files of the dependent components.

[0036] Based on the paths of components in the external dependency list, the components required for the current project development are invoked. The invoked components can include those corresponding to local paths in the external dependency list, or those corresponding to remote paths in the external dependency list. In this embodiment, when invoking a component from the local code repository based on a local path in the external dependency list, a dependency artifact file (such as a Podfile.lock file) is generated for the dependent component. The dependency artifact file indicates that the recorded component is from the local code repository. Furthermore, when invoking a remote component based on a remote path in the external dependency list, a dependency artifact file for the dependent component may not be generated, or a different dependency artifact file may be generated.

[0037] Step S108: After adjusting the local dependencies in the dependency artifact file to remote dependencies, commit the dependency artifact file.

[0038] Local dependencies include the dependencies of artifact files on components, and these local dependencies record the local paths of the components. Remote dependencies include the dependencies of artifact files on remote components on remote servers. Since the local code repository containing the component is pre-downloaded from the remote repository, there is a corresponding remote code repository for the local code repository, and consequently, a corresponding remote component for the component. These remote dependencies record the paths of the remote components on the remote server.

[0039] By adjusting local dependencies in the dependency artifact file that cannot be accessed by other users to remote dependencies that can be accessed by any user, the external dependencies of the current project can be kept pointing to remote addresses. This effectively avoids situations where users cannot obtain components due to inaccurate component paths when submitting dependency artifact files.

[0040] The dependency handling method in code development provided in this disclosure first obtains the local path of the component in the local code repository. When an external dependency acquisition operation is detected, the local path of the component is injected into the external dependency list. Then, based on the local path of the component in the external dependency list, the component is called to generate a dependency artifact file for the dependent component. Finally, the local dependencies in the dependency artifact file are adjusted to remote dependencies, and the dependency artifact file is committed. It is evident that this disclosure can automatically adjust the local dependencies in the dependency artifact file to remote dependencies, effectively reducing the error rate when manually modifying dependencies; furthermore, it reduces compilation failures caused by the committed dependency artifact file in other members of the project.

[0041] Regarding step S102 above, this embodiment provides a method for obtaining the local path of a component, as shown below:

[0042] First, the local repository list is scanned to determine the local path of the local code repository, the components within the local code repository, and the paths of the components within the local code repository. In one specific embodiment, the local workspace may include multiple local code repositories, each corresponding to a unique local path. Each local code repository may include multiple components, each corresponding to a unique path within the local code repository.

[0043] Then, based on the component's path in the local code repository and the local path of the local code repository, the local path of the component in the local code repository is determined. Specifically, the component's local path includes the component's path in the local code repository and the path of the local code repository in the local workspace.

[0044] Prior to step S106 above, this embodiment may also provide a dependency analysis method, as shown below:

[0045] When a dependency analysis operation is detected, it is determined whether a component corresponding to the component to be analyzed exists in the local code repository. The dependency analysis operation refers to the operation of analyzing the components that the current project depends on. Based on the dependency analysis operation, the number of components that the current project depends on, as well as information such as the path, functionality, and version of each component, are analyzed.

[0046] In this embodiment, when a dependency analysis operation is detected targeting the component to be analyzed, it is determined whether a component corresponding to the component to be analyzed exists in the local code repository. If no component corresponding to the component to be analyzed exists in the local code repository, it indicates that the current component to be analyzed is a remote component, and the path, implemented functions, and version information of the component to be analyzed are analyzed according to the existing scheme. If it is determined that a component corresponding to the component to be analyzed exists in the local code repository, the component to be analyzed is redirected to the component corresponding to the component to be analyzed in the local code repository.

[0047] The component to be analyzed may have corresponding components both remotely and locally, and the versions of the remote and local components may differ. Version conflicts often arise when versions differ, or the current project may need to continuously try different versions, leading to reduced development efficiency and increased costs associated with modifying the remote component. Therefore, this embodiment forces the use of the local component when a version mismatch is detected between the component and the component to be analyzed. Then, through redirection, the component to be analyzed is redirected to the corresponding component in the local code repository, forcing the use of the local component. Of course, it is understandable that if there is no version conflict, the component to be analyzed can be directly redirected to the corresponding component in the local code repository.

[0048] After redirecting the component to be analyzed to the corresponding component in the local code repository, based on the local path of the component in the external dependency list, the component is called to generate the dependency artifact file of the dependent component. Then, referring to steps 1 and 2 below, the local dependency relationship of the dependency artifact file is adjusted to the remote dependency relationship, and the dependency artifact file is committed.

[0049] Step 1: Obtain the source files corresponding to the dependency artifact files. The source files are pre-fetched from the remote server and are used as the development base files for the dependency artifact files.

[0050] Step 2: Based on the remote dependencies in the original file, adjust the local dependencies of the dependency artifact files to remote dependencies, and then commit the dependency artifact files.

[0051] Specifically, the local dependencies of the dependency artifact file can be compared with the remote dependencies of the original file. If they differ, the local dependencies of the dependency artifact file are adjusted to match the remote dependencies. Then, the dependency artifact file with the modified dependencies is committed.

[0052] Based on the above embodiments, this embodiment provides a method such as Figure 2 The method for handling dependencies in code development shown includes the following steps:

[0053] Step S202: Obtain the local path of the component in the local code repository.

[0054] Step S204: When an external dependency acquisition operation is detected, the local path of the component is injected into the external dependency list.

[0055] Step S206: Based on the local paths of the components in the external dependency list, call the component to generate the dependency artifact files of the dependent components.

[0056] Step S208: When a dependency analysis operation is detected, determine whether there is a component in the local code repository that corresponds to the component to be analyzed; if it is determined that there is a component in the local code repository that corresponds to the component to be analyzed, then execute the following step S210; if it is determined that there is no component in the local code repository that corresponds to the component to be analyzed, it means that the component corresponding to the component to be analyzed is a remote component, and the remote component can be analyzed according to the existing technology.

[0057] Step S210: When it is detected that the version of the component does not match the version of the component to be analyzed, the component is forced to be used.

[0058] Step S212: Redirect the component to be analyzed to the corresponding component in the local code repository.

[0059] Step S214: Obtain the source file corresponding to the dependent artifact file.

[0060] Step S216: Based on the remote dependencies in the original file, adjust the local dependencies of the dependency artifact file to remote dependencies, and then commit the dependency artifact file.

[0061] In summary, the dependency handling method in code development provided by this disclosure injects the pre-acquired local path of the component into the external dependency list when an external dependency acquisition operation is detected; then, based on the local path of the component in the external dependency list, the component is called to generate the dependency artifact file of the dependent component; it can be seen that this disclosure can automatically adjust the local dependency relationship in the dependency file artifact to the remote dependency relationship, effectively reducing the error rate when manually modifying the dependency relationship; and thus, reducing the compilation failure problem caused by the submitted dependency artifact file at other members of the project.

[0062] Based on the dependency handling method in code development provided in the above embodiments, this embodiment provides a dependency handling apparatus in code development. (Refer to...) Figure 3 The device includes the following modules:

[0063] Path acquisition module 302 is used to obtain the local path of components in the local code repository;

[0064] The path injection module 304 is used to inject the local path of the component into the list of external dependencies when an external dependency retrieval operation is detected.

[0065] The file generation module 306 is used to call the component to generate the dependency artifact file of the dependent component based on the local path of the component in the external dependency list.

[0066] The dependency adjustment module 308 is used to adjust the local dependencies in the dependency artifact file to remote dependencies and then submit the dependency artifact file. The local dependencies include the dependencies of the dependency artifact file on the component, and the remote dependencies include the dependencies of the dependency artifact file on the remote component corresponding to the component on the remote server.

[0067] The dependency handling device for code development provided in this disclosure first obtains the local path of the component in the local code repository. When an external dependency acquisition operation is detected, the local path of the component is injected into the external dependency list. Then, based on the local path of the component in the external dependency list, the component is called to generate the dependency artifact file of the dependent component. It can be seen that this disclosure can automatically adjust the local dependency relationship in the dependency file artifact to the remote dependency relationship, effectively reducing the error rate when manually modifying the dependency relationship. Furthermore, it reduces the compilation failure problem caused by the submitted dependency artifact file in other members of the project.

[0068] In one embodiment, the above-described apparatus further includes a dependency analysis module (not shown in the figure); the dependency analysis module is used to determine whether a component corresponding to the component to be analyzed exists in the local code repository when a dependency analysis operation is detected; and if it is determined that a component corresponding to the component to be analyzed exists in the local code repository, redirect the component to be analyzed to the component corresponding to the component to be analyzed in the local code repository.

[0069] In one embodiment, the dependency analysis module is further configured to force the use of a component when a version mismatch is detected between the component and the component to be analyzed.

[0070] In one embodiment, the dependency adjustment module 308 is specifically used for:

[0071] Obtain the source file corresponding to the dependency artifact file; the source file is pre-fetched from the remote server and is used as the development base file for the dependency artifact file; based on the remote dependency relationship in the source file, adjust the local dependency relationship of the dependency artifact file to the remote dependency relationship, and then commit the dependency artifact file.

[0072] In one embodiment, the path acquisition module 302 is specifically used for:

[0073] Scan the local repository list to determine the local path of the local code repository, the components in the local code repository, and the path of the components in the local code repository; based on the path of the components in the local code repository and the local path of the local code repository, determine the local path of the components in the local code repository; the local path of the components is used to uniquely identify the components.

[0074] The device provided in this embodiment has the same implementation principle and technical effects as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in this embodiment can be referred to the corresponding content in the aforementioned method embodiment.

[0075] In addition to the methods and apparatus described above, this disclosure also provides a computer program product, including a computer program / instruction, characterized in that the computer program / instruction, when executed by a processor, implements the steps of the aforementioned dependency handling method in code development.

[0076] Furthermore, this disclosure also provides a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to implement the dependency handling method in code development described in this disclosure.

[0077] Additionally, this disclosure also provides a dependency handling device for code development, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the aforementioned dependency handling method for code development. See also Figure 4 As shown, dependency handling devices in code development may include:

[0078] The device includes a processor 401, a memory 402, an input device 403, and an output device 404. The number of processors 401 in the dependency handling device during code development can be one or more. Figure 4 Taking a processor as an example. In some embodiments of this disclosure, the processor 401, memory 402, input device 403, and output device 404 can be connected via a bus or other means, wherein, Figure 4 Taking the example of a connection between China and Israel via a bus.

[0079] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing of the dependency processing device in code development by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store the operating system, at least one application program required for a function, etc. In addition, the memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. The input device 403 can be used to receive input digital or character information, and generate signal inputs related to user settings and function control of the dependency processing device in code development.

[0080] Specifically in this embodiment, the processor 401 will load the executable files corresponding to the processes of one or more applications into the memory 402 according to the following instructions, and the processor 401 will run the applications stored in the memory 402, thereby realizing the various functions of the dependency processing device in the above code development.

[0081] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0082] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method of dependency processing in code development, characterized by, The method comprises: acquiring a local path of a component in a local code repository; when detecting an acquisition operation of an external dependency, injecting the local path of the component into an external dependency list; according to the local path of the component in the external dependency list, calling the component to generate a dependency product file dependent on the component; wherein the component recorded in the dependency product file is a component in the local code repository; after adjusting a local dependency relationship in the dependency product file into a remote dependency relationship, submitting the dependency product file; wherein the local dependency relationship comprises a dependency relationship of the dependency product file on the component, the remote dependency relationship comprises a dependency relationship of the dependency product file on a remote component corresponding to the component in a remote server, and the remote dependency relationship records a path of the remote component in the remote server.

2. The method of claim 1, wherein, Before the calling of the component to generate the dependency product file dependent on the component according to the local path of the component in the external dependency list, the method further comprises: when detecting a dependency analysis operation, determining whether there is a component corresponding to a to-be-analyzed component in the local code repository; if it is determined that there is the component corresponding to the to-be-analyzed component in the local code repository, redirecting the to-be-analyzed component to the component corresponding to the to-be-analyzed component in the local code repository.

3. The method of claim 2, wherein, Before the redirecting of the to-be-analyzed component to the component corresponding to the to-be-analyzed component in the local code repository, the method further comprises: when detecting that a version of the component does not match a version of the to-be-analyzed component, forcibly using the component.

4. The method of claim 1, wherein, After the adjusting of the local dependency relationship of the product file into the remote dependency relationship, the submitting of the dependency product file comprises: acquiring an original file corresponding to the dependency product file; the original file is pre-pulled from a remote server and is used as a development basis file of the dependency product file; after adjusting the local dependency relationship of the dependency product file into the remote dependency relationship based on a remote dependency relationship in the original file, submitting the dependency product file.

5. The method of claim 1, wherein, The acquiring of the local path of the component in the local code repository comprises: scanning a local repository list to determine a local path of a local code repository, a component in the local code repository, and a path of the component in the local code repository; determining the local path of the component in the local code repository based on the path of the component in the local code repository and the local path of the local code repository; the local path of the component is used to uniquely identify the component.

6. A dependency processing apparatus in code development, characterized by comprising: The apparatus comprises: a path acquisition module configured to acquire a local path of a component in a local code repository; a path injection module configured to, when detecting an acquisition operation of an external dependency, inject the local path of the component into an external dependency list; a file generation module configured to, according to the local path of the component in the external dependency list, call the component to generate a dependency product file dependent on the component; wherein the component recorded in the dependency product file is a component in the local code repository; and a submission module configured to, after adjusting a local dependency relationship in the dependency product file into a remote dependency relationship, submit the dependency product file. The dependency relationship adjustment module is configured to adjust a local dependency relationship in the dependency product file to a remote dependency relationship, and submit the dependency product file after the adjustment; the local dependency relationship comprises a dependency relationship of the dependency product file to the component, and the remote dependency relationship comprises a dependency relationship of the dependency product file to a remote component corresponding to the component in a remote server, and the remote dependency relationship records a path of the remote component in the remote server.

7. The apparatus of claim 6, wherein, The apparatus further comprises a dependency analysis module; The dependency analysis module is configured to determine whether a component corresponding to a to-be-analyzed component exists in the local code repository when a dependency analysis operation is detected; and redirect the to-be-analyzed component to the component corresponding to the to-be-analyzed component in the local code repository when it is determined that the component corresponding to the to-be-analyzed component exists in the local code repository.

8. The apparatus of claim 7, wherein, The dependency analysis module is further configured to force use of the component when it is detected that the component does not match a version of the to-be-analyzed component.

9. A computer program product comprising computer programs / instructions, characterized in that, The computer program / instruction is executed by the processor to implement the steps of the method of any one of claims 1-5.

10. An apparatus, comprising: comprise: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the method of any one of claims 1-5 when executing the computer program.

Citation Information

Patent Citations

  • Method and device for reusing component of software system based on component

    CN101311903A