CN115145632A - Method, device and storage medium for modifying dependency package in program item - Google Patents

Method, device and storage medium for modifying dependency package in program item Download PDF

Info

Publication number
CN115145632A
CN115145632A CN202210804644.0A CN202210804644A CN115145632A CN 115145632 A CN115145632 A CN 115145632A CN 202210804644 A CN202210804644 A CN 202210804644A CN 115145632 A CN115145632 A CN 115145632A
Authority
CN
China
Prior art keywords
target
package
modified
program
modification
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210804644.0A
Other languages
Chinese (zh)
Inventor
李莹莹
杨森
董少波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Baijiayun Technology Co Ltd
Original Assignee
Shanghai Baijiayun Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Baijiayun Technology Co Ltd filed Critical Shanghai Baijiayun Technology Co Ltd
Priority to CN202210804644.0A priority Critical patent/CN115145632A/en
Publication of CN115145632A publication Critical patent/CN115145632A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/72Code refactoring
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation

Abstract

The application provides a method, a device and a storage medium for modifying a dependency package in a program project, wherein the modifying method comprises the following steps: acquiring a target patch package and installing the target patch package; acquiring a project configuration information file under a program project to be modified, and configuring a target patch package in the project configuration information file under the program project to be modified; acquiring modification requirement information of a target user, modifying a source code corresponding to a target dependent package in a program item to be modified based on the modification requirement information of the target user, and generating a modified target dependent package; generating a target patch file based on the modified target dependent package and a target patch package configured in the project configuration information file; and testing whether the target patch file is effective, and if so, determining that the target dependent package of the program item to be modified is successfully modified. The target dependent package in the program item to be modified is modified quickly through the target patch package, so that the modification efficiency of the dependent package in the program item to be modified can be improved.

Description

Method, device and storage medium for modifying dependency package in program item
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for modifying a dependency package in a program project, and a storage medium.
Background
When an error is found in an installation Package when the installation Package on a Node Package Manager (npm) is used, the installation Package needs to be modified, but in the modification process, other users cannot perform updating operation, or the installation Package is modified according to special requirements of the users. Generally, the modification of the files in the installation package is to download the codes of other users to the local and manually modify the codes, but this method may cause that the modified dependent package may not be timely synchronized by being covered after the codes downloaded by other users are installed again in npm. Or separately assembling a component by copying the source code of the component to be modified into the project and then referencing the component, this approach can result in a separate assembly of components that is cumbersome, time consuming, and inefficient. How to efficiently prune the dependency packages in a program project becomes a non-trivial technical problem.
Disclosure of Invention
In view of this, an object of the present application is to provide a method, an apparatus, and a storage medium for modifying a dependent package in a program item, where a target dependent package in a customized program item to be modified is modified by a target patch package, so that the modification efficiency of the dependent package in the program item to be modified can be improved.
The embodiment of the application provides a modification method of a dependency package in a program project, which comprises the following steps:
acquiring a target patch package and installing the target patch package;
acquiring a project configuration information file under a program project to be modified, and configuring the target patch package in the project configuration information file under the program project to be modified;
acquiring modification requirement information of a target user, modifying a source code corresponding to a target dependent package in the program project to be modified based on the modification requirement information of the target user, and generating a modified target dependent package;
generating a target patch file based on the modified target dependency package and the target patch package configured in the project configuration information file;
and testing whether the target patch file is effective, and if so, determining that the target dependent package of the program item to be modified is successfully modified.
In a possible implementation manner, if the modification requirement information of the target user is modification target time, modifying the source code corresponding to the target dependency package in the program item to be modified based on the modification requirement information of the target user to generate a modified target dependency package, including:
and code modification is carried out on the source code of the time information in the date component in the target dependent package in the program item to be modified by utilizing the modification requirement information of the modified target time, and the modified target dependent package is generated.
In one possible embodiment, the generating a target patch file based on the modified target dependency package and the target patch package configured in the project configuration information file includes:
automatically creating a target folder in the program project to be modified by using the modified target dependent package and the target patch package;
and automatically generating the target patch file in the target folder, wherein the name of the target patch file is formed by combining the name of the target dependency package and the version number of the target dependency package.
In one possible embodiment, the target patch file is tested for effectiveness by:
deleting the target dependent package in the program item to be modified, and reinstalling the modified target dependent package;
after the modified target dependent package is successfully installed, judging whether a code for modifying a source code of the target dependent package in the program project to be modified by using the modification requirement information exists in the modified target dependent package;
if so, the target patch file takes effect;
and if not, the target patch file is not effective.
In one possible implementation, after determining that the target dependent package modification of the program item to be modified is successful, the modification method further includes:
and storing the target patch file into a database so that any user can obtain the target patch file for testing.
An embodiment of the present application further provides a device for modifying a dependent package in a program item, where the device for modifying a dependent package includes:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a target patch package and installing the target patch package;
the configuration module is used for acquiring a project configuration information file under a program project to be modified and configuring the target patch package in the project configuration information file under the program project to be modified;
the modification module is used for acquiring modification requirement information of a target user, modifying a source code corresponding to a target dependent package in the program project to be modified based on the modification requirement information of the target user, and generating a modified target dependent package;
a generating module, configured to generate a target patch file based on the modified target dependency package and the target patch package configured in the project configuration information file;
and the test module is used for testing whether the target patch file takes effect or not, and if the target patch file takes effect, determining that the target dependent package of the program item to be modified is successfully modified.
In a possible implementation manner, when the modification module is configured to modify, if the modification requirement information of the target user is modification target time, a source code corresponding to a target dependent package in the program item to be modified based on the modification requirement information of the target user, and generate a modified target dependent package, the modification module is specifically configured to:
and code modification is carried out on the source code of the time information in the date component in the target dependent package in the program item to be modified by utilizing the modification requirement information of the modified target time, and the modified target dependent package is generated.
In a possible implementation manner, when the generating module is configured to generate a target patch file based on the modified target dependency package and the target patch package configured in the project configuration information file, the generating module is specifically configured to:
automatically creating a target folder in the program project to be modified by using the modified target dependent package and the target patch package;
and automatically generating the target patch file in the target folder, wherein the name of the target patch file is formed by combining the name of the target dependency package and the version number of the target dependency package.
An embodiment of the present application further provides an electronic device, including: a processor, a memory and a bus, the memory storing machine readable instructions executable by the processor, the processor and the memory communicating via the bus when the electronic device is running, the machine readable instructions when executed by the processor performing the steps of the packet dependent modification method as in the program item above.
The embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps of the method for modifying a dependency package in the program item described above.
The embodiment of the application provides a method, a device and a storage medium for modifying a dependency package in a program project, wherein the modifying method comprises the following steps: acquiring a target patch package and installing the target patch package; acquiring a project configuration information file under a program project to be modified, and configuring a target patch package in the project configuration information file under the program project to be modified; acquiring modification demand information of a target user, modifying a source code corresponding to a target dependent package in a program item to be modified based on the modification demand information of the target user, and generating a modified target dependent package; generating a target patch file based on the modified target dependency package and a target patch package configured in the project configuration information file; and testing whether the target patch file is effective, and if so, determining that the target dependent package of the program item to be modified is successfully modified. The target dependent package in the program item to be modified is modified quickly through the target patch package, so that the modification efficiency of the dependent package in the program item to be modified is effectively improved.
In order to make the aforementioned objects, features and advantages of the present application comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
To more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
FIG. 1 is a flowchart of a method for modifying a dependency package in a program item according to an embodiment of the present disclosure;
FIG. 2 is a second flowchart of a method for modifying a dependency package in a program item according to an embodiment of the present application;
FIG. 3 is a schematic structural diagram of an apparatus for modifying a dependency package in a program item according to an embodiment of the present application;
FIG. 4 is a second schematic structural diagram of a package-dependent modification apparatus for program items according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
To make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it should be understood that the drawings in the present application are for illustrative and descriptive purposes only and are not used to limit the scope of protection of the present application. Additionally, it should be understood that the schematic drawings are not necessarily drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of the present application. It should be understood that the operations of the flow diagrams may be performed out of order, and that steps without logical context may be performed in reverse order or concurrently. In addition, one skilled in the art, under the guidance of the present disclosure, may add one or more other operations to the flowchart, or may remove one or more operations from the flowchart.
In addition, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
To enable those skilled in the art to utilize the present disclosure, in connection with certain application scenarios "modifying dependency packages in a program project," the following embodiments are presented to enable those skilled in the art to apply the general principles defined herein to other embodiments and application scenarios without departing from the spirit and scope of the present disclosure.
The following method, apparatus, electronic device, or computer-readable storage medium in the embodiments of the present application may be applied to any scenario that requires modification of a dependent package in a program item, and the embodiments of the present application are not limited to a specific application scenario, and any scheme that uses the method, apparatus, and storage medium for modifying a dependent package in a program item provided in the embodiments of the present application is within the scope of protection of the present application.
First, an application scenario to which the present application is applicable will be described. The method and the device can be applied to the technical field of computers.
Research shows that when an error exists in an installation Package when the installation Package on a Node Package Manager (npm) is used, the installation Package needs to be modified, but other users cannot perform updating operation in the modification process, or the installation Package is modified according to special requirements of the users. Generally, the modification of the files in the installation package is to download the codes of other users to the local and manually modify the codes, but this method may cause that the modified dependent package may be covered and cannot be synchronized in time after the codes downloaded by other users are installed again in npm. Or separately assembling a component by copying the source code of the component to be modified into the project and then referencing the component, this approach can result in a separate assembly of components that is cumbersome, time consuming, and inefficient. How to efficiently prune dependency packages in a program project into a non-trivial technical problem.
Based on this, the embodiment of the application provides a method for modifying a dependent package in a program project, and the target dependent package in the program project to be modified is quickly customized by the target patch package, so that the modification efficiency of the dependent package in the program project to be modified is improved.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for modifying a dependency package in a program item according to an embodiment of the present application. As shown in fig. 1, a modification method provided in an embodiment of the present application includes:
s101: and acquiring a target patch package and installing the target patch package.
In this step, a target patch package is obtained and installed.
Here, the target patch package is any one of existing general patch packages.
The "npm instruction patch-package-save-dev" is a write code for installing the target patch package.
The patch package is used for repairing the program when the program has a problem in the using process, and a user using the program cannot download a new program again after the repair is completed, so that the program can be repaired through the patch, and time waste caused by repeated program downloading can be avoided.
S102: and acquiring a project configuration information file under a program project to be modified, and configuring the target patch package in the project configuration information file under the program project to be modified.
In the step, a project configuration information file under the program project to be modified is obtained, and the target patch package is configured in the project configuration information file under the program project to be modified.
Here, the item configuration information file under the program item to be modified is a package.
Here, a package json file is stored in the root directory of each program.
The writing codes of the project configuration information file of the target patch package configured under the program project to be modified are related codes of 'poststall' and 'patch-package' added to the scripts in the package.
The program item to be modified is a program item modified by a user, such as an iview third-party UI library or other program items.
S103: and acquiring modification requirement information of a target user, modifying a source code corresponding to a target dependent package in the program item to be modified based on the modification requirement information of the target user, and generating a modified target dependent package.
In the step, modification requirement information of a target user is obtained, and a source code corresponding to a target dependent package in a program item to be modified is modified by using the modification requirement information, so as to generate a modified target dependent package.
Here, the modification requirement information is a requirement for modifying the program item to be modified by the target user, for example, the target user wants to modify the current date selected by default in the component DatePicker, and the current date is displayed as the current date of the beijing time in any time zone.
Here, the target dependency package may be a node _ modules dependency package.
Here, the modified target dependent packet is a modified target dependent packet obtained by modifying the target dependent packet according to the modification requirement information.
When a dependency package is a plug-in, it needs some other plug-in at a lower layer to support, and generally, the dependency package is bundled with the plug-in, and the dependency package is downloaded before the plug-in is downloaded and installed.
In a possible implementation manner, if the modification requirement information of the target user is modification target time, modifying the source code corresponding to the target dependency package in the program item to be modified based on the modification requirement information of the target user to generate a modified target dependency package, including:
and code modification is carried out on the source code of the time information in the date component in the target dependent package in the program item to be modified by utilizing the modification requirement information of the modified target time, and the modified target dependent package is generated.
And code modification is carried out on the source code of the time information in the date component in the target dependency package in the program item to be modified by utilizing the modification requirement information for modifying the target time, so as to generate the modified target dependency package.
Here, the modification target time is, for example, the current date selected by default, and is displayed as the current date of the beijing time in any time zone.
In an embodiment, the current Beijing time is 2022-05-05, and the United states time (2022-05-04) of the Alaska time zone of the computer time zone is modified, at this time, the date component in the iView modifies the date component in the iView by default along with the system time 2022-05-04 by using a patch-package and always defaults to select the current date of the Beijing time by default.
S104: and generating a target patch file based on the modified target dependency package and the target patch package configured in the project configuration information file.
In this step, a target patch file is generated using the modified target dependency package and the target patch package configured in the project configuration information file.
In one possible embodiment, the generating a target patch file based on the modified target dependency package and the target patch package configured in the project configuration information file includes:
a: and automatically creating a target folder in the program item to be modified by using the modified target dependent package and the target patch package.
Here, a target folder is automatically created in the program item to be modified using the modified target dependency package and the target patch.
Here, the target folder is a patches folder automatically created in the root directory of the program item to be modified.
B: and automatically generating the target patch file in the target folder, wherein the name of the target patch file is formed by combining the name of the target dependency package and the version number of the target dependency package.
Here, the target patch file is generated in the target folder.
Here, the name of the target patch file is a combination of the name of the target dependent package and the version number of the target dependent package. Patch, the package-name is the name of the target dependency package, and the version is the version number of the target dependency package.
S105: and testing whether the target patch file is effective, and if so, determining that the target dependent package of the program item to be modified is successfully modified.
In the step, whether the target patch file is effective or not is tested, and if the target patch file is effective, the target dependent package of the program item to be modified is determined to be successfully modified.
In one possible implementation, the target patch file is tested for effectiveness by:
a: and deleting the target dependent package in the program item to be modified, and reinstalling the modified target dependent package.
Here, the original target dependent package in the program item to be modified is deleted, and the modified target dependent package is reinstalled.
b: and when the modified target dependent package is successfully installed, judging whether codes for modifying the source codes of the target dependent package in the program project to be modified by utilizing the modification requirement information exist in the modified target dependent package.
Here, after the modified target dependent package is successfully installed, it is determined whether a code for performing source code modification on the target dependent package in the program item to be modified by using the modification requirement information exists in the modified target dependent package.
c: if yes, the target patch file takes effect; and if not, the target patch file is not effective.
Here, if there is a code that modifies the source code of the target dependent package, the target patch file takes effect; and if the code for modifying the source code of the target dependent package does not exist, the target patch file does not take effect.
In a specific embodiment, the node _ modules file in the program item to be modified is manually deleted, and the npm install command is executed again to install the target dependent packages modified by the node _ modules. And after the installation is successful, checking the file in the target dependent package modified by the node _ modules modified before, checking whether the modified source code still exists, if the source code modified before still exists, indicating that the target patch file is effective, and if the source code modified before still exists, indicating that the patch file is not effective, needing to regenerate the target patch file.
In another specific embodiment, taking customizing a date component in a third-party library iview as an example, the iview third-party UI library, modifying a current date selected by default in a component DatePicker, in which time zone the current date is displayed as the current date of beijing time, first installing a target patch package through an installation command, after completing installation of the target patch package, modifying a source code in the date component in the iview in the target dependency package according to modification requirement information of the current date displayed as the current date of beijing time in which time zone the current date selected by default is to be displayed, generating a modified target dependency package after completing modification, manually executing a target patch file created by a command using the modified target dependency package and the target patch package in the project configuration information file, automatically creating a patch folder in a directory in the project root during execution of the command, if the modified target patch package does not have a problem of successful modification of the target patch, and if the modified target patch package still has a problem that the target patch package is not subjected to be modified, checking whether the target patch package is valid again.
The modification method for the dependency package in the program project provided by the embodiment of the application comprises the following steps: acquiring a target patch package and installing the target patch package; acquiring a project configuration information file under a program project to be modified, and configuring the target patch package in the project configuration information file under the program project to be modified; acquiring modification requirement information of a target user, modifying a source code corresponding to a target dependent package in the program project to be modified based on the modification requirement information of the target user, and generating a modified target dependent package; generating a target patch file based on the modified target dependent package and the target patch package configured in the project configuration information file; and testing whether the target patch file is effective, and if so, determining that the target dependent package of the program item to be modified is successfully modified. And quickly customizing the target dependent package in the program project to be modified through the target patch package, so that the modification efficiency of the dependent package in the program project to be modified is improved.
Referring to fig. 2, fig. 2 is a second flowchart of a method for modifying a dependency package in a program item according to an embodiment of the present application. As shown in fig. 2, the processing method provided in the embodiment of the present application includes:
s201: and acquiring a target patch package and installing the target patch package.
S202: and acquiring a project configuration information file under a program project to be modified, and configuring the target patch package in the project configuration information file under the program project to be modified.
S203: and acquiring modification requirement information of a target user, modifying a source code corresponding to a target dependent package in the program project to be modified based on the modification requirement information of the target user, and generating a modified target dependent package.
S204: and generating a target patch file based on the modified target dependency package and the target patch package configured in the project configuration information file.
S205: and testing whether the target patch file is effective, and if so, determining that the target dependent package of the program project to be modified is successfully modified.
The descriptions of S201 to S205 may refer to the descriptions of S101 to S105, and the same technical effects can be achieved, which are not described in detail herein.
S206: and storing the target patch file into a database so that any user can obtain the target patch file for testing.
In this step, the target patch file is stored in a database so that any user can obtain the target patch file for testing.
Here, the database may be a public repository.
In a specific embodiment, a target patch package (patch-package) is obtained, the target patch package (patch-package) is installed, a project configuration information file (package.json file) under a program project to be modified is modified, the patch-package is configured in the package.json file, a source code in an iview date component in a node _ modules target dependency package is manually modified by using modification requirement information of a target user, a modified target dependency package is generated, an npx patch-package patch-name target patch file is created by using the modified target dependency package and a target patch package manual execution command configured in the project configuration information file, a target folder (patch folder) is automatically generated, and a target patch file of the patch-name + version.patch appears in the target folder. Manually deleting a node _ modules folder in a program item to be modified, re-executing an npm install command to install a modified target dependent package, checking whether a modified source code still exists after success, if so, indicating that a target patch file is effective, otherwise, indicating that the patch file is not effective, and if the target patch file passes the test, pushing the target patch file into a remote database so as to facilitate any user to obtain the target patch file for test use, wherein the target patch file is effective no matter how many times the target patch file is installed. The target dependent package in the program item to be modified can be modified quickly through the target patch package, the modification efficiency of the dependent package in the program item to be modified can be improved, only any user needs to complete the modification of the target dependent package, other users can directly utilize the modified target dependent package for testing and using, the time for modifying the target dependent package by other users is saved, and the efficiency is improved.
The modification method for the dependency package in the program project provided by the embodiment of the application comprises the following steps: acquiring a target patch package and installing the target patch package; acquiring a project configuration information file under a program project to be modified, and configuring the target patch package in the project configuration information file under the program project to be modified; acquiring modification requirement information of a target user, modifying a source code corresponding to a target dependent package in the program project to be modified based on the modification requirement information of the target user, and generating a modified target dependent package; generating a target patch file based on the modified target dependent package and the target patch package configured in the project configuration information file; and testing whether the target patch file is effective, if so, determining that the target dependency package of the program item to be modified is successfully modified, and storing the target patch file into a database so that any user can obtain the target patch file for testing. The target dependent package in the program project to be modified is customized quickly through the target patch package, the modification efficiency of the dependent package in the program project to be modified is improved, other users can obtain the modified target patch file for testing without modifying the target dependent package, and the testing convenience is improved.
Referring to fig. 3 and 4, fig. 3 is a first schematic structural diagram of a modification device for a dependency package in a program item according to an embodiment of the present application, and fig. 4 is a second schematic structural diagram of the modification device for a dependency package in a program item according to an embodiment of the present application. As shown in fig. 3, the device 300 for modifying a dependent package in a program item includes:
an obtaining module 310, configured to obtain a target patch package and install the target patch package;
a configuration module 320, configured to obtain a project configuration information file under a program project to be modified, and configure the target patch package in the project configuration information file under the program project to be modified;
a modifying module 330, configured to obtain modification requirement information of a target user, modify a source code corresponding to a target dependent package in the program item to be modified based on the modification requirement information of the target user, and generate a modified target dependent package;
a generating module 340, configured to generate a target patch file based on the modified target dependency package and the target patch package configured in the project configuration information file;
the testing module 350 is configured to test whether the target patch file is valid, and if the target patch file is valid, determine that the target dependent package of the program item to be modified is successfully modified.
Further, when the modifying module 330 is configured to modify, if the modification requirement information of the target user is modification target time, the source code corresponding to the target dependent package in the program item to be modified based on the modification requirement information of the target user, and generate a modified target dependent package, the modifying module 330 is specifically configured to:
and code modification is carried out on the source code of the time information in the date component in the target dependent package in the program item to be modified by utilizing the modification requirement information of the modified target time, and the modified target dependent package is generated.
Further, when the generating module 340 is configured to generate a target patch file based on the modified target dependent package and the target patch package configured in the project configuration information file, the generating module 340 is specifically configured to:
automatically creating a target folder in the program project to be modified by using the modified target dependent package and the target patch package;
and automatically generating the target patch file in the target folder, wherein the name of the target patch file is formed by combining the name of the target dependent package and the version number of the target dependent package.
Further, the testing module 350 tests whether the target patch file is valid by:
deleting the target dependent package in the program item to be modified, and reinstalling the modified target dependent package;
after the modified target dependent package is successfully installed, judging whether a code for modifying a source code of the target dependent package in the program project to be modified by using the modification requirement information exists in the modified target dependent package;
if so, the target patch file takes effect;
and if not, the target patch file is not valid.
Further, as shown in fig. 4, the apparatus 300 for modifying a dependent package in a program item further includes a storage module 360, where the storage module 360 is configured to:
and storing the target patch file into a database so that any user can obtain the target patch file for testing.
An embodiment of the present application provides an apparatus for modifying a dependent package in a program item, where the apparatus includes: the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a target patch package and installing the target patch package; the configuration module is used for acquiring a project configuration information file under a program project to be modified and configuring the target patch package in the project configuration information file under the program project to be modified; the modification module is used for acquiring modification requirement information of a target user, modifying a source code corresponding to a target dependent package in the program project to be modified based on the modification requirement information of the target user, and generating a modified target dependent package; a generating module, configured to generate a target patch file based on the modified target dependent package and the target patch package configured in the project configuration information file; and the test module is used for testing whether the target patch file takes effect or not, and if the target patch file takes effect, determining that the target dependent package of the program item to be modified is successfully modified. And quickly customizing a target dependent package in the program project to be modified through the target patch package, so that the modification efficiency of the dependent package in the program project to be modified is improved.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. As shown in fig. 5, the electronic device 500 includes a processor 510, a memory 520, and a bus 530.
The memory 520 stores machine-readable instructions executable by the processor 510, when the electronic device 500 runs, the processor 510 communicates with the memory 520 through the bus 530, and when the machine-readable instructions are executed by the processor 510, the steps of the method for modifying a dependency package in a program item in the method embodiment shown in fig. 1 and fig. 2 may be executed.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program may perform the steps of the method for modifying a dependency package in the program items in the method embodiments shown in fig. 1 and fig. 2.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in software functional units and sold or used as a stand-alone product, may be stored in a non-transitory computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, an optical disk, or other various media capable of storing program codes.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present application, and are used for illustrating the technical solutions of the present application, but not limiting the same, and the scope of the present application is not limited thereto, and although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the exemplary embodiments of the present application, and are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method for modifying a dependent package in a program item, the method comprising:
acquiring a target patch package and installing the target patch package;
acquiring a project configuration information file under a program project to be modified, and configuring the target patch package in the project configuration information file under the program project to be modified;
acquiring modification requirement information of a target user, modifying a source code corresponding to a target dependent package in the program project to be modified based on the modification requirement information of the target user, and generating a modified target dependent package;
generating a target patch file based on the modified target dependency package and the target patch package configured in the project configuration information file;
and testing whether the target patch file is effective, and if so, determining that the target dependent package of the program project to be modified is successfully modified.
2. The modification method according to claim 1, wherein if the modification requirement information of the target user is modification target time, modifying the source code corresponding to the target dependency package in the program item to be modified based on the modification requirement information of the target user to generate a modified target dependency package, including:
and modifying the source code of the time information in the date component in the target dependency package in the program item to be modified by utilizing the modification requirement information for modifying the target time, and generating the modified target dependency package.
3. The method of modifying as claimed in claim 2, wherein said generating a target patch file based on said modified target dependency package and said target patch package configured in said project configuration information file comprises:
automatically creating a target folder in the program project to be modified by using the modified target dependent package and the target patch package;
and automatically generating the target patch file in the target folder, wherein the name of the target patch file is formed by combining the name of the target dependency package and the version number of the target dependency package.
4. A modification method according to claim 1, wherein the target patch file is tested for validity by:
deleting the target dependent package in the program item to be modified, and reinstalling the modified target dependent package;
after the modified target dependent package is successfully installed, judging whether a code for modifying a source code of the target dependent package in the program project to be modified by using the modification requirement information exists in the modified target dependent package;
if so, the target patch file takes effect;
and if not, the target patch file is not effective.
5. The modification method according to claim 1, wherein after determining that the target dependent package modification of the program item to be modified is successful, the modification method further comprises:
and storing the target patch file into a database so that any user can obtain the target patch file for testing.
6. A package dependent modification apparatus in a program item, the modification apparatus comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a target patch package and installing the target patch package;
the configuration module is used for acquiring a project configuration information file under a program project to be modified and configuring the target patch package in the project configuration information file under the program project to be modified;
the modification module is used for acquiring modification requirement information of a target user, modifying a source code corresponding to a target dependent package in the program project to be modified based on the modification requirement information of the target user, and generating a modified target dependent package;
a generating module, configured to generate a target patch file based on the modified target dependent package and the target patch package configured in the project configuration information file;
and the test module is used for testing whether the target patch file takes effect or not, and if the target patch file takes effect, determining that the target dependent package of the program item to be modified is successfully modified.
7. The modifying device according to claim 6, wherein when the modifying module is configured to modify, if the modification requirement information of the target user is modification target time, the source code corresponding to the target dependent package in the program item to be modified based on the modification requirement information of the target user, and generate a modified target dependent package, the modifying module is specifically configured to:
and code modification is carried out on the source code of the time information in the date component in the target dependent package in the program item to be modified by utilizing the modification requirement information of the modified target time, and the modified target dependent package is generated.
8. The modifying apparatus according to claim 7, wherein when the generating module is configured to generate a target patch file based on the modified target dependency package and the target patch package configured in the project configuration information file, the generating module is specifically configured to:
automatically creating a target folder in the program project to be modified by using the modified target dependent package and the target patch package;
and automatically generating the target patch file in the target folder, wherein the name of the target patch file is formed by combining the name of the target dependent package and the version number of the target dependent package.
9. An electronic device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when the electronic device is running, the machine-readable instructions being executable by the processor to perform the steps of the packet-dependent modification method in the program item according to any one of claims 1 to 5.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of a method for package-dependent modification of a program item as claimed in any one of claims 1 to 5.
CN202210804644.0A 2022-07-08 2022-07-08 Method, device and storage medium for modifying dependency package in program item Pending CN115145632A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210804644.0A CN115145632A (en) 2022-07-08 2022-07-08 Method, device and storage medium for modifying dependency package in program item

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210804644.0A CN115145632A (en) 2022-07-08 2022-07-08 Method, device and storage medium for modifying dependency package in program item

Publications (1)

Publication Number Publication Date
CN115145632A true CN115145632A (en) 2022-10-04

Family

ID=83412545

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210804644.0A Pending CN115145632A (en) 2022-07-08 2022-07-08 Method, device and storage medium for modifying dependency package in program item

Country Status (1)

Country Link
CN (1) CN115145632A (en)

Similar Documents

Publication Publication Date Title
US8745585B2 (en) Meta-data for single development test environment
CN102289378B (en) Method for automatically generating APP (Application)
US20160306737A1 (en) Automated error checking system for a software application and method therefor
US9063819B2 (en) Extensible patch management
US9823909B1 (en) Program code conversion for cross-platform compatibility
CN105446712B (en) Application program defect repairing method and device
CN110096424B (en) Test processing method and device, electronic equipment and storage medium
CN105389187B (en) System updating method
CN103019764B (en) The detection method of Andriod resource bag installability and system
CN109814873B (en) Code publishing method and device
WO2020029967A1 (en) Method and apparatus for repairing fault in operating system
CN113434158A (en) User-defined management method, device, equipment and medium for big data component
CN110851151B (en) Method, device, terminal, server and storage medium for pre-installing application
CN110727575B (en) Information processing method, system, device and storage medium
CN108170588B (en) Test environment construction method and device
CN111949303A (en) Upgrade package processing method and device, electronic equipment and storage medium
CN115145632A (en) Method, device and storage medium for modifying dependency package in program item
CN115168175A (en) Program error solving method, device, electronic equipment and storage medium
CN113064698A (en) Method for providing product environment and corresponding device, system, equipment and medium
CN113031964A (en) Management method, device, equipment and storage medium for big data application
CN105068796A (en) Pushing method for patch program set and pushing system for patch program set
CN111143229A (en) Software testing method and device, computer equipment and computer readable storage medium
CN112445513A (en) Installation package processing method and device
JP2019152947A (en) System management device, system management method, and program
CN112631640B (en) Patch generation method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination