CN107193622B - Code compiling processing method and device and terminal - Google Patents

Code compiling processing method and device and terminal Download PDF

Info

Publication number
CN107193622B
CN107193622B CN201710342999.1A CN201710342999A CN107193622B CN 107193622 B CN107193622 B CN 107193622B CN 201710342999 A CN201710342999 A CN 201710342999A CN 107193622 B CN107193622 B CN 107193622B
Authority
CN
China
Prior art keywords
code
file
subfile
code file
name list
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
CN201710342999.1A
Other languages
Chinese (zh)
Other versions
CN107193622A (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.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software 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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201710342999.1A priority Critical patent/CN107193622B/en
Publication of CN107193622A publication Critical patent/CN107193622A/en
Application granted granted Critical
Publication of CN107193622B publication Critical patent/CN107193622B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/43Checking; Contextual analysis
    • G06F8/433Dependency analysis; Data or control flow analysis

Abstract

The disclosure relates to a processing method, a device and a terminal for code compilation, wherein the method comprises the following steps: acquiring code files of development users, wherein one code file comprises at least one code subfile; for each code file, determining a file name list corresponding to the code file according to each code subfile, wherein the file name list comprises code subfiles which are depended by at least one code subfile and do not belong to the code file; and determining a code file list corresponding to the code file according to the file name list aiming at each code file, wherein the code file list comprises at least one other code file, the other code files are code files corresponding to the code subfiles in the file name list, and the other code files are in an open state. The dependency relationship of the source code can be safely and conveniently acquired, the problem of development and debugging failure caused by complex code dependency relationship is solved, and the working efficiency of developers is improved.

Description

Code compiling processing method and device and terminal
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, and a terminal for processing code compilation.
Background
With the development of terminal technology, many terminals adopt android systems. Developers need to develop application programs suitable for the android system or the whole terminal system suitable for the android system and the like for a terminal adopting the android system. Development of code at both the system level and the application level requires multiple developers to be responsible for the same project. Codes developed by different developers usually have context dependency; when the codes are compiled, only the codes with the dependency relationship are compiled at the same time, the codes can be compiled to pass, otherwise, the codes fail to be compiled.
In the related art, developers need to be very familiar with codes of the developers, and need to rely on the codes of the developers and the codes of the developers; then, when compiling the code, developers manually configure the dependency relationship and manually adjust the dependent code.
However, in the related art, codes generally have a more responsible dependency relationship, and since developers are required to manually adjust the dependency relationship of the codes, a fault occurs, and then debugging and development failures occur; and the manual adjustment mode has low efficiency, and influences the development time of the whole code.
Disclosure of Invention
The method aims to overcome the problems that debugging and development failure occur in the dependency relationship of codes needing to be manually adjusted by developers in the related technology; the manual adjustment mode has low efficiency, and influences the development time of the whole code.
According to a first aspect of the embodiments of the present disclosure, there is provided a processing method for code compilation, including:
acquiring code files of development users, wherein one code file comprises at least one code subfile;
for each code file, determining a file name list corresponding to the code file according to each code subfile, wherein the file name list comprises code subfiles which are depended by at least one code subfile and do not belong to the code file;
and for each code file, determining a code file list corresponding to the code file according to the file name list, wherein the code file list comprises at least one other code file, the other code file is a code file corresponding to a code subfile in the file name list, and the other code file is in an open state.
Further, the code subfile comprises code content; for each code file, determining a file name list corresponding to the code file according to each code subfile, wherein the file name list comprises:
for each code subfile of each code file, determining the contained information of the code subfile according to the code content of the code subfile, wherein the contained information is each code subfile depended on in the code content of the code subfile;
for each code subfile of each code file, determining analysis information of the code subfile according to the contained information of the code subfile, wherein the analysis information is the code subfile which does not belong to the code file corresponding to the code subfile in the contained information;
and generating a file name list corresponding to the code file according to the analysis information of each code subfile of the code file.
Further, the determining, for each code file, a code file list corresponding to the code file according to the file name list includes:
determining code file dependency information according to code subfiles in a file name list corresponding to each code file, wherein the code file dependency information comprises at least one code file to which the code subfiles in the file name list belong;
for each code file, judging the state of each code file in the code file dependency information according to the code file dependency information;
and for each code file, if the state of the code file in the code file dependency information is determined to be an open state, generating the code file list according to the code file in the open state.
Further, the determining, for each code file, a code file list corresponding to the code file according to the file name list includes:
for each code file, determining other code files in an open state, and determining code subfiles under the other code files in the open state;
for each code file, judging whether the code subfiles in the file name list exist in the code subfiles under other code files in an open state;
when the code file is determined to be possessed, the code file list is generated from other code files that have code subfiles in the file name list and are to be in an open state.
Further, after the determining, for each code file, a code file list corresponding to the code file according to the file name list, the method further includes:
and compiling each code file according to each code file list of each code file.
Further, the code subfile includes at least one of the following information:
code version information, code path, code subfile identification.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects: acquiring code files of development users, wherein one code file comprises at least one code subfile; for each code file, determining a file name list corresponding to the code file according to each code subfile, wherein the file name list comprises code subfiles which are depended by at least one code subfile and do not belong to the code file; and determining a code file list corresponding to the code file according to the file name list aiming at each code file, wherein the code file list comprises at least one other code file, the other code files are code files corresponding to the code subfiles in the file name list, and the other code files are in an open state. Therefore, the method for analyzing the code dependency relationship is provided, and the dependency relationship among the code files can be automatically analyzed. Furthermore, when a plurality of developers are jointly responsible for the same development project, especially under the condition that the code dependency relationship developed by a plurality of developers is complex, the dependency relationship of the source code can be safely and conveniently acquired, and then debugging and testing are facilitated; the method provides a stable technical support in both the compiling stage and the debugging and testing stage of the code, greatly solves the problem of development and debugging failure caused by complex code dependency relationship, and improves the working efficiency of developers.
According to a second aspect of the embodiments of the present disclosure, there is provided a processing apparatus for code compilation, including:
the system comprises an acquisition module, a storage module and a display module, wherein the acquisition module is configured to acquire code files of development users, and one code file comprises at least one code subfile;
the first determining module is configured to determine a file name list corresponding to the code file according to the code subfiles for each code file, wherein the file name list comprises the code subfiles which are depended by at least one code subfile and do not belong to the code file;
the second determining module is configured to determine, for each code file, a code file list corresponding to the code file according to the file name list, where the code file list includes at least one other code file, the other code file is a code file corresponding to a code subfile in the file name list, and the other code file is in an open state.
Further, the code subfile comprises code content; the first determining module is specifically configured to:
for each code subfile of each code file, determining the contained information of the code subfile according to the code content of the code subfile, wherein the contained information is each code subfile depended on in the code content of the code subfile;
for each code subfile of each code file, determining analysis information of the code subfile according to the contained information of the code subfile, wherein the analysis information is the code subfile which does not belong to the code file corresponding to the code subfile in the contained information;
and generating a file name list corresponding to the code file according to the analysis information of each code subfile of the code file.
Further, the second determining module is specifically configured to:
determining code file dependency information according to code subfiles in a file name list corresponding to each code file, wherein the code file dependency information comprises at least one code file to which the code subfiles in the file name list belong;
for each code file, judging the state of each code file in the code file dependency information according to the code file dependency information;
and for each code file, if the state of the code file in the code file dependency information is determined to be an open state, generating the code file list according to the code file in the open state.
Further, the second determining module is specifically configured to:
for each code file, determining other code files in an open state, and determining code subfiles under the other code files in the open state;
for each code file, judging whether the code subfiles in the file name list exist in the code subfiles under other code files in an open state;
when the code file is determined to be possessed, the code file list is generated from other code files that have code subfiles in the file name list and are to be in an open state.
Further, the apparatus further comprises:
and the compiling module is configured to compile each code file according to each code file list of each code file after the second determining module determines the code file list corresponding to the code file according to the file name list for each code file.
Further, the code subfile includes at least one of the following information:
code version information, code path, code subfile identification.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects: acquiring code files of development users, wherein one code file comprises at least one code subfile; for each code file, determining a file name list corresponding to the code file according to each code subfile, wherein the file name list comprises code subfiles which are depended by at least one code subfile and do not belong to the code file; and determining a code file list corresponding to the code file according to the file name list aiming at each code file, wherein the code file list comprises at least one other code file, the other code files are code files corresponding to the code subfiles in the file name list, and the other code files are in an open state. Therefore, the method for analyzing the code dependency relationship is provided, and the dependency relationship among the code files can be automatically analyzed. Furthermore, when a plurality of developers are jointly responsible for the same development project, especially under the condition that the code dependency relationship developed by a plurality of developers is complex, the dependency relationship of the source code can be safely and conveniently acquired, and then debugging and testing are facilitated; the method provides a stable technical support in both the compiling stage and the debugging and testing stage of the code, greatly solves the problem of development and debugging failure caused by complex code dependency relationship, and improves the working efficiency of developers.
According to a third aspect of the embodiments of the present disclosure, there is provided a terminal, including:
a processor, and a memory for storing processor-executable instructions;
wherein the processor is configured to: acquiring code files of development users, wherein one code file comprises at least one code subfile; for each code file, determining a file name list corresponding to the code file according to each code subfile, wherein the file name list comprises code subfiles which are depended by at least one code subfile and do not belong to the code file; and for each code file, determining a code file list corresponding to the code file according to the file name list, wherein the code file list comprises at least one other code file, the other code file is a code file corresponding to a code subfile in the file name list, and the other code file is in an open state.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects: acquiring code files of development users, wherein one code file comprises at least one code subfile; for each code file, determining a file name list corresponding to the code file according to each code subfile, wherein the file name list comprises code subfiles which are depended by at least one code subfile and do not belong to the code file; and determining a code file list corresponding to the code file according to the file name list aiming at each code file, wherein the code file list comprises at least one other code file, the other code files are code files corresponding to the code subfiles in the file name list, and the other code files are in an open state. Therefore, the method for analyzing the code dependency relationship is provided, and the dependency relationship among the code files can be automatically analyzed. Furthermore, when a plurality of developers are jointly responsible for the same development project, especially under the condition that the code dependency relationship developed by a plurality of developers is complex, the dependency relationship of the source code can be safely and conveniently acquired, and then debugging and testing are facilitated; the method provides a stable technical support in both the compiling stage and the debugging and testing stage of the code, greatly solves the problem of development and debugging failure caused by complex code dependency relationship, and improves the working efficiency of developers.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a flowchart illustrating a first embodiment of a method for processing code compilation according to an illustrative embodiment;
FIG. 2 is a flowchart illustrating a second embodiment of a method for processing code compilation according to an illustrative embodiment;
FIG. 3 is a block diagram illustrating a third embodiment of a method and apparatus for processing code compilation according to an illustrative embodiment;
FIG. 4 is a block diagram illustrating a fourth embodiment of a method and apparatus for processing code compilation according to an illustrative embodiment;
FIG. 5 is a block diagram illustrating entities of a terminal in accordance with an exemplary embodiment;
fig. 6 is a block diagram illustrating a terminal device 800 according to an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
Fig. 1 is a flowchart illustrating a first embodiment of a processing method for code compilation, as shown in fig. 1, the processing method for code compilation is used in a terminal, which includes a mobile terminal, a personal terminal, and the like, such as a touch screen mobile phone, a tablet computer, a personal computer, and the like, and the method includes the following steps.
In step S11, code files of development users are obtained, wherein one of the code files includes at least one code subfile.
In this step, after each development user has developed a code file for each development user, the terminal can acquire each code file of each development user. For example, each development user may input or copy a respective code file into the terminal, or the terminal may obtain each code file from the terminal of each development user, or the terminal may obtain each code file of each development user from the code library.
Wherein each code file comprises at least one code subfile. A code subfile comprising at least one of the following information: code content, code version information, code path, code subfile identification.
For example, this step is performed by a code monitoring module, which is responsible for monitoring the dynamics of the code base; the code monitoring module has no input and outputs the relevant information of submitted code files; therefore, the code monitoring module can acquire the code file submitted by the developer from the code library, acquire the code path of each code subfile, the version branch where the code is located, the content of the code and the identifier of the code subfile from the code subfile of the code file, and acquire the information such as the unique identifier changeID of the code file.
In step S12, for each code file, a file name list corresponding to the code file is determined according to each code subfile, where the file name list includes code subfiles that are each depended on by at least one code subfile and do not belong to the code file.
In this step, for each code file, for each code subfile in one code file, the terminal determines, according to information in the code subfile, a code subfile which is dependent on the current code subfile and does not belong to the current code file. For each code file, the terminal executes the above process, further determines the code subfiles which are depended by each code subfile in the code file and do not belong to the current code file, and then obtains a file name list corresponding to one code file.
For example, for a code file changeID of 1, the code file has 3 code subfiles, which are an a code subfile, a B code subfile, and a C code subfile. The terminal can determine a file name list, wherein the file name list comprises a D code subfile, an E code subfile and an F code subfile; the subfiles in the file name list are code subfiles which are depended by at least one code subfile with the code file changeID of 1 and do not belong to the code file changeID of 1. For example, this step may be performed by a code scanning module, which may input code file 1 into the code scanning module, which may output a list of file names; the file name list is a character string list such as [ "com.
In step S13, for each code file, a code file list corresponding to the code file is determined according to the file name list, where the code file list includes at least one other code file, the other code file is a code file corresponding to a code subfile in the file name list, and the other code file is in an open state.
In this step, for each code file, the terminal may determine the code file corresponding to the code subfile in the file name list, and then the terminal determines whether the determined state of the code file is in a development state. The terminal can determine the code files in the development state, and then the terminal obtains a code file list according to the code files in the development state.
The present embodiment may be executed by a code state determination module in the terminal, and may input a file name list into the code state determination module, and then may obtain a code file in an open state in the code files corresponding to the code subfiles in the file name list, so as to obtain a code file list. The code file list is, for example, [ '30122', '30211' … ].
For example, for a code file changeID of 1, the code file has 3 code subfiles, which are an a code subfile, a B code subfile, and a C code subfile. The terminal can determine a file name list, wherein the file name list comprises a D code subfile, an E code subfile and an F code subfile; the subfiles in the file name list are code subfiles which are depended by at least one code subfile with the code file changeID of 1 and do not belong to the code file changeID of 1. Then, the terminal may determine that the D-code subfile of the file name list belongs to the code file changeID of 2, determine that the E-code subfile of the file name list belongs to the code file changeID of 2, and determine that the F-code subfile of the file name list belongs to the code file changeID of 3. Then, the terminal determines whether the code file change id is 2 and the code file change id is 3, respectively, and the terminal may determine that the code file change id is 2, respectively, in the open state, and then the terminal may generate a code file list corresponding to the code file change id of 1 according to the code file change id of 2, where the code file list includes an identifier change id of 2.
In the embodiment, each code file of each development user is obtained, wherein one code file comprises at least one code subfile; for each code file, determining a file name list corresponding to the code file according to each code subfile, wherein the file name list comprises code subfiles which are depended by at least one code subfile and do not belong to the code file; and determining a code file list corresponding to the code file according to the file name list aiming at each code file, wherein the code file list comprises at least one other code file, the other code files are code files corresponding to the code subfiles in the file name list, and the other code files are in an open state. Therefore, the method for analyzing the code dependency relationship is provided, and the dependency relationship among the code files can be automatically analyzed. Furthermore, when a plurality of developers are jointly responsible for the same development project, especially under the condition that the code dependency relationship developed by a plurality of developers is complex, the dependency relationship of the source code can be safely and conveniently acquired, and then debugging and testing are facilitated; the method provides a stable technical support in both the compiling stage and the debugging and testing stage of the code, greatly solves the problem of development and debugging failure caused by complex code dependency relationship, and improves the working efficiency of developers.
Fig. 2 is a flowchart illustrating a second embodiment of a processing method for code compilation according to an exemplary embodiment, where the method includes the following steps, as shown in fig. 2.
In step S21, code files of each development user are obtained, where one of the code files includes at least one code subfile, and the code subfile includes code content.
In this step, the step is referred to step S11 of fig. 1.
In step S22, for each code subfile of each code file, the inclusion information of the code subfile is determined according to the code content of the code subfile, where the inclusion information is the code subfiles depended on in the code content of the code subfile.
In this step, for each code file, for each code subfile in one code file, the terminal determines, according to the code content in the code subfile, each code subfile on which the code content of the current code subfile depends, and further obtains the inclusion information of the current code subfile. For each code file, the terminal executes the above process, and further determines the contained information of each code subfile of each code file.
For example, for a code file changeID of 1, the code file has 3 code subfiles, which are an a code subfile, a B code subfile, and a C code subfile. The terminal determines that each code subfile depended in the code content of the A code subfile is a B code subfile, a C code subfile and a D code subfile according to the code content of the A code subfile; the terminal determines each code subfile depended in the code content of the B code subfile to be an A code subfile and an E code subfile according to the code content of the B code subfile; and the terminal determines that each code subfile depended in the code content of the C code subfile is an F code subfile and a G code subfile according to the code content of the C code subfile.
In step S23, for each code subfile of each code file, determining analysis information of the code subfile according to inclusion information of the code subfile, where the analysis information is a code subfile of the inclusion information that does not belong to the code file corresponding to the code subfile; and generating a file name list corresponding to the code file according to the analysis information of each code subfile of the code file.
In this step, for each code subfile of each code file, the terminal determines, according to the inclusion information of the code subfile, a code subfile, which does not belong to the code file corresponding to the code subfile, in the inclusion information, and further obtains analysis information of the code subfile. For each code file, the terminal executes the above process, and further determines the analysis information of each code subfile of each code file.
Then, a file name list corresponding to the code file is generated based on the analysis information of each code subfile of the code file.
For example, for a code file changeID of 1, the code file has 3 code subfiles, which are an a code subfile, a B code subfile, and a C code subfile. The terminal determines that the information contained in the A code subfile is a B code subfile, a C code subfile and a D code subfile according to the code content of the A code subfile; the terminal determines that the information contained in the B code subfile is an A code subfile and an E code subfile according to the code content of the B code subfile; and the terminal determines that the contained information of the C code subfile is an F code subfile and a G code subfile according to the code content of the C code subfile. Then, the terminal may determine that the D code subfile in the analysis information of the a code subfile does not belong to the code file changeID of 1, and then determine that the analysis information of the a code subfile is the D code subfile; the terminal may determine that an E code subfile in the analysis information of the B code subfile does not belong to the code file changeID of 1, and then determine that the analysis information of the B code subfile is the E code subfile; then, the terminal may determine that the F-code subfile and the G-code subfile in the analysis information of the C-code subfile do not belong to the code file changeID of 1, and then determine that the analysis information of the C-code subfile is the F-code subfile and the G-code subfile. Then, the terminal writes the identifier of the code subfile under each analysis information of each code subfile with the code file changeID of 1 into a file name list corresponding to the code file changeID of 1, and the file name list is a D code subfile, an E code subfile, an F code subfile and a G code subfile.
In step S24, for each code file, a code file list corresponding to the code file is determined according to the file name list, where the code file list includes at least one other code file, the other code file is a code file corresponding to a code subfile in the file name list, and the other code file is in an open state.
The specific implementation manner of step S24 includes two types:
the first realization mode is as follows: determining code file dependency information according to code subfiles in a file name list corresponding to each code file, wherein the code file dependency information comprises at least one code file to which the code subfiles in the file name list belong; for each code file, judging the state of each code file in the code file dependency information according to the code file dependency information; and for each code file, if the state of the code file in the code file dependency information is determined to be an open state, generating the code file list according to the code file in the open state.
The second implementation manner is as follows: for each code file, determining other code files in an open state, and determining code subfiles under the other code files in the open state; for each code file, judging whether the code subfiles in the file name list exist in the code subfiles under other code files in an open state; when the code file is determined to be possessed, the code file list is generated from other code files that have code subfiles in the file name list and are to be in an open state.
In this step, for each code file, the terminal determines a code file list corresponding to the code file according to the file name list, and there are two implementation manners.
The first way is the following process. For each code file, the terminal queries a code file to which the code subfile in the file name list belongs according to the code subfile in the file name list corresponding to the code file, and further obtains code file dependence information of the code file; then, the code file has several states in the code library, including an Open state and a closed state, where the closed state includes closed state such as merged or closed or abandon; the terminal inquires whether the state of each code file in the code file dependency information of the code file is an open state in a code library; then, the terminal generates a code file list of the code file according to the code file in the open state in the code file dependency information.
For example, the terminal obtains a file name list corresponding to the code file changeID of 1, where the file name list is a D-code subfile, an E-code subfile, an F-code subfile and a G-code subfile; the terminal determines that the code file to which the D code subfile belongs is the code file changeID of 2, determines that the code file to which the E code subfile belongs is the code file changeID of 3, determines that the code file to which the F code subfile belongs is the code file changeID of 3, determines that the code file to which the G code subfile belongs is the code file changeID of 4, and further obtains that the code file dependent information of which the code file changeID is 1 is the code file changeID of 2, the code file changeID of 3 and the code file changeID of 4. Then, the terminal checks the states of the changeids for 2, 3 and 4 in the code file change id, if the state of the changeID is a closed state such as merged, closed or abandon, the terminal skips the continuous check, and when the changeID in the open state is encountered, the terminal adds the changeID into the output list and checks the next changeID, and the terminal can determine that the code file change id is 2 and the code file change id is 3 in the open state, and then obtain a code file list including the identifier of 2 and the identifier of 3.
The second way is the following process. For each code file, the terminal determines all other code files in an open state and then determines code subfiles under the other code files in the open state; the terminal continues to judge whether the code subfiles in the file name list of the current code file exist in the code subfiles under other code files in the open state; when the terminal determines the code file, the terminal can generate a code file list of the current code file according to other code files which have the code subfiles in the file name list and are to be in an open state.
For example, the terminal obtains a file name list corresponding to the code file changeID of 1, where the file name list is a D-code subfile, an E-code subfile, an F-code subfile and a G-code subfile; the terminal scans in a code base, selects all code files in an open state, and the code files include code file changeID 2, code file changeID 3, code file changeID 4 and the like; then, whether the terminal has a code subfile in the current file name list in all the code subfiles under the code files in the open state or not is judged; the terminal may determine that the code file changeID in the open state is 2 and has a D code subfile in the current file name list, and determine that the code file changeID in the open state is 3 and has an E code subfile and an F code subfile in the current file name list; the terminal can obtain a code file list including an identifier of code file changeID 2 and an identifier of code file changeID 3 from code file changeID 2 and code file changeID 3.
In step S25, each code file is compiled from each code file list of each code file.
In this step, after the terminal obtains each code file list of each code file, it can determine the dependency relationship between each code file, and then the terminal can compile each code file according to each code file list of each code file.
In the embodiment, each code file of each development user is obtained, wherein one code file comprises at least one code subfile; for each code file, determining a file name list corresponding to the code file according to each code subfile, wherein the file name list comprises code subfiles which are depended by at least one code subfile and do not belong to the code file; determining a code file list corresponding to each code file according to the file name list, wherein the code file list comprises at least one other code file, the other code files are code files corresponding to code subfiles in the file name list, and the other code files are in an open state; and compiling each code file according to each code file list of each code file. Therefore, the method for analyzing the code dependency relationship is provided, and the dependency relationship among the code files can be automatically analyzed. Furthermore, when a plurality of developers are jointly responsible for the same development project, especially under the condition that the code dependency relationship developed by a plurality of developers is complex, the dependency relationship of the source code can be safely and conveniently acquired, and then debugging and testing are facilitated; the method provides a stable technical support in both the compiling stage and the debugging and testing stage of the code, greatly solves the problem of development and debugging failure caused by complex code dependency relationship, and improves the working efficiency of developers.
Fig. 3 is a block diagram illustrating a third embodiment of a processing method and apparatus for code compilation according to an exemplary embodiment. Referring to fig. 3, the apparatus includes:
an obtaining module 31, configured to obtain code files of each development user, where one of the code files includes at least one code subfile;
a first determining module 32, configured to determine, for each code file, a file name list corresponding to the code file according to each code subfile, where the file name list includes code subfiles that are each depended on by at least one code subfile and do not belong to the code file;
the second determining module 33 is configured to determine, for each code file, a code file list corresponding to the code file according to the file name list, where the code file list includes at least one other code file, the other code file is a code file corresponding to a code subfile in the file name list, and the other code file is in an open state.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
In the embodiment, each code file of each development user is obtained, wherein one code file comprises at least one code subfile; for each code file, determining a file name list corresponding to the code file according to each code subfile, wherein the file name list comprises code subfiles which are depended by at least one code subfile and do not belong to the code file; and determining a code file list corresponding to the code file according to the file name list aiming at each code file, wherein the code file list comprises at least one other code file, the other code files are code files corresponding to the code subfiles in the file name list, and the other code files are in an open state. Therefore, the method for analyzing the code dependency relationship is provided, and the dependency relationship among the code files can be automatically analyzed. Furthermore, when a plurality of developers are jointly responsible for the same development project, especially under the condition that the code dependency relationship developed by a plurality of developers is complex, the dependency relationship of the source code can be safely and conveniently acquired, and then debugging and testing are facilitated; the method provides a stable technical support in both the compiling stage and the debugging and testing stage of the code, greatly solves the problem of development and debugging failure caused by complex code dependency relationship, and improves the working efficiency of developers.
Fig. 4 is a block diagram illustrating a fourth embodiment of a processing method and apparatus for code compilation according to an exemplary embodiment. Referring to fig. 4, the code subfile includes code content therein; the first determining module 32 is specifically configured to:
for each code subfile of each code file, determining the contained information of the code subfile according to the code content of the code subfile, wherein the contained information is each code subfile depended on in the code content of the code subfile;
for each code subfile of each code file, determining analysis information of the code subfile according to the contained information of the code subfile, wherein the analysis information is the code subfile which does not belong to the code file corresponding to the code subfile in the contained information;
and generating a file name list corresponding to the code file according to the analysis information of each code subfile of the code file.
The second determining module 33 is specifically configured to:
determining code file dependency information according to code subfiles in a file name list corresponding to each code file, wherein the code file dependency information comprises at least one code file to which the code subfiles in the file name list belong;
for each code file, judging the state of each code file in the code file dependency information according to the code file dependency information;
and for each code file, if the state of the code file in the code file dependency information is determined to be an open state, generating the code file list according to the code file in the open state.
Alternatively, the second determining module 33 is specifically configured to:
for each code file, determining other code files in an open state, and determining code subfiles under the other code files in the open state;
for each code file, judging whether the code subfiles in the file name list exist in the code subfiles under other code files in an open state;
when the code file is determined to be possessed, the code file list is generated from other code files that have code subfiles in the file name list and are to be in an open state.
The apparatus provided in this embodiment further includes:
a compiling module 41 configured to compile each code file according to each code file list of each code file after the second determining module 33 determines the code file list corresponding to the code file according to the file name list for each code file.
The code subfile comprises at least one of the following information: code version information, code path, code subfile identification.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
In the embodiment, each code file of each development user is obtained, wherein one code file comprises at least one code subfile; for each code file, determining a file name list corresponding to the code file according to each code subfile, wherein the file name list comprises code subfiles which are depended by at least one code subfile and do not belong to the code file; determining a code file list corresponding to each code file according to the file name list, wherein the code file list comprises at least one other code file, the other code files are code files corresponding to code subfiles in the file name list, and the other code files are in an open state; and compiling each code file according to each code file list of each code file. Therefore, the method for analyzing the code dependency relationship is provided, and the dependency relationship among the code files can be automatically analyzed. Furthermore, when a plurality of developers are jointly responsible for the same development project, especially under the condition that the code dependency relationship developed by a plurality of developers is complex, the dependency relationship of the source code can be safely and conveniently acquired, and then debugging and testing are facilitated; the method provides a stable technical support in both the compiling stage and the debugging and testing stage of the code, greatly solves the problem of development and debugging failure caused by complex code dependency relationship, and improves the working efficiency of developers.
Fig. 5 is a block diagram illustrating entities of a terminal according to an example embodiment. Referring to fig. 5, the terminal may be embodied as: a processor 51, and a memory 52 configured to store processor-executable instructions;
wherein the processor 51 is configured to: acquiring code files of development users, wherein one code file comprises at least one code subfile; for each code file, determining a file name list corresponding to the code file according to each code subfile, wherein the file name list comprises code subfiles which are depended by at least one code subfile and do not belong to the code file; and for each code file, determining a code file list corresponding to the code file according to the file name list, wherein the code file list comprises at least one other code file, the other code file is a code file corresponding to a code subfile in the file name list, and the other code file is in an open state.
In the above embodiments, it should be understood that the Processor may be a Central Processing Unit (CPU), other general purpose processors, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. The general-purpose processor may be a microprocessor, or the processor may be any conventional processor, and the aforementioned memory may be a read-only memory (ROM), a Random Access Memory (RAM), a flash memory, a hard disk, or a solid state disk. SIM cards, also known as subscriber identity cards, smart cards, must be installed in a digital mobile phone for use. That is, the information of the digital mobile phone client, the encrypted key and the contents of the user's phone book are stored on the computer chip. The steps of a method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.
With regard to the terminal in the above-described embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment related to the method and apparatus, and will not be elaborated herein.
In the embodiment, each code file of each development user is obtained, wherein one code file comprises at least one code subfile; for each code file, determining a file name list corresponding to the code file according to each code subfile, wherein the file name list comprises code subfiles which are depended by at least one code subfile and do not belong to the code file; and determining a code file list corresponding to the code file according to the file name list aiming at each code file, wherein the code file list comprises at least one other code file, the other code files are code files corresponding to the code subfiles in the file name list, and the other code files are in an open state. Therefore, the method for analyzing the code dependency relationship is provided, and the dependency relationship among the code files can be automatically analyzed. Furthermore, when a plurality of developers are jointly responsible for the same development project, especially under the condition that the code dependency relationship developed by a plurality of developers is complex, the dependency relationship of the source code can be safely and conveniently acquired, and then debugging and testing are facilitated; the method provides a stable technical support in both the compiling stage and the debugging and testing stage of the code, greatly solves the problem of development and debugging failure caused by complex code dependency relationship, and improves the working efficiency of developers.
Fig. 6 is a block diagram illustrating a terminal device 800 according to an example embodiment. For example, the terminal device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, and the like.
Referring to fig. 6, terminal device 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communication component 816.
The processing component 802 generally controls overall operation of the terminal device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the terminal device 800. Examples of such data include instructions for any application or method operating on terminal device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power components 806 provide power to the various components of terminal device 800. Power components 806 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for terminal device 800.
The multimedia component 808 comprises a screen providing an output interface between the terminal device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. When the terminal device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive an external audio signal when the terminal device 800 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
Sensor component 814 includes one or more sensors for providing various aspects of state assessment for terminal device 800. For example, sensor assembly 814 may detect an open/closed status of terminal device 800, the relative positioning of components, such as a display and keypad of terminal device 800, sensor assembly 814 may also detect a change in the position of terminal device 800 or a component of terminal device 800, the presence or absence of user contact with terminal device 800, orientation or acceleration/deceleration of terminal device 800, and a change in the temperature of terminal device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
Communication component 816 is configured to facilitate communications between terminal device 800 and other devices in a wired or wireless manner. The terminal device 800 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the terminal device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 804 comprising instructions, executable by the processor 820 of the terminal device 800 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium having instructions therein, which when executed by a processor of a mobile terminal, enable the mobile terminal to perform a processing method of code compilation, the method comprising:
acquiring code files of development users, wherein one code file comprises at least one code subfile;
for each code file, determining a file name list corresponding to the code file according to each code subfile, wherein the file name list comprises code subfiles which are depended by at least one code subfile and do not belong to the code file;
and for each code file, determining a code file list corresponding to the code file according to the file name list, wherein the code file list comprises at least one other code file, the other code file is a code file corresponding to a code subfile in the file name list, and the other code file is in an open state.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (11)

1. A method for processing code compilation, comprising:
acquiring code files of development users, wherein one code file comprises at least one code subfile;
for each code file, determining a file name list corresponding to the code file according to each code subfile, wherein the file name list comprises code subfiles which are depended by at least one code subfile and do not belong to the code file;
for each code file, determining a code file list corresponding to the code file according to the file name list, wherein the code file list comprises at least one other code file, the other code file is a code file corresponding to a code subfile in the file name list, and the other code file is in an open state;
determining a code file list corresponding to the code file according to the file name list, wherein the code file list comprises:
determining code file dependency information according to code subfiles in a file name list corresponding to each code file, wherein the code file dependency information comprises at least one code file to which the code subfiles in the file name list belong;
for each code file, judging the state of each code file in the code file dependency information according to the code file dependency information;
and for each code file, if the state of the code file in the code file dependency information is determined to be an open state, generating the code file list according to the code file in the open state.
2. The method of claim 1, wherein the code subfile includes code content;
for each code file, determining a file name list corresponding to the code file according to each code subfile, wherein the file name list comprises:
for each code subfile of each code file, determining the contained information of the code subfile according to the code content of the code subfile, wherein the contained information is each code subfile depended on in the code content of the code subfile;
for each code subfile of each code file, determining analysis information of the code subfile according to the contained information of the code subfile, wherein the analysis information is the code subfile which does not belong to the code file corresponding to the code subfile in the contained information;
and generating a file name list corresponding to the code file according to the analysis information of each code subfile of the code file.
3. The method according to claim 1, wherein the determining, for each code file, a code file list corresponding to the code file according to the file name list comprises:
for each code file, determining other code files in an open state, and determining code subfiles under the other code files in the open state;
for each code file, judging whether the code subfiles in the file name list exist in the code subfiles under other code files in an open state;
when the code file is determined to be possessed, the code file list is generated from other code files that have code subfiles in the file name list and are to be in an open state.
4. The method according to any one of claims 1 to 3, further comprising, after determining, for each code file, a list of code files corresponding to the code file from the list of file names:
and compiling each code file according to each code file list of each code file.
5. The method of any of claims 1-3, wherein the code subfile includes at least one of:
code version information, code path, code subfile identification.
6. A code compilation processing apparatus, comprising:
the system comprises an acquisition module, a storage module and a display module, wherein the acquisition module is configured to acquire code files of development users, and one code file comprises at least one code subfile;
the first determining module is configured to determine a file name list corresponding to the code file according to the code subfiles for each code file, wherein the file name list comprises the code subfiles which are depended by at least one code subfile and do not belong to the code file;
a second determining module, configured to determine, for each code file, a code file list corresponding to the code file according to the file name list, where the code file list includes at least one other code file, the other code file is a code file corresponding to a code subfile in the file name list, and the other code file is in an open state;
the second determining module is specifically configured to:
determining code file dependency information according to code subfiles in a file name list corresponding to each code file, wherein the code file dependency information comprises at least one code file to which the code subfiles in the file name list belong;
for each code file, judging the state of each code file in the code file dependency information according to the code file dependency information;
and for each code file, if the state of the code file in the code file dependency information is determined to be an open state, generating the code file list according to the code file in the open state.
7. The apparatus of claim 6, wherein the code subfile comprises code content;
the first determining module is specifically configured to:
for each code subfile of each code file, determining the contained information of the code subfile according to the code content of the code subfile, wherein the contained information is each code subfile depended on in the code content of the code subfile;
for each code subfile of each code file, determining analysis information of the code subfile according to the contained information of the code subfile, wherein the analysis information is the code subfile which does not belong to the code file corresponding to the code subfile in the contained information;
and generating a file name list corresponding to the code file according to the analysis information of each code subfile of the code file.
8. The apparatus of claim 6, wherein the second determining module is specifically configured to:
for each code file, determining other code files in an open state, and determining code subfiles under the other code files in the open state;
for each code file, judging whether the code subfiles in the file name list exist in the code subfiles under other code files in an open state;
when the code file is determined to be possessed, the code file list is generated from other code files that have code subfiles in the file name list and are to be in an open state.
9. The apparatus of any of claims 6-8, further comprising:
and the compiling module is configured to compile each code file according to each code file list of each code file after the second determining module determines the code file list corresponding to the code file according to the file name list for each code file.
10. The apparatus of any of claims 6-8, wherein the code subfile comprises at least one of:
code version information, code path, code subfile identification.
11. A terminal, comprising:
a processor, and a memory for storing processor-executable instructions;
wherein the processor is configured to: acquiring code files of development users, wherein one code file comprises at least one code subfile; for each code file, determining a file name list corresponding to the code file according to each code subfile, wherein the file name list comprises code subfiles which are depended by at least one code subfile and do not belong to the code file; for each code file, determining a code file list corresponding to the code file according to the file name list, wherein the code file list comprises at least one other code file, the other code file is a code file corresponding to a code subfile in the file name list, and the other code file is in an open state;
determining a code file list corresponding to the code file according to the file name list, wherein the code file list comprises:
determining code file dependency information according to code subfiles in a file name list corresponding to each code file, wherein the code file dependency information comprises at least one code file to which the code subfiles in the file name list belong;
for each code file, judging the state of each code file in the code file dependency information according to the code file dependency information;
and for each code file, if the state of the code file in the code file dependency information is determined to be an open state, generating the code file list according to the code file in the open state.
CN201710342999.1A 2017-05-16 2017-05-16 Code compiling processing method and device and terminal Active CN107193622B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710342999.1A CN107193622B (en) 2017-05-16 2017-05-16 Code compiling processing method and device and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710342999.1A CN107193622B (en) 2017-05-16 2017-05-16 Code compiling processing method and device and terminal

Publications (2)

Publication Number Publication Date
CN107193622A CN107193622A (en) 2017-09-22
CN107193622B true CN107193622B (en) 2020-03-17

Family

ID=59873641

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710342999.1A Active CN107193622B (en) 2017-05-16 2017-05-16 Code compiling processing method and device and terminal

Country Status (1)

Country Link
CN (1) CN107193622B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111984944B (en) * 2020-08-28 2024-04-19 重庆小雨点小额贷款有限公司 Source code processing method, related device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102880466A (en) * 2012-09-04 2013-01-16 中标软件有限公司 Method for detecting dependent relationship of software package in Linux operating system
CN104077140A (en) * 2014-07-04 2014-10-01 用友软件股份有限公司 Automatic compiling method and compiling device for continuous integration
CN104991773A (en) * 2015-06-30 2015-10-21 小米科技有限责任公司 Program generation method and apparatus
CN105354037A (en) * 2015-11-30 2016-02-24 用友优普信息技术有限公司 Modularized software developing method and software developing device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102880466A (en) * 2012-09-04 2013-01-16 中标软件有限公司 Method for detecting dependent relationship of software package in Linux operating system
CN104077140A (en) * 2014-07-04 2014-10-01 用友软件股份有限公司 Automatic compiling method and compiling device for continuous integration
CN104991773A (en) * 2015-06-30 2015-10-21 小米科技有限责任公司 Program generation method and apparatus
CN105354037A (en) * 2015-11-30 2016-02-24 用友优普信息技术有限公司 Modularized software developing method and software developing device

Also Published As

Publication number Publication date
CN107193622A (en) 2017-09-22

Similar Documents

Publication Publication Date Title
CN109032606B (en) Native application compiling method and device and terminal
CN111274131A (en) Interface testing method and device, electronic equipment and storage medium
CN111221559A (en) Application updating method and device, storage medium, terminal and server
CN108764003B (en) Picture identification method and device
CN107423218B (en) Application testing method, device and terminal
CN111240694B (en) Application detection method, application detection device and storage medium
CN109814942B (en) Parameter processing method and device
CN111221733A (en) Information processing method and device, mobile terminal and storage medium
CN115185717B (en) Interface calling method and device, electronic equipment and storage medium
CN107911482B (en) Target application opening method and device
CN107562500B (en) Debugging device, method and equipment
CN107463372B (en) Data-driven page updating method and device
CN109684112B (en) Program file operation method, device, terminal and storage medium
CN111538502A (en) Installation package processing method and device, electronic equipment and storage medium
CN108280342B (en) Application synchronization method and device for application synchronization
CN109344051B (en) Data processing method and device, electronic equipment and storage medium
CN110852163A (en) Binding method and device
CN107193622B (en) Code compiling processing method and device and terminal
CN110221813B (en) Application data connection establishment method and device, storage medium and electronic equipment
CN112114814A (en) Compiled file determining method and device and application program generating method and device
CN106293683B (en) Project compiling method and device
CN111221593A (en) Dynamic loading method and device
CN111913756A (en) Application program optimization method, device and system, electronic equipment and storage medium
CN112733092B (en) Information processing method and device
CN111984531B (en) Code coupling detection method and device

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