CN114153457A - Application program installation file generation method and device and storage medium - Google Patents

Application program installation file generation method and device and storage medium Download PDF

Info

Publication number
CN114153457A
CN114153457A CN202111414979.3A CN202111414979A CN114153457A CN 114153457 A CN114153457 A CN 114153457A CN 202111414979 A CN202111414979 A CN 202111414979A CN 114153457 A CN114153457 A CN 114153457A
Authority
CN
China
Prior art keywords
file
version
application program
source code
released
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
CN202111414979.3A
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.)
Shenzhen Wangxu Technology Co ltd
Original Assignee
Shenzhen Wangxu Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Wangxu Technology Co ltd filed Critical Shenzhen Wangxu Technology Co ltd
Priority to CN202111414979.3A priority Critical patent/CN114153457A/en
Publication of CN114153457A publication Critical patent/CN114153457A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Abstract

The invention relates to the technical field of data processing, and discloses a method for generating an application program installation file, which comprises the following steps: the method comprises the steps of obtaining a source code file of a to-be-released version of an application program and a plurality of third-party source code library files, identifying a changed target library file in the library files based on a sha1 value in a first version file of a third-party source code of the released version of the application program and a sha1 value in a second version file of the third-party source code of the to-be-released version, performing code compiling on the target library file to obtain a compiled file of a new version, updating a compiled file corresponding to the released version of the application program stored in a preset cache based on the compiled file of the new version, generating an application program file of the to-be-released version based on the source code file and the compiled file of the to-be-released version stored in the preset cache, and packaging the application program file of the to-be-released version to generate an application program installation file. The method for generating the application program installation file improves the compiling efficiency by partially recompiling the file.

Description

Application program installation file generation method and device and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method for generating an application installation file, an electronic device, and a computer-readable storage medium.
Background
In the prior art, when the application program is recompiled, all files are generally recompiled instead of incremental compiling, and a large amount of repeated compiling is easy to occur, so that the efficiency of file compiling is reduced. The existing accelerated compiling method is accelerated by using a binary product generated by pod, and the whole compiling speed is improved by storing and reading the binary product. And after the compiling is completed, the generated application program is manually packed, signed, notarized and stamped, and the next step can be carried out only after the previous step is completed clearly, so that the time is consumed, the complexity is high, and the development efficiency is seriously influenced.
Disclosure of Invention
In view of the foregoing, it is desirable to provide an application installation file generation method for automatically and efficiently packaging application files.
The invention provides a method for generating an application program installation file, which comprises the following steps:
the method comprises the steps of obtaining a source code file of a to-be-released version of an application program and library files of a plurality of third-party source codes, obtaining a first version file of the third-party source codes of the released version of the application program, obtaining a second version file of the third-party source codes of the to-be-released version based on the source code file of the to-be-released version of the application program, wherein the first version file and the second version file store sha1 values of the library files of corresponding versions;
identifying a changed target library file in the library file based on a sha1 value in a first version file of a third-party source code of a released version of an application program and a sha1 value in a second version file of the third-party source code of a to-be-released version, and performing code compilation on the target library file to obtain a compiled file of a new version;
updating the compiled file corresponding to the published version of the application program stored in a preset cache based on the compiled file of the new version to obtain the compiled file of the version to be published of the application program, and modifying the compiling output path of the application program into a folder for storing the compiled file of the application program in the preset cache;
and generating an application program file of the version to be released based on the compiled file of the version to be released acquired from the preset cache and the source code file, packaging the application program file of the version to be released to obtain a packaged file, and processing the packaged file to generate an application program installation file.
Optionally, before the obtaining the source code file of the to-be-released version of the application program and the multiple third-party source code library files, the method further includes:
establishing a third-party source code dependent library of the application program through the cocoadods, wherein the third-party source code dependent library is used for storing a plurality of library files of third-party source codes of released versions of the application program;
creating a third party source code engineering project of the application program through the Xcode, wherein the third party source code engineering project is used for installing and operating a source code file of the application program;
when a source code file of an application program is installed and operated, compiling the source code file of the released version of the application program by using Xcodebuild to obtain a first version file of a third party source code of the released version of the application program;
and compiling the library files of the source codes of the third parties of the released versions of the application program to obtain compiled files of the released versions and storing the compiled files into the preset cache.
Optionally, the identifying the changed target library file in the library file based on the sha1 value in the first version file of the third-party source code of which the version of the application program is released and the sha1 value in the second version file of the third-party source code of which the version is to be released includes:
comparing the sha1 values corresponding to each third-party source code library file in the first version file with the sha1 values corresponding to each third-party source code library file in the second version file;
if the sha1 value in the first version file is different from the corresponding sha1 value in the second version file, identifying the third-party source code library file corresponding to the sha1 value as a changed third-party source code library file;
if the sha1 value in the first version file does not have a corresponding sha1 value in the second version file, identifying the third-party source code library file corresponding to the sha1 value as a deleted third-party source code library file;
and if the sha1 value in the second version file does not have a corresponding sha1 value in the first version file, identifying the third-party source code library file corresponding to the sha1 value as a newly added third-party source code library file.
Optionally, the updating the published version compiled file of the application program stored in the preset cache based on the new version compiled file includes:
identifying and deleting a corresponding published version compilation file of the changed or deleted third-party source code library file in a preset cache;
and storing the new version of the compiled file into the preset cache.
Optionally, the modifying the compiling output path of the application program into a folder storing the compiling file of the application program in the preset cache includes:
and modifying the compiling output path of the application program into a folder for storing the compiling file of the application program in the preset cache in advance through the organization configuration file of the third-party source code engineering project, and deleting the dependency engineering of the third-party source code of the application program.
Optionally, the processing the packaged file to generate the application installation file includes:
acquiring a signature instruction, and writing signature information into the packed file according to the signature instruction;
notarizing the packaged file written with the signature information;
and writing the signature information into the packaged file after the notarization to obtain an application program installation file.
Optionally, notarizing the packaged file written with the signature information by using notacrytool.
In addition, to achieve the above object, the present invention also provides an electronic device including: the storage is electrically connected with the processor, the storage is stored with an application installation file generation program which can run on the processor, and the application installation file generation realizes the application installation file generation method when being executed by the processor.
Further, to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon an application installation file generation program executable by one or more processors to implement the application installation file generation method as described above.
In addition, to achieve the above object, the present invention provides an application installation file generating apparatus, including:
a file acquisition module: the system comprises a source code file, a first version file, a second version file and a third party source code, wherein the source code file is used for acquiring a source code file of a to-be-released version of an application program and library files of a plurality of third party source codes, the first version file of the third party source codes of the released version of the application program is acquired, the second version file of the third party source codes of the to-be-released version is acquired based on the source code file of the to-be-released version of the application program, and the first version file and the second version file store the sha1 values of the library files of corresponding versions;
a compiling module: the method comprises the steps of identifying a changed target library file in the library file based on a sha1 value in a first version file of a third-party source code of a released version of an application program and a sha1 value in a second version file of the third-party source code of a to-be-released version, and performing code compiling on the target library file to obtain a compiled file of a new version;
a cache module: the compiling output path of the application program is modified into a folder for storing the compiling file of the application program in the preset cache;
a packaging module: the device is used for compiling files based on the version to be released, which is obtained from the preset cache, generating application program files of the version to be released with the source code files, packaging the application program files of the version to be released to obtain packaged files, and processing the packaged files to generate application program installation files.
Drawings
FIG. 1 is a flowchart of an embodiment of a method for generating an application installation file according to the present invention;
FIG. 2 is a diagram of an electronic device according to an embodiment of the invention;
fig. 3 is a schematic block diagram of an application installation file generating apparatus according to an embodiment of the present invention.
The implementation, functional features and advantages of the objectives of the present application will be further explained with reference to the accompanying drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the description relating to "first", "second", etc. in the present invention is for descriptive purposes only and is not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
Referring to fig. 1, a flowchart of an embodiment of an application installation file generating method according to the present invention is shown, and the application installation file generating method includes steps S1-S3.
S1, acquiring a source code file of a to-be-released version of the application program and library files of a plurality of third-party source codes, acquiring a first version file of the third-party source codes of the released version of the application program, acquiring a second version file of the third-party source codes of the to-be-released version based on the source code file of the to-be-released version of the application program, and storing sha1 values of the library files of corresponding versions in the first version file and the second version file.
Specifically, a packaging instruction sent by a user is obtained through a terminal, the packaging instruction comprises a file identifier of an application program, and a source code file of a version to be issued of the application program, library files of a plurality of third-party source codes and a first version file of the third-party source code of an issued version are obtained from a database according to the file identifier. The application program version file is used for recording version information and dependency relationship of each installed version of a source code file of the application program, the first version file is a corresponding version file obtained by compiling the source code file of the version which is released by the application program by using Xcodebuild, and the second version file is a corresponding version file obtained by compiling the source code file of the version to be released by the application program by using Xcodebuild.
Specifically, the database manages corresponding files of the application program based on the file identifier, including source code files of a to-be-released version and a released version of the application program, and library files of a plurality of third-party source codes corresponding to each version.
S2, identifying the changed target library file in the library file based on the sha1 value in the first version file of the third-party source code of the released version of the application program and the sha1 value in the second version file of the third-party source code of the to-be-released version, and performing code compiling on the target library file to obtain a compiled file of a new version.
Specifically, a third-party source code dependency library of the application program is established through coco objects and used for storing a library file of a plurality of third-party source codes of released versions of the application program; creating a third party source code engineering project of the application program through the Xcode, wherein the third party source code engineering project is used for installing and operating a source code file of the application program; when a source code file of an application program is installed and operated, compiling the source code file of the released version of the application program by using Xcodebuild to obtain a first version file of a third party source code of the released version of the application program; and compiling the library files of the source codes of the third parties of the released versions of the application program to obtain compiled files of the released versions and storing the compiled files into the preset cache.
Specifically, the identifying the changed target library file in the library file based on the sha1 value in the first version file of the third-party source code of which the version is released by the application program and the sha1 value in the second version file of the third-party source code of which the version is to be released includes: comparing the sha1 values corresponding to each third-party source code library file in the first version file with the sha1 values corresponding to each third-party source code library file in the second version file; if the sha1 value in the first version file is different from the corresponding sha1 value in the second version file, identifying the third-party source code library file corresponding to the sha1 value as a changed third-party source code library file; if the sha1 value in the first version file does not have a corresponding sha1 value in the second version file, identifying the third-party source code library file corresponding to the sha1 value as a deleted third-party source code library file; and if the sha1 value in the second version file does not have a corresponding sha1 value in the first version file, identifying the third-party source code library file corresponding to the sha1 value as a newly added third-party source code library file. The Sha1 value is the secure hash algorithm value corresponding to the application source code library file.
Specifically, the updating the published version compiled file of the application program stored in the preset cache based on the new version compiled file includes: and identifying and deleting a corresponding published version compilation file of the changed or deleted third-party source code library file in a preset cache, and storing the compilation file of the new version in the preset cache.
And S3, updating the compiled file corresponding to the published version of the application program stored in a preset cache based on the compiled file of the new version to obtain a compiled file of the version to be published of the application program, and modifying the compiling output path of the application program into a folder for storing the compiled file of the application program in the preset cache.
Specifically, the compiling output path of the application program is modified into a folder storing the compiling file of the application program in the preset cache in advance through the organization configuration file of the third-party source code engineering project, so that the compiling file of the third-party source code library file corresponding to the application program is obtained from the cache and the corresponding application program file is generated. And modifying a compiling output path of the application program by changing a PODS _ CONFIGUTION _ BUILD _ DIR value and a BUILT _ PRODUCTS _ DIR value through the organization CONFIGURATION file of the third-party source code engineering project, and deleting the dependence engineering of the third-party source code of the application program so as to prevent the repeated compiling caused by the full compiling of the dependence engineering of the third-party source code on the application program when the compiling file is obtained each time.
And S4, compiling the file based on the version to be released, which is obtained from the preset cache, and the source code file to generate an application program file of the version to be released, packaging the application program file of the version to be released to obtain a packaged file, and processing the packaged file to generate an application program installation file.
Specifically, the processing the packaged file to generate the application installation file includes: and acquiring a signature instruction, writing signature information into the packaged file according to the signature instruction, notarizing the packaged file written with the signature information, and writing the signature information into the notarized packaged file to obtain an application program installation file.
Specifically, notarization is performed on the packaged file written with the signature information by adopting a notary tool, and the next step is automatically carried out when the notarization is finished, so that the notary query steps are reduced.
Specifically, the application program installation file is tested, the file package is uploaded to a server after the test is passed, a distribution object sent by a user is obtained through a terminal, and a server address of the file package is obtained from the server and sent to the distribution object.
It can be seen from the foregoing embodiment that, in the method for generating an application installation file provided by the present invention, the third-party source code library file that is changed is identified by detecting the sha1 value in the file of the first version of the released version of the application and the file of the second version of the to-be-released version of the application, that is, only the third-party source code library file that is partially changed is recompiled, and the compiled file corresponding to the third-party source code library file that is not changed is obtained by caching, so that the compiling efficiency is improved, and meanwhile, the manual process is automatically run through the computer program, so that the possibility of manual operation errors is reduced, and the efficiency of packaging the application installation file is improved.
Fig. 2 is a schematic diagram of an electronic device 1 according to an embodiment of the invention. The electronic apparatus 1 is a device capable of automatically performing numerical calculation and/or information processing in accordance with a command set or stored in advance. The electronic device 1 may be a computer, or may be a single network server, a server group composed of a plurality of network servers, or a cloud composed of a large number of hosts or network servers based on cloud computing, where cloud computing is one of distributed computing and is a super virtual computer composed of a group of loosely coupled computers.
In the present embodiment, the electronic device 1 includes, but is not limited to, a memory 11, a processor 12, and a network interface 13, which are communicatively connected to each other through a system bus, wherein the memory 11 stores an application installation file generating program 10, and the application installation file generating program 10 is executable by the processor 12. While fig. 1 shows only the electronic device 1 with the components 11-13 and the application installation file generation program 10, those skilled in the art will appreciate that the configuration shown in fig. 1 does not constitute a limitation of the electronic device 1, and may include fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
The storage 11 includes a memory and at least one type of readable storage medium. The memory provides cache for the operation of the electronic device 1; the readable storage medium may be volatile or nonvolatile. Specifically, the readable storage medium may be a storage medium such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the readable storage medium may be an internal storage unit of the electronic apparatus 1, such as a hard disk of the electronic apparatus 1; in other embodiments, the storage medium may also be an external storage device of the electronic apparatus 1, such as a plug-in hard disk provided on the electronic apparatus 1, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash memory card (FlashCard), and the like. In this embodiment, the readable storage medium of the memory 11 mainly includes a storage program area and a storage data area, where the storage program area is generally used for storing an operating system installed in the electronic device 1 and various types of application software, for example, codes of the application installation file generation program 10 in an embodiment of the present invention; the storage data area may store data created according to the use of the blockchain node, etc., such as various types of data that have been output or are to be output.
Processor 12 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 12 is generally used for controlling the overall operation of the electronic apparatus 1, such as performing control and processing related to data interaction or communication with other devices. In this embodiment, the processor 12 is configured to run the program code stored in the memory 11 or process data, for example, run the application installation file generating program 10.
The network interface 13 may comprise a wireless network interface or a wired network interface, and the network interface 13 is used for establishing a communication connection between the electronic device 1 and a client (not shown).
Optionally, the electronic device 1 may further include a user interface, the user interface may include a Display (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface may further include a standard wired interface and a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an organic light-emitting diode (OLED) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the electronic apparatus 1 and for displaying a visualized user interface.
In one embodiment of the present invention, the application installation file generating program 10 implements the following steps S1-S3 when executed by the processor 12.
S1, acquiring a source code file of a to-be-released version of the application program and library files of a plurality of third-party source codes, acquiring a first version file of the third-party source codes of the released version of the application program, acquiring a second version file of the third-party source codes of the to-be-released version based on the source code file of the to-be-released version of the application program, and storing sha1 values of the library files of corresponding versions in the first version file and the second version file.
Specifically, a packaging instruction sent by a user is obtained through a terminal, the packaging instruction comprises a file identifier of an application program, and a source code file of a version to be issued of the application program, library files of a plurality of third-party source codes and a first version file of the third-party source code of an issued version are obtained from a database according to the file identifier. The application program version file is used for recording version information and dependency relationship of each installed version of a source code file of the application program, the first version file is a corresponding version file obtained by compiling the source code file of the version which is released by the application program by using Xcodebuild, and the second version file is a corresponding version file obtained by compiling the source code file of the version to be released by the application program by using Xcodebuild.
Specifically, the database manages corresponding files of the application program based on the file identifier, including source code files of a to-be-released version and a released version of the application program, and library files of a plurality of third-party source codes corresponding to each version.
S2, identifying the changed target library file in the library file based on the sha1 value in the first version file of the third-party source code of the released version of the application program and the sha1 value in the second version file of the third-party source code of the to-be-released version, and performing code compiling on the target library file to obtain a compiled file of a new version.
Specifically, a third-party source code dependency library of the application program is established through coco objects and used for storing a library file of a plurality of third-party source codes of released versions of the application program; creating a third party source code engineering project of the application program through the Xcode, wherein the third party source code engineering project is used for installing and operating a source code file of the application program; when a source code file of an application program is installed and operated, compiling the source code file of the released version of the application program by using Xcodebuild to obtain a first version file of a third party source code of the released version of the application program; and compiling the library files of the source codes of the third parties of the released versions of the application program to obtain compiled files of the released versions and storing the compiled files into the preset cache.
Specifically, the identifying the changed target library file in the library file based on the sha1 value in the first version file of the third-party source code of which the version is released by the application program and the sha1 value in the second version file of the third-party source code of which the version is to be released includes: comparing the sha1 values corresponding to each third-party source code library file in the first version file with the sha1 values corresponding to each third-party source code library file in the second version file; if the sha1 value in the first version file is different from the corresponding sha1 value in the second version file, identifying the third-party source code library file corresponding to the sha1 value as a changed third-party source code library file; if the sha1 value in the first version file does not have a corresponding sha1 value in the second version file, identifying the third-party source code library file corresponding to the sha1 value as a deleted third-party source code library file; and if the sha1 value in the second version file does not have a corresponding sha1 value in the first version file, identifying the third-party source code library file corresponding to the sha1 value as a newly added third-party source code library file. The Sha1 value is the secure hash algorithm value corresponding to the application source code library file.
Specifically, the updating the published version compiled file of the application program stored in the preset cache based on the new version compiled file includes: and identifying and deleting a corresponding published version compilation file of the changed or deleted third-party source code library file in a preset cache, and storing the compilation file of the new version in the preset cache.
And S3, updating the compiled file corresponding to the published version of the application program stored in a preset cache based on the compiled file of the new version to obtain a compiled file of the version to be published of the application program, and modifying the compiling output path of the application program into a folder for storing the compiled file of the application program in the preset cache.
Specifically, the compiling output path of the application program is modified into a folder storing the compiling file of the application program in the preset cache in advance through the organization configuration file of the third-party source code engineering project, so that the compiling file of the third-party source code library file corresponding to the application program is obtained from the cache and the corresponding application program file is generated. And modifying a compiling output path of the application program by changing a PODS _ CONFIGUTION _ BUILD _ DIR value and a BUILT _ PRODUCTS _ DIR value through the organization CONFIGURATION file of the third-party source code engineering project, and deleting the dependence engineering of the third-party source code of the application program so as to prevent the repeated compiling caused by the full compiling of the dependence engineering of the third-party source code on the application program when the compiling file is obtained each time.
And S4, compiling the file based on the version to be released, which is obtained from the preset cache, and the source code file to generate an application program file of the version to be released, packaging the application program file of the version to be released to obtain a packaged file, and processing the packaged file to generate an application program installation file.
Specifically, the processing the packaged file to generate the application installation file includes: and acquiring a signature instruction, writing signature information into the packaged file according to the signature instruction, notarizing the packaged file written with the signature information, and writing the signature information into the notarized packaged file to obtain an application program installation file.
Specifically, notarization is performed on the packaged file written with the signature information by adopting a notary tool, and the next step is automatically carried out when the notarization is finished, so that the notary query steps are reduced.
Specifically, the application program installation file is tested, the file package is uploaded to a server after the test is passed, a distribution object sent by a user is obtained through a terminal, and a server address of the file package is obtained from the server and sent to the distribution object.
As can be seen from the foregoing embodiments, in the electronic device 1 provided by the present invention, the third-party source code library file that has been changed is identified by detecting the sha1 value in the file of the first version of the released version of the application program and the file of the second version of the to-be-released version of the application program, and is recompiled, that is, only the third-party source code library file that has been partially changed is recompiled, and the compiled file corresponding to the third-party source code library file that has not been changed is obtained by caching, so that the compiling efficiency is improved, and meanwhile, the manual process is automatically run through the computer program, so that the possibility of errors in manual operation is reduced, and the efficiency of packaging the application program installation files is improved.
In other embodiments, the application installation file generating program 10 can be further divided into one or more modules, and the one or more modules are stored in the memory 11 and executed by one or more processors (in this embodiment, the processor 12) to implement the present invention, where the module referred to in the present invention refers to a series of computer program instruction segments capable of performing specific functions for describing the execution process of the application installation file generating program 10 in the electronic device 1.
Fig. 3 is a schematic block diagram of an application installation file generating apparatus 10 according to an embodiment of the present invention.
In an embodiment of the present invention, the application installation file generating apparatus 10 includes a file obtaining module 110, a compiling module 120, a caching module 130, and a packaging module 140, and exemplarily:
the file obtaining module 110 is configured to obtain a source code file of a to-be-released version of an application program and library files of a plurality of third-party source codes, obtain a first version file of a third-party source code of a released version of the application program, and obtain a second version file of the third-party source code of the to-be-released version based on the source code file of the to-be-released version of the application program, where the first version file and the second version file store sha1 values of each library file of corresponding versions;
the compiling module 120 is configured to identify a target library file that changes in the library file based on a sha1 value in a first version file of a third-party source code of a released version of an application program and a sha1 value in a second version file of the third-party source code of a to-be-released version, and perform code compiling on the target library file to obtain a compiled file of a new version;
the cache module 130 is configured to update, based on the compiled file of the new version, the compiled file corresponding to the published version of the application program stored in a preset cache to obtain a compiled file of a to-be-published version of the application program, and modify a compiling output path of the application program into a folder in the preset cache, where the folder stores the compiled file of the application program;
the packaging module 140 is configured to compile a file based on the version to be released, which is obtained from the preset cache, with the source code file to generate an application program file of the version to be released, package the application program file of the version to be released to obtain a packaged file, and process the packaged file to generate an application program installation file.
The functions or operation steps of the modules such as the file obtaining module 110, the compiling module 120, the caching module 130, and the packing module 140 when executed are substantially the same as those of the above embodiments, and are not repeated herein.
In addition, the embodiment of the invention also provides a computer readable storage medium, and the readable storage medium can be volatile or nonvolatile. Specifically, the computer-readable storage medium may be any one or any combination of a hard disk, a multimedia card, an SD card, a flash memory card, an SMC, a Read Only Memory (ROM), an Erasable Programmable Read Only Memory (EPROM), a portable compact disc read only memory (CD-ROM), a USB memory, and the like. Included in the computer-readable storage medium is an application installation file generating program 10, which when executed by a processor, the application installation file generating program 10 implements the following operations:
a1, acquiring a source code file of a to-be-released version of an application program and library files of a plurality of third-party source codes, acquiring a first version file of the third-party source codes of the released version of the application program, acquiring a second version file of the third-party source codes of the to-be-released version based on the source code file of the to-be-released version of the application program, wherein the first version file and the second version file store sha1 values of the library files of corresponding versions;
a2, identifying a changed target library file in the library file based on a sha1 value in a first version file of a third-party source code of a released version of an application program and a sha1 value in a second version file of the third-party source code of a to-be-released version, and performing code compiling on the target library file to obtain a compiled file of a new version;
a3, updating a compiled file corresponding to the published version of the application program stored in a preset cache based on the compiled file of the new version to obtain a compiled file of the version to be published of the application program, and modifying a compiling output path of the application program into a folder for storing the compiled file of the application program in the preset cache;
a4, compiling a file based on the version to be released, which is obtained from the preset cache, and the source code file to generate an application program file of the version to be released, packaging the application program file of the version to be released to obtain a packaged file, and processing the packaged file to generate an application program installation file.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. An application installation file generation method is characterized by comprising the following steps:
the method comprises the steps of obtaining a source code file of a to-be-released version of an application program and library files of a plurality of third-party source codes, obtaining a first version file of the third-party source codes of the released version of the application program, obtaining a second version file of the third-party source codes of the to-be-released version based on the source code file of the to-be-released version of the application program, wherein the first version file and the second version file store sha1 values of the library files of corresponding versions;
identifying a changed target library file in the library file based on a sha1 value in a first version file of a third-party source code of a released version of an application program and a sha1 value in a second version file of the third-party source code of a to-be-released version, and performing code compilation on the target library file to obtain a compiled file of a new version;
updating the compiled file corresponding to the published version of the application program stored in a preset cache based on the compiled file of the new version to obtain the compiled file of the version to be published of the application program, and modifying the compiling output path of the application program into a folder for storing the compiled file of the application program in the preset cache;
and generating an application program file of the version to be released based on the compiled file of the version to be released acquired from the preset cache and the source code file, packaging the application program file of the version to be released to obtain a packaged file, and processing the packaged file to generate an application program installation file.
2. The method for generating the application installation file according to claim 1, wherein before the obtaining the source code file of the version to be released of the application and the plurality of third-party source code library files, the method further comprises:
establishing a third-party source code dependent library of the application program through the cocoadods, wherein the third-party source code dependent library is used for storing a plurality of library files of third-party source codes of released versions of the application program;
creating a third party source code engineering project of the application program through the Xcode, wherein the third party source code engineering project is used for installing and operating a source code file of the application program;
when a source code file of an application program is installed and operated, compiling the source code file of the released version of the application program by using Xcodebuild to obtain a first version file of a third party source code of the released version of the application program;
and compiling the library files of the source codes of the third parties of the released versions of the application program to obtain compiled files of the released versions and storing the compiled files into the preset cache.
3. The method of claim 1, wherein identifying the changed target library file in the library file based on the sha1 value in the first version file of the third-party source code of the published version of the application and the sha1 value in the second version file of the third-party source code of the version to be published comprises:
comparing the sha1 values corresponding to each third-party source code library file in the first version file with the sha1 values corresponding to each third-party source code library file in the second version file;
if the sha1 value in the first version file is different from the corresponding sha1 value in the second version file, identifying the third-party source code library file corresponding to the sha1 value as a changed third-party source code library file;
if the sha1 value in the first version file does not have a corresponding sha1 value in the second version file, identifying the third-party source code library file corresponding to the sha1 value as a deleted third-party source code library file;
and if the sha1 value in the second version file does not have a corresponding sha1 value in the first version file, identifying the third-party source code library file corresponding to the sha1 value as a newly added third-party source code library file.
4. The method for generating an application installation file according to claim 3, wherein the updating the published version compilation file of the application stored in the preset cache based on the new version compilation file comprises:
identifying and deleting a corresponding published version compilation file of the changed or deleted third-party source code library file in a preset cache;
and storing the new version of the compiled file into the preset cache.
5. The method for generating an application installation file according to claim 1, wherein the modifying the compilation output path of the application program into a folder for storing the application compilation file in the preset cache comprises:
and modifying the compiling output path of the application program into a folder for storing the compiling file of the application program in the preset cache in advance through the organization configuration file of the third-party source code engineering project, and deleting the dependency engineering of the third-party source code of the application program.
6. The method of claim 1, wherein processing the packaged file to generate an application installation file comprises:
acquiring a signature instruction, and writing signature information into the packed file according to the signature instruction;
notarizing the packaged file written with the signature information;
and writing the signature information into the packaged file after the notarization to obtain an application program installation file.
7. The method for generating an application installation file according to claim 6, wherein the packaged file written with the signature information is notarized by using notrytool.
8. An electronic device, comprising: the storage and the processor are electrically connected with the storage, the storage is stored with an application installation file generation program which can run on the processor, and the application installation file generation realizes the application installation file generation method according to any one of claims 1 to 7 when the application installation file generation program is executed by the processor.
9. A computer-readable storage medium having stored thereon an application installation file generation program, the application installation file generation program being executable by one or more processors to implement the application installation file generation method of any one of claims 1 to 7.
10. An application installation file generating apparatus, comprising:
a file acquisition module: the system comprises a source code file, a first version file, a second version file and a third party source code, wherein the source code file is used for acquiring a source code file of a to-be-released version of an application program and library files of a plurality of third party source codes, the first version file of the third party source codes of the released version of the application program is acquired, the second version file of the third party source codes of the to-be-released version is acquired based on the source code file of the to-be-released version of the application program, and the first version file and the second version file store the sha1 values of the library files of corresponding versions;
a compiling module: the method comprises the steps of identifying a changed target library file in the library file based on a sha1 value in a first version file of a third-party source code of a released version of an application program and a sha1 value in a second version file of the third-party source code of a to-be-released version, and performing code compiling on the target library file to obtain a compiled file of a new version;
a cache module: the compiling output path of the application program is modified into a folder for storing the compiling file of the application program in the preset cache;
a packaging module: the device is used for compiling files based on the version to be released, which is obtained from the preset cache, generating application program files of the version to be released with the source code files, packaging the application program files of the version to be released to obtain packaged files, and processing the packaged files to generate application program installation files.
CN202111414979.3A 2021-11-25 2021-11-25 Application program installation file generation method and device and storage medium Pending CN114153457A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111414979.3A CN114153457A (en) 2021-11-25 2021-11-25 Application program installation file generation method and device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111414979.3A CN114153457A (en) 2021-11-25 2021-11-25 Application program installation file generation method and device and storage medium

Publications (1)

Publication Number Publication Date
CN114153457A true CN114153457A (en) 2022-03-08

Family

ID=80457653

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111414979.3A Pending CN114153457A (en) 2021-11-25 2021-11-25 Application program installation file generation method and device and storage medium

Country Status (1)

Country Link
CN (1) CN114153457A (en)

Similar Documents

Publication Publication Date Title
US11150891B2 (en) Method and device for updating software executed from non-volatile memory
CN106775723B (en) Android platform-based system firmware customization method and Android device
CN109542461A (en) Dissemination method, terminal device and the medium of application installation package
CN109032631B (en) Application program patch package obtaining method and device, computer equipment and storage medium
CN111008034A (en) Patch generation method and device
CN103761107A (en) Software package customizing device and method
WO2019071898A1 (en) Electronic device, database query script generation method and storage medium
CN111078279A (en) Processing method, device and equipment of byte code file and storage medium
EP3067795A1 (en) A method for generating an embedded system derivable into a plurality of personalized embedded system
CN114153457A (en) Application program installation file generation method and device and storage medium
CN114138577B (en) TPC-H test method and device, computer equipment and storage medium
CN115185550A (en) Service deployment method, device, computer equipment and storage medium
JP6717140B2 (en) Analysis program, analysis method, and analysis device
CN112463042B (en) Data volume import data verification method, device, terminal and storage medium
CN112685078A (en) Interface document generation and query method, device and computer readable storage medium
TWI682296B (en) Image file packaging method and image file packaging system
CN113434122A (en) Multi-role page creation method and device, server and readable storage medium
US8539461B2 (en) Method for identifying memory of virtual machine and computer system thereof
CN113342379B (en) Micro-service upgrading method and device, electronic equipment and storage medium
CN116661876B (en) System starting method, file generating method, electronic equipment and server
CN116991427B (en) Application compiling method and device, computing equipment and storage medium
CN112748905B (en) Method and device for initializing and calling basic library, electronic equipment and storage medium
CN111831609B (en) Method and system for unified management and distribution of binary metric values in virtualized environments
CN112631650A (en) Plug-in version information checking method, computing device and storage medium
CN107346248B (en) Platform identification method and device

Legal Events

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