WO2022105563A1 - 索引文件生成方法、终端设备、电子设备及介质 - Google Patents

索引文件生成方法、终端设备、电子设备及介质 Download PDF

Info

Publication number
WO2022105563A1
WO2022105563A1 PCT/CN2021/126885 CN2021126885W WO2022105563A1 WO 2022105563 A1 WO2022105563 A1 WO 2022105563A1 CN 2021126885 W CN2021126885 W CN 2021126885W WO 2022105563 A1 WO2022105563 A1 WO 2022105563A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
index file
target application
directory
file
Prior art date
Application number
PCT/CN2021/126885
Other languages
English (en)
French (fr)
Inventor
李俊良
Original Assignee
北京字节跳动网络技术有限公司
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 北京字节跳动网络技术有限公司 filed Critical 北京字节跳动网络技术有限公司
Publication of WO2022105563A1 publication Critical patent/WO2022105563A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present disclosure relates to the field of computer technologies, and in particular, the present disclosure relates to a method for generating an index file, a terminal device, an electronic device, and a medium.
  • index file Mainly used to record the relationship between data and its storage path.
  • the storage path of data in one electronic device is different from the storage path of the data in another electronic device, which makes the index file generated by one electronic device unable to be used in another electronic device. Therefore, for each electronic device that needs to compile the source code of the application, the electronic device needs to generate an index file before or during the compilation of the source code of the application. If the electronic device generates an index file before compiling the source code of the application, it will not only consume a lot of time resources, but also occupy a lot of system resources, making it difficult for the electronic device to perform other operations for a long time; When the source code of the application is compiled, the index file is generated, which not only consumes a lot of time resources, but also greatly increases the compilation time and affects the development process of the application.
  • the present disclosure provides a method for generating an index file, a terminal device, an electronic device and a medium, which can quickly generate an index file.
  • a method for generating an index file is provided, and the method is executed by a terminal device, including:
  • the first index file and compilation process data of the target application wherein the first index file is generated when compiling the source code of the target application, the directory path of each target file is recorded in the first index file, and the compilation process data is recorded in the first index file. is the data related to the first index file generated during the compilation process;
  • the second index file corresponding to the target application program in the terminal device is obtained.
  • a terminal device in a second aspect, includes:
  • the acquisition module is used to acquire the first index file and compilation process data of the target application, wherein the first index file is generated when compiling the source code of the target application, and the directory of each target file is recorded in the first index file path, the compilation process data is the data related to the first index file generated in the compilation process;
  • a first determining module used for determining target replacement parameters by using the compilation process data
  • the second determination module is used to determine the parameter value of the target replacement parameter corresponding to the target application program in the terminal device
  • the replacement module is configured to replace the parameter value of the target replacement parameter in the first index file with the determined parameter value to obtain the second index file corresponding to the target application in the terminal device.
  • an electronic device which includes:
  • processors one or more processors
  • one or more application programs wherein the one or more application programs are stored in memory and configured to be executed by one or more processors, the one or more programs are configured to: execute the indexing according to the first aspect The operation corresponding to the file generation method.
  • a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, the method for generating an index file shown in the first aspect is implemented.
  • the present disclosure provides a method for generating an index file, a terminal device, an electronic device and a medium.
  • the present disclosure obtains a first index file and compilation process data of a target application program, wherein the first index file is Generated in the process of compiling the source code of the target application, the directory path of each target file is recorded in the first index file, and the compilation process data is the data related to the first index file generated in the compilation process.
  • the process data determines the target replacement parameter, determines the parameter value of the target replacement parameter corresponding to the target application in the terminal device, and finally replaces the parameter value of the target replacement parameter in the first index file with the determined parameter value to obtain the target in the terminal device.
  • the second index file corresponding to the application program realizes the replacement of the parameter value of the target replacement parameter in the original index file, thereby quickly obtaining the index file corresponding to the target application program in the terminal device, reducing time consumption and improving the performance of the application program. development efficiency.
  • FIG. 1 is a schematic flowchart of a method for generating an index file according to an embodiment of the present disclosure
  • FIG. 2 is a schematic structural diagram of a terminal device according to an embodiment of the present disclosure
  • FIG. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
  • the term “including” and variations thereof are open-ended inclusions, ie, "including but not limited to”.
  • the term “based on” is “based at least in part on.”
  • the term “one embodiment” means “at least one embodiment”; the term “another embodiment” means “at least one additional embodiment”; the term “some embodiments” means “at least some embodiments”. Relevant definitions of other terms will be given in the description below.
  • An embodiment of the present disclosure provides a method for generating an index file, which can be executed by a terminal device, where the terminal device can be a mobile phone, a tablet computer, a desktop computer, a notebook computer, etc. As shown in FIG. 1 , the method includes steps S101 to S104 .
  • Step S101 acquiring a first index file and compilation process data of a target application.
  • the first index file is generated when compiling the source code of the target application, the directory path of each target file is recorded in the first index file, and the compilation process data is the data related to the first index file generated during the compilation process .
  • the first index file is generated by the server of the target application program in the process of compiling the source code of the program.
  • the server of the target application is the server that provides the service of the target APP.
  • the server of the target APP can compile the source code of the target App, and during the compilation process, the index file of the target App (that is, the above-mentioned first index file) and the data related to the index file (including but not limited to the above-mentioned compilation process) will be generated.
  • data the related data may include but not limited to data such as the storage location or storage path of the file related to the index file.
  • step S102 target replacement parameters are determined using the compilation process data.
  • Step S103 Determine the parameter value of the target replacement parameter corresponding to the target application in the terminal device.
  • Step S104 replace the parameter value of the target replacement parameter in the first index file with the determined parameter value to obtain a second index file corresponding to the target application in the terminal device.
  • the index file (including the first index file and the second index file mentioned above) is also called a unit file.
  • the unit file structure of an index usually includes three parts, which are the directory path of the index file and the target file's directory path.
  • the file name and the check code corresponding to the target file, the check code may be a Hash check code.
  • the unit file structure of an index can be: /xxx/Index/DataStore/v5/units/TTBridgePlugins-dummy.o-3GROH29GTL804, where /xxx/Index/DataStore/v5/units is the directory path of the index file, TTBridgePlugins -dummy.o is the file name of the target file, and 3GROH29GTL804 is the check code corresponding to the target file.
  • the target file is the OBJ file.
  • the file name of the target file and its check code are obtained by calculating the relevant information of the target file, and the relevant information of the target file may be the directory path of the target file.
  • TTBridgePlugins-dummy.o-3GROH29GTL804 is obtained by calculating the relevant information of the target file.
  • the relevant information of the target file can be: "/Users/yyy/Library/Developer/Xcode/DerivedData/Article-eyvyloqhxkpnlkbzndcpojajjnbr/Build/ Intermediates.noindex/Article.build/Video-iphonesimulator/VideoInHouse.build/Objects-normal/x86_64/BDViewController.o", the relevant information of this object file is the directory path of the object file.
  • an index database reading and writing tool may be installed in the terminal device, and the relevant steps in steps S101 to S104 are performed by using the index database reading and writing tool.
  • the index database reading and writing tool can be obtained based on the underlying virtual machine (Low Level Virtual Machine, LLVM), and can be used to modify the parameter value of the target replacement parameter in the index file.
  • LLVM Low Level Virtual Machine
  • An embodiment of the present disclosure provides a method for generating an index file.
  • the embodiment of the present disclosure obtains a first index file and compilation process data of a target application program, wherein the first index file is for the target application program.
  • the source code is generated when compiling, the directory path of each target file is recorded in the first index file, the compilation process data is the data related to the first index file generated in the compilation process, and then, the target replacement parameter is determined by using the compilation process data , determine the parameter value of the target replacement parameter corresponding to the target application in the terminal device, and finally, replace the parameter value of the target replacement parameter in the first index file with the determined parameter value, and obtain the second corresponding to the target application in the terminal device.
  • the index file realizes the replacement of the parameter value of the target replacement parameter in the original index file, thereby quickly obtaining the index file corresponding to the target application program in the terminal device, reducing time consumption and improving the development efficiency of the application program.
  • the index file includes at least one item of the following information A1-A4.
  • the index file may be the first index file or the second index file, that is to say, the file content styles of the first index file and the second index file are the same, and the difference between the two is that the two files The parameter value of the target substitution parameter differs.
  • the information A1 the work directory information is work_dir information
  • the work_dir information includes the directory path of the parent directory of the work space of the target application.
  • the work_dir information in the index file may include: /Users/yyy/Desktop/Workspace/TTVideo/Article, where the path includes the directory path of the parent directory of the workspace of the target application.
  • the work_dir information in the first index file is included in the server of the target application, the directory path of the parent directory of the workspace of the target application; the work_dir information in the second index file is included in the terminal device , the directory path to the parent directory of the target application's workspace.
  • the main path information is mainPath information
  • the mainPath information includes the directory path of the source code of the target application.
  • the mainPath information in the index file may include: /Users/yyy/Desktop/Workspace/TTVideo/Article/ShortVideo/Detail/Classes/VideoDetail/VideoDetailPage/Actions/ADVideoDetailActionManager.m, where the path includes the source of the target application The directory path of the code.
  • the mainPath information in the first index file is included in the server of the target application, the directory path of the source code of the target application; the mainPath information in the second index file is included in the terminal device, the target application The directory path of the source code.
  • the information A3 is the out directory information, namely out_dir information, and the out_dir information includes the directory path of each target file generated in the process of compiling the source code of the target application.
  • the out_dir information of the index file can include: /Users/yyy/Library/Developer/Xcode/DerivedData/Article-eyvyloqhxkpnlkbzndcpojajjnbr/Build/Intermediates.noindex/Article.build/Video-iphonesimulator/VideoInHouse.build/Objects-normal/x86_64 /ADVideoDetailActionManager.o, where the path includes the directory path of each target file generated during the process of compiling the source code of the target application.
  • the out_dir information in the first index file is included in the server of the target application, and the directory paths of each target file generated during the process of compiling the source code of the target application; the out_dir in the second index file
  • the information includes, in the terminal device, the directory paths of each target file generated during the process of compiling the source code of the target application.
  • the information A4 is the dependent directory information, that is, the dep_dir information, and the dep_dir information includes the directory path of each file on which the source code of the target application program depends.
  • the dep_dir information of the index file may include: /Users/yyy/Desktop/Workspace/TTVideo/Article/Model/DataModel/Article+Biz.h
  • step S101 acquiring the first index file and the compilation process data of the target application may specifically include: acquiring the first index file and the compilation process of the target application from the cloud server data.
  • the cloud server is the server that stores the first index file and the compilation process data.
  • the server of the target application program generates the first index file and the data related to the first index file each time the source code of the target application program is compiled.
  • the first index file and data related to the first index file are uploaded to the cloud server.
  • the server of the target application may obtain the first index file generated in the process of compiling the source code of the target application, and the target application The data related to the first index file generated in the process of the source code of the program, and the generated first index file and the data related to the first index file are uploaded to the cloud server.
  • the commit ID (Commit ID) of the target application can be used to generate mark information, and the mark information can be used to mark this time The uploaded first index file and data related to the first index file.
  • the commit number when using the commit number to generate the tag information, can be used as the tag information, or the commit number and other information can be used to generate the tag information, and the other information can include the unified resources of the distributed version control system (Git). Locator (Uniform Resource Locator, URL), and/or, identification information (such as name) of the target application, etc.
  • Git distributed version control system
  • Locator Uniform Resource Locator, URL
  • identification information such as name
  • the terminal device when the terminal device detects that the target application is updated, it can obtain the first index file corresponding to the target tag information and the first index file from the cloud server according to the updated submission number of the target application.
  • the first index file corresponding to the target mark information is taken as the first index file
  • the data related to the first index file corresponding to the target mark information is taken as the compilation process data.
  • the target tag information includes the updated commit number.
  • the compilation process data includes workspace information and storage space information of cache data generated in the compilation process.
  • the workspace information is the workspace information
  • the storage space information of the cached data generated during the compilation process is the DerviedData information.
  • the workspace file includes at least one file and/or at least one folder
  • the DerviedData file mainly stores cache data.
  • compilation process data includes workspace information and DerviedData information, but is not limited to the above two information, which is not limited here.
  • the target replacement parameter is determined by using the compilation process data, which may specifically include steps S1021 and S1022.
  • step S1021 the parent directory of the workspace of the target application is determined according to the workspace information as the target replacement parameter. That is, take the parent directory of the target application's workspace as the target substitution parameter.
  • the workspace of the target application and the parent directory of the workspace may be determined according to the workspace information.
  • the workspace of the target application is xcworkspace.
  • the directory path of the workspace can be: /Users/yyy/Desktop/Workspace/TTVideo/Article/Article.xcworkspace, in this path, the workspace is Article.xcworkspace, and the parent directory of the workspace is Article.
  • the parameter value of the target replacement parameter in the index file includes the directory path of the parent directory of the workspace, where the directory path of the parent directory of the workspace is also called workdir.
  • the parent directory of the workspace is Article
  • the directory path of Article is: /Users/yyy/Desktop/Workspace/TTVideo/Article. That is, the workdir is: /Users/yyy/Desktop/Workspace/TTVideo/Article.
  • the work_dir information in the information A1 includes the directory path of the parent directory of the workspace, for example, /Users/yyy/Desktop/Workspace/TTVideo/Article in the work_dir information is the directory path of the parent directory of the workspace , which is the directory path of Article.
  • the workspace information can include xcworkspace and its directory path, the parent directory of xcworkspace and the directory path of the parent directory, the subdirectory of xcworkspace and the directory path of the subdirectory, such as WorkspaceSettings.xcsettings of the corresponding user in the xcworkspace directory.
  • Step S1022 Determine the root directory of the target file corresponding to the target application program according to the storage space information, as the target replacement parameter. Take the root directory of the target file corresponding to the target application as the target replacement parameter.
  • the root directory of the target file may be determined according to the DerviedData information, where the root directory of the target file is OBJ_ROOT.
  • the parameter value of the target replacement parameter in the index file includes the directory path of OBJ_ROOT.
  • the directory path for OBJ_ROOT could be: /Users/yyy/Library/Developer/Xcode/DerivedData/Article-eyvyloqhxkpnlkbzndcpojajjnbr/Build/Intermediates.noindex.
  • DerviedData information may include DerviedData, OBJ_ROOT in DerviedData, etc., which is not limited herein.
  • the parameter value of the target replacement parameter corresponding to the target application in the terminal device is determined, Specifically, it may include: determining the workspace of the target application in the terminal device; determining the directory path of the parent directory of the workspace, and using the determined directory path of the parent directory of the workspace as the work corresponding to the target application in the terminal device The parameter value of the parent directory of the space.
  • the parameter value of the target replacement parameter corresponding to the target application in the terminal device is determined, which may specifically include: determining the workspace of the target application in the terminal device; Using the directory path of the workspace, determine the directory path of the root directory of the target file corresponding to the target application in the terminal device, and use the determined directory path of the root directory of the target file as the parameter value of the root directory of the target file.
  • step S103 the parameter value of the target replacement parameter corresponding to the target application in the terminal device is determined, which may specifically include steps S1031-S1032.
  • Step S1031 Determine the workspace of the target application in the terminal device.
  • Step S1032 using the workspace, determine the parameter value of the target replacement parameter corresponding to the target application in the terminal device.
  • the workspace xcworkspace of the target application in the terminal device can be determined, and the parameter value of the target replacement parameter corresponding to the target application in the terminal device is determined by using the xcworkspace of the target application in the terminal device.
  • the target replacement parameter includes the parent directory of the target application's workspace. Then, in step S1032, use the workspace to determine the parameter value of the target replacement parameter corresponding to the target application in the terminal device, which may specifically include:
  • the workspace xcworkspace of the target application in the terminal device can be used to determine the directory path of the parent directory of the xcworkspace, and the determined directory path of the parent directory of the xcworkspace can be used as the corresponding target application in the terminal device.
  • the parameter value of the parent directory of xcworkspace can be used to determine the directory path of the parent directory of the xcworkspace, and the determined directory path of the parent directory of the xcworkspace can be used as the corresponding target application in the terminal device.
  • the target replacement parameter includes the parent directory of the xcworkspace of the target application, and correspondingly, the parameter value of the target replacement parameter includes the directory path of the parent directory of the xcworkspace of the target application.
  • step S104 the directory path of the parent directory of xcworkspace in the first index file can be replaced, and the parent directory of xcworkspace of the target application in the terminal device can be used to replace the parent directory of xcworkspace in the first index file.
  • the directory path of the directory, where the directory path of the parent directory of the xcworkspace in the first index file is the directory path of the parent directory of the xcworkspace of the target application in the server of the target application.
  • the work_dir information, mainPath information and dep_dir information in the first index file include the directory path of the parent directory of xcworkspace, and the directory path of the parent directory of xcworkspace in the above three pieces of information can be replaced.
  • At least one of the work_dir information, mainPath information and dep_dir information may not include the directory path of the parent directory of xcworkspace, and/or other information in the first index file may also include the directory path of the parent directory of xcworkspace , which is not limited here.
  • step S1032 use the workspace to determine the parameter value of the target replacement parameter corresponding to the target application in the terminal device, which may specifically include:
  • the directory path of the workspace determine the directory path of the root directory of the target file corresponding to the target application in the terminal device, and use the determined directory path of the root directory of the target file as the parameter value of the root directory of the target file.
  • the workspace xcworkspace of the target application in the terminal device can be used to determine the directory path of the xcworkspace, for example, the directory path of the xcworkspace can be: /Users/yyy/Desktop/Workspace/TTVideo/Article/Article. xcworkspace.
  • the directory path of the temporary directory can be determined using the directory path of the xcworkspace in the terminal device.
  • the temporary directory is the directory of the target file generated when the terminal device compiles the source code of the target application.
  • the directory path for the temporary directory could be: /Users/yyy/Library/Developer/Xcode/DerivedData/Article-eyvyloqhxkpnlkbzndcpojajjnbr.
  • the directory path of the root directory of the target file corresponding to the target application program in the terminal device can be determined, and the determined directory path of the root directory of the target file can be used as the root directory of the target file parameter value.
  • the following path can be determined according to the directory path of the temporary directory: /Users/yyy/Library/Developer/Xcode/DerivedData/Article-eyvyloqhxkpnlkbzndcpojajjnbr/Build/Intermediates.noindex, which is the root directory of the determined target file directory path.
  • the target replacement parameter includes the root directory OBJ_ROOT of the target file, and correspondingly, the parameter value of the target replacement parameter includes the directory path of OBJ_ROOT, that is, the directory path of OBJ_ROOT is the parameter value of OBJ_ROOT.
  • the directory path of OBJ_ROOT in the first index file may be replaced, and the directory path of OBJ_ROOT in the target application in the terminal device is used to replace the directory path of OBJ_ROOT in the first index file, wherein the first The directory path of OBJ_ROOT in the index file is the directory path of OBJ_ROOT of the target application in the server of the target application.
  • the out_dir information in the first index file and the dep_dir information include the directory path of OBJ_ROOT, and the directory path of OBJ_ROOT in the above two pieces of information can be replaced.
  • At least one of the out_dir information and the dep_dir information may not include the directory path of OBJ_ROOT, and/or other information in the first index file may also include the directory path of OBJ_ROOT, which is not limited here.
  • the above describes the index file generation method from the perspective of method steps.
  • the following describes the terminal device from the perspective of virtual module, as follows:
  • the terminal device 20 may include: an acquisition module 201, a first determination module 202, a second determination module 203, and a replacement module 204, wherein,
  • the obtaining module 201 is used to obtain the first index file and compilation process data of the target application, wherein the first index file is generated when compiling the source code of the target application, and the first index file records the data of each target file.
  • Directory path, the compilation process data is the data related to the first index file generated in the compilation process.
  • the first determining module 202 is configured to determine target replacement parameters by using the compilation process data.
  • the second determining module 203 is configured to determine the parameter value of the target replacement parameter corresponding to the target application in the terminal device.
  • the replacement module 204 is configured to replace the parameter value of the target replacement parameter in the first index file with the determined parameter value to obtain a second index file corresponding to the target application in the terminal device.
  • the acquiring module 201 acquires the first index file and the compilation process data of the target application, it is specifically used for:
  • the cloud server is the server that stores the first index file and the compilation process data.
  • the server of the target application program will generate the first index file and the data related to the first index file every time the source code of the target application program is compiled.
  • An index file and data related to the first index file are uploaded to the cloud server.
  • the compilation process data includes workspace information and storage space information of cached data generated in the compilation process
  • the first determining module 202 uses the compilation process data to determine the target replacement parameter, it is specifically used for:
  • the root directory of the target file corresponding to the target application is determined according to the storage space information as the target replacement parameter.
  • the target replacement parameter includes the parent directory of the workspace of the target application
  • the second determining module 203 is specifically configured to:
  • the target replacement parameter includes the root directory of the target file
  • the second determination module 203 determines the parameter value of the target replacement parameter corresponding to the target application in the terminal device, it is specifically used for:
  • the directory path of the workspace determine the directory path of the root directory of the target file corresponding to the target application in the terminal device, and use the determined directory path of the root directory of the target file as the parameter value of the root directory of the target file.
  • the index file includes at least one of the following:
  • Working directory work_dir information includes the directory path of the parent directory of the workspace of the target application
  • the main path mainPath information includes the directory path of the source code of the target application
  • the out_dir information of the outer directory, the out_dir information includes the directory path of each target file generated in the process of compiling the source code of the target application;
  • the dependency directory dep_dir information includes the directory path of each file on which the source code of the target application depends.
  • the first determination module 202 and the second determination module 203 may be the same determination module, or may be different determination modules, which are not limited herein.
  • the terminal device in this embodiment can execute the method for generating an index file provided by the method embodiment of the present disclosure, and the implementation principle thereof is similar, which is not repeated here.
  • An embodiment of the present disclosure provides a terminal device. Compared with the prior art, the embodiment of the present disclosure obtains a first index file and compilation process data of a target application, wherein the first index file is a source for the target application Generated in the process of compiling the code, the directory path of each target file is recorded in the first index file, the compilation process data is the data related to the first index file generated in the compilation process, and then, the target replacement parameter is determined by using the compilation process data , determine the parameter value of the target replacement parameter corresponding to the target application in the terminal device, and finally, replace the parameter value of the target replacement parameter in the first index file with the determined parameter value, and obtain the second corresponding to the target application in the terminal device.
  • the index file realizes the replacement of the parameter value of the target replacement parameter in the original index file, thereby quickly obtaining the index file corresponding to the target application program in the terminal device, reducing time consumption and improving the development efficiency of the application program.
  • the terminal device of the present disclosure is described above from the perspective of a virtual module, and the electronic device of the present disclosure is described below from the perspective of an entity device.
  • FIG. 3 it shows a schematic structural diagram of an electronic device (eg, the terminal device in the above-mentioned embodiment) 300 suitable for implementing an embodiment of the present disclosure.
  • the electronic equipment includes:
  • processors one or more processors
  • one or more application programs wherein the one or more application programs are stored in memory and configured to be executed by one or more processors, the one or more programs are configured to: execute the indexing shown according to the method embodiment File generation method.
  • Terminal devices in the embodiments of the present disclosure may include, but are not limited to, such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablets), PMPs (portable multimedia players), vehicle-mounted terminals (eg, mobile terminals such as in-vehicle navigation terminals), etc., and stationary terminals such as digital TVs, desktop computers, and the like.
  • PDAs personal digital assistants
  • PADs tablets
  • PMPs portable multimedia players
  • vehicle-mounted terminals eg, mobile terminals such as in-vehicle navigation terminals
  • stationary terminals such as digital TVs, desktop computers, and the like.
  • the electronic device shown in FIG. 3 is only an example, and should not impose any limitation on the function and scope of use of the embodiments of the present disclosure.
  • the electronic device includes: a memory and a processor, where the processor here may be referred to as a processing device 301 described below, and the memory may include a read-only memory (ROM) 302, a random access memory (RAM) 303, and a storage device hereinafter At least one of 308 as follows:
  • an electronic device 300 may include a processing device (eg, a central processing unit, a graphics processor, etc.) 301 that may be loaded into random access according to a program stored in a read only memory (ROM) 302 or from a storage device 308 Various appropriate actions and processes are executed by the programs in the memory (RAM) 303 .
  • RAM 303 various programs and data required for the operation of the electronic device 300 are also stored.
  • the processing device 301, the ROM 302, and the RAM 303 are connected to each other through a bus 304.
  • An input/output (I/O) interface 305 is also connected to bus 304 .
  • the following devices may be connected to the I/O interface 305: input devices 306 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speakers, vibration An output device 307 of a computer, etc.; a storage device 308 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 309. Communication means 309 may allow electronic device 300 to communicate wirelessly or by wire with other devices to exchange data. While FIG. 3 shows electronic device 300 having various means, it should be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
  • embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated in the flowchart.
  • the computer program may be downloaded and installed from the network via the communication device 309, or from the storage device 308, or from the ROM 302.
  • the processing device 301 When the computer program is executed by the processing device 301, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are executed.
  • the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two.
  • a computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the above. More specific examples of computer readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), fiber optics, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave with computer-readable program code embodied thereon. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device .
  • Program code embodied on a computer readable medium may be transmitted using any suitable medium including, but not limited to, electrical wire, optical fiber cable, RF (radio frequency), etc., or any suitable combination of the foregoing.
  • the client and server can use any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol) to communicate, and can communicate with digital data in any form or medium Communication (eg, a communication network) interconnects.
  • HTTP HyperText Transfer Protocol
  • Examples of communication networks include local area networks (“LAN”), wide area networks (“WAN”), the Internet (eg, the Internet), and peer-to-peer networks (eg, adhoc peer-to-peer networks), as well as any currently known or future developed network.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or may exist alone without being assembled into the electronic device.
  • the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device causes the electronic device to: obtain the first index file and compilation process data of the target application program, wherein the The first index file is generated when compiling the source code of the target application, the directory path of each target file is recorded in the first index file, and the compilation process data is generated in the compilation process and the first index file.
  • an index file related data use the compilation process data to determine target replacement parameters; determine the parameter value of the target replacement parameter corresponding to the target application in the terminal device; replace the first parameter value with the determined parameter value
  • the parameter value of the target replacement parameter in the index file is used to obtain a second index file corresponding to the target application in the terminal device.
  • Computer program code for performing operations of the present disclosure may be written in one or more programming languages, including but not limited to object-oriented programming languages—such as Java, Smalltalk, C++, and This includes conventional procedural programming languages - such as the "C" language or similar programming languages.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server.
  • the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (eg, using an Internet service provider through Internet connection).
  • LAN local area network
  • WAN wide area network
  • each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more logical functions for implementing the specified functions executable instructions.
  • the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented in dedicated hardware-based systems that perform the specified functions or operations , or can be implemented in a combination of dedicated hardware and computer instructions.
  • the modules or units involved in the embodiments of the present disclosure may be implemented in software or hardware. Wherein, the name of the module or unit does not constitute a limitation of the unit itself under certain circumstances, for example, the first determination module may also be described as "a module for determining target substitution parameters using compilation process data".
  • exemplary types of hardware logic components include: Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), Systems on Chips (SOCs), Complex Programmable Logical Devices (CPLDs) and more.
  • FPGAs Field Programmable Gate Arrays
  • ASICs Application Specific Integrated Circuits
  • ASSPs Application Specific Standard Products
  • SOCs Systems on Chips
  • CPLDs Complex Programmable Logical Devices
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in connection with the instruction execution system, apparatus or device.
  • the machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • Machine-readable media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or devices, or any suitable combination of the foregoing.
  • machine-readable storage media would include one or more wire-based electrical connections, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), fiber optics, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.
  • RAM random access memory
  • ROM read only memory
  • EPROM or flash memory erasable programmable read only memory
  • CD-ROM compact disk read only memory
  • magnetic storage or any suitable combination of the foregoing.
  • An embodiment of the present disclosure provides an electronic device.
  • the electronic device in the embodiment of the present disclosure includes: a memory and a processor; and at least one program, stored in the memory, is used to be executed by the processor, which can be compared with the prior art.
  • Realization by acquiring the first index file and compilation process data of the target application, wherein the first index file is generated when compiling the source code of the target application, and the directory path of each target file is recorded in the first index file,
  • the compilation process data is the data related to the first index file generated in the compilation process.
  • the target replacement parameter is determined by using the compilation process data, and the parameter value of the target replacement parameter corresponding to the target application program in the terminal device is determined.
  • the obtained parameter value replaces the parameter value of the target replacement parameter in the first index file, and the second index file corresponding to the target application program in the terminal device is obtained, and the parameter value of the target replacement parameter in the original index file is replaced, thereby
  • the index file corresponding to the target application program in the terminal device is quickly obtained, time consumption is reduced, and the development efficiency of the application program is improved.
  • the electronic device of the present disclosure is described above from the perspective of a physical device, and the computer-readable medium of the present disclosure is described below from the perspective of a medium.
  • Embodiments of the present disclosure provide a computer-readable medium, where a computer program is stored on the computer-readable medium, and when the computer program runs on the computer, the computer can execute the corresponding content in the foregoing method embodiments.
  • the first index file is generated when compiling the source code of the target application, and each target is recorded in the first index file.
  • the directory path of the file, the compilation process data is the data related to the first index file generated in the compilation process, and then, the target replacement parameter is determined by using the compilation process data, and the parameter value of the target replacement parameter corresponding to the target application in the terminal device is determined , and finally, use the determined parameter value to replace the parameter value of the target replacement parameter in the first index file to obtain the second index file corresponding to the target application in the terminal device, and realize the parameter value of the target replacement parameter in the original index file The value is replaced, thereby quickly obtaining the index file corresponding to the target application in the terminal device, reducing time consumption and improving the development efficiency of the application.
  • a method for generating an index file is provided.
  • the method is executed by a terminal device, including:
  • the first index file is generated when compiling the source code of the target application, and records the data of each target file in the first index file.
  • Directory path the compilation process data is the data related to the first index file generated in the compilation process;
  • the parameter value of the target replacement parameter in the first index file is replaced with the determined parameter value, and a second index file corresponding to the target application program in the terminal device is obtained.
  • the obtaining of the first index file and compilation process data of the target application includes:
  • the cloud server is a server that stores the first index file and the compilation process data, and the server of the target application generates a first index file and is related to the first index file every time the source code of the target application is compiled.
  • the generated first index file and the data related to the first index file are uploaded to the cloud server.
  • the compilation process data includes workspace information and storage space information of cached data generated in the compilation process
  • the determining of target replacement parameters using the compilation process data includes:
  • the root directory of the target file corresponding to the target application is determined according to the storage space information as the target replacement parameter.
  • the target replacement parameter includes a parent directory of a workspace of the target application
  • the determining the parameter value of the target replacement parameter corresponding to the target application in the terminal device includes:
  • the target replacement parameter includes the root directory of the target file
  • the determining the parameter value of the target replacement parameter corresponding to the target application in the terminal device includes:
  • the index file includes at least one of the following:
  • Working directory work_dir information includes the directory path of the parent directory of the workspace of the target application
  • mainPath information includes the directory path of the source code of the target application
  • Outer directory out_dir information includes the directory path of each target file generated in the process of compiling the source code of the target application;
  • Dependency directory dep_dir information where the dep_dir information includes directory paths of various files on which the source code of the target application depends.
  • a terminal device including:
  • the acquisition module is used to acquire the first index file and compilation process data of the target application, wherein the first index file is generated when compiling the source code of the target application, and the first index file contains Record the directory path of each target file, and the compilation process data is the data related to the first index file generated in the compilation process;
  • a first determining module for determining target replacement parameters using the compilation process data
  • a second determining module configured to determine the parameter value of the target replacement parameter corresponding to the target application in the terminal device
  • a replacement module configured to replace the parameter value of the target replacement parameter in the first index file with the determined parameter value to obtain a second index file corresponding to the target application in the terminal device.
  • the acquiring module acquires the first index file and the compilation process data of the target application, it is specifically used for:
  • the cloud server is a server that stores the first index file and the compilation process data, and the server of the target application generates a first index file and is related to the first index file every time the source code of the target application is compiled.
  • the generated first index file and the data related to the first index file are uploaded to the cloud server.
  • the compilation process data includes workspace information and storage space information of cached data generated in the compilation process
  • the first determining module is specifically used for:
  • the root directory of the target file corresponding to the target application is determined according to the storage space information as the target replacement parameter.
  • the target replacement parameter includes a parent directory of a workspace of the target application
  • the second determining module is specifically configured to:
  • the target replacement parameter includes the root directory of the target file
  • the second determining module is specifically configured to:
  • the index file includes at least one of the following:
  • Working directory work_dir information includes the directory path of the parent directory of the workspace of the target application
  • mainPath information includes the directory path of the source code of the target application
  • Outer directory out_dir information includes the directory path of each target file generated in the process of compiling the source code of the target application;
  • Dependency directory dep_dir information where the dep_dir information includes directory paths of various files on which the source code of the target application depends.
  • an electronic device comprising:
  • processors one or more processors
  • one or more application programs wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs are configured to: execute According to the method for generating an index file shown in the method embodiment.
  • a computer-readable medium is provided, and a computer program is stored thereon.
  • the program is executed by a processor, the method for generating an index file shown in the method embodiment is implemented.

Abstract

一种索引文件生成方法、终端设备、电子设备及介质。该方法由终端设备执行,包括:获取目标应用程序的第一索引文件以及编译过程数据,其中,第一索引文件为针对目标应用程序的源代码进行编译时生成的,第一索引文件中记录各目标文件的目录路径,编译过程数据为编译过程中产生的与第一索引文件相关的数据(S101);利用编译过程数据确定目标替换参数(S102);确定在终端设备中目标应用程序对应的目标替换参数的参数值(S103);利用确定出的参数值替换第一索引文件中目标替换参数的参数值,得到终端设备中目标应用程序对应的第二索引文件(S104)。

Description

索引文件生成方法、终端设备、电子设备及介质
本公开要求于2020年11月17日提交的,申请名称为“索引文件生成方法、终端设备、电子设备及介质”的、中国专利申请号为“202011289784.6”的优先权,该中国专利申请的全部内容通过引用结合在本公开中。
技术领域
本公开涉及计算机技术领域,具体而言,本公开涉及一种索引文件生成方法、终端设备、电子设备及介质。
背景技术
在应用程序的开发过程中,编辑代码或者阅读代码时需要经常用到跳转、高亮、重构、搜索、静态检查等功能,这些功能需要利用该应用程序的索引文件完成,其中,索引文件主要用于记录数据及其存储路径之间的关系。
通常情况下,数据在一个电子设备中的存储路径与该数据在另一个电子设备中的存储路径存在差别,这使得一个电子设备生成的索引文件无法在另一个电子设备中使用。因此,对于需要对应用程序的源代码进行编译的每一个电子设备,该电子设备需要在对应用程序的源代码进行编译前或者进行编译的过程中生成索引文件。若电子设备在对应用程序的源代码进行编译前生成索引文件,不仅会消耗大量的时间资源,还会占用很多系统资源,导致该电子设备长时间内难以执行其他的操作;若电子设备在对应用程序的源代码进行编译的过程中生成索引文件,不仅会消耗大量的时间资源,还会大大增加编译时长,影响应用程序的开发进程。
发明内容
本公开提供了一种索引文件生成方法、终端设备、电子设备及介质,可以快速生成索引文件。
第一方面,提供了一种索引文件生成方法,该方法由终端设备执行,包括:
获取目标应用程序的第一索引文件以及编译过程数据,其中,第一索引文件为针对目标应用程序的源代码进行编译时生成的,第一索引文件中记录各目标文件的目录路径,编译过程数据为编译过程中产生的与第一索引文件相关的数据;
利用编译过程数据确定目标替换参数;
确定在终端设备中目标应用程序对应的目标替换参数的参数值;
利用确定出的参数值替换第一索引文件中目标替换参数的参数值,得到终端设备中目标应用程序对应的第二索引文件。
第二方面,提供了一种终端设备,该终端设备包括:
获取模块,用于获取目标应用程序的第一索引文件以及编译过程数据,其中,第一索引文件为针对目标应用程序的源代码进行编译时生成的,第一索引文件中记录各目标文件的目录路径,编译过程数据为编译过程中产生的与第一索引文件相关的数据;
第一确定模块,用于利用编译过程数据确定目标替换参数;
第二确定模块,用于确定在终端设备中目标应用程序对应的目标替换参数的参数 值;
替换模块,用于利用确定出的参数值替换第一索引文件中目标替换参数的参数值,得到终端设备中所述目标应用程序对应的第二索引文件。
第三方面,提供了一种电子设备,其包括:
一个或多个处理器;
存储器;
一个或多个应用程序,其中一个或多个应用程序被存储在存储器中并被配置为由一个或多个处理器执行,一个或多个程序配置用于:执行根据第一方面所示的索引文件生成方法对应的操作。
第四方面,提供了一种计算机可读介质,其上存储有计算机程序,该程序被处理器执行时实现第一方面所示的索引文件生成方法。
本公开提供的技术方案带来的有益效果是:
本公开提供了一种索引文件生成方法、终端设备、电子设备及介质,与现有技术相比,本公开通过获取目标应用程序的第一索引文件以及编译过程数据,其中,第一索引文件为针对目标应用程序的源代码进行编译的过程中生成的,第一索引文件中记录各目标文件的目录路径,编译过程数据为编译过程中产生的与第一索引文件相关的数据,然后,利用编译过程数据确定目标替换参数,确定在终端设备中目标应用程序对应的目标替换参数的参数值,最后,利用确定出的参数值替换第一索引文件中目标替换参数的参数值,得到终端设备中目标应用程序对应的第二索引文件,实现了对原有索引文件中的目标替换参数的参数值进行替换,从而快速地得到终端设备中目标应用程序对应的索引文件,减少时间消耗,提高应用程序的开发效率。
附图说明
结合附图并参考以下具体实施方式,本公开各实施例的上述和其他特征、优点及方面将变得更加明显。贯穿附图中,相同或相似的附图标记表示相同或相似的元素。应当理解附图是示意性的,原件和元素不一定按照比例绘制。
图1为本公开实施例提供的一种索引文件生成方法的流程示意图;
图2为本公开实施例提供的一种终端设备的结构示意图;
图3为本公开实施例提供的一种电子设备的结构示意图。
具体实施方式
下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。
应当理解,本公开的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本公开的范围在此方面不受限制。
本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。
需要注意,本公开中提及的“第一”、“第二”等概念仅用于对装置、模块或单元进行区分,并非用于限定这些装置、模块或单元一定为不同的装置、模块或单元,也并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。
需要注意,本公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。
下面以具体地实施例对本公开的技术方案以及本公开的技术方案如何解决上述技术问题进行详细说明。下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例中不再赘述。下面将结合附图,对本公开的实施例进行描述。
本公开实施例提供了一种索引文件生成方法,可以由终端设备执行,该终端设备可以为手机、平板电脑、台式电脑、笔记本电脑等,如图1所示,该方法包括步骤S101-步骤S104。
步骤S101,获取目标应用程序的第一索引文件以及编译过程数据。
其中,第一索引文件为针对目标应用程序的源代码进行编译时生成的,第一索引文件中记录各目标文件的目录路径,编译过程数据为编译过程中产生的与第一索引文件相关的数据。
具体地,第一索引文件为目标应用程序的服务器在对该程序的源代码进行编译的过程中生成的。
本公开实施例中,目标应用程序(Application,App)的服务器为提供目标APP的服务的服务器。目标APP的服务器可以对目标App的源代码进行编译,在编译过程中会生成目标App的索引文件(即上述第一索引文件)、以及与该索引文件相关的数据(包括但不限于上述编译过程数据),该相关的数据可以包括但不限于与该索引文件相关的文件的存储位置或者存储路径等数据。
步骤S102,利用编译过程数据确定目标替换参数。
步骤S103,确定在终端设备中目标应用程序对应的目标替换参数的参数值。
步骤S104,利用确定出的参数值替换第一索引文件中目标替换参数的参数值,得到终端设备中目标应用程序对应的第二索引文件。
本公开实施例中,索引文件(包括上述涉及第一索引文件、第二索引文件)也叫unit文件,一个索引的unit文件结构通常会包括三部分,分别为索引文件的目录路径、目标文件的文件名以及目标文件对应的校验码,该校验码可以为哈希(Hash)校验码。
例如,一条索引的unit文件结构可以为: /xxx/Index/DataStore/v5/units/TTBridgePlugins-dummy.o-3GROH29GTL804,其中,/xxx/Index/DataStore/v5/units为索引文件的目录路径,TTBridgePlugins-dummy.o为目标文件的文件名,3GROH29GTL804为目标文件对应的校验码。
其中,目标文件即为OBJ文件。目标文件的文件名及其校验码是通过对目标文件的相关信息进行计算得到的,目标文件的相关信息可以为目标文件的目录路径。
例如,TTBridgePlugins-dummy.o-3GROH29GTL804是通过对目标文件的相关信息进行计算得到的,目标文件的相关信息可以为:"/Users/yyy/Library/Developer/Xcode/DerivedData/Article-eyvyloqhxkpnlkbzndcpojajjnbr/Build/Intermediates.noindex/Article.build/Video-iphonesimulator/VideoInHouse.build/Objects-normal/x86_64/BDViewController.o",该目标文件的相关信息是目标文件的目录路径。
本公开实施例中,可以在终端设备中安装索引数据库读写工具,利用索引数据库读写工具执行步骤S101-步骤S104中的相关步骤。其中,索引数据库读写工具可以基于底层虚拟机(Low Level Virtual Machine,LLVM)得到,可以用来修改索引文件中目标替换参数的参数值。
本公开实施例提供了一种索引文件生成方法,与现有技术相比,本公开实施例通过获取目标应用程序的第一索引文件以及编译过程数据,其中,第一索引文件为针对目标应用程序的源代码进行编译时生成的,第一索引文件中记录各目标文件的目录路径,编译过程数据为编译过程中产生的与第一索引文件相关的数据,然后,利用编译过程数据确定目标替换参数,确定在终端设备中目标应用程序对应的目标替换参数的参数值,最后,利用确定出的参数值替换第一索引文件中目标替换参数的参数值,得到终端设备中目标应用程序对应的第二索引文件,实现了对原有索引文件中的目标替换参数的参数值进行替换,从而快速地得到终端设备中目标应用程序对应的索引文件,减少时间消耗,提高应用程序的开发效率。
本公开实施例的另一种可能实现方式,对于第一索引文件和第二索引文件中的任一索引文件,该索引文件中包括下文中的信息A1-A4中的至少一项。
其中,索引文件可以为第一索引文件,也可以为第二索引文件,也就是说,第一索引文件和第二索引文件的文件内容样式是相同的,两者不同之处在于两个文件中的目标替换参数的参数值不同。
信息A1,工作目录信息即work_dir信息,work_dir信息包括目标应用程序的工作空间的父目录的目录路径。
例如,索引文件中的work_dir信息可以包括:/Users/yyy/Desktop/Workspace/TTVideo/Article,其中,该路径包括目标应用程序的工作空间的父目录的目录路径。
本公开实施例中,第一索引文件中的work_dir信息包括在目标应用程序的服务器中,该目标应用程序的工作空间的父目录的目录路径;第二索引文件中的work_dir信息包括在终端设备中,该目标应用程序的工作空间的父目录的目录路径。
信息A2,主路径信息即mainPath信息,mainPath信息包括目标应用程序的源代码的目录路径。
例如,索引文件中的mainPath信息可以包括:/Users/yyy/Desktop/Workspace/TTVideo/Article/ShortVideo/Detail/Classes/VideoDetail/VideoDetailPage/Actions/ADVideoDetailActionManager.m,其中,该路径包括目标应用程序的源代码的目录路径。
本公开实施例中,第一索引文件中的mainPath信息包括在目标应用程序的服务器中,目标应用程序的源代码的目录路径;第二索引文件中的mainPath信息包括在终端设备中,目标应用程序的源代码的目录路径。
信息A3,外目录信息即out_dir信息,out_dir信息包括对目标应用程序的源代码进行编译的过程中生成的各个目标文件的目录路径。
例如,索引文件的out_dir信息可以包括:/Users/yyy/Library/Developer/Xcode/DerivedData/Article-eyvyloqhxkpnlkbzndcpojajjnbr/Build/Intermediates.noindex/Article.build/Video-iphonesimulator/VideoInHouse.build/Objects-normal/x86_64/ADVideoDetailActionManager.o,其中,该路径包括对目标应用程序的源代码进行编译的过程中生成的各个目标文件的目录路径。
本公开实施例中,第一索引文件中的out_dir信息包括在目标应用程序的服务器中,目标应用程序的源代码进行编译的过程中生成的各个目标文件的目录路径;第二索引文件中的out_dir信息包括在终端设备中,目标应用程序的源代码进行编译的过程中生成的各个目标文件的目录路径。
信息A4,依赖目录信息即dep_dir信息,dep_dir信息包括目标应用程序的源代码所依赖的各个文件的目录路径。
例如,索引文件的dep_dir信息可以包括:/Users/yyy/Desktop/Workspace/TTVideo/Article/Model/DataModel/Article+Biz.h|Article+Biz.h-8U985XT788VJ,该路径包括目标应用程序的源代码所依赖的各个文件的目录路径。
本公开实施例的另一种可能实现方式,步骤S101中,获取目标应用程序的第一索引文件以及编译过程数据,具体可以包括:从云端服务器中获取目标应用程序的第一索引文件以及编译过程数据。
其中,云端服务器为存储第一索引文件以及编译过程数据的服务器,目标应用程序的服务器在每次编译目标应用程序的源代码生成第一索引文件以及与第一索引文件相关的数据时,将生成的第一索引文件以及与第一索引文件相关的数据上传至云端服务器。
本公开实施例中,目标应用程序的服务器在每一次编译目标应用程序的源代码后,可以获取该次编译目标应用程序的源代码的过程中生成的第一索引文件,以及该次编译目标应用程序的源代码的过程中产生的与第一索引文件相关的数据,并将生成的第一索引文件以及与第一索引文件相关的数据上传至云端服务器。
其中,每一次将生成的第一索引文件以及与第一索引文件相关的数据上传至云端服务器中后,可以利用目标应用程序的提交号(Commit ID)生成标记信息,可以使用标记信息标记本次上传的第一索引文件以及与第一索引文件相关的数据。
需要说明的是,在利用提交号生成标记信息时,可以将提交号作为标记信息,也可以利用提交号以及其他信息,生成标记信息,其他信息可以包括分布式版本控制系统(Git)的统一资源定位符(Uniform Resource Locator,URL),和/或,目标应用程序的标识信息(如名称)等。
本公开实施例中,当终端设备检测到目标应用程序发生更新时,可以根据目标应用程序的更新后的提交号,从云端服务器中获取目标标记信息对应的第一索引文件以及与第一索引文件相关的数据,将目标标记信息对应的第一索引文件作为第一索引文件,将目标标记信息对应的与第一索引文件相关的数据作为编译过程数据。其中,目标标记信息中包括更新后的提交号。
本公开实施例的另一种可能实现方式,编译过程数据包括工作空间信息以及编译过程中产生的缓存数据的存储空间信息。
本公开实施例中,工作空间信息即为workspace信息,编译过程中产生的缓存数据的存储空间信息即为DerviedData信息。需要说明的是,通常情况下,在项目启动阶段需要设置该项目的workspace,workspace文件中包括至少一个文件和/或至少一个文件夹,DerviedData文件主要存储缓存数据。
可以理解的是,编译过程数据包括workspace信息和DerviedData信息,但不限于上述两个信息,在此不做限定。
其中,步骤S102中,利用编译过程数据确定目标替换参数,具体可以包括步骤S1021和步骤S1022。
步骤S1021,根据工作空间信息确定目标应用程序的工作空间的父目录,作为目标替换参数。即将目标应用程序的工作空间的父目录作为目标替换参数。
本公开实施例中,可以根据workspace信息确定目标应用程序的工作空间以及工作空间的父目录。其中,目标应用程序的工作空间为xcworkspace。
例如,工作空间的目录路径可以为:/Users/yyy/Desktop/Workspace/TTVideo/Article/Article.xcworkspace,该路径中,工作空间为Article.xcworkspace,工作空间的父目录为Article。
可以理解的是,索引文件中目标替换参数的参数值包括工作空间的父目录的目录路径,其中,工作空间的父目录的目录路径也称为workdir。
例如,工作空间的父目录为Article,Article的目录路径为:/Users/yyy/Desktop/Workspace/TTVideo/Article。即,workdir为:/Users/yyy/Desktop/Workspace/TTVideo/Article。
需要说明的是,信息A1中的work_dir信息包括工作空间的父目录的目录路径,例如,work_dir信息中的/Users/yyy/Desktop/Workspace/TTVideo/Article,即为工作空间的 父目录的目录路径,即Article的目录路径。
需要说明的是,workspace信息可以包括xcworkspace及其目录路径、xcworkspace的父目录以及父目录的目录路径、xcworkspace的子目录以及子目录的目录路径,如xcworkspace目录下的对应用户的WorkspaceSettings.xcsettings等。
步骤S1022,根据存储空间信息确定目标应用程序对应的目标文件的根目录,作为目标替换参数。即将目标应用程序对应的目标文件的根目录作为目标替换参数。
本公开实施例中,可以根据DerviedData信息确定目标文件的根目录,其中,目标文件的根目录即为OBJ_ROOT。
可以理解的是,索引文件(包括上述涉及的第一索引文件、第二索引文件)中目标替换参数的参数值包括OBJ_ROOT的目录路径。
例如,OBJ_ROOT的目录路径可以为:/Users/yyy/Library/Developer/Xcode/DerivedData/Article-eyvyloqhxkpnlkbzndcpojajjnbr/Build/Intermediates.noindex。
需要说明的是,DerviedData信息可以包括DerviedData、以及DerviedData中的OBJ_ROOT等,在此不做限定。
本公开实施例的另一种可能实现方式,若目标替换参数包括目标应用程序的工作空间的父目录;则,步骤S103中,确定在终端设备中目标应用程序对应的目标替换参数的参数值,具体可以包括:确定在终端设备中目标应用程序的工作空间;确定工作空间的父目录的目录路径,将确定出的工作空间的父目录的目录路径,作为在终端设备中目标应用程序对应的工作空间的父目录的参数值。
若目标替换参数包括目标文件的根目录;则,步骤S103中,确定在终端设备中目标应用程序对应的目标替换参数的参数值,具体可以包括:确定在终端设备中目标应用程序的工作空间;利用工作空间的目录路径,确定在终端设备中目标应用程序对应的目标文件的根目录的目录路径,将确定出的目标文件的根目录的目录路径,作为目标文件的根目录的参数值。
下面将针对这两种情况分别进行详细描述。具体地:
步骤S103中,确定在终端设备中目标应用程序对应的目标替换参数的参数值,具体可以包括步骤S1031-步骤S1032。
步骤S1031,确定在终端设备中目标应用程序的工作空间。
步骤S1032,利用工作空间,确定在终端设备中目标应用程序对应的目标替换参数的参数值。
本公开实施例中,可以确定在终端设备中目标应用程序的工作空间xcworkspace,利用在终端设备中目标应用程序的xcworkspace,确定在终端设备中目标应用程序对应的目标替换参数的参数值。
其中,若目标替换参数包括目标应用程序的工作空间的父目录。则,步骤S1032中,利用工作空间,确定在终端设备中目标应用程序对应的目标替换参数的参数值,具 体可以包括:
确定工作空间的父目录的目录路径,将确定出的工作空间的父目录的目录路径,作为在终端设备中目标应用程序对应的工作空间的父目录的参数值。
本公开实施例中,可以利用在终端设备中目标应用程序的工作空间xcworkspace,确定xcworkspace的父目录的目录路径,将确定出的xcworkspace的父目录的目录路径作为在终端设备中目标应用程序对应的xcworkspace的父目录的参数值。
即,目标替换参数包括目标应用程序的xcworkspace的父目录,对应地,目标替换参数的参数值包括目标应用程序的xcworkspace的父目录的目录路径。
在执行步骤S104时,可以将第一索引文件中的xcworkspace的父目录的目录路径进行替换,利用在终端设备中目标应用程序的xcworkspace的父目录的目录路径,替换第一索引文件中xcworkspace的父目录的目录路径,其中,第一索引文件中xcworkspace的父目录的目录路径,为在目标应用程序的服务器中目标应用程序的xcworkspace的父目录的目录路径。
通常情况下,第一索引文件中的work_dir信息、mainPath信息以及dep_dir信息中包含xcworkspace的父目录的目录路径,可以对上述三个信息中的xcworkspace的父目录的目录路径进行替换。
当然,根据实际情况,work_dir信息、mainPath信息以及dep_dir信息中至少一个,可以不包含xcworkspace的父目录的目录路径,和/或第一索引文件中的其他信息也可以包含xcworkspace的父目录的目录路径,在此不做限定。
其中,若目标替换参数包括目标文件的根目录。则,步骤S1032中,利用工作空间,确定在终端设备中目标应用程序对应的目标替换参数的参数值,具体可以包括:
利用工作空间的目录路径,确定在终端设备中目标应用程序对应的目标文件的根目录的目录路径,将确定出的目标文件的根目录的目录路径,作为目标文件的根目录的参数值。
本公开实施例中,可以利用在终端设备中目标应用程序的工作空间xcworkspace,确定xcworkspace的目录路径,例如,xcworkspace的目录路径可以为:/Users/yyy/Desktop/Workspace/TTVideo/Article/Article.xcworkspace。
可以利用在终端设备中xcworkspace的目录路径确定临时目录的目录路径。其中,临时目录为终端设备在编译目标应用程序的源代码时所生成的目标文件的目录。例如,临时目录的目录路径可以为:/Users/yyy/Library/Developer/Xcode/DerivedData/Article-eyvyloqhxkpnlkbzndcpojajjnbr。
在终端设备中临时目录的目录路径中,可以确定出在终端设备中目标应用程序对应的目标文件的根目录的目录路径,将确定出的目标文件的根目录的目录路径作为目标文件的根目录的参数值。
例如,可以根据临时目录的目录路径确定出如下路径:/Users/yyy/Library/Developer/Xcode/DerivedData/Article-eyvyloqhxkpnlkbzndcpojajjnbr/B uild/Intermediates.noindex,该路径即为确定出的目标文件的根目录的目录路径。
需要说明的是,目标替换参数包括目标文件的根目录OBJ_ROOT,对应地,目标替换参数的参数值包括OBJ_ROOT的目录路径,即OBJ_ROOT的目录路径为OBJ_ROOT的参数值。
在执行步骤S104时,可以将第一索引文件中的OBJ_ROOT的目录路径进行替换,利用在终端设备中目标应用程序的OBJ_ROOT的目录路径,替换第一索引文件中OBJ_ROOT的目录路径,其中,第一索引文件中OBJ_ROOT的目录路径,为在目标应用程序的服务器中目标应用程序的OBJ_ROOT的目录路径。
通常情况下,第一索引文件中的out_dir信息以及dep_dir信息中包含OBJ_ROOT的目录路径,可以对上述两个信息中的OBJ_ROOT的目录路径进行替换。
当然,根据实际情况,out_dir信息以及dep_dir信息中至少一个,可以不包含OBJ_ROOT的目录路径,和/或第一索引文件中的其他信息也可以包含OBJ_ROOT的目录路径,在此不做限定。
上述从方法步骤的角度具体阐述了索引文件生成方法,下面从虚拟模块的角度介绍终端设备,具体如下所示:
本公开实施例提供了一种终端设备,如图2所示,该终端设备20可以包括:获取模块201、第一确定模块202、第二确定模块203以及替换模块204,其中,
获取模块201,用于获取目标应用程序的第一索引文件以及编译过程数据,其中,第一索引文件为针对目标应用程序的源代码进行编译时生成的,第一索引文件中记录各目标文件的目录路径,编译过程数据为编译过程中产生的与第一索引文件相关的数据。
第一确定模块202,用于利用编译过程数据确定目标替换参数。
第二确定模块203,用于确定在终端设备中目标应用程序对应的目标替换参数的参数值。
替换模块204,用于利用确定出的参数值替换第一索引文件中目标替换参数的参数值,得到终端设备中目标应用程序对应的第二索引文件。
本公开实施例的另一种可能实现方式,获取模块201在获取目标应用程序的第一索引文件以及编译过程数据时,具体用于:
从云端服务器中获取目标应用程序的第一索引文件以及编译过程数据;
云端服务器为存储第一索引文件以及编译过程数据的服务器,目标应用程序的服务器在每次编译目标应用程序的源代码生成第一索引文件以及与第一索引文件相关的数据时,将生成的第一索引文件以及与第一索引文件相关的数据上传至云端服务器。
本公开实施例的另一种可能实现方式,编译过程数据包括工作空间信息以及编译过程中产生的缓存数据的存储空间信息;
第一确定模块202在利用编译过程数据确定目标替换参数时,具体用于:
根据工作空间信息确定目标应用程序的工作空间的父目录,作为目标替换参数;
根据存储空间信息确定目标应用程序对应的目标文件的根目录,作为目标替换参数。
本公开实施例的另一种可能实现方式,若目标替换参数包括目标应用程序的工作空间的父目录;
第二确定模块203在确定在终端设备中目标应用程序对应的目标替换参数的参数值时,具体用于:
确定在终端设备中目标应用程序的工作空间;
确定工作空间的父目录的目录路径,将确定出的工作空间的父目录的目录路径,作为在终端设备中目标应用程序对应的工作空间的父目录的参数值。
本公开实施例的另一种可能实现方式,若目标替换参数包括目标文件的根目录;
第二确定模块203在确定在终端设备中目标应用程序对应的目标替换参数的参数值时,具体用于:
确定在终端设备中目标应用程序的工作空间;
利用工作空间的目录路径,确定在终端设备中目标应用程序对应的目标文件的根目录的目录路径,将确定出的目标文件的根目录的目录路径,作为目标文件的根目录的参数值。
本公开实施例的另一种可能实现方式,对于第一索引文件和第二索引文件中的任一索引文件,该索引文件中包括以下至少一项:
工作目录work_dir信息,work_dir信息包括目标应用程序的工作空间的父目录的目录路径;
主路径mainPath信息,mainPath信息包括目标应用程序的源代码的目录路径;
外目录out_dir信息,out_dir信息包括对目标应用程序的源代码进行编译的过程中生成的各个目标文件的目录路径;
依赖目录dep_dir信息,dep_dir信息包括目标应用程序的源代码所依赖的各个文件的目录路径。
本公开实施例中,第一确定模块202和第二确定模块203可以为同一个确定模块,也可以为不同的确定模块,在此不做限定。
本实施例的终端设备可执行本公开方法实施例提供的一种索引文件生成方法,其实现原理相类似,此处不再赘述。
本公开实施例提供了一种终端设备,与现有技术相比,本公开实施例通过获取目标应用程序的第一索引文件以及编译过程数据,其中,第一索引文件为针对目标应用程序的源代码进行编译的过程中生成的,第一索引文件中记录各目标文件的目录路径,编译过程数据为编译过程中产生的与第一索引文件相关的数据,然后,利用编译过程数据确定目标替换参数,确定在终端设备中目标应用程序对应的目标替换参数的参数值,最后,利用确定出的参数值替换第一索引文件中目标替换参数的参数值,得到终端设备中目标应用程序对应的第二索引文件,实现了对原有索引文件中的目标替换参数的参数值进行替换,从而快速地得到终端设备中目标应用程序对应的索引文件,减少时间消耗,提高应用程序的开发效率。
上述从虚拟模块的角度介绍本公开的终端设备,下面从实体装置的角度介绍本公开的电子设备。
下面参考图3,其示出了适于用来实现本公开实施例的电子设备(例如上述实施例中的终端设备)300的结构示意图。该电子设备包括:
一个或多个处理器;
存储器;
一个或多个应用程序,其中一个或多个应用程序被存储在存储器中并被配置为由一个或多个处理器执行,一个或多个程序配置用于:执行根据方法实施例所示的索引文件生成方法。
本公开实施例中的终端设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图3示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
电子设备包括:存储器以及处理器,其中,这里的处理器可以称为下文所述的处理装置301,存储器可以包括下文中的只读存储器(ROM)302、随机访问存储器(RAM)303以及存储装置308中的至少一项,具体如下所示:
如图3所示,电子设备300可以包括处理装置(例如中央处理器、图形处理器等)301,其可以根据存储在只读存储器(ROM)302中的程序或者从存储装置308加载到随机访问存储器(RAM)303中的程序而执行各种适当的动作和处理。在RAM 303中,还存储有电子设备300操作所需的各种程序和数据。处理装置301、ROM 302以及RAM 303通过总线304彼此相连。输入/输出(I/O)接口305也连接至总线304。
通常,以下装置可以连接至I/O接口305:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置306;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置307;包括例如磁带、硬盘等的存储装置308;以及通信装置309。通信装置309可以允许电子设备300与其他设备进行无线或有线通信以交换数据。虽然图3示出了具有各种装置的电子设备300,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置309从网络上被下载和安装,或者从存储装置308被安装,或者从ROM 302被安装。在该计算机程序被处理装置301执行时,执行本公开实施例的方法中限定的上述功能。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不 限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText Transfer Protocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,adhoc端对端网络),以及任何当前已知或未来研发的网络。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:获取目标应用程序的第一索引文件以及编译过程数据,其中,所述第一索引文件为针对所述目标应用程序的源代码进行编译时生成的,所述第一索引文件中记录各目标文件的目录路径,所述编译过程数据为编译过程中产生的与所述第一索引文件相关的数据;利用所述编译过程数据确定目标替换参数;确定在终端设备中所述目标应用程序对应的所述目标替换参数的参数值;利用确定出的参数值替换所述第一索引文件中所述目标替换参数的参数值,得到所述终端设备中所述目标应用程序对应的第二索引文件。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部 计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的模块或单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,模块或单元的名称在某种情况下并不构成对该单元本身的限定,例如,第一确定模块还可以被描述为“利用编译过程数据确定目标替换参数的模块”。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。
本公开实施例提供了一种电子设备,本公开实施例中的电子设备包括:存储器和处理器;至少一个程序,存储于存储器中,用于被处理器执行时,与现有技术相比可实现:通过获取目标应用程序的第一索引文件以及编译过程数据,其中,第一索引文件为针对目标应用程序的源代码进行编译时生成的,第一索引文件中记录各目标文件的目录路径,编译过程数据为编译过程中产生的与第一索引文件相关的数据,然后,利用编译过程数据确定目标替换参数,确定在终端设备中目标应用程序对应的目标替换参数的参数值,最后,利用确定出的参数值替换第一索引文件中目标替换参数的参数值,得到终端设备中目标应用程序对应的第二索引文件,实现了对原有索引文件中的目标替换参数的参数值进行替换,从而快速地得到终端设备中目标应用程序对应的索引文件,减少时间消耗,提高应用程序的开发效率。
上述从实体装置的角度介绍本公开的电子设备,下面从介质的角度介绍本公开的计算机可读介质。
本公开实施例提供了一种计算机可读介质,该计算机可读介质上存储有计算机程序,当其在计算机上运行时,使得计算机可以执行前述方法实施例中相应内容。与现有技术相比,通过获取目标应用程序的第一索引文件以及编译过程数据,其中,第一索引文件为针对目标应用程序的源代码进行编译时生成的,第一索引文件中记录各目标文件的目录路径,编译过程数据为编译过程中产生的与第一索引文件相关的数据,然后,利用编译过程数据确定目标替换参数,确定在终端设备中目标应用程序对应的目标替换参数的参数值,最后,利用确定出的参数值替换第一索引文件中目标替换参数的参数值,得到终端设备中目标应用程序对应的第二索引文件,实现了对原有索引文件中的目标替换参数的参数值进行替换,从而快速地得到终端设备中目标应用程序对应的索引文件,减少时间消耗,提高应用程序的开发效率。
根据本公开的一个或多个实施例,提供了一种索引文件生成方法,所述方法由终端设备执行,包括:
获取目标应用程序的第一索引文件以及编译过程数据,其中,所述第一索引文件为针对所述目标应用程序的源代码进行编译时生成的,所述第一索引文件中记录各目标文件的目录路径,所述编译过程数据为编译过程中产生的与所述第一索引文件相关的数据;
利用所述编译过程数据确定目标替换参数;
确定在终端设备中所述目标应用程序对应的所述目标替换参数的参数值;
利用确定出的参数值替换所述第一索引文件中所述目标替换参数的参数值,得到所述终端设备中所述目标应用程序对应的第二索引文件。
根据本公开的一个或多个实施例,所述获取目标应用程序的第一索引文件以及编译过程数据,包括:
从云端服务器中获取所述目标应用程序的第一索引文件以及编译过程数据;
所述云端服务器为存储所述第一索引文件以及所述编译过程数据的服务器,目标应用程序的服务器在每次编译目标应用程序的源代码生成第一索引文件以及与所述第一索引文件相关的数据时,将生成的第一索引文件以及与所述第一索引文件相关的数据上传至所述云端服务器。
根据本公开的一个或多个实施例,所述编译过程数据包括工作空间信息以及编译过程中产生的缓存数据的存储空间信息;
所述利用所述编译过程数据确定目标替换参数,包括:
根据所述工作空间信息确定所述目标应用程序的工作空间的父目录,作为目标替换参数;
根据所述存储空间信息确定所述目标应用程序对应的目标文件的根目录,作为所述目标替换参数。
根据本公开的一个或多个实施例,若所述目标替换参数包括所述目标应用程序的工作空间的父目录;
所述确定在所述终端设备中所述目标应用程序对应的所述目标替换参数的参数值,包括:
确定在所述终端设备中所述目标应用程序的工作空间;
确定所述工作空间的父目录的目录路径,将确定出的所述工作空间的父目录的目录路径,作为在所述终端设备中所述目标应用程序对应的所述工作空间的父目录的参数值。
根据本公开的一个或多个实施例,若所述目标替换参数包括所述目标文件的根目录;
所述确定在所述终端设备中所述目标应用程序对应的所述目标替换参数的参数值,包括:
确定在所述终端设备中所述目标应用程序的工作空间;
利用所述工作空间的目录路径,确定在所述终端设备中所述目标应用程序对应的所述目标文件的根目录的目录路径,将确定出的所述目标文件的根目录的目录路径,作为所述目标文件的根目录的参数值。
根据本公开的一个或多个实施例,对于所述第一索引文件和所述第二索引文件中的任一索引文件,该索引文件中包括以下至少一项:
工作目录work_dir信息,所述work_dir信息包括所述目标应用程序的工作空间的父目录的目录路径;
主路径mainPath信息,所述mainPath信息包括所述目标应用程序的源代码的目录路径;
外目录out_dir信息,所述out_dir信息包括对所述目标应用程序的源代码进行编译的过程中生成的各个目标文件的目录路径;
依赖目录dep_dir信息,所述dep_dir信息包括所述目标应用程序的源代码所依赖的各个文件的目录路径。
根据本公开的一个或多个实施例,提供了一种终端设备,包括:
获取模块,用于获取目标应用程序的第一索引文件以及编译过程数据,其中,所述第一索引文件为针对所述目标应用程序的源代码进行编译时生成的,所述第一索引文件中记录各目标文件的目录路径,所述编译过程数据为编译过程中产生的与所述第一索引文件相关的数据;
第一确定模块,用于利用所述编译过程数据确定目标替换参数;
第二确定模块,用于确定在所述终端设备中所述目标应用程序对应的所述目标替换参数的参数值;
替换模块,用于利用确定出的参数值替换所述第一索引文件中所述目标替换参数的参数值,得到所述终端设备中所述目标应用程序对应的第二索引文件。
根据本公开的一个或多个实施例,所述获取模块在获取目标应用程序的第一索引文件以及编译过程数据时,具体用于:
从云端服务器中获取所述目标应用程序的第一索引文件以及编译过程数据;
所述云端服务器为存储所述第一索引文件以及所述编译过程数据的服务器,目标应用程序的服务器在每次编译目标应用程序的源代码生成第一索引文件以及与所述第一索引文件相关的数据时,将生成的第一索引文件以及与所述第一索引文件相关的数据上传至所述云端服务器。
根据本公开的一个或多个实施例,所述编译过程数据包括工作空间信息以及编译过程中产生的缓存数据的存储空间信息;
所述第一确定模块在利用所述编译过程数据确定目标替换参数时,具体用于:
根据所述工作空间信息确定所述目标应用程序的工作空间的父目录,作为目标替换参数;
根据所述存储空间信息确定所述目标应用程序对应的目标文件的根目录,作为所述目标替换参数。
根据本公开的一个或多个实施例,若所述目标替换参数包括所述目标应用程序的工作空间的父目录;
所述第二确定模块在确定在所述终端设备中所述目标应用程序对应的所述目标替换参数的参数值时,具体用于:
确定在所述终端设备中所述目标应用程序的工作空间;
确定所述工作空间的父目录的目录路径,将确定出的所述工作空间的父目录的目录路径,作为在所述终端设备中所述目标应用程序对应的所述工作空间的父目录的参数值。
根据本公开的一个或多个实施例,若所述目标替换参数包括所述目标文件的根目录;
所述第二确定模块在确定在所述终端设备中所述目标应用程序对应的所述目标替换参数的参数值时,具体用于:
确定在所述终端设备中所述目标应用程序的工作空间;
利用所述工作空间的目录路径,确定在所述终端设备中所述目标应用程序对应的所述目标文件的根目录的目录路径,将确定出的所述目标文件的根目录的目录路径,作为所述目标文件的根目录的参数值。
根据本公开的一个或多个实施例,对于所述第一索引文件和所述第二索引文件中的任一索引文件,该索引文件中包括以下至少一项:
工作目录work_dir信息,所述work_dir信息包括所述目标应用程序的工作空间的父目录的目录路径;
主路径mainPath信息,所述mainPath信息包括所述目标应用程序的源代码的目录路径;
外目录out_dir信息,所述out_dir信息包括对所述目标应用程序的源代码进行编译的过程中生成的各个目标文件的目录路径;
依赖目录dep_dir信息,所述dep_dir信息包括所述目标应用程序的源代码所依赖的各个文件的目录路径。
根据本公开的一个或多个实施例,提供了一种电子设备,其包括:
一个或多个处理器;
存储器;
一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于:执行根据方法实施例所示的索引文件生成方法。
根据本公开的一个或多个实施例,提供了一种计算机可读介质,其上存储有计算机程序,该程序被处理器执行时实现方法实施例所示的索引文件生成方法。
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。
此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。
尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。

Claims (10)

  1. 一种索引文件生成方法,其包括:
    获取目标应用程序的第一索引文件以及编译过程数据,其中,所述第一索引文件为针对所述目标应用程序的源代码进行编译时生成的,所述第一索引文件中记录各目标文件的目录路径,所述编译过程数据为编译过程中产生的与所述第一索引文件相关的数据;
    利用所述编译过程数据确定目标替换参数;
    确定在终端设备中所述目标应用程序对应的所述目标替换参数的参数值;
    利用确定出的参数值替换所述第一索引文件中所述目标替换参数的参数值,得到所述终端设备中所述目标应用程序对应的第二索引文件。
  2. 根据权利要求1所述的方法,其中,所述获取目标应用程序的第一索引文件以及编译过程数据,包括:
    从云端服务器中获取所述目标应用程序的第一索引文件以及编译过程数据;
    所述云端服务器为存储所述第一索引文件以及所述编译过程数据的服务器,目标应用程序的服务器在每次编译目标应用程序的源代码生成第一索引文件以及与所述第一索引文件相关的数据时,将生成的第一索引文件以及与所述第一索引文件相关的数据上传至所述云端服务器。
  3. 根据权利要求1所述的方法,其中,所述编译过程数据包括工作空间信息以及编译过程中产生的缓存数据的存储空间信息;
    所述利用所述编译过程数据确定目标替换参数,包括:
    根据所述工作空间信息确定所述目标应用程序的工作空间的父目录,作为目标替换参数;
    根据所述存储空间信息确定所述目标应用程序对应的目标文件的根目录,作为所述目标替换参数。
  4. 根据权利要求3所述的方法,其中,若所述目标替换参数包括所述目标应用程序的工作空间的父目录;
    所述确定在终端设备中所述目标应用程序对应的所述目标替换参数的参数值,包括:
    确定在终端设备中所述目标应用程序的工作空间;
    确定所述工作空间的父目录的目录路径,将确定出的所述工作空间的父目录的目录路径,作为在所述终端设备中所述目标应用程序对应的所述工作空间的父目录的参数值。
  5. 根据权利要求3所述的方法,其中,若所述目标替换参数包括所述目标文件的根目录;
    所述确定在终端设备中所述目标应用程序对应的所述目标替换参数的参数值,包括:
    确定在终端设备中所述目标应用程序的工作空间;
    利用所述工作空间的目录路径,确定在所述终端设备中所述目标应用程序对应的所述目标文件的根目录的目录路径,将确定出的所述目标文件的根目录的目录路径,作为所述目标文件的根目录的参数值。
  6. 根据权利要求1-5任一项所述的方法,其中,对于所述第一索引文件和所述第二索引文件中的任一索引文件,该索引文件中包括以下至少一项:
    工作目录work_dir信息,所述work_dir信息包括所述目标应用程序的工作空间的父目录的目录路径;
    主路径mainPath信息,所述mainPath信息包括所述目标应用程序的源代码的目录路径;
    外目录out_dir信息,所述out_dir信息包括对所述目标应用程序的源代码进行编译的过程中生成的各个目标文件的目录路径;
    依赖目录dep_dir信息,所述dep_dir信息包括所述目标应用程序的源代码所依赖的各个文件的目录路径。
  7. 一种终端设备,其包括:
    获取模块,用于获取目标应用程序的第一索引文件以及编译过程数据,其中,所述第一索引文件为针对所述目标应用程序的源代码进行编译时生成的,所述第一索引文件中记录各目标文件的目录路径,所述编译过程数据为编译过程中产生的与所述第一索引文件相关的数据;
    第一确定模块,用于利用所述编译过程数据确定目标替换参数;
    第二确定模块,用于确定在所述终端设备中所述目标应用程序对应的所述目标替换参数的参数值;
    替换模块,用于利用确定出的参数值替换所述第一索引文件中所述目标替换参数的参数值,得到所述终端设备中所述目标应用程序对应的第二索引文件。
  8. 根据权利要求7所述的终端设备,其中,所述编译过程数据包括工作空间信息以及编译过程中产生的缓存数据的存储空间信息;
    所述第一确定模块具体用于:
    根据所述工作空间信息确定所述目标应用程序的工作空间的父目录,作为目标替换参数;
    根据所述存储空间信息确定所述目标应用程序对应的目标文件的根目录,作为所述目标替换参数。
  9. 一种电子设备,其包括:
    一个或多个处理器;
    存储器;
    一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于:执行根据权利要求1~6任一项所述的索引文件生成方法。
  10. 一种计算机可读介质,其上存储有计算机程序,其中,该程序被处理器执行时实现权利要求1~6任一项所述的索引文件生成方法。
PCT/CN2021/126885 2020-11-17 2021-10-28 索引文件生成方法、终端设备、电子设备及介质 WO2022105563A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011289784.6A CN112395253B (zh) 2020-11-17 2020-11-17 索引文件生成方法、终端设备、电子设备及介质
CN202011289784.6 2020-11-17

Publications (1)

Publication Number Publication Date
WO2022105563A1 true WO2022105563A1 (zh) 2022-05-27

Family

ID=74606372

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/126885 WO2022105563A1 (zh) 2020-11-17 2021-10-28 索引文件生成方法、终端设备、电子设备及介质

Country Status (2)

Country Link
CN (1) CN112395253B (zh)
WO (1) WO2022105563A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116624361A (zh) * 2023-04-11 2023-08-22 北京通嘉宏瑞科技有限公司 真空泵工作方法、装置、计算机设备和存储介质

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112395253B (zh) * 2020-11-17 2024-03-12 抖音视界有限公司 索引文件生成方法、终端设备、电子设备及介质
CN114117530B (zh) * 2021-11-29 2023-08-22 抖音视界有限公司 一种文件泄露检测方法及装置
CN114040222A (zh) * 2021-12-24 2022-02-11 湖南快乐阳光互动娱乐传媒有限公司 一种多媒体文件防篡改播放方法、处理方法及装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060288026A1 (en) * 2005-06-20 2006-12-21 Zayas Edward R System and method for maintaining mappings from data containers to their parent directories
CN102799679A (zh) * 2012-07-24 2012-11-28 河海大学 基于Hadoop的海量空间数据索引更新系统及方法
CN107544785A (zh) * 2017-06-28 2018-01-05 新华三技术有限公司 一种应用程序更新方法及装置
CN110119381A (zh) * 2019-05-17 2019-08-13 北京思维造物信息科技股份有限公司 一种索引更新方法、装置、设备及介质
CN112395253A (zh) * 2020-11-17 2021-02-23 北京字节跳动网络技术有限公司 索引文件生成方法、终端设备、电子设备及介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060288026A1 (en) * 2005-06-20 2006-12-21 Zayas Edward R System and method for maintaining mappings from data containers to their parent directories
CN102799679A (zh) * 2012-07-24 2012-11-28 河海大学 基于Hadoop的海量空间数据索引更新系统及方法
CN107544785A (zh) * 2017-06-28 2018-01-05 新华三技术有限公司 一种应用程序更新方法及装置
CN110119381A (zh) * 2019-05-17 2019-08-13 北京思维造物信息科技股份有限公司 一种索引更新方法、装置、设备及介质
CN112395253A (zh) * 2020-11-17 2021-02-23 北京字节跳动网络技术有限公司 索引文件生成方法、终端设备、电子设备及介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
BENNUCTECH: "Dynamically Modifying "resId" on Android", pages 1 - 13, XP009536588, Retrieved from the Internet <URL:https://blog.csdn.net/chzphoenix/article/details/80581838> *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116624361A (zh) * 2023-04-11 2023-08-22 北京通嘉宏瑞科技有限公司 真空泵工作方法、装置、计算机设备和存储介质
CN116624361B (zh) * 2023-04-11 2024-03-22 北京通嘉宏瑞科技有限公司 真空泵工作方法、装置、计算机设备和存储介质

Also Published As

Publication number Publication date
CN112395253B (zh) 2024-03-12
CN112395253A (zh) 2021-02-23

Similar Documents

Publication Publication Date Title
WO2022105563A1 (zh) 索引文件生成方法、终端设备、电子设备及介质
EP3605324B1 (en) Application development method and tool, and storage medium thereof
Lampa et al. SciPipe: A workflow library for agile development of complex and dynamic bioinformatics pipelines
CN109726217B (zh) 一种数据库操作方法、装置、设备及存储介质
CN111367516B (zh) 应用界面生成方法、装置及电子设备
CN110960855B (zh) 一种通信协议代码更新方法、装置、电子设备及存储介质
CN112965761B (zh) 一种数据处理方法、系统、电子设备及存储介质
CN111857720B (zh) 用户界面状态信息的生成方法、装置、电子设备及介质
CN111309304B (zh) 一种生成idl文件的方法、装置、介质和电子设备
CN113407165B (zh) Sdk的生成和自升级方法、装置、可读介质和设备
CN112416303B (zh) 软件开发工具包热修复方法、装置及电子设备
CN115344688B (zh) 业务数据展示方法、装置、电子设备和计算机可读介质
CN113377342A (zh) 一种项目构建方法、装置、电子设备及存储介质
CN109815455A (zh) 项目文件处理方法和装置
CN115167822A (zh) 分支代码合并方法、装置、设备和存储介质
CN111240657A (zh) 用于生成sdk的方法、装置和电子设备
US11340897B1 (en) Subject matter expert identification for computer software
CN111625232B (zh) 应用程序安装包的生成方法、装置、可读介质和电子设备
CN115422131B (zh) 业务审核知识库检索方法、装置、设备和计算机可读介质
CN111399902B (zh) 客户端源文件处理方法、装置、可读介质与电子设备
WO2022184037A1 (zh) 文档处理方法、装置、设备和介质
CN115878091A (zh) 一种数据处理方法、装置、设备及存储介质
CN112486494A (zh) 文件生成方法、装置、电子设备及计算机可读存储介质
CN115292254A (zh) 文件存储方法及装置、介质、电子设备
CN116594630A (zh) 文件生成方法、装置、介质及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21893711

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 07.09.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21893711

Country of ref document: EP

Kind code of ref document: A1