CN110795102B - Module compiling method, device, electronic equipment and computer readable medium - Google Patents

Module compiling method, device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN110795102B
CN110795102B CN201910926859.8A CN201910926859A CN110795102B CN 110795102 B CN110795102 B CN 110795102B CN 201910926859 A CN201910926859 A CN 201910926859A CN 110795102 B CN110795102 B CN 110795102B
Authority
CN
China
Prior art keywords
target
module
operation mode
configuration file
node object
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.)
Active
Application number
CN201910926859.8A
Other languages
Chinese (zh)
Other versions
CN110795102A (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.)
Shanghai Zhangmen Science and Technology Co Ltd
Original Assignee
Shanghai Zhangmen Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Zhangmen Science and Technology Co Ltd filed Critical Shanghai Zhangmen Science and Technology Co Ltd
Priority to CN201910926859.8A priority Critical patent/CN110795102B/en
Publication of CN110795102A publication Critical patent/CN110795102A/en
Application granted granted Critical
Publication of CN110795102B publication Critical patent/CN110795102B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application discloses a module compiling method, a module compiling device, electronic equipment and a computer readable medium. An embodiment of the method comprises: taking a current module to be compiled in the target engineering as a target module, and determining an operation mode of the target module; acquiring a configuration file of the target module in an independent operation mode; when the operation mode is an integrated operation mode, deleting target content in the configuration file to obtain a target configuration file of the target module in the integrated operation mode, wherein the target content comprises an entry node object for providing a user interaction interface; and compiling the target module by utilizing the target configuration file. The embodiment improves the generation efficiency of the configuration file in the integrated operation mode and reduces the risk of compiling errors.

Description

Module compiling method, device, electronic equipment and computer readable medium
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a module compiling method, a module compiling device, electronic equipment and a computer readable medium.
Background
The componentized development refers to a development mode of splitting one Application (APP) or engineering with complete functions into a plurality of modules. Each module can be compiled and run independently, or can be combined with any other module into a new application or project. Compared with the traditional development mode, the modularized development does not need to compile the whole project after each code modification, so that the development difficulty is reduced.
In the existing manner, two configuration files (such as android management file) are generally required to be set for a certain module, and the configuration files are used in an independent operation mode and an integrated operation mode respectively. In the development process, the modification condition of the configuration file in the independent operation mode is required to be manually synchronized into the configuration file in the integrated operation mode. However, the manual synchronization method is easy to miss, for example, when invisible component information such as a Receiver (broadcast Receiver) and a Service (Service) in Android (Android) language is missed, the component information can not be found in a regression test, and thus risks are brought to engineering.
Disclosure of Invention
The embodiment of the application provides a module compiling method, a device, electronic equipment and a computer readable medium, which are used for improving the generating efficiency of a configuration file in an integrated operation mode and reducing the risk of compiling errors.
In a first aspect, an embodiment of the present application provides a module compiling method, including: taking a current module to be compiled in the target engineering as a target module, and determining an operation mode of the target module; acquiring a configuration file of the target module in an independent operation mode; when the operation mode is an integrated operation mode, deleting target content in the configuration file to obtain a target configuration file of the target module in the integrated operation mode, wherein the target content comprises an entry node object for providing a user interaction interface; and compiling the target module by utilizing the target configuration file.
In a second aspect, an embodiment of the present application provides a module compiling apparatus, including: the determining unit is configured to take a current module to be compiled in the target engineering as a target module, and determine an operation mode of the target module; the acquisition unit is configured to acquire a configuration file of the target module in an independent operation mode; the deleting unit is configured to delete target content in the configuration file when the operation mode is an integrated operation mode to obtain a target configuration file of the target module in the integrated operation mode, wherein the target content comprises an entry node object for providing a user interaction interface; and the first compiling unit is configured to compile the target module by using the target configuration file.
In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors; and a storage device having one or more programs stored thereon, which when executed by the one or more processors, cause the one or more processors to implement the method as described in the first aspect above.
In a fourth aspect, embodiments of the present application provide a computer readable medium having stored thereon a computer program which, when executed by a processor, implements a method as described in the first aspect above.
The embodiment of the application provides a module compiling method, a device, electronic equipment and a computer readable medium, which are used for determining the running mode of a target module to be compiled currently in a target project; then acquiring a configuration file of the target module in an independent operation mode, and deleting target content in the configuration file when the operation mode is an integrated operation mode, so as to obtain a target configuration file of the target module in the integrated operation mode, wherein the target content comprises an entry node object for providing a user interaction interface; and finally compiling the target module by utilizing the target configuration file. On the one hand, the developer is not required to manually synchronize the change condition of the configuration file in the independent operation mode to the configuration file in the integrated operation mode, the operation is simple, and the generation efficiency of the configuration file in the integrated operation mode can be improved. On the other hand, the configuration file in the integrated operation mode is obtained by deleting the configuration file in the independent operation mode, so that the condition that information such as invisible components is omitted due to manual copying is avoided, and the risk of compiling errors is reduced.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the detailed description of non-limiting embodiments, made with reference to the accompanying drawings in which:
FIG. 1 is a flow chart of one embodiment of a module compilation method in accordance with the present application;
FIG. 2 is a flow chart of yet another embodiment of a module compilation method in accordance with the present application;
FIG. 3 is a schematic illustration of the structure of a high coupling engineering according to the present application;
FIG. 4 is a schematic diagram of a module compiler apparatus according to an embodiment of the present application;
fig. 5 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the application.
Detailed Description
The application is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be noted that, for convenience of description, only the portions related to the present application are shown in the drawings.
It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other. The application will be described in detail below with reference to the drawings in connection with embodiments.
Referring to FIG. 1, a flow 100 of one embodiment of a module compilation method in accordance with the present application is shown. The module compiling method can be operated in various electronic devices capable of program development. The electronic device may include, but is not limited to: servers, tablet computers, laptop portable computers, desktop computers, and the like.
The module compiling method in the embodiment can be applied to a componentized development scene. The componentized development refers to a development mode of splitting one application or engineering with complete functions into a plurality of modules. Each module can be compiled and run independently, or can be combined with any other module into a new application or project. Thus, the modules in the componentized development scene can have two operation modes, namely an integrated operation mode and an independent operation mode.
For a module, when the module is in the integrated mode of operation, the module may be relied upon by other modules (e.g., a master module, other business modules, etc.), at which point the module may be considered a library module. When the module is in the independent operation mode, the module can be used as an independent Application (APP) and can be independently developed and debugged.
The flow of the module compiling method in the embodiment comprises the following steps:
and step 101, taking a current module to be compiled in the target engineering as a target module, and determining an operation mode of the target module.
In this embodiment, the execution body of the module compiling method (such as the electronic device for program development described above) may build the target project in advance through a pre-installed integrated development tool (such as an Android Studio). The target engineering can be established and developed through a modularized development mode. The target project may include a plurality of modules, such as a master module, a business module, and the like. The modules may be independent of each other or coupled.
In this embodiment, the execution body may first determine a module to be compiled currently in the target project. For example, the execution body may receive a compilation instruction triggered by a developer, so that the module indicated by the compilation designation is used as a module to be compiled currently.
And then, the execution main body can take the current module to be compiled in the target engineering as a target module, and determine the running mode of the target module. Here, the operation modes of the modules in the componentized development scenario may include an integrated operation mode and an independent operation mode. The technician can set the operation mode of each module in advance. Thus, the execution body can determine the operation mode of the target module by reading the setting result of the operation mode.
In the process of using the integrated development tool (such as Android Studio) to perform component development, each module is usually developed independently first. And after the independent development is finished, performing integrated compiling. Thus, for each module, a configuration file (e.g., an android management file) in the independent operation mode is generally set. In practice, the configuration file may be used to declare rights required by the component and content of the component (such as Application, activity, service, broadcast, etc.). In view of this, if the operation mode of the target module is the independent operation mode, the configuration file of the target module in the independent operation mode may be read, and the target module may be directly compiled by using the configuration file.
It should be further noted that, in general, in the process of performing component development by using the integrated development tool (such as Android Studio), when the operation modes of the same module are different, the configuration files (such as Android management. The configuration file for the independent operation mode generally includes an entry node object (e.g., an Activity node object) for providing a user interaction interface. When the project is in the integrated mode, the configuration files of the modules in the integrated operation mode need to be combined. At this time, if each module is configured with an entry of the user interaction interface, a conflict of configuration files may be caused, resulting in a compiling failure. Thus, if the target component is in the integrated operation mode, a configuration file for the integrated operation mode needs to be formulated to compile the target component. At this time, see steps 102-104 below.
Step 102, obtaining a configuration file of the target module in an independent operation mode.
In this embodiment, the execution body may first obtain a configuration file (such as an android management file) of the target module in the independent operation mode.
And step 103, deleting target content in the configuration file when the operation mode is the integrated operation mode, and obtaining a target configuration file of the target module in the integrated operation mode.
In this embodiment, when the operation mode is the integrated operation mode, the execution body may delete the target content in the configuration file, and use the configuration file after deleting the target content as the target configuration file of the target module in the integrated operation mode. The target content may include an entry node object (e.g., activity) for providing a user interaction interface.
It should be noted that, the above target content may include, in addition to the entry node object for providing the user interaction interface, other configuration information to be deleted according to needs, which is not limited herein.
In some optional implementations of this embodiment, the executing entity may delete the target content in the configuration file by:
and firstly, reversely serializing the character strings in the configuration file in sequence to generate a node object sequence. Wherein, the inverse Serialization is the inverse of Serialization (Serialization). Serialization is the process of converting state information of an object into a form that can be stored or transmitted. Deserialization is the process of creating objects based on byte streams. Thus, by de-serializing the strings in the configuration file, a plurality of node objects, such as XML (Extensible Markup Language ) node objects, may be obtained. Further, the sequentially generated node objects may be combined into a node object sequence.
And a second step of deleting an entry node object (i.e. Activity node object) for providing a user interaction interface from the node object sequence. In practice, activity is a component that may contain a user interface, primarily for interacting with a user. When the target application is in the integrated operation mode, the target application is used as a library module, and an entry of a user interaction interface is not required to be configured. The Activity node object may be deleted.
Alternatively, the following steps may be employed to delete the ingress node object: first, each node object in the node object sequence is sequentially set as a target node object, and if the attribute information of the target node object includes a target sentence, the target node object is determined as an entry node object. Then, each entry node object in the node object sequence is deleted. The target sentence is used for indicating to start the user interaction interface. In practice, the target statement may include "android.intent.action.MAIN" and "android.intent.category.LAUNCHER". Wherein, "android.intent.action.main" characterizes the portal activity of the user interface; "android.intent.category.LAUNCHER" means that activity should be listed in the user interface launcher of the system.
And thirdly, serializing the node object sequence after deleting the entry node object. Thereby, a configuration file can be obtained in which the entry node object for providing the user interaction interface is deleted. The obtained configuration file can be directly used when the target object is in the integrated operation mode.
And fourthly, recording the character strings obtained after serialization to a target configuration file. Here, the execution subject may first create a target configuration file (e.g., an android management file) of the target module in the integrated operation mode, where the file may be a blank file. And then, the character strings obtained after serialization can be recorded into a target configuration file.
And 104, compiling the target module by utilizing the target configuration file.
In this embodiment, the execution body may compile the target module using the target configuration file. Therefore, the configuration file applied to the integrated operation mode can be generated by deleting the target content in the configuration file in the independent operation mode, and a developer is not required to manually synchronize the change condition of the configuration file in the independent operation mode to the configuration file in the integrated operation mode.
The method provided by the embodiment of the application comprises the steps of determining the running mode of the current target module to be compiled in the target engineering; then acquiring a configuration file of the target module in an independent operation mode; then deleting target content in the configuration file when the operation mode is an integrated operation mode, so as to obtain a target configuration file of the target module in the integrated operation mode, wherein the target content comprises an entry node object for providing a user interaction interface; and finally compiling the target module by utilizing the target configuration file. On the one hand, the developer is not required to manually synchronize the change condition of the configuration file in the independent operation mode to the configuration file in the integrated operation mode, the operation is simple, and the generation efficiency of the configuration file in the integrated operation mode can be improved. On the other hand, the configuration file in the integrated operation mode is obtained by deleting the configuration file in the independent operation mode, so that the condition that information such as invisible components (such as Receiver, service) and the like is omitted due to manual copying is avoided, and the risk of compiling errors is reduced.
With further reference to FIG. 2, a flow 200 of yet another embodiment of a module compilation method is shown. The flow 200 of the module compiling method comprises the following steps:
step 201, taking a current module to be compiled in the target project as a target module, and reading a value of a preset variable from a target file of a root directory of the target project.
In this embodiment, the execution body of the module compiling method may build the target project in advance through a pre-installed integrated development tool (such as an Android Studio). The target engineering can be developed and debugged in a componentized development mode. The target project may include a plurality of modules.
In practice, when any project is created by using the integrated development tool (Android Studio), a file (gradle. Properties file) can be generated in the root directory of the project. The file may be used to configure engineering data (e.g., variables, etc.). This file supports the module file (build. Gradle) of any one module in the project the file) reads the variable set in this file (gradle.
Thus, in this embodiment, a gradle property file in the root directory of the target project may be used as a target file, a variable (may be referred to as a preset variable) may be preset in the file in advance, and a module in the independent operation mode may be specified by setting the value of the preset variable. Therefore, when the target module to be compiled currently in the target engineering needs to be compiled, the value of the preset variable is read from the target file of the root directory of the target engineering, and the running state of the target module is judged through the value.
Step 202, determining an operation mode of the target module based on the matching condition of the module name of the target module and the value of the preset variable.
In this embodiment, since the preset variable may be used to indicate a module in an independent operation mode, the execution body may match a module name of a target module to be compiled currently in a target project with a value of the preset variable, and determine an operation mode of the target module based on a matching result.
In some optional implementations of this embodiment, the value of the preset variable may be a preset name of the module in the independent operation mode. At this time, the execution body may determine whether the module name of the target module is the same as the preset name. If the operation modes are the same, the operation mode of the target module can be determined to be an independent operation mode. If the operation modes are different, the operation mode of the target module can be determined to be an integrated operation mode.
In some alternative implementations of the present embodiment, the values of the preset variables may be in the form of groups. The array includes the names of at least one module in the independent operation mode. At this time, the execution body may determine whether the array includes the module name of the target module. If so, the operation mode of the target module can be determined to be an independent operation mode. If not, the operation mode of the target module can be determined to be an integrated operation mode.
In the prior art, a variable (such as may be defined as an isModule) for controlling the compiling condition is usually set, and when the variable is set as true, each module in the target engineering is in an independent running mode; when the variable is set to false (no), each module in the target project is in the integrated operation mode. However, this approach is only applicable to the case of code-free coupling between modules of the engineering. When there is a code coupling between the modules, for example, a certain module a needs to rely on a resource module B when in an independent operation mode, and at this time, the resource module B needs to be in an integrated operation mode to be invoked by the module a. In the prior art, different modules cannot be controlled to be in different operation modes, so that when code coupling exists between the modules, the situation that compiling cannot be performed may occur.
According to the embodiment of the application, the modules in the independent operation mode are controlled by setting the values of the preset variables, so that part of the modules in the target engineering can be controlled to be in the independent operation mode, and the other modules are controlled to be in the integrated operation mode. The control mode of the module operation mode can flexibly set the operation mode of each module in the engineering. In the case of high coupling of codes between modules, compiling of the required modules can be flexibly performed.
As an example, as shown in fig. 3. Fig. 3 shows a schematic diagram of the structure of a high coupling engineering. The main engineering relies on modules a, B, C, D and E. Wherein, the module A and the module B do not depend on other modules when running. Both modules C and D rely on module B at run-time. Module E relies on module a and module C at run-time.
At this time, if the module D needs to operate independently, the module B needs to be made as a library module, and thus the module B needs to be in an integrated operation state. At this time, the value of the preset variable may be set as the name of the module D, so that the module D is in the independent operation mode. Since the value of the preset variable is not module B, module B is in an integrated operating state by default.
In addition, if the modules D and E need to be independently operated at the same time, the values of the preset variables may be set in an array form, where the array includes the names of the modules D and E at the same time, so that the modules D and E are in an independent operation mode. Meanwhile, the names of the modules A, B and C are not set in the array, so that the modules A, B and C can be used as library modules and are in an integrated running state. At this time, the module B may be relied upon by the module D, and the modules a and C may be relied upon by the module E.
It should be noted that, when a certain module (e.g., module C) is relied upon by another module (e.g., module E) and the module (E) operates independently, another module (e.g., module B) is relied upon, the module (e.g., module C) and the another module (e.g., module E) cannot operate independently at the same time.
Step 203, obtain the configuration file of the target module in the independent operation mode.
In this embodiment, the execution body may obtain a configuration file (e.g., an android management file) of the target module in the independent operation mode.
It should be noted that, when the operation mode is the independent operation mode, the direct main body may directly use the configuration file of the target module in the independent operation mode to compile the target module. When the operational mode is an integrated operational mode, the operations of steps 204-208 may be directly as follows.
And 204, when the operation mode is the integrated operation mode, the character strings in the configuration file are reversely sequenced in sequence to generate a node object sequence.
In this embodiment, when the operation mode is the integrated operation mode, the execution body may sequentially deserialize the character strings in the obtained configuration file, and generate the node object sequence. Wherein, the inverse Serialization is the inverse of Serialization (Serialization). Serialization is the process of converting state information of an object into a form that can be stored or transmitted. Deserialization is the process of creating objects based on byte streams. Thus, by de-serializing the strings in the configuration file, a plurality of node objects, such as XML (Extensible Markup Language ) node objects, may be obtained. Further, the sequentially generated node objects may be combined into a node object sequence.
Step 205, deleting an entry node object for providing a user interaction interface from the node object sequence.
In this embodiment, the execution body may delete an entry node object (i.e., an Activity node object) for providing a user interaction interface from the node object sequence. In practice, activity is a component that may contain a user interface, primarily for interacting with a user. When the target application is in the integrated operation mode, the target application is used as a library module, and an entry of a user interaction interface is not required to be configured. The Activity node object may be deleted.
In practice, the following steps may be taken to delete the ingress node object: first, each node object in the node object sequence is sequentially set as a target node object, and if the attribute information of the target node object includes a target sentence, the target node object is determined as an entry node object. Then, each entry node object in the node object sequence is deleted. The target sentence is used for indicating to start the user interaction interface. In practice, the target statement may include "android.intent.action.MAIN" and "android.intent.category.LAUNCHER". Wherein, "android.intent.action.main" characterizes the portal activity of the user interface; "android.intent.category.LAUNCHER" means that activity should be listed in the user interface launcher of the system.
Step 206, serializing the node object sequence after deleting the entry node object.
In this embodiment, the execution body may sequence the node object sequence from which the entry node object is deleted. Thereby, a configuration file can be obtained in which the entry node object for providing the user interaction interface is deleted. The obtained configuration file can be directly used when the target object is in the integrated operation mode.
Step 207, recording the character string obtained after serialization to the target configuration file.
In this embodiment, the execution body may first create a target configuration file (e.g., an android management file) of the target module in the integrated operation mode, where the file may be an empty file; then, the character string obtained after serialization may be recorded into the above-mentioned target profile.
And step 208, compiling the target module by using the target configuration file.
In this embodiment, the execution body may compile the target module using the target configuration file. Thus, the configuration file applied to the integrated operation mode may be generated by deleting the target content in the configuration file in the independent operation mode. On the one hand, the developer is not required to manually synchronize the change condition of the configuration file in the independent operation mode to the configuration file in the integrated operation mode, the operation is simple, and the generation efficiency of the configuration file can be improved. On the other hand, the condition that information such as invisible components (such as Receiver, service) and the like is omitted due to manual copying is avoided, and engineering risks are reduced.
As can be seen from fig. 2, compared with the embodiment corresponding to fig. 1, the module compiling method in this embodiment controls the modules in the independent operation mode by setting the values of the preset variables, so that part of the modules in the target engineering can be controlled to be in the independent operation mode, and meanwhile, the rest of the modules are controlled to be in the integrated operation mode. The control mode of the module operation mode can flexibly set the operation mode of each module in the engineering. In the case of high coupling of codes between modules, compiling of the required modules can be flexibly performed.
With further reference to fig. 4, as an implementation of the method shown in the foregoing figures, the present application provides an embodiment of a module compiling apparatus, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 1, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 4, the module compiling apparatus 400 according to the embodiment includes: a determining unit 401, configured to determine an operation mode of a target module by using a current module to be compiled in the target project as the target module; an obtaining unit 402, configured to obtain a configuration file of the target module in the independent operation mode if the operation mode is an integrated operation mode; a deleting unit 403 configured to delete target content in the configuration file, to obtain a target configuration file of the target module in the integrated operation mode, where the target content includes an entry node object for providing a user interaction interface; a first compiling unit 404 configured to compile the target module using the target configuration file
In some optional implementations of this embodiment, the determining unit 401 is further configured to: reading the value of a preset variable from a target file of a root directory of the target project; and determining the operation mode of the target module based on the matching condition of the module name of the target module and the value of the preset variable.
In some optional implementations of this embodiment, the value of the preset variable is a preset name of the module in the independent operation mode; and the above-mentioned determination unit 401, further configured to: determining whether the module name of the target module is the same as the preset name; if the operation modes are the same, determining that the operation mode of the target module is an independent operation mode; if the operation modes are different, determining that the operation mode of the target module is an integrated operation mode.
In some optional implementations of this embodiment, the value of the preset variable is an array, where the array includes a name of at least one module in an independent operation mode; and the above-mentioned determination unit 401, further configured to: determining whether the array contains the module name of the target module; if the target module is included, determining the operation mode of the target module to be an independent operation mode; and if the operation mode of the target module is not included, determining that the operation mode of the target module is an integrated operation mode.
In some optional implementations of this embodiment, the deleting unit 403 is further configured to: the character strings in the configuration file are reversely sequenced in sequence to generate a node object sequence; deleting an entry node object for providing a user interaction interface from the node object sequence; serializing the node object sequence after deleting the entry node object; and recording the character strings obtained after serialization to a target configuration file.
In some optional implementations of this embodiment, the deleting unit 403 is further configured to: taking each node object in the node object sequence as a target node object in turn, and determining the target node object as an entry node object if the attribute information of the target node object contains a target statement for indicating to start a user interaction interface; and deleting each entry node object in the node object sequence.
In some optional implementations of this embodiment, the apparatus further includes: and the second compiling unit is configured to acquire the configuration file of the target module in the independent operation mode if the operation mode is the independent operation mode, and compile the target module by using the configuration file.
The device provided by the embodiment of the application determines the running mode of the current target module to be compiled in the target engineering; then acquiring a configuration file of the target module in an independent operation mode; then deleting target content in the configuration file when the operation mode is an integrated operation mode, so as to obtain a target configuration file of the target module in the integrated operation mode, wherein the target content comprises an entry node object for providing a user interaction interface; and finally compiling the target module by utilizing the target configuration file. On the one hand, the developer is not required to manually synchronize the change condition of the configuration file in the independent operation mode to the configuration file in the integrated operation mode, the operation is simple, and the generation efficiency of the configuration file in the integrated operation mode can be improved. On the other hand, the configuration file in the integrated operation mode is obtained by deleting the configuration file in the independent operation mode, so that the condition that information such as invisible components is omitted due to manual copying is avoided, and the risk of compiling errors is reduced.
Referring now to FIG. 5, there is illustrated a schematic diagram of a computer system 500 suitable for use in implementing an electronic device of an embodiment of the present application. The electronic device shown in fig. 5 is only an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present application.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU501, ROM 502, and RAM 503 are connected to each other through a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input section 506 including a keyboard, a mouse, and the like; an output portion 507 including a Liquid Crystal Display (LCD) or the like, a speaker or the like; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The drive 510 is also connected to the I/O interface 505 as needed. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as needed so that a computer program read therefrom is mounted into the storage section 508 as needed.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 509, and/or installed from the removable media 511. The above-described functions defined in the method of the present application are performed when the computer program is executed by a Central Processing Unit (CPU) 501. The computer readable medium according to the present application may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present application, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present application may be implemented in software or in hardware. The described units may also be provided in a processor, wherein the names of the units do not in some cases constitute a limitation of the unit itself.
As another aspect, the present application also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to: taking a current module to be compiled in the target engineering as a target module, and determining an operation mode of the target module; acquiring a configuration file of the target module in an independent operation mode; when the operation mode is an integrated operation mode, deleting target content in the configuration file to obtain a target configuration file of the target module in the integrated operation mode, wherein the target content comprises an entry node object for providing a user interaction interface; and compiling the target module by utilizing the target configuration file.
The above description is only illustrative of the preferred embodiments of the present application and of the principles of the technology employed. It will be appreciated by persons skilled in the art that the scope of the application referred to in the present application is not limited to the specific combinations of the technical features described above, but also covers other technical features formed by any combination of the technical features described above or their equivalents without departing from the inventive concept described above. Such as the above-mentioned features and the technical features disclosed in the present application (but not limited to) having similar functions are replaced with each other.

Claims (8)

1. A method of compiling a module, comprising:
taking a current module to be compiled in a target project as a target module, and determining an operation mode of the target module;
acquiring a configuration file of the target module in an independent operation mode;
when the operation mode is an integrated operation mode, deleting target content in the configuration file to obtain a target configuration file of the target module in the integrated operation mode, wherein the method comprises the following steps: sequentially carrying out reverse serialization on the character strings in the configuration file to generate a node object sequence, deleting an entry node object for providing a user interaction interface from the node object sequence, serializing the node object sequence after deleting the entry node object, and recording the character strings obtained after serialization to a target configuration file, wherein the target content comprises the entry node object for providing the user interaction interface;
and compiling the target module by utilizing the target configuration file.
2. The method of claim 1, wherein the determining the operating mode of the target module comprises:
reading the value of a preset variable from a target file of a root directory of the target project;
and determining the running mode of the target module based on the matching condition of the module name of the target module and the value of the preset variable.
3. The method according to claim 2, characterized in that the value of the preset variable is a preset name of the module in the independent operation mode; and
the determining the operation mode of the target module based on the matching condition of the module name of the target module and the value of the preset variable includes:
determining whether the module name of the target module is the same as the preset name;
if the operation modes are the same, determining that the operation mode of the target module is an independent operation mode;
and if the operation modes are different, determining that the operation mode of the target module is an integrated operation mode.
4. The method according to claim 2, wherein the value of the preset variable is an array, and the array includes a name of at least one module in an independent operation mode; and
the determining the operation mode of the target module based on the matching condition of the module name of the target module and the value of the preset variable includes:
determining whether the array contains the module name of the target module;
if so, determining the operation mode of the target module as an independent operation mode;
and if the operation mode of the target module is not included, determining that the operation mode of the target module is an integrated operation mode.
5. The method according to claim 1, wherein deleting the entry node object for providing the user interaction interface in the target module from the sequence of node objects comprises:
taking each node object in the node object sequence as a target node object in turn, and if attribute information of the target node object contains a target statement for indicating to start a user interaction interface, determining the target node object as an entry node object;
and deleting each entry node object in the node object sequence.
6. The method of claim 1, wherein after the obtaining the configuration file of the target module in the standalone operation mode, the method further comprises:
and when the operation mode is an independent operation mode, compiling the target module by utilizing the configuration file of the target module in the independent operation mode.
7. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-6.
8. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-6.
CN201910926859.8A 2019-09-27 2019-09-27 Module compiling method, device, electronic equipment and computer readable medium Active CN110795102B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910926859.8A CN110795102B (en) 2019-09-27 2019-09-27 Module compiling method, device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910926859.8A CN110795102B (en) 2019-09-27 2019-09-27 Module compiling method, device, electronic equipment and computer readable medium

Publications (2)

Publication Number Publication Date
CN110795102A CN110795102A (en) 2020-02-14
CN110795102B true CN110795102B (en) 2023-08-29

Family

ID=69439945

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910926859.8A Active CN110795102B (en) 2019-09-27 2019-09-27 Module compiling method, device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN110795102B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111399840B (en) * 2020-03-04 2024-03-19 腾讯音乐娱乐科技(深圳)有限公司 Module development method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102722370A (en) * 2012-05-24 2012-10-10 南京华设科技股份有限公司 Modular development method for Android
CN107885501A (en) * 2017-11-03 2018-04-06 武汉斗鱼网络科技有限公司 Obtain the method and device of the mutual adduction relationship of component in Android
CN107908407A (en) * 2017-12-11 2018-04-13 北京奇虎科技有限公司 Compilation Method, device and terminal device
CN107908403A (en) * 2017-11-10 2018-04-13 北京搜狐新动力信息技术有限公司 A kind of collocation method and system of the modularization of mobile terminal business module
CN109491727A (en) * 2018-10-16 2019-03-19 深圳壹账通智能科技有限公司 Object serialization method, terminal device and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102722370A (en) * 2012-05-24 2012-10-10 南京华设科技股份有限公司 Modular development method for Android
CN107885501A (en) * 2017-11-03 2018-04-06 武汉斗鱼网络科技有限公司 Obtain the method and device of the mutual adduction relationship of component in Android
CN107908403A (en) * 2017-11-10 2018-04-13 北京搜狐新动力信息技术有限公司 A kind of collocation method and system of the modularization of mobile terminal business module
CN107908407A (en) * 2017-12-11 2018-04-13 北京奇虎科技有限公司 Compilation Method, device and terminal device
CN109491727A (en) * 2018-10-16 2019-03-19 深圳壹账通智能科技有限公司 Object serialization method, terminal device and computer readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Android架构设计之插件化、组件化;星辰之力;《博客园(https://www.cnblogs.com/zhujiabin/p/10118029.html)》;第1-32页 *

Also Published As

Publication number Publication date
CN110795102A (en) 2020-02-14

Similar Documents

Publication Publication Date Title
US10503634B1 (en) Semantic comparison of computer compiler traces
CN110457045B (en) Component combining and compiling method, device, equipment and storage medium
US9244709B2 (en) Automatic recognition of web application
US8997067B2 (en) Unified software build system
US7526753B2 (en) System and method for creating, managing and using code segments
US9086885B2 (en) Reducing merge conflicts in a development environment
JP7324831B2 (en) DEPLOYMENT METHOD, DEPLOYMENT DEVICE AND ELECTRONIC DEVICE OF OPERATORS IN DEEP LEARNING FRAMEWORK
CN112104709B (en) Intelligent contract processing method, device, medium and electronic equipment
US20120174061A1 (en) Code suggestion in a software development tool
CN111740948B (en) Data packet issuing method, dynamic updating method, device, equipment and medium
US20100162225A1 (en) Cross-product refactoring apparatus and method
US20030009747A1 (en) Apparatus and method for porting applications to different platforms
US8997085B2 (en) Image delta-based upgrade of complex stack in software appliance
CN109976793B (en) Application program running method, device, equipment and medium
CN110990023A (en) aar file dependency uploading method and device, storage medium and electronic equipment
US10248409B1 (en) Limiting the effects of source code patches on corresponding native-code patches
CN113377342B (en) Project construction method and device, electronic equipment and storage medium
CN110795102B (en) Module compiling method, device, electronic equipment and computer readable medium
CN111858359B (en) Method and device for acquiring engineering code position of executable file
CN111984300B (en) Code copying method and device, electronic equipment and computer readable storage medium
CN110083351B (en) Method and device for generating code
US9075679B1 (en) Creating a prerequisite checklist corresponding to a software application
US10409573B1 (en) Batch script decomposer
CN115167822A (en) Branch code merging method, device, equipment and storage medium
CN115080113A (en) Item code detection method and device, readable storage medium and electronic equipment

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