Debugging method and device of application development project, equipment and storage medium
Obtain the source code address and debugging function status of the functional component through the custom component configuration file, obtain the latest functional component source code and add it as a sub-project to the application development project, solving the problem of inconvenient debugging after the functional component source code is updated, and achieving Simplify the debugging process and improve debugging efficiency.
Patent Information
- Application Number
- CN202410073408.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-17
- Publication Date
- 2024-09-17
AI Technical Summary
In the component development stage, after the source code of functional components is updated, the release and introduction of JAR/AAR files cause debugging inconvenience.
By customizing the component configuration file, obtain the source code address and debugging function status of the functional component, obtain the latest functional component source code, and add it to the application development project as a sub-project, replacing the compilation of JAR/AAR files, and realizing the updated Debugging of functional components.
It simplifies the debugging process, improves debugging efficiency, avoids the need to release new JAR/AAR files and introduce new dependency information, and achieves rapid debugging of updated functional components.
Smart Images

Figure CN118656288A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a debugging method, device, equipment and storage medium for an application development project. Background Art
[0002] During the component-based development phase, an application development project and the functional components it contains are usually no longer in the same project directory. The application development project's dependency on the functional components is introduced by relying on the Java Archive (JAR) files or Android Archive (AAR) files published by the functional components.
[0003] When developing new functions for a functional component, a new JAR file or AAR file will be released and introduced into the application development project, which will bring great inconvenience to the debugging of the functional component. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a debugging method, device, equipment and storage medium for an application development project, which is used to solve the problem of debugging inconvenience caused by publishing and introducing JAR files or AAR files after the source code of the functional component is updated.
[0005] In order to achieve the above objectives, the present application embodiment adopts the following technical solutions:
[0006] In a first aspect, an embodiment of the present application provides a debugging method for an application development project, comprising:
[0007] Acquire a source code address of a target functional component from a component configuration file, wherein the component configuration file includes a source code debugging function state and a source code address of a functional component in an application development project, and the target functional component is a functional component whose source code debugging function state is turned on;
[0008] Obtain the latest source code of the target functional component from the source code address;
[0009] Adding the latest source code as a sub-project to the application development project, and adding dependency information of the application development project on the sub-project;
[0010] Run the application development project.
[0011] In a second aspect, an embodiment of the present application provides a debugging device for an application development project, comprising:
[0012] A first acquisition unit is used to acquire a source code address of a target functional component from a component configuration file, wherein the component configuration file includes a source code debugging function state and a source code address of a functional component in an application development project, and the target functional component is a functional component whose source code debugging function state is enabled;
[0013] A second acquisition unit, used to acquire the latest source code of the target functional component from the source code address;
[0014] An updating unit, configured to add the latest source code as a sub-project to the application development project, and to add dependency information of the application development project on the sub-project;
[0015] The first running unit is used to run the application development project.
[0016] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the debugging method of the application development project as described in the first aspect.
[0017] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the debugging method of the application development project as described in the first aspect.
[0018] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects:
[0019] By customizing the component configuration file and adding the source code debugging function status of the functional component in the component configuration file, the debugger can modify the source code debugging function status according to whether the functional component is updated to decide whether to directly use the source code of the functional component for debugging; at the same time, the source code address of the functional component is also added to the component configuration file, so that when the application development project needs to be debugged, the latest source code of the functional component can be obtained from the source code address, so that after the source code is updated, the latest source code can be quickly obtained for debugging; in addition, the implementation method of the application development project relying on the functional component is improved, the latest source code of the functional component is added as a sub-project to the application development project, and the dependency information of the application development project on the sub-project is added, so that the application development project will compile the latest source code of the functional component during operation, instead of compiling the JAR / AAR file. Therefore, the debugging of the updated functional component can be realized by running the application development project, and there is no need to publish new JAR / AAR files and introduce new dependency information during the entire debugging process, thereby simplifying the debugging process and improving the debugging efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0021] Figure 1 A flowchart of a debugging method for an application development project provided by an embodiment of the present application;
[0022] Figure 2 A schematic diagram of the operation process of a custom script provided for one embodiment of the present application;
[0023] Figure 3 A schematic diagram of interaction between a developer and a user provided for an embodiment of the present application;
[0024] Figure 4 A schematic diagram of the structure of a debugging device for an application development project provided by an embodiment of the present application;
[0025] Figure 5 A schematic diagram of the structure of an electronic device provided for one embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0027] The terms "first", "second", etc. in this specification and claims are used to distinguish similar objects, and are not used to describe a particular order or precedence. It should be understood that the terms used in this way can be interchanged where appropriate so that the embodiments of the present application are implemented in a sequence other than those illustrated or described herein. In addition, "and / or" in this specification and claims means at least one of the connected objects, and the character " / " generally means that the objects associated with each other are in an "or" relationship.
[0028] Some concept descriptions:
[0029] Component-based development: is a method of using modular structure in applications, which enables developers to divide applications into independent components, modules or sub-projects, each of which is responsible for specific functions or features. This approach helps improve the maintainability, scalability and team collaboration of the code, and helps better manage complex applications.
[0030] JAR file: It is an ordinary ZIP file that can store any file, but its main use is to store Java class files, resource files, text files, image files, etc. These files can be packaged together into a JAR file to support the distribution and deployment of Java programs.
[0031] AAR file: In Android development, AAR usually refers to Android Archive file, which contains compiled code and resources and is usually used to share and distribute Android libraries and modules.
[0032] Gradle: is an open source build tool for building automated tasks. It was originally designed for Java projects, but is now widely used in a variety of programming languages and platforms, including the development of Android applications. Gradle is based on the Groovy and Kotlin programming languages and provides a flexible and powerful way to manage project build and dependency information.
[0033] Settings.gradle: is a configuration file in the root directory of the Android project, used to configure the AndroidGradle build system. It is mainly used to configure the sub-projects (modules) contained in the project and some global settings.
[0034] Build.gradle: It is the configuration file of the Gradle build system, which is used to configure the project's build process, dependency information, and other build-related settings.
[0035] The present application has studied the component development process in the related art and found that the implementation method of the application development project's reliance on the functional component is usually to set the dependency information of the application development project on the JAR / AAR file of the functional component in the build.gradle file of the application development project. The dependency information indicates that the operation of the application development project depends on the JAR / AAR file. In this way, once the functional component is updated, it is necessary to re-publish the new JAR / AAR file and reset the dependency information of the application development project on the new JAR / AAR file in the build.gradle file. It can be seen that this method brings great inconvenience to the debugging of the functional component.
[0036] Based on this, the embodiment of the present application provides a debugging method for an application development project, by customizing a component configuration file and adding the source code debugging function status of a functional component in the component configuration file, so that the debugger can modify the source code debugging function status according to whether the functional component is updated to decide whether to directly use the source code of the functional component for debugging; at the same time, the source code address of the functional component is also added to the component configuration file, so that the latest source code of the functional component can be quickly obtained from the source code address for debugging; in addition, the implementation method of the application development project relying on the functional component is improved, the latest source code of the functional component is added as a sub-project to the application development project, and the dependency information of the application development project on the sub-project is added to indicate that the operation of the application development project depends on the latest source code of the functional component, so that the application development project will compile the latest source code of the functional component during operation to replace the compilation of the JAR / AAR file. Thus, the debugging of the updated functional component can be realized by running the application development project, and there is no need to publish a new JAR / AAR file and introduce new dependency information during the entire debugging process, thereby simplifying the debugging process and improving the debugging efficiency.
[0037] It should be understood that the debugging method of the application development project provided in the embodiment of the present application can be executed by an electronic device, specifically by software in the electronic device. The electronic device can be a terminal device, such as a smart phone, a tablet computer, a laptop computer, a desktop computer, an intelligent voice interaction device, a smart home appliance, a smart watch, a vehicle terminal, an aircraft, etc.; or, the electronic device can also be a server, such as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0038] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0039] See also Figure 1 , is a flow chart of a debugging method for an application development project provided by an embodiment of the present application, the method may include the following steps:
[0040] S102, obtaining the source code address of the target functional component from the component configuration file.
[0041] The component configuration file is used to configure the components in the application development project. Its format can be set according to the actual development environment, such as json format, etc., which is not limited in the embodiments of the present application. The component configuration file includes the source code debugging function status and source code address of the functional components in the application development project. In actual applications, the component configuration file can also include more configuration items, such as but not limited to at least one of the following configuration items: Maven address, name, dependency scope, etc. of the functional component. In this way, in the actual debugging process, there is no need for developers to manually modify the application development project every time, which is conducive to improving debugging efficiency and stability.
[0042] The target functional component is a functional component whose source code debugging function state is turned on. The source code debugging function state of the functional component is used to indicate whether the source code debugging function of the functional component is turned on. The source code debugging function state of the functional component can be set according to actual needs, and the embodiment of the present application does not limit this. As an example, in order to avoid affecting the compilation time during the debugging process, the source code debugging function state of the functional component is closed by default. At this time, the JAR / AAR file of the functional component can be used for debugging, such as adding the dependency information of the application development project on the JAR / AAR file in the build.gradle file of the application development project, and compiling the JAR / AAR file during the running of the application development project. When the source code of the functional component needs to be used for debugging, such as when an error (bug) occurs in the functional component or the source code of the functional component is updated, the source code debugging function state of the functional component is modified to be turned on. It can be seen that by adding the source code debugging state of the functional component in the component configuration file, the one-key opening / closing of the source code debugging function can be realized by modifying the source code debugging state, which helps to simplify the configuration operation of the functional component, avoid affecting the compilation time, and improve debugging efficiency.
[0043] The source code address of a functional component refers to the storage address of the source code used for the functional component. As an example, in order to achieve multi-party sharing of the source code of the functional component, the source code of the functional component can be written or modified by the developer according to actual needs and stored in a remote code repository, such as a remote distributed version control system such as Git. In this case, the source code address can be the access address of the remote code repository. By adding the source code address of the functional component to the component configuration file, it is helpful to quickly obtain the latest source code of the functional component from the source code address for debugging when the source code of the functional component is needed for debugging.
[0044] In one embodiment, considering that an application development project includes more than one functional component, in the case of a large number of functional components, in order to avoid omission of a target functional component and improve debugging accuracy, the above S102 may include the following steps: S121, parsing the component configuration file to obtain a component configuration information set, the component configuration information set including at least one component configuration information, each component configuration information corresponding to a functional component in the application development project, the component configuration information including the source code debugging function status and source code address of the corresponding functional component; S122, polling all component configuration information in the component configuration information set; S123, if the source code debugging function status in the currently polled component configuration information is on, determining the functional component corresponding to the currently polled component configuration information as the target functional component, and determining the source code address in the currently polled component configuration information as the source code address of the target functional component.
[0045] For example, if an application development project includes n components, where n is a positive integer, then the component configuration set includes n component configuration information, and the n component configuration information corresponds to the n components one by one. Poll all component configuration information in the component configuration information set. If the source code debugging function status in the i-th component configuration information is turned on, the i-th functional component is determined as the target functional component, and the source code address is obtained from the i-th component configuration information to obtain the source code address of the target functional component. Repeat the above polling operation until the polling of the n-th component configuration information is completed.
[0046] In actual applications, each time a target functional component is polled, the source code address of the target functional component is obtained, and based on the source code address, the following steps S104 to S106 are performed on the target functional component until the configuration information of all functional components in the component configuration information is polled; further, the following step S108 is performed. Thus, the debugging of the application development project is completed.
[0047] S104, obtaining the latest source code of the target functional component from the source code address.
[0048] In one embodiment, the above-mentioned step S104 may include the following steps: S141, obtaining the latest source code version of the target functional component from the source code address; S142, searching in the local code repository whether there is a target branch corresponding to the latest source code version, the local code repository includes at least one branch, each branch corresponds to a source code version, and each branch is used to store the source code of the corresponding source code version; S143, if the target branch does not exist in the local code repository, create a target branch in the local code repository, and obtain the latest source code of the target functional component from the source code address and store it under the target branch; S144, if the target branch exists in the local code repository, obtain the latest source code of the target functional component from the source code address and update the existing source code under the target branch.
[0049] For example, the latest source code version of the target functional component is v1.1. If the local code repository only includes the branch corresponding to v1.0, then create a branch corresponding to v1.1 in the local code repository, obtain the latest source code of the target functional component from the source code address and store it in the branch corresponding to v1.1; if the local code repository includes the branch corresponding to v1.0 and the branch corresponding to v1.1, then obtain the latest source code of the target functional component from the source code address, and update the existing source code under the v1.1 branch based on the latest source code.
[0050] This implementation helps to manage different versions of source code for the same functional component to avoid source code confusion, and is suitable for situations where the functional component is large in scale or multiple people are involved in the development.
[0051] In another embodiment, it is not necessary to perform version management on the source code of the functional component in the local code repository. In this case, the version of the target functional component is not differentiated in the local code repository, and the latest source code of the target functional component is stored in the main branch of the local code repository. Specifically, if the historical source code of the target functional component is stored in the main branch, the historical source code is updated based on the latest source code.
[0052] The embodiment of the present application shows some implementation methods of the above S104. Of course, the above S104 can also be implemented in other ways, which are not limited in the embodiment of the present application.
[0053] S106, adding the latest source code as a sub-project to the application development project, and adding the dependency information of the application development project on the sub-project.
[0054] The application development project is built in a componentized development mode. During the operation of the application development project, the sub-projects it contains will be compiled. Based on this, by adding the latest source code of the functional component as a sub-project to the application development project, and adding the dependency information of the application development project on the sub-project, to indicate that the operation of the application development project depends on the minimum source code of the functional component, the application development project will only compile the latest source code of the functional component during operation, instead of compiling the JAR / AAR file. In this way, there is no need to introduce the dependency on the JAR / AAR file in the application development project, thereby simplifying the debugging process and improving the debugging efficiency.
[0055] In one implementation, the above S106 may include the following steps:
[0056] S161, based on the component name and project path of the target functional component, modify the project configuration file of the application development project to add the latest source code of the target functional component as a sub-project to the application development project.
[0057] The project path of the target functional component refers to the directory to which the target functional component belongs in the application development project. The project configuration file is used to describe the sub-projects included in the application development project. By modifying the project configuration file, you can add, delete, or change sub-projects to the application development project. As an example, for an application development project on the Android system, the project configuration file is the settings.gradle file of the application development project. By using the include function on the settings.gradle file, the latest source code of the target functional component can be added as a sub-project to the application development project, as follows:
[0058] include”:${module.moduleName}”
[0059] project(”:${module.moduleName}”.projectDir=file(”:${module.sourceDir}”)
[0060] Among them, module.moduleName represents the name of the target functional component, and module.sourceDir represents the project path of the target functional component.
[0061] S162, in a dependency configuration file of the application development project, replacing the dependency information of the application development project on the archive file of the target functional component with the dependency information of the application development project on the sub-project corresponding to the latest source code.
[0062] The dependency configuration file is used to describe the dependency information of the application development project on the included sub-projects. By modifying the dependency configuration file, you can add, delete or modify the dependency information. As an example, for an application development project on the Android system, the archive file of the target functional component is a JAR file or an AAR file, and the dependency configuration file is a build.gradle file. By using the substitute function on the build.gradle file, the dependency information of the application development project on the target functional component can be modified. The details are as follows:
[0063] projectObj.configurations.all{config->
[0064] config.resolutionStrategy.depencySubstitution{
[0065]
[0066] An application development project usually contains two build.gradle files, one build.gradle file is located in the outer layer, that is, in the root directory of the application development project; the other build.gradle file is located in the app sub-project, where the app sub-project is the directory where the source code of the application development project is located, and is used to store some resource files of the application development project. In actual applications, in the outer build.gradle file, the dependency information of the application development project on the archive file of the target functional component can be replaced with the dependency information of the application development project on the sub-project corresponding to the latest source code; or, in the build.gradle file of the app sub-project, the dependency information of the application development project on the archive file of the target functional component can be replaced with the dependency information of the application development project on the sub-project corresponding to the latest source code. In this way, during the operation of the application development project, there is no need to compile all sub-projects, but only the sub-project corresponding to the latest source code of the target functional component will be compiled, thereby further improving debugging efficiency.
[0067] The embodiment of the present application shows some implementation methods of the above S106. Of course, it should be understood that the above S106 can also be implemented in other ways, and the embodiment of the present application does not limit this.
[0068] S108, running the application development project.
[0069] Through the above S102~S106, the dependency information of the application development project on the sub-project corresponding to the latest source code of the target functional component has been configured. By running the application development project, the target functional component can be debugged, and there is no need to release new JAR / AAR files and introduce new dependency information during the entire debugging process, thereby simplifying the debugging process and improving debugging efficiency.
[0070] In the embodiment of the present application, the above S102 to S106 can be implemented by a pre-generated custom script. By integrating the above S102 to S106 into one script for execution, it is possible to avoid problems such as compilation failure when the relevant files of the application development project (such as project configuration files and dependent configuration files, etc.) cannot be found, thereby improving the stability of the debugging process.
[0071] Considering that the above-mentioned custom script is run every time the application development project is run, it will affect the running time. For this reason, in another embodiment of the present application, the component configuration file may also include the switch status of the custom script. As an example, in order to avoid increasing the running time by running the custom script every time the application development project is run, the switch status of the custom script is closed by default, and the application development project can be run in the traditional way of compilation and operation; when the source code of the functional component needs to be used for debugging, such as when a bug occurs in the application development project or the source code of the functional component is updated, the running status of the custom script is modified to open in the component configuration file.
[0072] Accordingly, before the above S102, the debugging method of the application development project provided in the embodiment of the present application may also include: parsing the component configuration file to obtain the switch status of the custom script; if the switch status is on, running the custom script to execute the above steps S102 to S106.
[0073] As an example, Figure 2 As shown, when receiving a running instruction for an application development project, the running status of the custom script is read from the component configuration file; if the running status is on, the custom script is run, and the following operations are performed through the custom script:
[0074] First, read and parse the component configuration file to obtain a component configuration information set; poll all component configuration information in the component configuration information set, and if the source code debugging function status in the currently polled component configuration information is closed, continue to poll the next component configuration information; if the source code debugging function status in the currently polled component configuration information is on, determine the functional component corresponding to the currently polled component configuration information as the target functional component, and determine the source code address in the currently polled component configuration information as the source code address of the target functional component.
[0075] Then, the latest source code version of the target functional component is obtained from the source code address, and the target branch corresponding to the latest source code version is searched in the local code repository; if it exists, the latest source code of the target functional component is obtained from the source code address and the existing source code under the target branch is updated; if it does not exist, the target branch is created in the local code repository, and the latest source code of the target functional component is obtained from the source code address and stored under the target branch.
[0076] Further, based on the component name and project path of the target functional component, the project configuration file of the application development project is modified to add the latest source code of the target functional component as a sub-project to the application development project.
[0077] Furthermore, in the dependency configuration file of the application development project, the dependency information of the application development project on the archive file of the target functional component is replaced with the dependency information of the application development project on the sub-project corresponding to the latest source code.
[0078] Further, the next component configuration information is continuously polled until all component configuration information in the component configuration information set is polled.
[0079] In the debugging method for the application development project provided in this embodiment, by adding a configuration item of the switch status of the custom script in the component configuration file, the custom script can be started / shut down with one click by modifying the switch status, thereby increasing the operating flexibility of the application development project.
[0080] In another embodiment of the present application, in order to ensure that the custom script can be run normally, before running the custom script, it also includes: adding the custom script and the component configuration file as sub-projects to the application development project. In this way, only the running instruction needs to be input to the application development project to automatically start the custom script and run the application development project.
[0081] It is worth noting that the specific implementation of this step is similar to the specific implementation of adding the latest source code as a sub-project to the application development project in the above S106, and will not be repeated here.
[0082] In actual applications, custom scripts and component configuration files can be created by the developer, and then the user adds the custom scripts and component configuration files as sub-projects to the application development project, and inputs the running instructions for the application development project to instruct the execution of the above S102 to S108.
[0083] As an example, Figure 3As shown, the developer creates a corresponding component configuration file for the application development project, and creates a parsing code for parsing the component configuration file based on the component configuration information of each functional component in the component configuration file, and the parsing code is used to execute the above steps S102 to S104; then, based on the component name and project path of each functional component, a first modification code for modifying the project configuration file of the application development project and a second modification code for modifying the dependency configuration file of the application development project are created, the first modification code is used to execute the above step S106 to add the latest source code as a sub-project to the application development project, and the second modification code is used to execute the above step S106 to update the dependency information of the application development project on the functional component to the dependency information of the application development project on the sub-project corresponding to the latest source code; finally, based on the parsing code, the first modification code and the second modification code, the above custom script file is generated.
[0084] The user adds the custom script and component configuration file as sub-projects to the application development project, and inputs a running instruction for the application development project to execute the above steps S102 to S108.
[0085] One or more embodiments of the present application provide a debugging method for an application development project, which customizes a component configuration file and adds the source code debugging function status of a functional component to the component configuration file, so that the debugger can modify the source code debugging function status according to whether the functional component is updated to decide whether to directly use the source code of the functional component for debugging; at the same time, the source code address of the functional component is also added to the component configuration file, so that when the application development project needs to be debugged, the latest source code of the functional component can be obtained from the source code address, so that after the source code is updated, the latest source code can be quickly obtained for debugging; in addition, the implementation method of the application development project relying on the functional component is improved, the latest source code of the functional component is added as a sub-project to the application development project, and the dependency information of the application development project on the sub-project is added, so that the application development project will compile the latest source code of the functional component during operation to replace the compilation of the JAR / AAR file. Thus, the debugging of the updated functional component can be realized by running the application development project, and there is no need to publish a new JAR / AAR file and introduce a new dependency information system during the entire debugging process, thereby simplifying the debugging process and improving the debugging efficiency.
[0086] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0087] Based on the same inventive concept, the present application embodiment also provides a debugging device for an application development project. Figure 4 , is a structural diagram of a debugging device 400 for an application development project provided by an embodiment of the present application, the device 400 includes: a first acquisition unit 410, a second acquisition unit 420, an update unit 430 and a first operation unit 440.
[0088] The first acquisition unit 410 is used to acquire the source code address of the target functional component from the component configuration file, wherein the component configuration file includes the source code debugging function status and source code address of the functional component in the application development project, and the target functional component is the functional component with the source code debugging function status turned on.
[0089] The second acquisition unit 420 is used to acquire the latest source code of the target functional component from the source code address.
[0090] The updating unit 430 is used to add the latest source code as a sub-project to the application development project, and to add the dependency information of the application development project on the sub-project.
[0091] The first running unit 440 is used to run the application development project.
[0092] In one implementation, the first acquisition unit is specifically configured to:
[0093] Parsing the component configuration file to obtain a component configuration information set, the component configuration information set including at least one component configuration information, each component configuration information corresponding to a functional component in the application development project, the component configuration information including a source code debugging function state and a source code address of the corresponding functional component;
[0094] Poll all component configuration information in the component configuration information set;
[0095] If the source code debugging function status in the currently polled component configuration information is turned on, the functional component corresponding to the currently polled component configuration information is determined as the target functional component, and the source code address in the currently polled component configuration information is determined as the source code address of the target functional component.
[0096] In one implementation, the second acquisition unit is specifically configured to:
[0097] Obtain the latest source code version of the target functional component from the source code address;
[0098] Searching in a local code repository whether there is a target branch corresponding to the latest source code version, the local code repository includes at least one branch, each branch corresponds to a source code version, and each branch is used to store the source code of the corresponding source code version;
[0099] If the target branch does not exist in the local code repository, create the target branch in the local code repository, and obtain the latest source code of the target functional component from the source code address and store it under the target branch;
[0100] If the target branch exists in the local code repository, the latest source code of the target functional component is obtained from the source code address and the existing source code under the target branch is updated.
[0101] In one implementation, the updating unit is specifically configured to:
[0102] Based on the component name and project path of the target functional component, modifying a project configuration file of the application development project to add the latest source code as a sub-project to the application development project, the project configuration file being used to describe the sub-projects included in the application development project;
[0103] In the dependency configuration file of the application development project, the dependency information of the application development project on the archive file of the target functional component is replaced with the dependency information of the application development project on the sub-project corresponding to the latest source code. The dependency configuration file is used to describe the dependency information of the application development project on the included sub-projects.
[0104] In one embodiment, the steps of obtaining the source code address of the target functional component from the component configuration file and adding the dependency information of the application development project on the sub-project are implemented by running a pre-generated custom script.
[0105] In one embodiment, the component configuration file further includes a switch status of the custom script;
[0106] The device 400 further includes:
[0107] A parsing unit, configured to parse the component configuration file to obtain the switch state before the first obtaining unit obtains the source code address of the target functional component from the component configuration file;
[0108] The second running unit is used to run the custom script if the switch state is on.
[0109] In one embodiment, the device 400 further includes:
[0110] The adding unit is used to add the custom script and the component configuration file as sub-projects to the application development project before the second running unit runs the custom script.
[0111] Obviously, the debugging device for the application development project provided in the embodiment of the present application can be used as the above Figure 1 The execution subject of the debugging method of the application development project shown in the figure can realize the debugging device of the application development project in Figure 1 The functions realized are as follows. Since the principles are the same, they will not be described in detail.
[0112] Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. Figure 5 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. Of course, the electronic device may also include hardware required for other services.
[0113] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0114] The memory is used to store the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.
[0115] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a debugging device for the application development project at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations:
[0116] Acquire a source code address of a target functional component from a component configuration file, wherein the component configuration file includes a source code debugging function state and a source code address of a functional component in an application development project, and the target functional component is a functional component whose source code debugging function state is turned on;
[0117] Obtain the latest source code of the target functional component from the source code address;
[0118] Adding the latest source code as a sub-project to the application development project, and adding dependency information of the application development project on the sub-project;
[0119] Run the application development project.
[0120] The above application Figure 1 The method executed by the debugging device of the application development project disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0121] The electronic device may also perform Figure 1 The method and implementation of the debugging device of the application development project are Figure 1 , Figure 2 , Figure 3 The functions of the illustrated embodiment will not be described in detail in the embodiments of the present application.
[0122] Of course, in addition to software implementation, the electronic device of the present application does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0123] The embodiment of the present application also provides a computer-readable storage medium, which stores one or more programs, wherein the one or more programs include instructions, which, when executed by a portable electronic device including a plurality of application programs, enable the portable electronic device to execute Figure 1 The method of the embodiment shown is specifically used to perform the following operations:
[0124] Acquire a source code address of a target functional component from a component configuration file, wherein the component configuration file includes a source code debugging function state and a source code address of a functional component in an application development project, and the target functional component is a functional component whose source code debugging function state is turned on;
[0125] Obtain the latest source code of the target functional component from the source code address;
[0126] Adding the latest source code as a sub-project to the application development project, and adding dependency information of the application development project on the sub-project;
[0127] Run the application development project.
[0128] In short, the above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0129] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0130] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0131] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0132] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
Claims
1. A debugging method for an application development project, characterized in that: include: Acquire a source code address of a target functional component from a component configuration file, wherein the component configuration file includes a source code debugging function state and a source code address of a functional component in an application development project, and the target functional component is a functional component whose source code debugging function state is turned on; Obtain the latest source code of the target functional component from the source code address; Adding the latest source code as a sub-project to the application development project, and adding dependency information of the application development project on the sub-project; Run the application development project.
2. The method according to claim 1, characterized in that The step of obtaining the source code address of the target functional component from the preset component configuration file includes: Parsing the component configuration file to obtain a component configuration information set, the component configuration information set including at least one component configuration information, each component configuration information corresponding to a functional component in the application development project, the component configuration information including a source code debugging function state and a source code address of the corresponding functional component; Poll all component configuration information in the component configuration information set; If the source code debugging function status in the currently polled component configuration information is turned on, the functional component corresponding to the currently polled component configuration information is determined as the target functional component, and the source code address in the currently polled component configuration information is determined as the source code address of the target functional component.
3. The method according to claim 1, characterized in that The obtaining the latest source code of the target functional component from the source code address includes: Obtain the latest source code version of the target functional component from the source code address; Searching in a local code repository whether there is a target branch corresponding to the latest source code version, the local code repository includes at least one branch, each branch corresponds to a source code version, and each branch is used to store the source code of the corresponding source code version; If the target branch does not exist in the local code repository, create the target branch in the local code repository, and obtain the latest source code of the target functional component from the source code address and store it under the target branch; If the target branch exists in the local code repository, the latest source code of the target functional component is obtained from the source code address and the existing source code under the target branch is updated.
4. The method according to claim 1, characterized in that The adding the latest source code as a sub-project to the application development project, and adding the dependency information of the application development project on the sub-project, includes: Based on the component name and project path of the target functional component, modifying a project configuration file of the application development project to add the latest source code as a sub-project to the application development project, the project configuration file being used to describe the sub-projects included in the application development project; In the dependency configuration file of the application development project, the dependency information of the application development project on the archive file of the target functional component is replaced with the dependency information of the application development project on the sub-project corresponding to the latest source code. The dependency configuration file is used to describe the dependency information of the application development project on the included sub-projects.
5. The method according to any one of claims 1 to 4, characterized in that The steps of obtaining the source code address of the target functional component from the component configuration file to adding the dependency information of the application development project on the sub-project are implemented by running a pre-generated custom script.
6. The method according to claim 5, characterized in that The component configuration file also includes the switch status of the custom script; Before obtaining the source code address of the target functional component from the component configuration file, the method further includes: Parsing the component configuration file to obtain the switch status; If the switch state is on, the custom script is run.
7. The method according to claim 5, characterized in that Before running the custom script, the method further includes: The custom script and the component configuration file are added as sub-projects to the application development project.
8. A debugging device for an application development project, characterized in that: include: A first acquisition unit is used to acquire a source code address of a target functional component from a component configuration file, wherein the component configuration file includes a source code debugging function state and a source code address of a functional component in an application development project, and the target functional component is a functional component whose source code debugging function state is enabled; A second acquisition unit, used to acquire the latest source code of the target functional component from the source code address; An updating unit, configured to add the latest source code as a sub-project to the application development project, and to add dependency information of the application development project on the sub-project; The first running unit is used to run the application development project.
9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the debugging method for the application development project according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the debugging method for an application development project according to any one of claims 1 to 7.
