CN112988161B - Method and device for constructing absolute path of compiled product and readable storage medium - Google Patents

Method and device for constructing absolute path of compiled product and readable storage medium Download PDF

Info

Publication number
CN112988161B
CN112988161B CN202110295107.3A CN202110295107A CN112988161B CN 112988161 B CN112988161 B CN 112988161B CN 202110295107 A CN202110295107 A CN 202110295107A CN 112988161 B CN112988161 B CN 112988161B
Authority
CN
China
Prior art keywords
path
target
file
product
absolute
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
CN202110295107.3A
Other languages
Chinese (zh)
Other versions
CN112988161A (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.)
Glodon Co Ltd
Original Assignee
Glodon 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 Glodon Co Ltd filed Critical Glodon Co Ltd
Priority to CN202110295107.3A priority Critical patent/CN112988161B/en
Publication of CN112988161A publication Critical patent/CN112988161A/en
Application granted granted Critical
Publication of CN112988161B publication Critical patent/CN112988161B/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

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

Abstract

The invention discloses a construction method of absolute paths of compiled products, which can solve the technical problems of lower efficiency and higher error rate of manually counting the absolute paths expected by the compiled products in the prior art, and comprises the following steps: receiving target path information, and determining a target engineering file according to the target path information; acquiring path information of a defined compiled product output catalog in the target engineering file; when the path information of the compiled product output catalog is a relative path, acquiring a reference path variable parameter associated with the relative path, and assigning a value to the reference path variable parameter according to the target path information; and constructing an absolute path of the compiled product according to the assigned reference path variable parameters. The invention also discloses a construction device of the absolute path of the compiled product, a computer device and a computer readable storage medium.

Description

Method and device for constructing absolute path of compiled product and readable storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and apparatus for constructing an absolute path of a compiled product, a computer device, and a computer readable storage medium.
Background
In the prior art, an engineering document is typically used to store program code for all or part of the functionality of a product. Compiling code in an engineering file may result in several compiled products and absolute paths of the compiled products, wherein a compiled product may be an executable file, e.g. a compiled product is an executable file of a software product or an executable file of a certain function of a software product.
To verify whether the compilation result is correct, it is often necessary to determine in advance the absolute path expected by the compilation product and then compare the absolute path expected by the compilation product with the absolute path of the compilation product in the compilation result. In the existing related technology, a manual statistics engineering file is needed to determine the expected absolute path of the compiled product, and the method has the defects of lower working efficiency and higher error rate.
Aiming at the technical problems of lower efficiency and higher error rate of the absolute path expected by the manual statistics compiling product in the prior art, no effective solution is provided at present.
Disclosure of Invention
The invention aims to provide a method, a device, computer equipment and a computer readable storage medium for constructing an absolute path of a compiled product, which can solve the technical problems of low efficiency and high error rate in the prior art of manually counting the absolute path expected by the compiled product.
One aspect of the present invention provides a method for constructing an absolute path of a compiled product, the method comprising: receiving target path information, and determining a target engineering file according to the target path information; acquiring path information of a defined compiled product output catalog in the target engineering file; when the path information of the compiled product output catalog is a relative path, acquiring a reference path variable parameter associated with the relative path, and assigning a value to the reference path variable parameter according to the target path information; and constructing an absolute path of the compiled product according to the assigned reference path variable parameters.
Optionally, the step of constructing the absolute path of the compiled product according to the assigned reference path argument comprises: determining an absolute path of the compiled product output catalog according to the assigned reference path variable parameters; and constructing the absolute path of the compiling product according to the absolute path of the compiling product output catalog.
Optionally, the step of constructing the absolute path of the compiled product from the absolute path of the compiled product output directory includes: determining the name of the compiled product; acquiring the type of the defined compiling product in the target engineering file; determining an extension of the compilation product associated with the type of the compilation product; and constructing the absolute path of the compiling product according to the absolute path of the compiling product output catalog, the name of the compiling product and the extension name of the compiling product.
Optionally, the step of determining the name of the compiled product includes: judging whether the defined name of the compiling product exists in the target engineering file; when the defined name of the compiling product exists in the target engineering file, acquiring the name of the compiling product from the target engineering file; and when the name of the compiling product is not defined in the target engineering file, determining the name of the target engineering file as the name of the compiling product.
Optionally, the step of determining the target engineering file according to the target path information includes: acquiring an absolute path pointed by the target path information; determining engineering files existing under the directed absolute path; when the project file is of a folder type, scanning all sub-project files associated with the project file, and determining the sub-project files of a file type as the target project file; and when the engineering file is of a file type, determining the engineering file as the target engineering file.
Optionally, the step of assigning the reference path variable parameter according to the target path information includes: when the project file is of a folder type, determining target sub-project files of all folder types affiliated to the target project file from all associated sub-project files; determining path information of a current catalog of each target sub-engineering file and path information of the current catalog of the target engineering file; when the determined path information is a relative path, determining an absolute path of the current catalog of the target engineering file according to the pointed absolute path, the path information of the current catalog of the target engineering file and the path information of the current catalog of the target engineering file; and assigning the reference path variable parameter as an absolute path of the current catalog of the target engineering file.
Optionally, the step of assigning the reference path variable parameter according to the received target path information includes: when the engineering file is of a file type, extracting an absolute path of a directory where the engineering file is currently located from the pointed absolute path; and assigning the reference path variable parameter as an absolute path of the current catalog of the engineering file.
Another aspect of the present invention provides an apparatus for constructing an absolute path of a compilation product, the apparatus comprising: the receiving module is used for receiving the target path information and determining a target engineering file according to the target path information; the first acquisition module is used for acquiring path information of the defined compiled product output catalogue in the target engineering file; the second acquisition module is used for acquiring the reference path variable parameters associated with the relative path when the path information of the compiled product output catalog is the relative path, and assigning values to the reference path variable parameters according to the target path information; and the construction module is used for constructing the absolute path of the compiled product according to the assigned reference path parameter.
Yet another aspect of the present invention provides a computer apparatus comprising: the method for constructing the absolute path of the compiled product according to any one of the embodiments described above is implemented by a memory, a processor, and a computer program stored in the memory and executable on the processor when the processor executes the computer program.
A further aspect of the present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method for constructing an absolute path of a compiled product according to any of the embodiments described above.
According to the method for constructing the absolute path of the compiled product, a target engineering file is determined according to the received target path information, the path information of the compiled product output catalog is predefined in the target engineering file, if the path information of the compiled product output catalog is a relative path, a reference path variable parameter for converting the relative path into the absolute path is preset in the path information of the compiled product output catalog, the reference path variable parameter after being assigned according to the received target path information can be obtained, and the absolute path of the compiled product can be constructed according to the assigned reference path variable parameter. According to the embodiment, the reference path variable parameters are preset in the path information of the compiled product output catalog, so that in the process of constructing the compiled product, the reference path variable parameters are assigned based on the received target path information, and then the absolute path of the compiled product is constructed according to the assigned reference path variable parameters, the technical effect of automatically constructing the absolute path of the compiled product is achieved, and the technical problems that the efficiency is low and the error rate is high in the process of manually counting the expected absolute path of the compiled product in the prior art are solved.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to designate like parts throughout the figures. In the drawings:
FIG. 1 is a flow chart of a method for constructing an absolute path of a compiled product according to an embodiment of the invention;
FIG. 2 is a schematic diagram of a construction scheme of an absolute path of a compiled product according to an embodiment of the present invention;
FIG. 3 is a block diagram of an apparatus for constructing an absolute path of a compiled product according to a second embodiment of the present invention;
Fig. 4 shows a block diagram of a computer device adapted to implement the method for constructing an absolute path of a compiled product according to the third embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Example 1
The absolute path refers to a path from a root directory at the top of the tree directory structure to a certain directory or file, and consists of a series of continuous directories, the middle is separated by oblique lines until the directory or file to be specified is reached, and the last name in the path is the directory or file to be pointed to. For example, in this embodiment, the current directory of an engineering file crl.pro is CRL, and the absolute path of the current directory CRL is: E:/HYCode/ghy/Art/Source/CRL, the absolute path of the engineering document CRL.pro is: E:/HYCode/ghy/Art/Source/CRL.
In this embodiment, path information of the compiled product output directory is predefined in the target engineering file, and the path information may be a relative path or an absolute path, and when the path information is a relative path, a reference path parameter for converting the relative path into the absolute path is preset, and the reference path parameter is assigned to convert the relative path into the absolute path, so that the absolute path of the compiled product output directory is obtained. The absolute path of the compilation product output catalog may then be converted to an absolute path of the compilation product by determining the name of the compilation product and the suffix name of the compilation product.
It should be noted that, the compiled product output directory defined in this embodiment is actually a directory to which the compiled product is expected to be output, and if the compiled product is actually output to the compiled product output directory after the compiling is completed, the compiled product output directory at this time may also be referred to as a directory in which the compiled product is currently located.
Specifically, fig. 1 shows a flowchart of a method for constructing an absolute path of a compiled product according to an embodiment of the present invention, and as shown in fig. 1, the method for constructing an absolute path of a compiled product may include steps S1 to S4, where:
step S1, receiving target path information, and determining a target engineering file according to the target path information.
The target path information is used to define an absolute path of an engineering file, and the target path information may be an absolute path including the engineering file, for example, the target path information is: the absolute path of the engineering file is: E:/HYCode/ghy/Art/Source/CRL/CRL.pro; the absolute path of the engineering file can also be directly defined, for example, the target path information is E: HYCode/ghy/Art/Source/CRL/CRL.pro, and the implementation is not limited as long as the target path information can define the absolute path of the engineering file.
Further, an engineering file is positioned according to the target path information, and then the target engineering file is determined according to the type of the engineering file. Specifically, the step of determining the target engineering file according to the target path information in the step S1 may include steps S11 to S14, where:
Step S11, acquiring an absolute path pointed by the target path information;
step S12, determining engineering files existing under the directed absolute paths;
Step S13, when the project file is of a folder type, scanning all sub-project files associated with the project file, and determining the sub-project file of a file type as the target project file;
and S14, when the engineering file is of a file type, determining the engineering file as the target engineering file.
It should be noted that, the absolute path of a file uniquely points to the file, and the absolute path of a directory uniquely points to the directory. In this embodiment, the absolute path pointed by the target path information is the absolute path of the engineering file, and the absolute path points to only one engineering file. And acquiring the engineering file under the absolute path, and judging the type of the engineering file, wherein the type is divided into a file type and a folder type. If the project file is of the file type, the project file acquired by default is a target project file; if the file type is the folder type, it indicates that the obtained project file is associated with at least one sub-project file (each sub-project file is also referred to as an project file, and in this embodiment, the sub-project file is referred to as a sub-project file for convenience of distinguishing), all the associated sub-project files are scanned, the type of each sub-project file is determined, and the sub-project file of each file type is recorded as a target project file. In this case, there may be a plurality of target engineering files, for each of which an absolute path of the compiled product may be constructed by the method described in the first embodiment.
In general, a large software project may include hundreds of folders, which are used for project files with different functional modules, where each project file has an association relationship. For example, the physical distribution of folders is: the dependency relationship of the engineering files of each folder is A- > B- > C- > D- > E- > F, namely the engineering files under the folder A depend on the engineering files under the folder B, … and the engineering files under the folder E depend on the engineering files under the folder F. In the prior art, the compiling results of the engineering files under the folder A are manually analyzed, B, C, D, E and F folders are required to be opened in sequence, the compiling results of the 5 engineering files are analyzed, the actual compiling results of the engineering files under the folder A can be obtained, and the operation is very complicated. And, if it is for more complex dependencies, it may be more difficult for manual analysis to determine the relationships between the engineering files. Based on the above, the present embodiment identifies whether the project file is a folder type or a file type according to the type of the project file, and only the project file of the file type has path information of the compiled product output directory, and for the project file of the folder type, the sub-project file is traversed and the types of the sub-project files are continuously judged, and the sub-project file of the file type is determined as the target project file, i.e. the present embodiment can rapidly and accurately distinguish the dependency relationship of the project file based on the type of the project file.
It should be noted that the engineering file may be a QT engineering file, and correspondingly, the target engineering file may be a target QT engineering file, and the sub-engineering files may be QT sub-engineering files, where each QT sub-engineering file is also a QT engineering file, and may be referred to as a QT sub-engineering file for convenience of distinction.
And S2, acquiring path information of the compiled product output catalogue defined in the target engineering file. If the path information of the compiled output directory is a relative path, the path information is based on the absolute path of the target engineering file.
As can be seen from the above description, the target engineering file is a file type, in which path information of the compiled product output directory is defined, and when the path information is a relative path, reference path change parameters for converting the relative path into an absolute path are preset in the path information of the compiled product output directory. Optionally, the path information of the compiled output directory may further include offset number information for defining an offset number and offset path information for defining an offset path, the reference path may be determined by the reference path argument and the offset number defined by the offset number information, and the absolute path of the compiled output directory may be determined by the reference path and the offset path defined by the offset path information.
For example, the path information of the compiled output directory is $$ PWD/./ Release/Bin/X86, the $ PWD is a reference path parameter,./ is offset amount information, and the offset amount information can be used to obtain the offset amount of 2, and the Release/Bin/X86 is offset path information, and the offset path information at this time is the offset path. Assuming that the reference path variable parameter is assigned as E:/HYCode/ghy/Art/Source/CRL, the reference path is E:/HYCode/ghy/Art, and the absolute path of the compiled product output directory is E:/HYCode/ghy/Art/Release/Bin/X86 due to the offset number of 2.
And step S3, when the path information of the compiled product output catalog is a relative path, acquiring a reference path variable parameter associated with the relative path, and assigning a value to the reference path variable parameter according to the target path information.
Since the absolute path of the compiled product is determined by the absolute path of the compiled product output directory, the name of the compiled product and the extension of the compiled product, and the path information of the compiled product output directory is the relative path, the reference path is also required to be subjected to parameter assignment to determine the absolute path of the compiled product output directory. Further, since the path information of the compiled product output directory is stored in the target engineering file, the path information of the compiled product output directory takes the absolute path of the directory where the target engineering file is currently located as a reference path, and at this time, the absolute path of the directory where the target engineering file is currently located needs to be given a reference path parameter.
Specifically, in one embodiment, if the determined engineering file is the target engineering file, the absolute path pointed by the target path information is the absolute path of the target engineering file, and the absolute path of the directory where the engineering file is currently located is extracted from the pointed absolute path and assigned to the reference path to be changed. That is, the step of assigning the reference path variable parameter according to the target path information in step S3 may include step S31 and step S32, in which:
step S31, when the attribute of the engineering file is a file type, extracting an absolute path of a current catalog of the engineering file from the pointed absolute path;
And S32, assigning the reference path parameter as an absolute path of the current catalog of the engineering file.
For example, the absolute path of the direction is: E:/HYCode/ghy/Art/Source/CRL. Pro, the absolute path of the current directory of engineering files is: E:/HYCode/ghy/Art/Source/CRL.
In another embodiment, if a sub-project file associated with the determined project file is the target project file, the absolute path of the directory where the target project file is currently located is determined according to the directed absolute path, and is assigned to the reference path parameter. That is, the step of assigning the reference path variable parameter according to the target path information in step S3 may include steps S31 'to S33', wherein:
Step S31', when the project file is of a folder type, determining target sub-project files of all folder types affiliated to the target project file from all associated sub-project files;
Step S32', determining path information of the current catalogue of each target sub-engineering file and path information of the current catalogue of the target engineering file;
step S33', when the determined path information is a relative path, determining an absolute path of the current catalog of the target engineering file according to the directed absolute path, the path information of the current catalog of the target sub-engineering file and the path information of the current catalog of the target engineering file;
And step S34', the reference path variable parameter is assigned as an absolute path of the current catalog of the target engineering file.
When the determined path information is a relative path, the path information of the current catalog of the target sub-engineering file is also referred to as a relative path of the current catalog of the target sub-engineering file, and the path information of the current catalog of the target engineering file is also referred to as a relative path of the current catalog of the target engineering file.
Specifically, when the engineering file is of a folder type, the engineering file stores relative paths of the current catalogues of all the sub-engineering files of the next level, and the relative paths are realized based on absolute paths of the engineering file; if the sub-project file of the next level is of the folder type, the relative paths of the directories where all the sub-project files of the next level are currently located are stored in the sub-project file, and the relative paths of the next level are realized based on the absolute paths of the sub-project files of the next level, …, and so on. Further, determining target sub-project files of all folder types to which the target project file belongs, determining the absolute path of the current directory of the sub-project file of the folder type immediately above the target project file according to the relative path and the directed absolute path of the current directory of the target sub-project file, determining the absolute path of the current directory of the target project file by combining the relative path of the current directory of the target project file, and assigning the absolute path to the reference path to be changed.
For example, the absolute path of the project file 1 is D/ghy/Source/WGH/UGFi.pro, the next level of the project file 1 has two folder type sub-project files 11 and 12, the next level of the sub-project file 12 has one folder type sub-project file 121, and the next level of the sub-project file 121 has one file type sub-project file 1211 (i.e., target sub-project file). The relative path of the current catalog of the sub-engineering file 11 and the relative path of the current catalog of the sub-engineering file 12 are stored in the engineering file 1, the relative path of the current catalog of the sub-engineering file 121 is stored in the sub-engineering file 12, and the relative path of the current catalog of the sub-engineering file 1211 is stored in the sub-engineering file 121. The target sub-project files to which the sub-project file 1211 belongs are a sub-project file 12 and a sub-project file 121. The absolute path of the current directory of the sub-project file 121 can be determined according to the absolute path pointed to, the relative path of the current directory of the sub-project file 12 and the relative path of the current directory of the sub-project file 121, wherein the sub-project file 121 is a sub-project file of the type of the immediately previous level folder of the sub-project file 1211. Further, according to the absolute path of the current catalog of the sub-engineering file 121 and the relative path of the current catalog of the sub-engineering file 1211, the absolute path of the current catalog of the sub-engineering file 1211 can be determined, and then the absolute path is assigned to the reference path to be changed.
And S4, constructing an absolute path of the compiled product according to the assigned reference path parameter.
Specifically, step S4 may include step S41 and step S42, wherein:
S41, determining an absolute path of the compiled product output catalog according to the assigned reference path variable parameter;
and step S42, constructing the absolute path of the compiled product according to the absolute path of the compiled product output catalog.
And obtaining a reference path by assigning a value to the reference path variable, then obtaining a reference path by decreasing the reference path from the lowest level to the highest level by an offset number of directories, obtaining an absolute path of a compiled product output directory by combining the reference path and the offset path, and further constructing the absolute path of the compiled product according to the absolute path of the compiled product output directory.
Specifically, step S42 may include steps S421 to S424, wherein:
step S421, determining the name of the compiling product;
Step S422, obtaining the type of the compiled product defined in the target engineering file;
Step S423, determining the extension of the compiling product associated with the type of the compiling product;
step S424, constructing the absolute path of the compiled product according to the absolute path of the output catalog of the compiled product, the name of the compiled product and the extension of the compiled product.
If the name of the compiling product is defined in the target engineering file, the compiling product is directly acquired; if not, the name of the target project file may be determined as the name of the compilation product. Specifically, step S421 may include steps S4211 to S4213:
step S4211, judging whether the defined name of the compiling product exists in the target engineering file;
Step S4212, when the defined name of the compiling product exists in the target engineering file, acquiring the name of the compiling product from the target engineering file;
Step S4213, when the name of the compilation product is not defined in the target engineering file, determining the name of the target engineering file as the name of the compilation product.
Optionally, the types of the compiled products are predefined in the target engineering file, each type is pre-associated with an extension, the extension of the compiled product can be obtained through the type of the compiled product, and then the absolute path of the compiled product can be constructed according to the absolute path of the output catalog of the compiled product, the name of the compiled product and the extension of the compiled product.
For example, the absolute path of the output catalog of the compiling product is E: HYCode/ghy/Art/Release/Bin/X86, the name of the compiling product is CRL, the type of the compiling product is lib, the associated extension name is dll, and the absolute path of the compiling product is constructed as follows: e \ HYCode \ ghy \art\Release\Bin\X86\CRL.dll; if the other information is the same, but the type of the compiled product is app, the associated extension name is exe, and the absolute path of the compiled product is constructed as follows: e \ HYCode \ ghy \art\Release\Bin\X86\CRL.exe.
The construction process of the absolute path of the compilation product of the present invention is described in detail below with a specific example.
As shown in FIG. 2, a user enters an absolute path of an engineering file, and the engineering file is uniquely determined according to the absolute path. And analyzing the engineering file, judging whether the engineering file is of a file type or a folder type, and if the engineering file is of the folder type, scanning all the associated sub-engineering files until the sub-engineering files of the file type (namely the target engineering file) are determined. If the file type is the file type, the engineering file uniquely determined according to the absolute path is the target engineering file. Analyzing the information in the target engineering file to judge the extension of the editing product, and specifically determining the extension according to the type of the editing product. Then, assigning a reference path parameter (i.e., $PWD macro definition) to convert the reference path parameter into an absolute path of the current catalog of the target engineering file, determining an absolute path of a compiling product output catalog according to the assigned reference path parameter, and constructing an absolute path of the compiling product: absolute path of compiled product output directory + name of compiled product + extension of compiled product and the absolute path of built compiled product is stored in data table.
Example two
The second embodiment of the present invention further provides a device for constructing an absolute path of a compiled product, where the device for constructing an absolute path of a compiled product corresponds to the method for constructing an absolute path of a compiled product provided in the first embodiment, and corresponding technical features and technical effects are not described in detail in the present embodiment, and reference is made to the first embodiment for relevant points. Specifically, fig. 3 shows a block diagram of a device for constructing an absolute path of a compiled product according to a second embodiment of the present invention. As shown in fig. 3, the construction apparatus 300 of the absolute path of the compiled product may include a receiving module 301, a first obtaining module 302, a second obtaining module 303, and a construction module 304, wherein:
A receiving module 301, configured to receive target path information, and determine a target engineering file according to the target path information;
a first obtaining module 302, configured to obtain path information of a compiled product output directory defined in the target engineering file;
a second obtaining module 303, configured to obtain a reference path argument associated with a relative path when the path information of the compiled output directory is the relative path, and assign a value to the reference path argument according to the target path information;
A construction module 304, configured to construct an absolute path of the compiled product according to the assigned reference path argument.
Optionally, the building module further comprises: the first determining unit is used for determining the absolute path of the compiling product output catalogue according to the assigned reference path variable parameter; and the construction unit is used for constructing the absolute path of the compiling product according to the absolute path of the compiling product output catalog.
Optionally, the building unit is further configured to: determining the name of the compiled product; acquiring the type of the defined compiling product in the target engineering file; determining an extension of the compilation product associated with the type of the compilation product; and constructing the absolute path of the compiling product according to the absolute path of the compiling product output catalog, the name of the compiling product and the extension name of the compiling product.
Optionally, the building unit, when performing the step of determining the name of the compilation product, is further configured to: judging whether the defined name of the compiling product exists in the target engineering file; when the defined name of the compiling product exists in the target engineering file, acquiring the name of the compiling product from the target engineering file; and when the name of the compiling product is not defined in the target engineering file, determining the name of the target engineering file as the name of the compiling product.
Optionally, the receiving module, when executing the step of determining the target engineering file according to the target path information, includes: an obtaining unit, configured to obtain an absolute path pointed by the target path information; the second determining unit is used for determining engineering files existing under the directed absolute path; the third determining unit is used for scanning all the sub-project files associated with the project file when the project file is of a folder type, and determining the sub-project file of a file type as the target project file; and the fourth determining unit is used for determining the engineering file as the target engineering file when the engineering file is of a file type.
Optionally, the second obtaining module when performing the step of assigning the reference path variable parameter according to the target path information includes: a fifth determining unit, configured to determine, when the project file is of a folder type, target sub-project files of all folder types to which the target project file belongs from all associated sub-project files; a sixth determining unit, configured to determine path information of a current directory where each target sub-engineering file is located and path information of a current directory where the target engineering file is located; a seventh determining unit, configured to determine, when the determined path information is a relative path, an absolute path of a current directory of the target engineering file according to the pointed absolute path, path information of the current directory of the target engineering file, and path information of the current directory of the target engineering file; and the first assignment unit is used for assigning the reference path variable parameter as an absolute path of the current catalog of the target engineering file.
Optionally, the second obtaining module further includes, when performing the step of assigning the reference path variable parameter according to the target path information: the extraction unit is used for extracting the absolute path of the current catalog of the engineering file from the directed absolute path when the engineering file is of the file type; and the second assignment unit is used for assigning the reference path variable parameter as an absolute path of the current catalog of the engineering file.
Example III
Fig. 4 shows a block diagram of a computer device adapted to implement the method for constructing an absolute path of a compiled product according to the third embodiment of the present invention. In this embodiment, the computer device 400 may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack-mounted server, a blade server, a tower server, or a rack-mounted server (including a stand-alone server or a server cluster formed by a plurality of servers) for executing a program, etc. As shown in fig. 4, the computer device 400 of the present embodiment includes at least, but is not limited to: a memory 401, a processor 402, and a network interface 403 which may be communicatively connected to each other through a system bus. It should be noted that FIG. 4 only shows computer device 400 having components 401-403, but it should be understood that not all of the illustrated components are required to be implemented and that more or fewer components may be implemented instead.
In this embodiment, the memory 403 includes at least one type of computer-readable storage medium, which includes flash memory, hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random Access Memory (RAM), static Random Access Memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 401 may be an internal storage unit of the computer device 400, such as a hard disk or a memory of the computer device 400. In other embodiments, the memory 401 may also be an external storage device of the computer device 400, such as a plug-in hard disk provided on the computer device 400, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD), or the like. Of course, memory 401 may also include both internal storage elements of computer device 400 and external storage devices. In the present embodiment, the memory 401 is typically used to store an operating system installed on the computer device 400 and various types of application software, such as program codes of a construction method of an absolute path of a compilation product, and the like.
Processor 402 may be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 402 is generally used to control the overall operation of the computer device 400. Such as performing control and processing related to data interaction or communication with the computer device 400. In this embodiment, the processor 402 is configured to execute program codes of steps of a method for constructing an absolute path of a compiled product stored in the memory 401.
In this embodiment, the method for constructing the absolute path of the compiled product stored in the memory 401 may also be divided into one or more program modules and executed by one or more processors (the processor 402 in this embodiment) to implement the present invention.
The network interface 403 may include a wireless network interface or a wired network interface, the network interface 403 typically being used to establish a communication link between the computer device 400 and other computer devices. For example, the network interface 403 is used to connect the computer device 400 to an external terminal through a network, establish a data transmission channel and a communication link between the computer device 400 and the external terminal, and the like. The network may be a wireless or wired network such as an Intranet (Intranet), the Internet (Internet), a global system for mobile communications (Global System of Mobile communication, abbreviated as GSM), wideband code division multiple access (Wideband Code Division Multiple Access, abbreviated as WCDMA), a 4G network, a 5G network, bluetooth (Bluetooth), wi-Fi, etc.
Example IV
The present embodiment also provides a computer-readable storage medium including a flash memory, a hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application store, etc., on which a computer program is stored, which when executed by a processor, implements the steps of the construction method of the absolute path of the compiled product.
It will be apparent to those skilled in the art that the modules or steps of the embodiments of the invention described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may alternatively be implemented in program code executable by computing devices, so that they may be stored in a storage device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than what is shown or described, or they may be separately fabricated into individual integrated circuit modules, or a plurality of modules or steps in them may be fabricated into a single integrated circuit module. Thus, embodiments of the invention are not limited to any specific combination of hardware and software.
It should be noted that, the embodiment numbers of the present invention are only for description, and do not represent the advantages and disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (9)

1. A method of constructing an absolute path of a compilation product, the method comprising:
Receiving target path information, and determining a target engineering file according to the target path information; specifically, the target path information is used for defining an absolute path of an engineering file, and when the engineering file is of a file type, the engineering file is determined to be the target engineering file;
Acquiring path information of a defined compiled product output catalog in the target engineering file;
When the path information of the compiled product output catalog is a relative path, acquiring a reference path variable parameter associated with the relative path, and assigning a value to the reference path variable parameter according to the target path information; specifically, the absolute path of the catalog where the target engineering file is currently located is endowed with the reference path for parameter changing;
Constructing an absolute path of a compiling product according to the assigned reference path variable parameters;
the step of constructing the absolute path of the compiled product according to the assigned reference path variable parameter comprises the following steps:
Determining an absolute path of the compiled product output catalog according to the assigned reference path variable parameters;
and constructing the absolute path of the compiling product according to the absolute path of the compiling product output catalog.
2. The method of claim 1, wherein the step of constructing the absolute path of the compiled product from the absolute path of the compiled product output directory comprises:
Determining the name of the compiled product;
Acquiring the type of the defined compiling product in the target engineering file;
Determining an extension of the compilation product associated with the type of the compilation product;
and constructing the absolute path of the compiling product according to the absolute path of the compiling product output catalog, the name of the compiling product and the extension name of the compiling product.
3. The method of claim 2, wherein the step of determining the name of the compiled product comprises:
judging whether the defined name of the compiling product exists in the target engineering file;
when the defined name of the compiling product exists in the target engineering file, acquiring the name of the compiling product from the target engineering file;
and when the name of the compiling product is not defined in the target engineering file, determining the name of the target engineering file as the name of the compiling product.
4. The method of claim 1, wherein the step of determining a target project file from the target path information comprises:
Acquiring an absolute path pointed by the target path information;
Determining engineering files existing under the directed absolute path;
When the project file is of a folder type, scanning all sub-project files associated with the project file, and determining the sub-project files of a file type as the target project file;
and when the engineering file is of a file type, determining the engineering file as the target engineering file.
5. The method of claim 4, wherein assigning the reference path argument according to the target path information comprises:
When the project file is of a folder type, determining target sub-project files of all folder types affiliated to the target project file from all associated sub-project files;
determining path information of a current catalog of each target sub-engineering file and path information of the current catalog of the target engineering file;
When the determined path information is a relative path, determining an absolute path of the current catalog of the target engineering file according to the pointed absolute path, the path information of the current catalog of the target engineering file and the path information of the current catalog of the target engineering file;
And assigning the reference path variable parameter as an absolute path of the current catalog of the target engineering file.
6. The method of claim 4, wherein assigning the reference path argument according to the target path information comprises:
When the engineering file is of a file type, extracting an absolute path of a directory where the engineering file is currently located from the pointed absolute path;
and assigning the reference path variable parameter as an absolute path of the current catalog of the engineering file.
7. A build apparatus for implementing the absolute path of the compilation product of the method of any of claims 1 to 6, the apparatus comprising:
The receiving module is used for receiving the target path information and determining a target engineering file according to the target path information;
The first acquisition module is used for acquiring path information of the defined compiled product output catalogue in the target engineering file;
the second acquisition module is used for acquiring the reference path variable parameters associated with the relative path when the path information of the compiled product output catalog is the relative path, and assigning values to the reference path variable parameters according to the target path information;
And the construction module is used for constructing the absolute path of the compiled product according to the assigned reference path parameter.
8. A computer device, the computer device comprising: a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of any of claims 1 to 6 when executing the computer program.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the method of any one of claims 1 to 6.
CN202110295107.3A 2021-03-19 2021-03-19 Method and device for constructing absolute path of compiled product and readable storage medium Active CN112988161B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110295107.3A CN112988161B (en) 2021-03-19 2021-03-19 Method and device for constructing absolute path of compiled product and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110295107.3A CN112988161B (en) 2021-03-19 2021-03-19 Method and device for constructing absolute path of compiled product and readable storage medium

Publications (2)

Publication Number Publication Date
CN112988161A CN112988161A (en) 2021-06-18
CN112988161B true CN112988161B (en) 2024-05-28

Family

ID=76333773

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110295107.3A Active CN112988161B (en) 2021-03-19 2021-03-19 Method and device for constructing absolute path of compiled product and readable storage medium

Country Status (1)

Country Link
CN (1) CN112988161B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109358841A (en) * 2018-08-15 2019-02-19 中国平安人寿保险股份有限公司 Web application develops Compilation Method, device and storage equipment, computer equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100442234C (en) * 2005-06-21 2008-12-10 国际商业机器公司 Software package constructing method and system for embedded system
US20070055963A1 (en) * 2005-09-08 2007-03-08 Lucent Technologies, Inc. Compile target and compiler flag extraction in program analysis and transformation systems

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109358841A (en) * 2018-08-15 2019-02-19 中国平安人寿保险股份有限公司 Web application develops Compilation Method, device and storage equipment, computer equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
浅谈网站建设中相对路径与绝对路径的使用;徐学辉;;中国科技信息(第03期);全文 *

Also Published As

Publication number Publication date
CN112988161A (en) 2021-06-18

Similar Documents

Publication Publication Date Title
CN109388566B (en) Code coverage rate analysis method, device, equipment and storage medium
CN108920250B (en) Application program containerization method and device
CN110704521A (en) Interface data access method and system
AU2018314520B2 (en) Collision check data processing method and apparatus, electronic device, and storage medium
CN108491321B (en) Method and device for determining test case range and storage medium
CN111191079B (en) Document content acquisition method, device, equipment and storage medium
CN104123381A (en) Automatic matching method of hardware board card
CN110175157B (en) Query method and query device for column storage file
US20140108469A1 (en) Software discovery with variable scan frequency
CN106557419B (en) Program testing method and device
CN105072398A (en) Equipment upgrading method and equipment upgrading device
CN111026647A (en) Code coverage rate obtaining method and device, computer equipment and storage medium
CN113238766A (en) Software deployment method, device and related equipment
CN112988161B (en) Method and device for constructing absolute path of compiled product and readable storage medium
CN111026047B (en) Software configuration method and device
CN112597023A (en) Case management method and device based on guide picture, computer equipment and storage medium
CN111274128A (en) Test method, test device, computer equipment and computer readable storage medium
CN111475165A (en) Intelligent compiling method, system, terminal and storage medium for application program
US9396239B2 (en) Compiling method, storage medium and compiling apparatus
CN110837500A (en) Data screening method and device based on local embedded window and computer equipment
CN112767040B (en) Engineering pricing file generation method and device, computer equipment and storage medium
CN102420724A (en) Method and device for testing north-orientation performance index
CN114511314A (en) Payment account management method and device, computer equipment and storage medium
CN111737316A (en) Engineering list query method and device, computer equipment and storage medium
CN113342860A (en) Index calculation method, device, equipment and storage medium based on universal interface

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