CN116302047A - Configuration file construction processing method, electronic equipment and storage medium - Google Patents

Configuration file construction processing method, electronic equipment and storage medium Download PDF

Info

Publication number
CN116302047A
CN116302047A CN202211664777.9A CN202211664777A CN116302047A CN 116302047 A CN116302047 A CN 116302047A CN 202211664777 A CN202211664777 A CN 202211664777A CN 116302047 A CN116302047 A CN 116302047A
Authority
CN
China
Prior art keywords
dependent
dependent item
nested
direct
item
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.)
Pending
Application number
CN202211664777.9A
Other languages
Chinese (zh)
Inventor
曾宇
刘鹏飞
曾井芳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Music Entertainment Technology Shenzhen Co Ltd
Original Assignee
Tencent Music Entertainment Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Music Entertainment Technology Shenzhen Co Ltd filed Critical Tencent Music Entertainment Technology Shenzhen Co Ltd
Priority to CN202211664777.9A priority Critical patent/CN116302047A/en
Publication of CN116302047A publication Critical patent/CN116302047A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/43Checking; Contextual analysis
    • G06F8/433Dependency analysis; Data or control flow analysis
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a configuration file construction processing method, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring a construction request of a configuration file of a target project; responding to the construction request, traversing to obtain a direct dependent item and a nested dependent item of the target engineering; downloading the code file of the direct dependent item and the code file of the nested dependent item from a remote repository; and storing the downloaded code file of the direct dependent item and the downloaded code file of the nested dependent item into a local directory, and constructing the configuration file through a local directory path. The problem that the dependent items in the remote warehouse cannot be effectively called due to the access rights in the prior art is solved, and the technical effects of efficiently and quickly constructing the target engineering and reducing the access cost are achieved.

Description

Configuration file construction processing method, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method for processing configuration files, an electronic device, and a storage medium.
Background
Currently, when engineering modules are constructed, the engineering modules mainly comprise: the SDK (Software Development Kit ) provider and the SDK access party, the SDK provider is responsible for constructing the SDK and publishing the constructed SDK to a remote Maven server warehouse or a local directory, and the SDK access party performs remote dependence by configuring a Maven warehouse address or performs local dependence by copying the SDK file to the own engineering directory, so that codes of the SDK are used and checked in engineering.
However, for the SDK access party, the Maven repository is sometimes not accessible due to the authority problem, which results in that remote dependency, i.e. access to the SDK, is not possible.
In view of the above problems, no effective solution has been proposed at present.
The description of the background art is only for the purpose of facilitating an understanding of the relevant art and is not to be taken as an admission of prior art.
Disclosure of Invention
Therefore, the embodiment of the invention aims to provide a method and a device for constructing and processing a configuration file, electronic equipment and a storage medium, so as to solve the problem that the existing dependency items in a remote warehouse cannot be effectively called due to access rights.
In a first aspect, a method for constructing and processing a configuration file is provided, including: acquiring a construction request of a configuration file of a target project; responding to the construction request, traversing to obtain a direct dependent item and a nested dependent item of the target engineering; downloading the code file of the direct dependent item and the code file of the nested dependent item from a remote repository; and storing the downloaded code file of the direct dependent item and the downloaded code file of the nested dependent item into a local directory, and constructing the configuration file through a local directory path.
In one embodiment, traversing to obtain the direct and nested dependent items of the target project includes: traversing the direct dependent items and the nested dependent items under the target engineering; determining whether a current direct dependency or nested dependency belongs to the remote repository; if the remote warehouse is included, the identification information of the current direct dependent item or the nested dependent item is stored in a list file.
In one embodiment, downloading the code file of the direct dependency and the code file of the nested dependency from a remote repository includes: each of the direct and nested dependencies of the target project performs the following operations: determining the version type of the current dependent item; determining the download address of the current dependent item according to the version type; and downloading the corresponding code file from the remote warehouse according to the determined downloading address.
In one embodiment, determining the download address of the current dependent item based on the version type includes: under the condition that the version type of the current dependent item is a formal release version, acquiring basic characterization information and a file name suffix of the current dependent item; and splicing the basic characterization information and the file name suffix to obtain the download address of the current dependent item.
In one embodiment, determining the download address of the current dependent item based on the version type includes: under the condition that the version type of the current dependent item is a development debugging version, acquiring basic characterization information and a file name suffix of the current dependent item; acquiring the latest version number of the current dependent item; and splicing the basic characterization information, the latest version number and the file name suffix to obtain the download address of the current dependent item.
In one embodiment, after downloading the code file of the direct dependency and the code file of the nested dependency from the remote repository, further comprising: building the target engineering module through the local catalogue trial; determining whether the target engineering module can be successfully compiled; and under the condition that compiling is successful, determining that the direct dependent item and the nested dependent item of the target project are successfully downloaded.
In one embodiment, storing the downloaded code file of the direct dependency and the code file of the nested dependency in a local directory includes: packaging the downloaded code file of the direct dependent item and the code file of the nested dependent item to obtain a compressed file; and pushing the compressed file to an access party of the target project.
In one embodiment, traversing to obtain the direct and nested dependent items of the target project in response to the build request includes: under the condition that a plurality of engineering modules exist in the target engineering, traversing the engineering modules one by one; determining direct dependent items and nested dependent items of each engineering module in the plurality of engineering modules to form a dependent item set; performing deduplication operation on the direct dependent items and the nested dependent items in the dependent item set to obtain a deduplicated dependent item set; and taking the de-duplicated dependent item set as a direct dependent item and a nested dependent item of the target engineering.
In one embodiment, performing a deduplication operation on direct and nested dependencies in the set of dependencies comprises: merging identical dependent items into one dependent item; and merging the dependent items belonging to the same class but with different version numbers into the dependent item corresponding to the latest version number.
In a second aspect, there is provided a configuration file construction processing apparatus, including: the acquisition module is used for acquiring a construction request of the configuration file of the target project; the traversing module is used for responding to the construction request and traversing to obtain a direct dependent item and a nested dependent item of the target project; a downloading module for downloading the code file of the direct dependent item and the code file of the nested dependent item from a remote warehouse; and the configuration module is used for storing the downloaded code file of the direct dependent item and the code file of the nested dependent item into a local directory, and constructing the configuration file through a local directory path.
In a third aspect, there is provided an electronic device comprising: a processor and a memory storing a computer program, the processor being configured to perform the processing method of any of the embodiments when the computer program is run.
In a fourth aspect, a storage medium is provided, the storage medium storing a computer program configured to perform the processing method of any of the embodiments when executed.
The embodiment of the invention provides an improved processing scheme, which aims at solving the problem that the existing dependence items in a remote warehouse cannot be effectively called due to access rights, traversing the direct dependence items and the nested dependence items required by target engineering in advance, downloading the direct dependence items and the nested dependence items from the remote warehouse to a local directory, and configuring the configuration file of the target engineering through a local directory path, so that the target engineering can directly access the local directory to acquire the dependence items without acquiring the dependence items from the remote warehouse during construction, thereby solving the problem that the existing dependence items in the remote warehouse cannot be effectively called due to the access rights, and achieving the technical effects of high-efficiency and quick construction of the target engineering and reduction of access cost.
Optional features and other effects of embodiments of the invention are described in part below, and in part will be apparent from reading the disclosure herein.
Drawings
Embodiments of the present invention will be described in detail with reference to the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements, and wherein:
FIG. 1 illustrates an architectural diagram of a build processing system for a target project in accordance with an embodiment of the present invention;
FIG. 2 is a method flow diagram illustrating a method of processing the construction of a configuration file according to an embodiment of the present invention
FIG. 3 shows a flow diagram of dependent item download according to an embodiment of the present invention;
FIG. 4 shows a flow diagram for summary packaging of dependent items according to an embodiment of the invention;
FIG. 5 is a block diagram showing the hardware structure of an electronic device of a method for processing the construction of a configuration file according to an embodiment of the present invention;
FIG. 6 shows a block diagram of a configuration file construction processing apparatus according to an embodiment of the present invention;
FIG. 7 shows a schematic diagram of a traversal module according to an embodiment of the invention;
fig. 8 shows an exemplary hardware architecture diagram of a mobile terminal capable of implementing a method according to an embodiment of the invention;
FIG. 9 illustrates an exemplary operating system architecture diagram of a mobile terminal capable of implementing methods in accordance with embodiments of the present invention;
fig. 10 illustrates an exemplary operating system architecture diagram of a mobile terminal capable of implementing methods in accordance with embodiments of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the following detailed description and the accompanying drawings, in order to make the objects, technical solutions and advantages of the present invention more apparent. The exemplary embodiments of the present invention and the descriptions thereof are used herein to explain the present invention, but are not intended to limit the invention.
Aiming at the problem that the SDK access party cannot conduct remote dependence because the SDK access party does not have access right and has no right to access the Maven warehouse, in the embodiment, considering that all SDKs required by automatic construction can be predetermined, then the SDKs are quickly integrated and stored in a local catalog, so that when the SDKs are constructed, only the SKD is read from the local catalog without accessing the remote Maven warehouse.
Specifically, in this example, a system for constructing and processing a target project is provided, as shown in fig. 1, may include the following modules: the SDK provider is used for constructing an SDK product and publishing the constructed SDK product to the remote Maven warehouse and the local catalog, and considering that the access authority to the Maven warehouse does not exist for the access party SDK sometimes, the SDK cannot be effectively called when the engineering is constructed, and therefore, in the embodiment, the access party SDK does not adopt a mode of accessing the remote Maven warehouse, but downloads the needed dependent items of the construction engineering from the remote Maven warehouse in advance, then places the downloaded dependent items into the local catalog, and configures an access path for accessing the local catalog when constructing the configuration file, so that the access party SDK directly accesses the dependent items of the SDK from the local catalog when constructing the target engineering.
Based on this, in this embodiment, a method for processing a configuration file is provided, and fig. 2 is a flowchart of a method for processing an embodiment of the method for processing a configuration file provided in the present application. Although the present application provides a method operation step or apparatus structure as shown in the following examples or figures, more or fewer operation steps or module units may be included in the method or apparatus based on routine or non-inventive labor. In the steps or structures where there is no necessary causal relationship logically, the execution order of the steps or the module structure of the apparatus is not limited to the execution order or the module structure shown in the drawings and described in the embodiments of the present application. The described methods or module structures may be implemented sequentially or in parallel (e.g., in a parallel processor or multithreaded environment, or even in a distributed processing environment) in accordance with the embodiments or the method or module structure connection illustrated in the figures when implemented in a practical device or end product application.
Specifically, as shown in fig. 2, the method for constructing and processing the configuration file may include the following steps:
step 201: acquiring a construction request of a configuration file of a target project;
Step 202: responding to the construction request, traversing to obtain a direct dependent item and a nested dependent item of the target engineering;
wherein the term dependency refers to, for example: one SDK references other SDKs and there is a dependency, then the dependent SDK is the dependent item of this SDK. There may be zero or more dependent items in one SDK.
For target engineering, there are often multiple engineering modules, each of which can be compiled and generate a build product, and there are typically multiple direct and nested dependencies in each module, for which purpose the engineering module by engineering module can be traversed, e.g., for engineering module 1, the traversal results in: direct dependent item 1-A, direct dependent item 1-B, and direct dependent item 1-C, there are also nested dependent items for each direct dependent item, e.g., direct dependent item 1-A depends on nested dependent item 1-A-a and nested dependent item 1-A-B. In this way, direct and nested dependencies of the individual engineering modules can be obtained, which is a relatively large set.
Because the same dependency items exist between the engineering modules and the dependency items, the dependency items in the large set can be summarized and de-duplicated for reducing, for example, if the direct dependency item 1-B is the same dependency item as the nested dependency item 1-a, the two can be merged into the same dependency item, and if the direct dependency item 1-B is the same type of dependency item as the nested dependency item 1-a but the version numbers are different, the two can be merged into the latest version numbers of the dependency item.
That is, in response to the construction request, traversing to obtain a direct dependency item and a nested dependency item of the target project, where a plurality of project modules exist in the target project, traversing the plurality of project modules one by one; determining direct dependent items and nested dependent items of each engineering module in the plurality of engineering modules to form a dependent item set; performing deduplication operation on the direct dependent items and the nested dependent items in the dependent item set to obtain a deduplicated dependent item set; and taking the de-duplicated dependent item set as a direct dependent item and a nested dependent item of the target engineering. When the direct dependent items and the nested dependent items in the dependent item set are subjected to the deduplication operation, the identical dependent items can be combined into one dependent item; and carrying out normalization processing on the dependent items belonging to the same class but with different version numbers, and adjusting the dependent items to be designated version numbers or merging the dependent items to be the dependent items corresponding to the latest version numbers.
Through the operation of summarizing and de-duplication, a plurality of dependent items can be reduced to a certain extent, so that repeated downloading of the same dependent items is avoided when the dependent items are downloaded.
Step 203: downloading the code file of the direct dependent item and the code file of the nested dependent item from a remote repository;
for SDKs, there are two version types: the system comprises a formal release edition and a development and debugging edition, wherein one version number corresponds to a unique set of files for the formal release edition, one version number corresponds to a plurality of sets of files for the development and debugging edition, and the latest version number is recorded in a metadata file.
Since the formally released version is a version number corresponding to a unique set of files, the corresponding code files can be matched only by corresponding to the version number, but for developing the debugging version, only the version number cannot be corresponding to the unique code files. Based on this, in this example, different download address determination methods need to be set for the differences of dependent item version types, because when file download is performed to a remote repository, a download address needs to be determined to download a corresponding code file. That is, downloading the code file of the direct dependency and the code file of the nested dependency from a remote repository may include: each of the direct and nested dependencies of the target project performs the following operations: determining the version type of the current dependent item; determining the download address of the current dependent item according to the version type; and downloading the corresponding code file from the remote warehouse according to the determined downloading address.
For different version types, the download address may be determined in different manners:
1) Under the condition that the version type of the current dependent item is a formal release version, acquiring basic characterization information and a file name suffix of the current dependent item; and splicing the information of the software development kit and the file name suffix to obtain the download address of the current dependent item.
2) Under the condition that the version type of the current dependent item is a development debugging version, acquiring basic characterization information and a file name suffix of the current dependent item; acquiring the latest version number of the current dependent item; and splicing the information of the software development kit, the latest version number and the file name suffix to obtain the download address of the current dependent item.
The basic characterization information may be basic information of the SDK, including: groupId (team or company to which the SDK belongs), artifactId (the SDK name), version (the SDK Version number).
For developing a debug version, it is necessary to obtain the latest version number, and for this purpose, the latest version number of the current dependency may be obtained from the metadata file record. And then assembled with the base characterizing information and suffixes of the dependent items to form a download address in the remote repository. Specifically, for developing a debug version, the version number may include: the main version number and the sub version number, therefore, the latest version number needs to be determined from metadata as the sub version number, and accordingly, the file name of the dependent item of the development debug version can be expressed as: artifactid+major version number+latest version number+suffix.
In practical implementation, the development of the debug version is considered, mainly because the debug version is not formally released, version type distinction is not needed when the debug version is downloaded locally as a file to be called later, and on the basis of the fact, distinction is needed through the sub-version number when the debug version is downloaded, but after the debug version is downloaded locally, distinction of the version type is not needed, so that the code file of the debug version can be renamed, and the debug version is named according to the formally released, namely, unification of local files is realized, and simple and efficient calling is facilitated.
Step 204: and storing the downloaded code file of the direct dependent item and the downloaded code file of the nested dependent item into a local directory, and constructing the configuration file through a local directory path.
In the above example, aiming at the problem that the existing dependence items in the remote warehouse cannot be effectively called due to the access rights, the direct dependence items and the nested dependence items required by the target engineering are traversed in advance, then the direct dependence items and the nested dependence items are downloaded into the local catalogue from the remote warehouse, and then the configuration file of the target engineering is configured through the local catalogue path, so that the target engineering can directly access the local catalogue to obtain the dependence items without obtaining the dependence items from the remote warehouse during construction, the problem that the existing dependence items in the remote warehouse cannot be effectively called due to the access rights is solved, and the technical effects of high-efficiency and rapid construction of the target engineering and reduction of access cost are achieved.
Considering that the dependent items need to be downloaded from a remote warehouse, but some dependent items are locally cataloged and do not need to be acquired from the remote warehouse, in order to reduce the downloading pressure, when the direct dependent items and the nested dependent items of the target project are obtained through traversing, the direct dependent items and the nested dependent items under the target project can be traversed; determining whether a current direct dependency or nested dependency belongs to the remote repository; if the remote warehouse is included, the identification information of the current direct dependent item or the nested dependent item is stored in a list file.
That is, only the dependent items belonging to the remote repository are stored in the list file, and if the dependent items do not belong to the remote repository, the dependent items do not need to be stored in the list file, and when the dependent items are downloaded, the dependent items are downloaded based on the records in the list file.
Specifically, when the dependent item is downloaded, as shown in fig. 3, the dependent item is traversed, and the downloading judgment is performed on each dependent item according to the following manner:
s1: determining whether the current dependent item is a development and debugging edition, if so, executing S2, and if not, executing S4;
S2: traversing urls of development debugging version;
s3: requesting url, if failed, trying next url, if successful, executing S6;
s4: traversing urls of the formal release edition;
s5: requesting url, if failed, trying next url, if successful, executing S6;
s6: and downloading the target dependent item.
After the code files of the direct dependent items and the code files of the nested dependent items are downloaded from a remote warehouse, in consideration of the condition that the download is leaked sometimes, verification can be performed, and specifically, the target engineering module can be built through the local directory trial; determining whether the target engineering module can be successfully compiled; and under the condition that compiling is successful, determining that the direct dependent item and the nested dependent item of the target project are successfully downloaded. That is, the trial construction of the target engineering can be performed based on the local directory, that is, the target engineering is run in advance, if the compiling can be successfully performed, it can be determined that all the direct dependent items and the nested dependent items are successfully downloaded, if the compiling can not be successfully performed, which one or a plurality of direct dependent items and nested dependent items are absent can be checked, and then the downloading process is triggered again until the compiling can be successfully performed.
The downloaded code file of the direct dependent item and the downloaded code file of the nested dependent item can be packaged to obtain a compressed file, and then the compressed file is pushed to an access party, and specifically, the downloaded code file of the direct dependent item and the downloaded code file of the nested dependent item can be packaged to obtain the compressed file; and pushing the compressed file to an access party of the target project.
In practical implementation, the obtained code files may be combined with the confusion rule, then the access document is copied through the shell command, and then the files are compressed together through the shell command, that is, the confusion rule, the SDK directory and the access document are packaged together, for example, packaged into a zip file, and transmitted to the compiling and operating party. If confusion is opened during engineering compiling of apk, class names, variable names, method names and the like are converted into aliases of English letter and number combinations, so that the number of characters is simplified, the volume of apk is reduced, and the confusion rule is a rule file which limits part of naming to be replaced by the aliases and keeps original naming.
Specifically, the target engineering module can be directly called from a local directory instead of relying on the Maven address of the intranet through variable control, i.e. a local directory path (for example: dir /) can be used as a Maven repository when a configuration file is built for the target engineering module.
The above method is described below in connection with a specific embodiment, however, it should be noted that this specific embodiment is only for better illustrating the present application and is not meant to be a undue limitation on the present application.
Aiming at the problem that the SDK access party cannot conduct remote dependence because the SDK access party does not have access right and has no right to access the Maven warehouse, in the embodiment, considering that all SDKs required by automatic construction can be predetermined, then the SDKs are quickly integrated and stored in a local catalog, so that when the SDKs are constructed, only the SKD is read from the local catalog without accessing the remote Maven warehouse.
Specifically, the method can comprise the following steps;
step 1: statistical dependency term:
and traversing all direct dependent items and nested dependent items under the target engineering module, determining whether the direct dependent items and the nested dependent items are SDKs belonging to an intranet Maven warehouse, if so, storing the dependent items into a set, and writing the dependent items into a local file.
In determining whether these direct and nested dependencies are SDKs belonging to the intranet Maven repository, it may be determined according to whether these dependencies contain keywords, for example, the keywords may be: tent or tme, etc.
Step 2: summarizing and de-duplicating the local files obtained through statistics to obtain list files;
step 3: downloading the dependent items:
url in a remote Maven server is divided into release (formal release) and snapshot (development and debugging) types.
Traversing the list file, and requesting corresponding url from a remote Maven server, namely requesting the url of release or snapshot in a Maven library according to the version type of each dependent item in the list file. For example: https:// mirrors.tent/com/repositive/maven/thredpart/and https:// mirrors.tent/repositive/maven/thredpart-snapshots /)
Specifically, for the dependent item of the release version, the downloaded target address can be determined by splicing url, sdk information (GroupId, artifactId, version) and file name suffixes (aar, pom); for dependency of the snapshot Version, version can be parsed from the metadata file.
In specific implementation, for the snappshot version, when the snappshot version is downloaded to the local, the snappshot version can be renamed according to the format of the release version, namely the snappshot version downloaded to the local is used as the release version.
Step 4: after each dependency item in the list file is downloaded locally, the target engineering module can be built in a trial mode to determine whether all SDKs have been downloaded successfully;
Step 5: in the case that it is determined that all the dependent items have been downloaded successfully, the dependent items are summarized and packaged, specifically, as shown in fig. 4, after the SDK code file directory is obtained, the confusion rule and the SDK directory may be combined, then the access document is copied through the shell command, the file is compressed through the shell command, that is, the confusion rule, the SDK directory and the access document are packaged together, for example, into a zip file, and then the zip file is delivered to the SDK access party. Wherein the access document is used to tell the SDK access party how to invoke the local directory. The delivery may be performed by, but not limited to, instant messaging software, FTP server, etc. when implemented.
Step 6: the target engineering module is enabled to be not dependent on the Maven address of the intranet through variable control, and is directly called from a local directory, namely, a local directory path (for example: dir /) can be used as a Maven warehouse when a configuration file is constructed for the target engineering module.
For example, a local directory path (e.g., dir /) may be used in building a profile. The access party configures and uses the local directory path in the engineering build. maven {. Url rootproject. Getprojectdir (). Path +'/localrepo }.
The problem that engineering module construction cannot be carried out under the condition that the existing SDK access party does not have permission to use the remote Maven warehouse is solved through the scheme, a large number of SDKs are integrated rapidly, effective call of the SDKs is achieved, and therefore the technical effect of task construction is achieved efficiently.
The method embodiments provided in the above embodiments of the present application may be performed in a mobile terminal, a computer terminal or similar computing device. Taking the operation on the electronic device as an example, fig. 5 is a block diagram of a hardware structure of the electronic device according to a method for processing configuration files. As shown in fig. 1, the electronic device 10 may include one or more (only one is shown in the figure) processors 02 (the processors 02 may include, but are not limited to, a microprocessor MCU, a programmable logic device FPGA, etc. processing means), a memory 04 for storing data, and a transmission module 06 for communication functions. It will be appreciated by those of ordinary skill in the art that the configuration shown in fig. 5 is merely illustrative and is not intended to limit the configuration of the electronic device described above. For example, the electronic device 10 may also include more or fewer components than shown in FIG. 5, or have a different configuration than shown in FIG. 5.
The memory 04 may be used to store software programs and modules of application software, such as program instructions/modules corresponding to the method for constructing and processing a configuration file in the embodiment of the present application, and the processor 02 executes the software programs and modules stored in the memory 04, thereby executing various functional applications and data processing, that is, implementing the method for constructing and processing a configuration file of an application program. Memory 04 may include high-speed random access memory, but may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 04 may further include memory located remotely from processor 02, which may be connected to electronic device 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission module 06 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communications provider of the electronic device 10. In one example, the transmission module 06 includes a network adapter (Network Interface Controller, NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission module 06 may be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
At the software level, the device for constructing and processing the configuration file may, as shown in fig. 6, include:
an obtaining module 601, configured to obtain a construction request of a configuration file of a target project;
a traversing module 602, configured to respond to the construction request, and traverse to obtain a direct dependency item and a nested dependency item of the target project;
a downloading module 603, configured to download the code file of the direct dependent item and the code file of the nested dependent item from a remote repository;
a configuration module 604, configured to store the downloaded code file of the direct dependent item and the code file of the nested dependent item into a local directory, and construct the configuration file through a local directory path.
In one embodiment, the traversing module may include, as shown in fig. 7: a traversing unit 701, configured to traverse the direct dependent item and the nested dependent item under the target project; a determining unit 702, configured to determine whether a current direct dependency or nested dependency belongs to the remote repository; a storage unit 703, configured to store, in the case where it is determined that the remote repository belongs to the remote repository, identification information of a current direct dependency item or a nested dependency item in a list file.
In one embodiment, the downloading module 603 may be specifically configured to perform the following operations on each of the direct dependency and the nested dependency of the target project: determining the version type of the current dependent item; determining the download address of the current dependent item according to the version type; and downloading the corresponding code file from the remote warehouse according to the determined downloading address.
In one embodiment, determining the download address of the current dependent item based on the version type may include: under the condition that the version type of the current dependent item is a formal release version, acquiring basic characterization information and a file name suffix of the current dependent item; and splicing the basic characterization information and the file name suffix to obtain the download address of the current dependent item.
In one embodiment, determining the download address of the current dependent item based on the version type may include: under the condition that the version type of the current dependent item is a development debugging version, acquiring basic characterization information and a file name suffix of the current dependent item; acquiring the latest version number of the current dependent item; and splicing the basic characterization information, the latest version number and the file name suffix to obtain the download address of the current dependent item.
In one embodiment, the device for constructing and processing the configuration file may further be configured to try to construct the target engineering module through the local directory after downloading the code file of the direct dependent item and the code file of the nested dependent item from a remote repository; determining whether the target engineering module can be successfully compiled; and under the condition that compiling is successful, determining that the direct dependent item and the nested dependent item of the target project are successfully downloaded.
In one embodiment, storing the downloaded code file of the direct dependency and the code file of the nested dependency in a local directory may include: packaging the downloaded code file of the direct dependent item and the code file of the nested dependent item to obtain a compressed file; and pushing the compressed file to an access party of the target project.
In one embodiment, traversing to obtain the direct and nested dependent items of the target project in response to the build request may include: under the condition that a plurality of engineering modules exist in the target engineering, traversing the engineering modules one by one; determining direct dependent items and nested dependent items of each engineering module in the plurality of engineering modules to form a dependent item set; performing deduplication operation on the direct dependent items and the nested dependent items in the dependent item set to obtain a deduplicated dependent item set; and taking the de-duplicated dependent item set as a direct dependent item and a nested dependent item of the target engineering.
In one embodiment, performing a deduplication operation on the direct and nested dependencies in the set of dependencies may include: merging identical dependent items into one dependent item; and merging the dependent items belonging to the same class but with different version numbers into the dependent item corresponding to the latest version number.
In an embodiment of the present invention, there is provided an electronic apparatus including: a processor and a memory storing a computer program, the processor being configured to implement any of the methods according to embodiments of the invention when the computer program is run. In addition, a processing apparatus implementing the embodiment of the present invention may also be provided.
In a preferred embodiment of the present invention, the electronic device is a mobile terminal, preferably a mobile phone. Fig. 8 shows, by way of example only, a schematic hardware architecture of a particular embodiment of an electronic device, such as a mobile terminal 800; and fig. 9 and 10 show a system architecture diagram of one embodiment of an electronic device, such as a mobile terminal.
In the illustrated embodiment, the mobile terminal 800 may include a processor 801, an external memory interface 812, an internal memory 810, a Universal Serial Bus (USB) interface 813, a charge management module 814, a power management module 815, a battery 816, a mobile communication module 840, a wireless communication module 842, antennas 839 and 841, an audio module 834, a speaker 835, a receiver 836, a microphone 837, an earphone interface 838, keys 809, a motor 808, an indicator 807, a Subscriber Identity Module (SIM) card interface 88, a display 805, an image pickup device 806, and a sensor module 820, among others.
It should be understood that the structures illustrated in the embodiments of the present application do not constitute a particular limitation on the mobile terminal 800. In other embodiments of the present application, mobile terminal 800 may include more or less components than illustrated, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
In some embodiments, the processor 801 may include one or more processing units. In some embodiments, the processor 801 may include one or a combination of at least two of the following: an Application Processor (AP), a modem processor, a baseband processor, a Graphics Processor (GPU), an Image Signal Processor (ISP), a controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor, a neural Network Processor (NPU), etc. The different processing units may be separate devices or may be integrated in one or more processors.
The controller may be a neural hub and command center of the mobile terminal 800. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor for storing instructions and data. In some embodiments, the memory in the processor is a cache memory. The memory may hold instructions or data that the processor has just used or recycled. If the processor needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 801 is reduced, thereby improving the efficiency of the system.
The NPU is a Neural Network (NN) computing processor, and can also be continuously self-learned by rapidly processing input information by referencing a biological neural network structure, for example, referencing a transmission mode between human brain neurons.
The GPU is a microprocessor for image processing and is connected with the display screen and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor may include one or more GPUs that execute program instructions to generate or change display information.
A digital signal processor (ISP) is used to process digital signals, and may process other digital signals in addition to digital image signals.
In some embodiments, the processor 801 may include one or more interfaces. The interfaces may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (I2S) interface, a Pulse Code Modulation (PCM) interface, a Universal Asynchronous Receiver Transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a General Purpose Input Output (GPIO) interface, a Subscriber Identity Module (SIM) interface, a Universal Serial Bus (USB) interface, and the like.
It should be understood that the connection relationship between the modules illustrated in the embodiments of the present application is only illustrative, and does not limit the structure of the mobile terminal. In other embodiments of the present application, the mobile terminal may also use different interfacing manners in the foregoing embodiments, or a combination of multiple interfacing manners.
The wireless communication function of the mobile terminal 800 may be implemented by antennas 839 and 841, mobile communication module 840, wireless communication module 842, modem processor, baseband processor, or the like.
Video codecs are used to compress or decompress digital video.
The mobile terminal 800 may implement audio functions through an audio module, speaker, receiver, microphone, earphone interface, application processor, and the like. Such as music playing, recording, etc.
The audio module is used for converting digital audio information into analog audio signals for output and also used for converting analog audio input into digital audio signals.
Microphones are used to convert sound signals into electrical signals. When making a call or transmitting voice information, a user can sound near the microphone through the mouth, inputting a sound signal to the microphone.
The sensor module 820 may include one or more of the following sensors:
The pressure sensor 823 is configured to sense a pressure signal, and convert the pressure signal into an electrical signal.
The air pressure sensor 824 is used to measure air pressure.
The magnetic sensor 825 includes a hall sensor.
The gyro sensor 827 may be used to determine a motion gesture of the mobile terminal 800.
The acceleration sensor 828 may detect the magnitude of acceleration of the mobile terminal 800 in various directions.
The distance sensor 829 may be configured to measure a distance.
The proximity light sensor 821 may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode.
The ambient light sensor 822 is used to sense ambient light level.
The fingerprint sensor 831 may be configured to collect a fingerprint.
The touch sensor 832 may be disposed on a display screen, and the touch sensor and the display screen form a touch screen, which is also referred to as a "touch screen". The touch sensor is used to detect a touch operation acting on or near it. The touch sensor may communicate the detected touch operation to the application processor to determine a touch event type, such as single click, double click, long press, tap, directional swipe, gather, and so forth.
The bone conduction sensor 833 may acquire a vibration signal.
An electronic device (computer), a software operating system such as a mobile terminal, may employ a layered architecture, an event driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture.
The embodiments shown herein exemplify the software architecture of a mobile terminal with a hierarchical architecture, taking iOS and android operating system platforms, respectively. It is contemplated that embodiments herein may be implemented in different software operating systems.
In the embodiment shown in fig. 9, the iOS operating system may be adopted in the scheme of the embodiment of the present invention. The iOS operating system adopts a four-layer architecture, which is a touchable layer (Cocoa Touch layer), a Media layer (Media layer) 920, a Core service layer (Core Services layer) 930, and a Core operating system layer (Core OS layer) 940 in order from top to bottom. Touch layer 910 provides various commonly used frameworks for application development and most of the frameworks are related to interfaces that are responsible for touch interactions by users on iOS devices. The media layer provides audiovisual technology in applications such as graphics images, sound technology, video and audio-video transmission related frameworks, etc. The core service layer provides the basic system services required by the application. The core operating system layer contains most of the low-level near hardware functionality.
In an embodiment of the present invention, UIKit is a user interface frame of the touchable layer 910 that may be supported by numerous Image frames in the media layer 920, including but not limited to Core Graphics, core Animation, open Graphics ES (OPEN GL ES), core Image, image IO, gallery pack (GLKit), as shown in fig. 9.
Fig. 10 is a schematic diagram of an android operating system, which may be adopted in the scheme of the embodiment of the present invention. The layered architecture divides the software into several layers, with the layers communicating through software interfaces. In some embodiments, the android system is divided into four layers, from top to bottom, an application layer 1010, an application framework layer 1020, android Runtime (run time) and system libraries 1030, and a kernel layer 1040, respectively.
The application layer 1010 may include a series of application packages.
The application framework layer 1020 provides Application Programming Interfaces (APIs) and programming frameworks for application programs of the application layer. The application framework layer includes a number of predefined functions.
The window manager is used for managing window programs.
The content provider is used to store and retrieve data and make such data accessible to applications.
The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text message notification icon may include a view displaying text and a view displaying a picture.
The telephony manager is used to provide communication functions of the mobile terminal.
The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like.
The notification manager allows the application to display notification information in a status bar, can be used to communicate notification type messages, can automatically disappear after a short dwell, and does not require user interaction.
The android run time comprises a core library and a virtual machine, and is responsible for scheduling and management of an android system. The core library consists of two parts: one part is a function to be called by java language, and the other part is a core library of android. The application layer and the framework layer run in virtual machines.
The system library may include a plurality of functional modules. The surface manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
Media libraries support a variety of commonly used audio, video format playback and recording, still image files, and the like. The media library may support a variety of audio video encoding formats, such as: MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc.
Kernel layer 1040 is a layer between hardware and software. The kernel layer may include display drivers, camera drivers, audio interfaces, sensor drivers, power management, and GPS interfaces. In some embodiments of the invention, the display may invoke a display driver.
The system, apparatus, module or unit set forth in the above embodiments may be implemented by an electronic device (computer) or its associated components, preferably by a mobile terminal. The mobile terminal may be, for example, a smart phone, a laptop computer, an in-vehicle human-machine interaction device, a personal digital assistant, a media player, a navigation device, a game console, a tablet, a wearable device, or a combination thereof.
Although not shown, in some embodiments a storage medium is also provided, storing a computer program. The computer program is configured to perform the method of any of the embodiments of the invention when run.
Storage media in embodiments of the invention include both permanent and non-permanent, removable and non-removable items that may be used to implement information storage by any method or technology. Examples of storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, read only compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium which can be used to store information that can be accessed by a computing device.
It will be appreciated by those skilled in the art that embodiments of the present description may be provided as a method, system, or computer program product. Thus, it will be apparent to those skilled in the art that the functional modules/units or controllers and associated method steps set forth in the above embodiments may be implemented in software, hardware, and a combination of software/hardware.
The acts of the methods, procedures, or steps described in accordance with the embodiments of the present invention do not have to be performed in a specific order and still achieve desirable results unless explicitly stated. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Various embodiments of the invention are described herein, but for brevity, description of each embodiment is not exhaustive and features or parts of the same or similar between each embodiment may be omitted. Herein, "one embodiment," "some embodiments," "example," "specific example," or "some examples" means that it is applicable to at least one embodiment or example, but not all embodiments, according to the present invention. The above terms are not necessarily meant to refer to the same embodiment or example. Those skilled in the art may combine and combine the features of the different embodiments or examples described in this specification and of the different embodiments or examples without contradiction.
The exemplary systems and methods of the present invention have been particularly shown and described with reference to the foregoing embodiments, which are merely examples of the best modes for carrying out the systems and methods. It will be appreciated by those skilled in the art that various changes may be made to the embodiments of the systems and methods described herein in practicing the systems and/or methods without departing from the spirit and scope of the invention as defined in the following claims.

Claims (11)

1. The method for constructing and processing the configuration file is characterized by comprising the following steps:
acquiring a construction request of a configuration file of a target project;
responding to the construction request, traversing to obtain a direct dependent item and a nested dependent item of the target engineering;
downloading the code file of the direct dependent item and the code file of the nested dependent item from a remote repository;
and storing the downloaded code file of the direct dependent item and the downloaded code file of the nested dependent item into a local directory, and constructing the configuration file through a local directory path.
2. The method of claim 1, wherein traversing to obtain the direct and nested dependent items of the target project comprises:
traversing the direct dependent items and the nested dependent items under the target engineering;
Determining whether a current direct dependency or nested dependency belongs to the remote repository;
if the remote warehouse is included, the identification information of the current direct dependent item or the nested dependent item is stored in a list file.
3. The method of claim 1, wherein downloading the code file of the direct dependent item and the code file of the nested dependent item from a remote repository comprises:
each of the direct and nested dependencies of the target project performs the following operations:
determining the version type of the current dependent item;
determining the download address of the current dependent item according to the version type;
and downloading the corresponding code file from the remote warehouse according to the determined downloading address.
4. A method according to claim 3, wherein determining the download address of the current dependent item based on the version type comprises:
under the condition that the version type of the current dependent item is a formal release version, acquiring basic characterization information and a file name suffix of the current dependent item;
and splicing the basic characterization information and the file name suffix to obtain the download address of the current dependent item.
5. A method according to claim 3, wherein determining the download address of the current dependent item based on the version type comprises:
Under the condition that the version type of the current dependent item is a development debugging version, acquiring basic characterization information and a file name suffix of the current dependent item;
acquiring the latest version number of the current dependent item;
and splicing the basic characterization information, the latest version number and the file name suffix to obtain the download address of the current dependent item.
6. The method of claim 1, further comprising, after downloading the code file of the direct dependency and the code file of the nested dependency from a remote repository:
building the target engineering module through the local catalogue trial;
determining whether the target engineering module can be successfully compiled;
and under the condition that compiling is successful, determining that the direct dependent item and the nested dependent item of the target project are successfully downloaded.
7. The method of claim 1, wherein storing the downloaded code file of the direct dependent item and the code file of the nested dependent item in a local directory comprises:
packaging the downloaded code file of the direct dependent item and the code file of the nested dependent item to obtain a compressed file;
and pushing the compressed file to an access party of the target project.
8. The method of claim 1, wherein traversing to obtain the direct and nested dependent items of the target project in response to the build request comprises:
under the condition that a plurality of engineering modules exist in the target engineering, traversing the engineering modules one by one;
determining direct dependent items and nested dependent items of each engineering module in the plurality of engineering modules to form a dependent item set;
performing deduplication operation on the direct dependent items and the nested dependent items in the dependent item set to obtain a deduplicated dependent item set;
and taking the de-duplicated dependent item set as a direct dependent item and a nested dependent item of the target engineering.
9. The method of claim 8, wherein performing a deduplication operation on direct and nested dependencies in the set of dependencies comprises:
merging identical dependent items into one dependent item;
and merging the dependent items belonging to the same class but with different version numbers into the dependent item corresponding to the latest version number.
10. An electronic device, comprising: a processor and a memory storing a computer program, the processor being configured to perform the method of any one of claims 1 to 9 when the computer program is run.
11. A storage medium storing a computer program configured to perform the method of any one of claims 1 to 9 when executed.
CN202211664777.9A 2022-12-23 2022-12-23 Configuration file construction processing method, electronic equipment and storage medium Pending CN116302047A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211664777.9A CN116302047A (en) 2022-12-23 2022-12-23 Configuration file construction processing method, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211664777.9A CN116302047A (en) 2022-12-23 2022-12-23 Configuration file construction processing method, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116302047A true CN116302047A (en) 2023-06-23

Family

ID=86796672

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211664777.9A Pending CN116302047A (en) 2022-12-23 2022-12-23 Configuration file construction processing method, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116302047A (en)

Similar Documents

Publication Publication Date Title
Meier Professional Android 4 application development
KR102128139B1 (en) File management with placeholders
JP5409767B2 (en) Application management within the expandable object hierarchy
CN112035410B (en) Log storage method, device, node equipment and storage medium
CN109074278B (en) Validating stateful dynamic links in mobile applications
US9575864B2 (en) Function-level dynamic instrumentation
CA2466184A1 (en) User interface automation framework classes and interfaces
CN113094123A (en) Method and device for realizing functions in application program, electronic equipment and storage medium
CN104137057A (en) Generating and caching software code
MX2015002906A (en) Generating native code from intermediate language code for an application.
CN110780930B (en) Method and device for starting Android system, electronic equipment and storage medium
CN110865837B (en) Method and terminal for system upgrade
KR102603767B1 (en) Method and system for generating knowledge graphs automatically
US20220334815A1 (en) Accelerating application and sub-package installations
CN111813465B (en) Information acquisition method, device, medium and equipment
WO2023216491A1 (en) Animation resource information processing method and apparatus, device, medium and product
CN114625439A (en) Sub-application operation method based on micro front-end architecture, electronic device and storage medium
US20130179414A1 (en) Mechanisms for connecting files between applications
CN112416303B (en) Software development kit hot repair method and device and electronic equipment
CN111414152B (en) Method, system, readable medium and electronic device for realizing business logic
CN112084157A (en) File recovery method and device, computer equipment and storage medium
CN116628773A (en) Data processing method, device, electronic equipment and storage medium
CN116302047A (en) Configuration file construction processing method, electronic equipment and storage medium
CN114385723A (en) Data reading method and device, electronic equipment and storage medium
CN111290746A (en) Object access method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination