CN111399840A - Module development method and device - Google Patents

Module development method and device Download PDF

Info

Publication number
CN111399840A
CN111399840A CN202010146458.3A CN202010146458A CN111399840A CN 111399840 A CN111399840 A CN 111399840A CN 202010146458 A CN202010146458 A CN 202010146458A CN 111399840 A CN111399840 A CN 111399840A
Authority
CN
China
Prior art keywords
module
project
source code
determining
name
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.)
Granted
Application number
CN202010146458.3A
Other languages
Chinese (zh)
Other versions
CN111399840B (en
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.)
Tencent Music Entertainment Technology Shenzhen Co Ltd
Original Assignee
Tencent Music Entertainment Technology Shenzhen 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 Tencent Music Entertainment Technology Shenzhen Co Ltd filed Critical Tencent Music Entertainment Technology Shenzhen Co Ltd
Priority to CN202010146458.3A priority Critical patent/CN111399840B/en
Publication of CN111399840A publication Critical patent/CN111399840A/en
Application granted granted Critical
Publication of CN111399840B publication Critical patent/CN111399840B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3628Software debugging of optimised code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/443Optimisation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application provides a module development method and a related device, wherein the module development method comprises the following steps: determining a compiling mode of a first module project to a second module project, wherein the first module project comprises a source code of a first module, the second module project comprises a source code of a second module, and the first module has a dependency relationship with the second module; if the compiling mode is the joint debugging mode, acquiring a target source code corresponding to the second module from the code management system; dynamically adding target source code into a first module project in a sub-project mode; editing a target source code of a second module in a code editor of a first module project; and compiling the source code of the first module and the target source code edited by the second module to obtain a compiling result. By implementing the embodiment of the application, a user can conveniently check, modify and compile the source code of another module in the target module engineering, the development efficiency is improved, and the server resource is saved.

Description

Module development method and device
Technical Field
The present application relates to the field of internet technologies, and in particular, to a module development method and apparatus.
Background
The functions of one program often need to be provided by a combination and cooperation of a plurality of modules. Therefore, the function calls must exist among different modules. In the existing modular development scheme, a part of public interfaces are provided after modules are extracted as module engineering, engineering source codes are compiled and packaged into binary filing AAR files after the development is finished and are issued to a Maven server, and other modules can refer to the public interfaces by downloading corresponding AARs, so that the purpose of function calling among the modules is achieved. However, when a function developed involves multiple modules at the same time, or when locating a defect involves multiple modules, it may be necessary to modify the code of the multiple modules and verify the same. The software development is a process requiring continuous debugging, and if the code needs to be modified for multiple times, the complicated and long process is required to be performed each time, so that the efficiency of module joint debugging is slowed down; and in the joint debugging process, the AAR can be uploaded for many times, so that the resource of the Maven server is wasted.
Therefore, how to avoid the low development efficiency and the waste of Maven server resources caused by repeating the native scheme for many times in the debugging process is an urgent problem to be solved.
Disclosure of Invention
In view of the above, the present application is proposed to provide a module development method and apparatus that overcomes or at least partially solves the above problems.
In a first aspect, an embodiment of the present application provides a module development method, which may include:
determining a compiling mode of a first module project to a second module project, wherein the first module project comprises a source code of a first module, the second module project comprises a source code of a second module, and the first module has a dependency relationship with the second module;
if the compiling mode is a joint debugging mode, acquiring a target source code corresponding to the second module from a code management system;
dynamically adding the target source code to the first module project in a sub-project mode;
editing the target source code of the second module in the code editor of the first module project;
and compiling the source code of the first module and the target source code edited by the second module to obtain a compiling result.
By the method of the first aspect, in the embodiment of the present application, a compiling mode of a first module project to a second module project may be determined, and if the compiling mode is a joint debugging mode, a target source code corresponding to the second module is obtained from a code management system; and adding the target source code into the first module project in a sub-project mode in a dynamic mode, and compiling the target source code after editing. After the target source code corresponding to the second module project required to be called by the first module project is dynamically added into the first module project in the form of a sub-project (namely, after the dependence mode of the target module project (such as the first module project) on other module projects (such as the second module project) is switched from AAR dependence to source code dependence), a user can directly check, modify and compile the source code of the other module project in the target module project, so that a long work flow of opening the other module project, modifying the code, releasing the AAR, downloading the AAR and then verifying is avoided, the development efficiency is improved, the AAR does not need to be repeatedly released in the modification test process, and the server resources are also saved.
In one possible implementation manner, the determining a compiling mode of the first module project to the second module project includes: determining a module name of the second module project that the first module project depends on; determining target version information corresponding to the module name according to the module name and the mapping relation between the module name and the version information; and determining a compiling mode of the first module project to the second module project according to the target version information.
In a possible implementation manner, the determining the module name of the second module project that the first module project depends on includes: determining a configuration file in the main project, wherein the configuration file comprises a JS object numbered notation json array, the json array comprises a plurality of statement information, and the statement information comprises: the module name of the module project which is depended by the module project and the version information corresponding to the module name; and determining the module name of a second module project which is depended by the first module project according to the declaration information in the configuration file.
In a possible implementation manner, the determining, according to the module name and the mapping relationship between the module name and the version information, the target version information corresponding to the module name includes: and determining target version information corresponding to the module name of the second module project in the declaration information of the configuration file.
In one possible implementation, the method further includes: if the compiling mode is an integration mode, acquiring a binary archive file corresponding to the second module project from a binary archive file management system; and generating a target application program package file corresponding to the first module project according to the binary archive file.
In a second aspect, a module development apparatus includes:
the system comprises a first determining unit, a second determining unit and a compiling unit, wherein the first determining unit is used for determining a compiling mode of a second module project corresponding to a first module project, the first module project comprises a source code of a first module, the second module project comprises a source code of a second module, and the first module has a dependency relationship with the second module;
a first obtaining unit, configured to obtain, if the compiling mode is a joint debugging mode, a target source code corresponding to the second module from a code management system;
a sub-engineering unit, configured to add the target source code to the first module engineering in a form of sub-engineering in a dynamic manner;
the editing unit is used for editing the target source code of the second module in the code editor of the first module project;
and the compiling unit is used for compiling the source code of the first module and the target source code edited by the second module to obtain a compiling result.
In a possible implementation manner, the first determining unit is specifically configured to: determining a module name of the second module project that the first module project depends on; determining target version information corresponding to the module name according to the module name and a first mapping relation between the module name and the version information; and determining a compiling mode of the first module project to the second module project according to the target version information.
In one possible implementation manner, the first modular project and the second modular project both belong to a main project; the first determining unit, when determining the module name of the second module project that the first module project depends on, is specifically configured to: determining a configuration file in the main project, wherein the configuration file comprises a JS object numbered notation json array, the json array comprises a plurality of statement information, and the statement information comprises: the module name of the module project which is depended by the module project and the version information corresponding to the module name; and determining the module name of a second module project which is depended by the first module project according to the declaration information in the configuration file.
In a possible implementation manner, when determining, according to the module name and the mapping relationship between the module name and the version information, the target version information corresponding to the module name, the first determining unit is specifically configured to: and determining target version information corresponding to the module name of the second module project in the declaration information of the configuration file.
In one possible implementation, the apparatus further includes: the generating unit is used for acquiring a binary archive file corresponding to the second module project from a binary archive file management system if the compiling mode is an integration mode; and generating a target application program package file corresponding to the first module project according to the binary archive file.
In a third aspect, an embodiment of the present application provides a module development apparatus, including a storage component, a processing component and a communication component, where the storage component, the processing component and the communication component are connected to each other, where the storage component is used to store a computer program, and the communication component is used to perform information interaction with an external device; the processing component is configured to invoke the computer program to execute the method according to the first aspect, which is not described herein again
In a fourth aspect, the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and the computer program is executed by a processor to implement the method of the first aspect.
In a fifth aspect, the present application provides a computer program, where the computer program includes instructions, and when the computer program is executed by a computer, the computer can execute the process executed by the module development apparatus in the second aspect.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments or the background art of the present application, the drawings required to be used in the embodiments or the background art of the present application will be described below.
Fig. 1 is a schematic diagram of a system architecture for module development provided in an embodiment of the present application;
fig. 2A is a schematic diagram of a module development method flow provided in an embodiment of the present application;
fig. 2B is a schematic flow chart of an actual application of a module development method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of another module development method flow provided in the embodiments of the present application;
fig. 4 is a schematic structural diagram of a module development apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of another module development apparatus provided in the embodiment of the present application.
Detailed Description
The embodiments of the present application will be described below with reference to the drawings.
The terms "first," "second," and "third," etc. in the description and claims of this application and in the accompanying drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, "include" and "have" and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
As used in this application, the terms "server," "unit," "system," and the like are intended to refer to a computer-related entity, either hardware, firmware, a combination of hardware and software, or software in execution. For example, a server may be, but is not limited to, a processor, a data processing platform, a computing device, a computer, two or more computers, and the like.
First, some terms in the present application are explained so as to be easily understood by those skilled in the art.
(1) JSON (javascript object Notation) is a lightweight data exchange format. It stores and represents data in a text format that is completely independent of the programming language, based on a subset of ECMAScript (js specification set by the european computer association). The compact and clear hierarchy makes JSON an ideal data exchange language. The network transmission method is easy to read and write by people, is easy to analyze and generate by machines, and effectively improves the network transmission efficiency.
(2) Android, an open source code mobile operating system based on L inux kernel, is one of the mainstream mobile phone operating systems at present, and the Android development referred to in the present application may refer to app application development based on the Android system.
(3) Engineering: a program often contains multiple functions, which are usually implemented by many source code files, and the project is an organization form of these source code files, which is a file directory with a certain structure.
(4) And (3) sub-engineering: in Android, the interior of a project can be continuously divided into different subdirectories according to functions, and each subdirectory stores different source codes.
(5) A module: refers to a part of a complex system (whole) and can be understood as a single functional module.
(6) Modularization: a method for decomposing a complex system into better manageable modules is used for dividing a certain service (function) into independent parts for development and maintenance in the field of software development.
(7) Aar (Android), a form of presence of third party libraries in Android. Mainly containing the code (class file) and resources of the third party library. The AAR files are typically stored in a maven repository.
(8) A maven warehouse: and the dependency management system is responsible for version management of the AAR. Usually built in a remote server, so it can also be called a maven server. The maven warehouse is divided into two types, namely a local warehouse and a remote warehouse, but the remote warehouse is divided into three types, namely: central warehouses, private uniforms, and other warehouses.
(9) Git: an open source distributed version control system. Source code that is commonly used to host and manage engineering in the field of software development.
(10) Apk (Android package), also known as Android application package, Android application package. The APK is a Symbian Sis or Sisx-like application package file format used by the Android operating system for distributing and installing mobile applications and middleware. The code of an Android application program is required to be run on an Android device, and the code must be compiled first and then packaged into a file which can be recognized by an Android system to be run, and the file format which can be recognized and run by the Android system is 'APK'.
Next, a description is given of one of the module development system architectures on which the embodiments of the present application are based.
In a first case, the module development apparatus may be a server in the cloud, and the server and the local terminal form a system, please refer to fig. 1, where fig. 1 is a schematic diagram of a system architecture for module development provided in an embodiment of the present application, and as shown in fig. 1, the system architecture may include one or more servers (a plurality of servers may form a server cluster), and one or more terminals (or devices), where: a module development device 101 and a terminal apparatus 102.
The module development device 101 may include, but is not limited to, a backend server, a component server, a data processing server, a processing plug-in (e.g., a Gradle plug-in), and the like, when the module development device 101 is a server, the server may communicate with a plurality of terminals through the internet, and the server also needs to run a corresponding server-side program to provide a corresponding module development service. For example, the server may determine a compilation mode of a first module project on a second module project, wherein the first module project comprises source code of a first module, the second module project comprises source code of a second module, and the first module has a dependency relationship on the second module; if the compiling mode is a joint debugging mode, acquiring a target source code corresponding to the second module from a code management system; dynamically adding the target source code to the first module project in a sub-project mode; editing the target source code of the second module in the code editor of the first module project; and compiling the source code of the first module and the target source code edited by the second module to obtain a compiling result.
The terminal device 102 may install and run the relevant applications. An application is a program that corresponds to a server and provides local services to a client. Here, the local service may include, but is not limited to: and sending a modification instruction to the server, wherein the modification instruction is used for modifying the target source code of the sub-project. Wherein the sub-engineering comprises: and calling the target source code corresponding to the first function of the second module project by the first module project, and the like. The terminal in the embodiment of the scheme can be packagedIncluding but not limited to any smart operating system based electronic product that can interact with a user through input devices such as keyboards, virtual keyboards, touch pads, touch screens, and voice-activated devices, such as smartphones, tablets, personal computers, etc. Smart operating systems include, but are not limited to, any operating system that enriches device functionality by providing various mobile applications to a mobile device, such as: android (Android)TM)、iOSTM、Windows PhoneTMAnd the like.
In case two, the system architecture may be a device, which may be a local terminal, and the terminal may install and run the relevant application. An application is a program that corresponds to a server and provides local services to a client. For example, the terminal may determine a compiling mode of a first module project to a second module project, wherein the first module project comprises a source code of a first module, the second module project comprises a source code of a second module, and the first module has a dependency relationship with the second module; if the compiling mode is a joint debugging mode, acquiring a target source code corresponding to the second module from a code management system; dynamically adding the target source code to the first module project in a sub-project mode; editing the target source code of the second module in the code editor of the first module project; and compiling the source code of the first module and the target source code edited by the second module to obtain a compiling result. The terminal in this embodiment may include, but is not limited to, any electronic product based on an intelligent operating system, which may perform human-computer interaction with a user through an input device such as a keyboard, a virtual keyboard, a touch pad, a touch screen, and a voice control device, such as a smart phone, a tablet computer, and a personal computer. The smart operating system includes, but is not limited to, any operating system that enriches device functionality by providing various mobile applications to the mobile device, such as Android (Android)TM)、iOSTM、Windows PhoneTMAnd the like.
It is also understood that the module development system architecture of fig. 1 is only a partial exemplary implementation manner in the embodiment of the present application, and the module development system architecture in the embodiment of the present application includes, but is not limited to, the above module development system architecture.
Referring to fig. 2A, fig. 2A is a schematic diagram of a module development method flow provided in an embodiment of the present application. Applicable to the system of fig. 1 described above, will be described below with reference to fig. 2A from a single side of the module development apparatus 101. The method may include the following steps S201 to S205.
Step S201: and determining a compiling mode of the first module project to the second module project.
Specifically, the module development device may determine a compiling mode of a first module project to a second module project, where the first module project includes a source code of a first module, the second module project includes a source code of a second module, and the first module has a dependency relationship with the second module. It should be noted that, the module engineering refers to that after the modular splitting, each service (function) exists in the form of a separate engineering. The modular engineering is a completely independent engineering, different modular engineering can not directly access the source code of the other side, and can only be mutually called in an AAR form, so that a certain code isolation effect is achieved. The first module project calls the first function of the second module project to realize the second function, namely, the first module project depends on the second module project.
Optionally, the determining, by the module development device, the compiling mode of the first module project to the second module project may include: determining a module name of the second module project that the first module project depends on; determining target version information corresponding to the module name according to the module name and the mapping relation between the module name and the version information; and determining a compiling mode of the first module project to the second module project according to the target version information.
The module development device can obtain version information of a second module project depended by a first module project, and determine a compiling mode of the second project module according to the version information, wherein the version information can comprise an actual version number (such as 1.0.0), a debug # Git warehouse address (remoteggitretpor UR L) # Git branch name (branchName) and the like, wherein different version information corresponds to different compiling modes, for example, the actual version number (such as 1.0.0) corresponds to an integrated mode of compiling, and for example, when the version information of the depended module project (i.e., the second module project) defined in module json by the first module project is the debug # Git warehouse address (remotegrettgipepo UR L) # t branch name (branchName), the compiling process can enter an associative mode, and the associative mode can switch the dependence mode on other module projects from an AAR dependence source, wherein the open code mode is used for storing distributed control system versions and software management.
Step S202: and if the compiling mode is the joint debugging mode, acquiring the target source code corresponding to the second module from the code management system.
In particular, if the version information includes a warehouse address and a branch name, and the compiling mode is a joint debugging mode, a module development device obtains a target source code corresponding to the second module from a code management system such as a Git system, for example, obtains a corresponding target source code according to the warehouse address and the branch name, wherein the warehouse address may be a remote Git warehouse address, and the branch name may be the remote Git branch name.
Step S203: and dynamically adding the target source code into the first module project in the form of sub-project.
Specifically, the module development device adds target source code to a first module project in a sub-project mode in a dynamic mode, so that the dependence of the first module project on a second module project is switched from AAR dependence to source code dependence.
The sub-project may be referred to as a sub-Module project or a sub-Module project in this document. In Android, the interior of a project can be continuously divided into different subdirectories according to functions, each subdirectory stores different source codes, and the subdirectory is called as a sub-module project.
For example, referring to fig. 2B, fig. 2B is a flow diagram illustrating a practical application of a Module development method according to an embodiment of the present application, a dynamic modification Module description file (setup.gradle file) is included in a sub-Module list of a current project, where the target source code (for example, a lib-xxx directory under a Module-xxx directory in step S202 above) is included in the sub-Module list of the current project.
It should be noted that: although the module project and the sub-module project can both comprise an independent functional module, different sub-module projects still exist in the same father directory, the code isolation purpose is not achieved, the module project is a completely independent project, different module projects cannot directly access the source codes of the other side, and can only be mutually called in an AAR mode, and the code isolation function is achieved to a certain extent.
Step S204: and editing the target source code of the second module in the code editor of the first module project.
Specifically, the module development apparatus may edit the target source code of the second module in a code editor of the first module project. For example: the modification instruction sent by the terminal equipment can be received, and the target source code of the sub-project can be modified according to the modification instruction. The developer can directly check, modify and compile the source code of the second module in the current first module project, a long work flow of opening a new project, modifying the code, issuing the AAR, downloading the AAR and then verifying is omitted, the development efficiency is improved, the repeated issuing of the AAR is not needed in the process of the module joint debugging, and the server resource is saved. Optionally, the implementation may be realized by using an extension parameter transfer manner of a gradient plug-in (Gradle plug-in), and a technician only needs to modify the build.
Step S205: and compiling the source code of the first module and the target source code edited by the second module to obtain a compiling result.
Specifically, the module development device may compile a source code of the first module and a target source code edited by the second module to obtain a compilation result.
By implementing the embodiment of the application, a compiling mode of a first module project to a second module project can be determined, and if the compiling mode is a joint debugging mode, a target source code corresponding to the second module is obtained from a code management system; and adding the target source code into the first module project in a sub-project mode in a dynamic mode, and compiling the target source code after editing. After the target source code corresponding to the second module project required to be called by the first module project is dynamically added into the first module project in the form of a sub-project (namely, after the dependence mode of the target module project (such as the first module project) on other module projects (such as the second module project) is switched from AAR dependence to source code dependence), a user can directly check, modify and compile the source code of the other module project in the target module project, so that a long work flow of opening the other module project, modifying the code, releasing the AAR, downloading the AAR and then verifying is avoided, the development efficiency is improved, the AAR does not need to be repeatedly released in the modification test process, and the server resources are also saved.
Referring to fig. 3, fig. 3 is a schematic diagram of another module development method flow provided in the embodiment of the present application. Applicable to the system of fig. 1 described above, will be described below with reference to fig. 3 from a single side of the module development apparatus 101. The method may comprise the following steps S301-S304.
Step S301: determining a configuration file in the main project.
Specifically, the modular development device determines a configuration file in the main project, wherein the configuration file comprises a JS object numbered notation json array, the json array comprises a plurality of declaration information, and the declaration information comprises: the module name of the module project which is depended by the module project and the version information corresponding to the module name; and determining the module name of a second module project which is depended by the first module project according to the declaration information in the configuration file.
First, each module project in the master project is named module-xxx (where xxx is the module name of the module project). There are two sub-modules within each modular project: lib-xxx and app. On one hand, a sub Module named lib-xxx is a core code of the Module, and after the development is completed, the sub Module can be compiled and packaged into a Module-xxx.aar (namely an AAR file), and uploaded to a remote Maven server to be called by other Module projects; on the other hand, a sub-Module project named app may call the lib-xxx project for running the validation code logic independently inside the current project.
Secondly, the main project counts or collects the module name corresponding to each module project and the module names of other module projects required to be called when the module project realizes the function. Json configuration file then declares other module projects that the module project needs to depend on. Json configuration file internally contains a JS object profile json array, and each item in the array declares the name (name) and version information (version) of the module to be depended on. Optionally, the first modular engineering and the second modular engineering both belong to a main engineering.
Optionally, the determining, according to the module name and the mapping relationship between the module name and the version information, the target version information corresponding to the module name includes: and determining target version information corresponding to the module name of the second module project in the declaration information of the configuration file.
Step S302: and determining the compiling mode of the first module project to the second module project according to the declaration information in the configuration file.
Specifically, the above description of step S302 may correspond to the description of step S201 in fig. 2A, and is not repeated here.
Step S303: and if the compiling mode is the integration mode, acquiring the binary archive file corresponding to the second module project from a binary archive file management system.
Specifically, if the version information is the preset version information, the compiling mode is represented as the integration mode, and then the module development device acquires the binary archive file corresponding to the second module project from a binary archive file management system such as a maven warehouse according to the module name and the version information of the second module project. The preset version information may be actual digital version information, such as 5.3.4. The preset version information is the version information of the binary archive file of the second functional module.
Step S304: and generating a target application program package file corresponding to the first module project according to the binary archive file.
Specifically, the module development device generates a target application package file corresponding to the first module project according to the binary archive file. For example: json, when a module defines the version of the module on which it depends as the actual version information (e.g., 1.0.0), then compilation will enter the integration mode. The Module development device can automatically download the corresponding AAR file to the local according to the Module name and version information version to the maven server, and add the dependence on the AAR file for the lib-xxx sub-Module of the current Module project. After the addition is completed, the AAR of another module project can participate in the compiling process of the current module project, namely, the function realized by the AAR file is called, and finally, the APK file of the current module project is generated. In the process, the AAR file is not changeable, the current module engineering is only responsible for integrating the functions realized by the AAR file, and the mode is mainly used for the APK packaging process after the development is finished.
In the embodiment of the present application, the module development device dynamically adds the target source code in the second module engineering called by the first module engineering to the first module engineering in a sub-engineering manner, that is, in the embodiment of the present application, the dependency manner of the target module engineering (e.g., the first module engineering) on other module engineering (e.g., the second module engineering) is switched from AAR dependency to source code dependency, before modifying and compiling the source code of another module engineering, it can also be determined whether the version information corresponding to the second module engineering is the preset version information, if the version information is the preset version information, the second module engineering AAR file can be directly called to execute or test the corresponding function of the first module engineering, the AAR corresponding to the second module engineering cannot be modified in the executing or testing process, and the modification time is also saved.
In summary, by implementing the application, the dependence mode on other modules can be quickly switched from the AAR dependence to the source code dependence, a developer or a related technical person can directly check, modify and compile the source code of another module in the current project, a long operation flow of opening another project, modifying codes, releasing the AAR, downloading the AAR and then verifying is omitted, the development efficiency is improved, the AAR does not need to be repeatedly released in the process of joint debugging of the modules, and the resources of a server are also saved.
The method of the embodiment of the present application is explained in detail above, and the following provides a module development apparatus related to the embodiment of the present application. Referring to fig. 4, fig. 4 is a schematic structural diagram of a module development apparatus according to an embodiment of the present disclosure. The method can comprise the following steps: a first determining unit 401, a first acquiring unit 402, a sub-engineering unit 403, an editing unit 404 and a compiling unit 405; the method can also comprise the following steps: a generating unit 406.
A first determining unit 401, configured to determine a compiling mode of a second module project corresponding to a first module project, where the first module project includes a source code of a first module, the second module project includes a source code of a second module, and the first module has a dependency relationship with the second module;
a first obtaining unit 402, configured to obtain, if the compiling mode is a joint debugging mode, a target source code corresponding to the second module from a code management system;
a sub-engineering unit 403, configured to add the target source code to the first module engineering in a sub-engineering manner in a dynamic manner;
an editing unit 404, configured to edit, in the code editor of the first module project, the target source code of the second module;
and a compiling unit 405, configured to compile the source code of the first module and the target source code edited by the second module to obtain a compiling result.
In a possible implementation manner, the first determining unit 401 is specifically configured to: determining a module name of the second module project that the first module project depends on; determining target version information corresponding to the module name according to the module name and a first mapping relation between the module name and the version information; and determining a compiling mode of the first module project to the second module project according to the target version information.
In one possible implementation manner, the first modular project and the second modular project both belong to a main project; the first determining unit 401, when determining the module name of the second module project that the first module project depends on, is specifically configured to: determining a configuration file in the main project, wherein the configuration file comprises a JS object numbered notation json array, the json array comprises a plurality of statement information, and the statement information comprises: the module name of the module project which is depended by the module project and the version information corresponding to the module name; and determining the module name of a second module project which is depended by the first module project according to the declaration information in the configuration file.
In a possible implementation manner, the first determining unit 401, when determining, according to the module name and the mapping relationship between the module name and the version information, the target version information corresponding to the module name, is specifically configured to: and determining target version information corresponding to the module name of the second module project in the declaration information of the configuration file.
In one possible implementation, the apparatus further includes: a generating unit 406, configured to obtain a binary archive file corresponding to the second module project from a binary archive file management system if the compiling mode is an integration mode; and generating a target application program package file corresponding to the first module project according to the binary archive file.
It should be noted that implementation of each operation may also correspond to corresponding description of the method embodiments shown in fig. 2A to fig. 3, and details are not described here again.
As shown in fig. 5, fig. 5 is a schematic structural diagram of another module development apparatus provided in this embodiment of the present application, where the apparatus 20 includes at least one processor 501, at least one memory 502, and at least one communication interface 503. In addition, the device may also include common components such as an antenna, which will not be described in detail herein.
The processor 501 may be a general purpose Central Processing Unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of programs according to the above schemes.
Communication interface 503 for communicating with other devices or communication Networks, such as ethernet, Radio Access Network (RAN), core network, Wireless L Area Networks (W L AN), etc.
The Memory 502 may be, but is not limited to, a Read-Only Memory (ROM) or other type of static storage device that can store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable Programmable Read-Only Memory (EEPROM), a Compact Disc Read-Only Memory (CD-ROM) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory may be self-contained and coupled to the processor via a bus. The memory may also be integral to the processor.
The memory 502 is used for storing application program codes for executing the above scheme, and is controlled by the processor 501 for execution. The processor 501 is used to execute application program code stored in the memory 502.
The code stored in the memory 502 may perform the module development method provided in fig. 2A or fig. 3 above, for example, when the apparatus 20 develops 101 for a module, a compiling mode of a first module project to a second module project may be determined, wherein the first module project includes a source code of the first module, the second module project includes a source code of the second module, and the first module has a dependency relationship with the second module; if the compiling mode is a joint debugging mode, acquiring a target source code corresponding to the second module from a code management system; dynamically adding the target source code to the first module project in a sub-project mode; editing the target source code of the second module in the code editor of the first module project; and compiling the source code of the first module and the target source code edited by the second module to obtain a compiling result.
It should be noted that, the functions of the functional units in the module development device 20 described in the embodiment of the present application may refer to the corresponding descriptions of the method embodiments shown in fig. 2A to fig. 3, and are not described again here.
In this application, 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 place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiments of the present application.
In addition, functional components in the embodiments of the present application may be integrated into one component, or each component may exist alone physically, or two or more components may be integrated into one component. The integrated components can be realized in a form of hardware or a form of software functional units.
The integrated components, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially or partially implemented in the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes several 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 described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
While the invention has been described with reference to specific embodiments, the scope of the invention is not limited thereto, and those skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the invention. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
It should be understood that, in the various embodiments of the present application, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application. While the present application has been described herein in conjunction with various embodiments, other variations to the disclosed embodiments may be understood and effected by those skilled in the art in practicing the present application as claimed herein.

Claims (10)

1. A method for module development, comprising:
determining a compiling mode of a first module project to a second module project, wherein the first module project comprises a source code of a first module, the second module project comprises a source code of a second module, and the first module has a dependency relationship with the second module;
if the compiling mode is a joint debugging mode, acquiring a target source code corresponding to the second module from a code management system;
dynamically adding the target source code to the first module project in a sub-project mode;
editing the target source code of the second module in the code editor of the first module project;
and compiling the source code of the first module and the target source code edited by the second module to obtain a compiling result.
2. The method of claim 1, wherein determining the compiling mode of the first modular project for the second modular project comprises:
determining a module name of the second module project that the first module project depends on;
determining target version information corresponding to the module name according to the module name and the mapping relation between the module name and the version information;
and determining a compiling mode of the first module project to the second module project according to the target version information.
3. The method of claim 2, wherein the first modular project and the second modular project both belong to a master project, and the determining the module name of the second modular project on which the first modular project depends comprises:
determining a configuration file in the main project, wherein the configuration file comprises a JS object numbered notation json array, the json array comprises a plurality of statement information, and the statement information comprises: the module name of the module project which is depended by the module project and the version information corresponding to the module name;
and determining the module name of a second module project which is depended by the first module project according to the declaration information in the configuration file.
4. The method according to claim 3, wherein the determining the target version information corresponding to the module name according to the module name and the mapping relationship between the module name and the version information comprises:
and determining target version information corresponding to the module name of the second module project in the declaration information of the configuration file.
5. The method of claim 1, further comprising:
if the compiling mode is an integration mode, acquiring a binary archive file corresponding to the second module project from a binary archive file management system;
and generating a target application program package file corresponding to the first module project according to the binary archive file.
6. A module development apparatus, comprising:
the system comprises a first determining unit, a second determining unit and a compiling unit, wherein the first determining unit is used for determining a compiling mode of a second module project corresponding to a first module project, the first module project comprises a source code of a first module, the second module project comprises a source code of a second module, and the first module has a dependency relationship with the second module;
a first obtaining unit, configured to obtain, if the compiling mode is a joint debugging mode, a target source code corresponding to the second module from a code management system;
a sub-engineering unit, configured to add the target source code to the first module engineering in a form of sub-engineering in a dynamic manner;
the editing unit is used for editing the target source code of the second module in the code editor of the first module project;
and the compiling unit is used for compiling the source code of the first module and the target source code edited by the second module to obtain a compiling result.
7. The apparatus according to claim 6, wherein the first determining unit is specifically configured to:
determining a module name of the second module project that the first module project depends on;
determining target version information corresponding to the module name according to the module name and a first mapping relation between the module name and the version information;
and determining a compiling mode of the first module project to the second module project according to the target version information.
8. The apparatus of claim 7, wherein the first modular project and the second modular project both belong to a main project; the first determining unit, when determining the module name of the second module project that the first module project depends on, is specifically configured to:
determining a configuration file in the main project, wherein the configuration file comprises a JS object numbered notation json array, the json array comprises a plurality of statement information, and the statement information comprises: the module name of the module project which is depended by the module project and the version information corresponding to the module name;
and determining the module name of a second module project which is depended by the first module project according to the declaration information in the configuration file.
9. The module development device is characterized by comprising a processing component, a storage component and a communication module component, wherein the processing component, the storage component and the communication component are connected with each other, the storage component is used for storing a computer program, and the communication component is used for carrying out information interaction with external equipment; the processing component is configured for invoking a computer program for performing the method according to any of claims 1-5.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which is executed by a processor to implement the method of any one of claims 1-5.
CN202010146458.3A 2020-03-04 2020-03-04 Module development method and device Active CN111399840B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010146458.3A CN111399840B (en) 2020-03-04 2020-03-04 Module development method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010146458.3A CN111399840B (en) 2020-03-04 2020-03-04 Module development method and device

Publications (2)

Publication Number Publication Date
CN111399840A true CN111399840A (en) 2020-07-10
CN111399840B CN111399840B (en) 2024-03-19

Family

ID=71436056

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010146458.3A Active CN111399840B (en) 2020-03-04 2020-03-04 Module development method and device

Country Status (1)

Country Link
CN (1) CN111399840B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112667384A (en) * 2020-12-31 2021-04-16 青岛海尔科技有限公司 Task flow scheduling method, device, storage medium and electronic device
CN112667520A (en) * 2021-01-18 2021-04-16 中国民航信息网络股份有限公司 Method and system for processing dependency package
CN112965721A (en) * 2021-02-26 2021-06-15 平安壹钱包电子商务有限公司 Android-based project compiling method and device, computer equipment and storage medium
CN113076146A (en) * 2021-03-09 2021-07-06 北京一亩田新农网络科技有限公司 Dynamic APK loading method, device, system and medium
WO2023213263A1 (en) * 2022-05-05 2023-11-09 阿里云计算有限公司 Program compiling method, program starting method, and device and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103853589A (en) * 2014-02-26 2014-06-11 上海爱数软件有限公司 Cross-platform system compiling and building method
KR101747424B1 (en) * 2016-02-04 2017-06-27 주식회사 제이티엘소프트 Apparatus and method for integrating design and implementation in object-oriented programming
CN107133036A (en) * 2017-04-26 2017-09-05 武汉斗鱼网络科技有限公司 The management method and device of a kind of module
CN107908403A (en) * 2017-11-10 2018-04-13 北京搜狐新动力信息技术有限公司 A kind of collocation method and system of the modularization of mobile terminal business module
CN109783081A (en) * 2018-12-27 2019-05-21 百富计算机技术(深圳)有限公司 A kind of development approach of application program, device and Integrated Development Tool
CN110096280A (en) * 2019-03-18 2019-08-06 中国平安人寿保险股份有限公司 Creation method, device, computer installation and the storage medium of code engineering
CN110377290A (en) * 2019-07-22 2019-10-25 阿里巴巴集团控股有限公司 A kind of method, device and equipment of purpose project compiling
US20190370010A1 (en) * 2018-05-31 2019-12-05 Bank Of America Corporation Integrated mainframe distributed orchestration tool
CN110795102A (en) * 2019-09-27 2020-02-14 上海掌门科技有限公司 Module compiling method, device, electronic equipment and computer readable medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103853589A (en) * 2014-02-26 2014-06-11 上海爱数软件有限公司 Cross-platform system compiling and building method
KR101747424B1 (en) * 2016-02-04 2017-06-27 주식회사 제이티엘소프트 Apparatus and method for integrating design and implementation in object-oriented programming
CN107133036A (en) * 2017-04-26 2017-09-05 武汉斗鱼网络科技有限公司 The management method and device of a kind of module
CN107908403A (en) * 2017-11-10 2018-04-13 北京搜狐新动力信息技术有限公司 A kind of collocation method and system of the modularization of mobile terminal business module
US20190370010A1 (en) * 2018-05-31 2019-12-05 Bank Of America Corporation Integrated mainframe distributed orchestration tool
CN109783081A (en) * 2018-12-27 2019-05-21 百富计算机技术(深圳)有限公司 A kind of development approach of application program, device and Integrated Development Tool
CN110096280A (en) * 2019-03-18 2019-08-06 中国平安人寿保险股份有限公司 Creation method, device, computer installation and the storage medium of code engineering
CN110377290A (en) * 2019-07-22 2019-10-25 阿里巴巴集团控股有限公司 A kind of method, device and equipment of purpose project compiling
CN110795102A (en) * 2019-09-27 2020-02-14 上海掌门科技有限公司 Module compiling method, device, electronic equipment and computer readable medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
向培素 等: "JBOSS编译子系统分析及其应用", 西南民族大学学报(自然科学版), no. 05, 30 October 2004 (2004-10-30), pages 90 - 94 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112667384A (en) * 2020-12-31 2021-04-16 青岛海尔科技有限公司 Task flow scheduling method, device, storage medium and electronic device
CN112667520A (en) * 2021-01-18 2021-04-16 中国民航信息网络股份有限公司 Method and system for processing dependency package
CN112965721A (en) * 2021-02-26 2021-06-15 平安壹钱包电子商务有限公司 Android-based project compiling method and device, computer equipment and storage medium
CN113076146A (en) * 2021-03-09 2021-07-06 北京一亩田新农网络科技有限公司 Dynamic APK loading method, device, system and medium
WO2023213263A1 (en) * 2022-05-05 2023-11-09 阿里云计算有限公司 Program compiling method, program starting method, and device and storage medium

Also Published As

Publication number Publication date
CN111399840B (en) 2024-03-19

Similar Documents

Publication Publication Date Title
CN111399840A (en) Module development method and device
EP3605324A1 (en) Application development method and tool, device, and storage medium thereof
CN108829378B (en) Application software development method and device and electronic equipment
WO2017185606A1 (en) Overlay mechanism-based apk development method and system
CN107832059B (en) Code static analysis method and device based on Makefile
CN110007926B (en) Language conversion method and device
CN111068328A (en) Game advertisement configuration table generation method, terminal device and medium
CN113805882A (en) Method and device for developing application program, electronic equipment and storage medium
CN111176629A (en) Application development method and device
CN113986402A (en) Function calling method and device, electronic equipment and storage medium
CN113778897A (en) Automatic test method, device, equipment and storage medium of interface
CN110806891B (en) Method and device for generating software version of embedded device
CN112235132A (en) Method, device, medium and server for dynamically configuring service
CN112486492A (en) Page generation method and device, storage medium and electronic equipment
CN107092472A (en) A kind of dynamic publishing method and equipment
CN111488286A (en) Method and device for independently developing Android module
CN114816475A (en) Method, device, equipment and medium for updating embedded operating system
CN111367512B (en) Method and device for creating Android library module dependency relationship in application development
CN114201174A (en) Construction method and device of hybrid mobile application, electronic equipment and storage medium
CN112612474A (en) Product transplanting method and device, storage medium and electronic equipment
CN112882698A (en) Development environment generation method and device, computer storage medium and electronic device
CN114115855A (en) Code multiplexing method and device, computer readable storage medium and electronic equipment
CN106775608A (en) The implementation method and device of autonomous system process
CN111026466A (en) File processing method and device, computer readable storage medium and electronic equipment
CN113590166B (en) Application program updating method and device and computer readable 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
GR01 Patent grant
GR01 Patent grant