CN117331571A - Application program packaging method and device, electronic equipment and storage medium - Google Patents
Application program packaging method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN117331571A CN117331571A CN202311304941.XA CN202311304941A CN117331571A CN 117331571 A CN117331571 A CN 117331571A CN 202311304941 A CN202311304941 A CN 202311304941A CN 117331571 A CN117331571 A CN 117331571A
- Authority
- CN
- China
- Prior art keywords
- target
- application program
- file
- packaging
- platform
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 62
- 238000004806 packaging method and process Methods 0.000 claims abstract description 186
- 230000001419 dependent effect Effects 0.000 claims abstract description 32
- 230000008520 organization Effects 0.000 claims abstract description 14
- 238000012545 processing Methods 0.000 claims description 25
- 238000004590 computer program Methods 0.000 claims description 7
- 230000003993 interaction Effects 0.000 claims description 7
- 238000012856 packing Methods 0.000 description 17
- 230000008569 process Effects 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 3
- 230000006978 adaptation Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000010354 integration Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/73—Program documentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/76—Adapting program code to run in a different environment; Porting
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Library & Information Science (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
Abstract
The disclosure relates to a packaging method and device of an application program, electronic equipment and a storage medium, and belongs to the technical field of computers, wherein the method comprises the following steps: the local packaging tool acquires a plurality of class files of the target application program; the plurality of class files are compiled from source files and dependent items of a target application program in a cross-system language environment; the method comprises the steps that a to-be-deployed file is obtained through organization according to a directory structure, the to-be-deployed file is sent to a portable packaging tool corresponding to a local packaging tool on a target platform, the portable packaging tool is instructed to interact with the target platform through a cross-system language environment, a target format of the target platform is obtained, and the to-be-deployed file is packaged according to the target format; the organization of class files does not need an independent server; the portable packaging tool corresponding to the local packaging tool generates the executable file in the target format, and the executable file is independent of the environment configuration of the system platform, so that the packaging cost of the application program is reduced, and the packaging efficiency of the application program is improved.
Description
Technical Field
The disclosure relates to the field of computer technology, and in particular, to a method and a device for packaging an application program, an electronic device and a storage medium.
Background
Current packaged deployment tools are, for example, automated deployment tools such as Jenkins. The automatic deployment tool can automatically pull the substitution codes, organize and generate the executable files, and deploy the executable files. In the scheme, the automatic deployment tool realizes integration of packaging, deployment and operation, wherein a server is needed to deploy and operate the generated executable file; and the automatic deployment tool depends on the system platforms, needs to independently configure each system platform, has high use threshold and is difficult to deploy across systems, so that the packaging cost of the application program is improved, and the packaging efficiency of the application program is reduced.
Disclosure of Invention
The disclosure provides a packaging method, a packaging device, electronic equipment and a storage medium for application programs, which at least solve the problems of high packaging cost and poor packaging efficiency of the application programs in the related technology. The technical scheme of the present disclosure is as follows:
according to a first aspect of an embodiment of the present disclosure, there is provided a packaging method of an application program, applied to a local packaging tool, including: acquiring a plurality of class files of a target application program; the class files are compiled from source files and dependent items of the target application program in a cross-system language environment and are used for platforms in different formats; organizing the plurality of class files according to a directory structure to obtain files to be deployed of the target application program; and sending the file to be deployed to a portable packaging tool corresponding to the local packaging tool on a target platform, indicating the portable packaging tool to interact with the target platform through a cross-system language environment, acquiring a target format of the target platform, and packaging the file to be deployed according to the target format to obtain an executable file of the target format.
According to a second aspect of the embodiments of the present disclosure, there is provided a packaging method of an application program, applied to a portable packaging tool on a target platform, including: receiving a file to be deployed of a target application program; the files to be deployed are obtained by organizing a plurality of class files of the target application program according to a directory structure; the class files are compiled from source files and dependent items of the target application program in a cross-system language environment and are used for platforms in different formats; the method comprises the steps of obtaining a target format of a target platform through interaction between a cross-system language environment and the target platform; and packaging the files to be deployed according to the target format to obtain executable files in the target format.
According to a third aspect of the embodiments of the present disclosure, there is provided a packaging apparatus for an application program, applied to a local packaging tool, including: the first acquisition module is used for acquiring a plurality of class files of the target application program; the class files are compiled from source files and dependent items of the target application program in a cross-system language environment and are used for platforms in different formats; the organization processing module is used for organizing the plurality of class files according to a directory structure to obtain files to be deployed of the target application program; the sending module is used for sending the file to be deployed to a portable packaging tool corresponding to the local packaging tool on a target platform, indicating the portable packaging tool to interact with the target platform through a cross-system language environment, acquiring a target format of the target platform, and packaging the file to be deployed according to the target format to obtain an executable file of the target format.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a packaging apparatus for an application program, applied to a portable packaging tool on a target platform, including: the receiving module is used for receiving a file to be deployed of the target application program; the files to be deployed are obtained by organizing a plurality of class files of the target application program according to a directory structure; the class files are compiled from source files and dependent items of the target application program in a cross-system language environment and are used for platforms in different formats; the acquisition module is used for acquiring a target format of the target platform through interaction between the cross-system language environment and the target platform; and the packaging processing module is used for packaging the files to be deployed according to the target format to obtain executable files in the target format.
According to a fifth aspect of embodiments of the present disclosure, there is provided an electronic device, comprising: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the method of packaging an application as described above.
According to a sixth aspect of embodiments of the present disclosure, there is provided a storage medium, which when executed by a processor of an electronic device, enables the electronic device to perform the method of packaging an application as described above.
According to a seventh aspect of embodiments of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor of an electronic device, enables the electronic device to perform a method of packaging an application as described above.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
the local packaging tool obtains a plurality of class files of the target application program; the plurality of class files are compiled from source files and dependent items of a target application program in a cross-system language environment and are used for platforms in different formats; organizing the plurality of class files according to a directory structure to obtain files to be deployed of the target application program; the method comprises the steps of sending a file to be deployed to a portable packaging tool corresponding to a local packaging tool on a target platform, indicating the portable packaging tool to interact with the target platform through a cross-system language environment, obtaining a target format of the target platform, and packaging the file to be deployed according to the target format to obtain an executable file of the target format; the organization of class files does not need an independent server; the portable packaging tool corresponding to the local packaging tool generates the executable file in the target format, and the executable file is deployed and processed, so that the cross-system deployment can be realized without depending on the environment configuration of a system platform, the packaging cost of the application program is reduced, and the packaging efficiency of the application program is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure and do not constitute an undue limitation on the disclosure.
FIG. 1 is a flow chart of a method of packaging an application program according to a first embodiment of the present disclosure;
FIG. 2 is a flow chart illustrating a method of packaging an application according to a second embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a method of packaging an application;
fig. 4 is a schematic structural view of a packing apparatus of an application program according to a third embodiment of the present disclosure;
fig. 5 is a schematic structural view of a packing apparatus of an application program according to a fourth embodiment of the present disclosure;
fig. 6 is a block diagram of an electronic device executing a packaging method of an application program.
Detailed Description
In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
Current packaged deployment tools are, for example, automated deployment tools such as Jenkins. The automatic deployment tool can automatically pull the substitution codes, organize and generate the executable files, and deploy the executable files. In the scheme, the automatic deployment tool realizes integration of packaging, deployment and operation, wherein a server is needed to deploy and operate the generated executable file; and the automatic deployment tool depends on the system platforms, needs to independently configure each system platform, has high use threshold and is difficult to deploy across systems, so that the packaging cost of the application program is improved, and the packaging efficiency of the application program is reduced.
In order to solve the problem of high packing cost and poor packing efficiency of application programs in the related art, the disclosure provides a packing method of application programs, and a local packing tool obtains a plurality of class files of a target application program; the plurality of class files are compiled from source files and dependent items of a target application program in a cross-system language environment and are used for platforms in different formats; organizing the plurality of class files according to a directory structure to obtain files to be deployed of the target application program; the method comprises the steps of sending a file to be deployed to a portable packaging tool corresponding to a local packaging tool on a target platform, indicating the portable packaging tool to interact with the target platform through a cross-system language environment, obtaining a target format of the target platform, and packaging the file to be deployed according to the target format to obtain an executable file of the target format; the organization of class files does not need an independent server; the portable packaging tool corresponding to the local packaging tool generates the executable file in the target format, and the executable file is deployed and processed, so that the cross-system deployment can be realized without depending on the environment configuration of a system platform, the packaging cost of the application program is reduced, and the packaging efficiency of the application program is improved.
Fig. 1 is a flowchart of a packaging method of an application program according to a first embodiment of the present disclosure, applied to a local packaging tool, as shown in fig. 1, including the following steps.
In step 101, a plurality of class files of a target application program are acquired; the multiple class files are compiled from source files and dependent items of the target application program in a cross-system language environment and are used for platforms in different formats.
The execution subject of the application program packaging method of the present disclosure is an application program packaging device. The method for packaging the application program according to the embodiment of the present disclosure may be performed by the apparatus for packaging the application program according to the embodiment of the present disclosure, and the apparatus for packaging the application program according to the embodiment of the present disclosure may be configured in any electronic device or any software on any electronic device, so as to perform the method for packaging the application program according to the embodiment of the present disclosure.
Wherein the electronic device is, for example, a system platform or the like. The system platform is, for example, a local platform, a target platform, etc. The number of the system platforms can be multiple, the system platform with the local packing tool arranged therein can be used as a local platform, and other system platforms can be used as target platforms. In the following embodiments, an execution body is taken as an example of a local packing tool set on a local platform.
In the embodiment of the present disclosure, the local packaging tool may be a cross-system language environment-based local packaging tool. That is, the local packaging tool is based on a cross-system language environment, so that the local packaging tool can be arranged on any one of the system platforms for realizing the packaging function of the application program without performing environment configuration and the like on the local packaging tool. Wherein the cross-system language environment is, for example, a go language environment, etc. The local packaging tool of the go language environment can be suitable for any system platform. The system platform, for example, a Windows platform, a macOS platform, a Linux platform, and the like, may be set according to actual needs.
In an embodiment of the present disclosure, prior to step 101, the local packaging tool may perform the following process: acquiring a source file and a dependent item of a target application program; compiling the source file and the dependent items in a cross-system language environment to obtain a plurality of class files of the target application program; and storing the plurality of class files, and storing the storage addresses of the plurality of class files into one file.
Among the plurality of class files, part of class files are compiled from source files; the partial class file is compiled by the dependent items.
It should be noted that, in the compiling process, the local packing tool may also compile the resource files required by the source code to obtain a plurality of class files. Where resource files, such as images, audio, text files, etc. Wherein the source file corresponds to a dependent item, such as setting information, a database, etc.
In the embodiment of the present disclosure, the source file of the target application program may be a source file of a cross-system language, for example, a source file of a Java language, or the like.
In the embodiment of the present disclosure, based on the above-mentioned process of obtaining and storing a plurality of class files, the corresponding process of executing step 101 by the local packaging tool may be, for example, obtaining a file path of a target file from a specified address; designating an address, presetting or determining according to the operation of an object; according to the file path, obtaining storage addresses of a plurality of class files from the target file; and acquiring the plurality of class files from the local platform through a cross-system language environment according to the storage addresses of the plurality of class files. The operation of the object, for example, a specified address input operation, a specified address update operation, or the like, may be set according to actual needs.
In another example, the process of obtaining the file path of the target file by the local packaging tool may be, for example, receiving a program packaging request, where the program packaging request carries the file path; and taking the file stored on the file path as a target file. The target file may be a txt file, or other text files, etc. The storage addresses of the plurality of class files for the same application program can be stored in the same file.
In step 102, a plurality of class files are organized according to a directory structure, so as to obtain files to be deployed of a target application program.
In the embodiment of the present disclosure, the directory structure may be a preset directory structure, in which placement positions of class files having different uses are specified, and the like. The local packaging tool can combine the directory structure to place a plurality of class files at preset placement positions, and organize to obtain files to be deployed of the target application program.
In step 103, the file to be deployed is sent to a portable packaging tool corresponding to the local packaging tool on the target platform, the portable packaging tool is instructed to interact with the target platform through a cross-system language environment, a target format of the target platform is obtained, and the file to be deployed is packaged according to the target format, so that an executable file in the target format is obtained.
In the disclosed embodiments, the local packaging tool is based on a cross-system language environment; the portable packaging tool corresponding to the local packaging tool can be separated from the language environment, and the files to be deployed are packaged only according to the target format of the target platform. Wherein the target format of the target platform, the portable packaging tool may be obtained through interaction with the target platform.
In the embodiment of the present disclosure, a system platform, for example, a Windows platform, a macOS platform, a Linux platform, and the like, may be set according to actual needs. The target format of the Windows platform may be, for example, exe file format. The target format of the macOS platform may be, for example, an IPA file format. The target format of the Linux platform may be, for example, a FAT file format.
In summary, the local packaging tool obtains a plurality of class files of the target application program; the plurality of class files are compiled from source files and dependent items of a target application program in a cross-system language environment and are used for platforms in different formats; organizing the plurality of class files according to a directory structure to obtain files to be deployed of the target application program; the method comprises the steps of sending a file to be deployed to a portable packaging tool corresponding to a local packaging tool on a target platform, indicating the portable packaging tool to interact with the target platform through a cross-system language environment, obtaining a target format of the target platform, and packaging the file to be deployed according to the target format to obtain an executable file of the target format; the organization of class files does not need an independent server; the portable packaging tool corresponding to the local packaging tool generates the executable file in the target format, and the executable file is deployed and processed, so that the cross-system deployment can be realized without depending on the environment configuration of a system platform, the packaging cost of the application program is reduced, and the packaging efficiency of the application program is improved.
Fig. 2 is a flowchart of a packaging method of an application program according to a second embodiment of the present disclosure, applied to a portable packaging tool on a target platform, as shown in fig. 2, including the following steps.
In step 201, a file to be deployed of a target application program is received; the files to be deployed are obtained by organizing a plurality of class files of the target application program according to a directory structure; the multiple class files are compiled from source files and dependent items of the target application program in a cross-system language environment and are used for platforms in different formats.
The execution subject of the application program packaging method of the present disclosure is an application program packaging device. The method for packaging the application program according to the embodiment of the present disclosure may be performed by the apparatus for packaging the application program according to the embodiment of the present disclosure, and the apparatus for packaging the application program according to the embodiment of the present disclosure may be configured in any electronic device or any software on any electronic device, so as to perform the method for packaging the application program according to the embodiment of the present disclosure.
Wherein the electronic device is, for example, a system platform or the like. The system platform is, for example, a local platform, a target platform, etc. The number of the system platforms may be plural, and the system platform in which the portable packing tool is provided may be a target platform, and the system platform in which the local packing tool corresponding to the portable packing tool is provided may be a local platform. In the following embodiments, a portable packing tool set on an execution body as a target platform will be described as an example.
In the embodiment of the disclosure, the portable packaging tool can be a portable packaging tool based on a cross-system language environment. That is, the portable packaging tool is based on a cross-system language environment, so that the portable packaging tool can be arranged on any one of the system platforms for realizing the packaging function of the application program without environment configuration and the like. Wherein the cross-system language environment is, for example, a go language environment, etc. The portable packaging tool of the go language environment can be suitable for any system platform. The system platform, for example, a Windows platform, a macOS platform, a Linux platform, and the like, may be set according to actual needs.
In the embodiment of the present disclosure, the process of performing step 201 by the portable packaging tool may be, for example, determining a local packaging tool corresponding to the portable packaging tool; the file to be deployed is received from a local platform deployed with a local packaging tool. The files to be deployed are obtained by organizing a plurality of class files of the target application program according to a directory structure. The system comprises a plurality of class files, wherein the local packing tool corresponding to the portable packing tool is used for compiling and processing source files, dependent items and resource files of a target application program in a cross-system language environment.
The source file of the target application program may be a source file of a cross-system language, for example, a source file of a Java language, etc. Where resource files, such as images, audio, text files, etc. Wherein the source file corresponds to a dependent item, such as setting information, a database, etc.
In step 202, a target format of a target platform is obtained by interacting with the target platform across a system language environment.
In the embodiment of the present disclosure, a system platform, for example, a Windows platform, a macOS platform, a Linux platform, and the like, may be set according to actual needs. The target format of the Windows platform may be, for example, exe file format. The target format of the macOS platform may be, for example, an IPA file format. The target format of the Linux platform may be, for example, a FAT file format.
In step 203, the file to be deployed is packaged according to the target format, so as to obtain an executable file in the target format.
In summary, the portable packaging tool on the target platform receives the file to be deployed of the target application program; the files to be deployed are obtained by organizing a plurality of class files of the target application program according to a directory structure; the multiple class files are compiled from source files and dependent items of the target application program in a cross-system language environment and are used for platforms in different formats; the method comprises the steps of obtaining a target format of a target platform through interaction between a cross-system language environment and the target platform; packaging the files to be deployed according to the target format to obtain executable files in the target format; the organization of class files does not need an independent server; the portable packaging tool generates the executable file in the target format for deployment processing, and the configuration of the environment of the system platform is not relied on, so that cross-system deployment can be realized, the packaging cost of the application program is reduced, and the packaging efficiency of the application program is improved.
In order to more clearly illustrate the above embodiments, an example will now be described.
For example, fig. 3 is a schematic diagram of a packing method of an application program.
In fig. 3, (1) starts. (2) The input path file path, i.e., the file path of the target file storing the storage addresses of the plurality of class files of the target application. (3) The file is called, and the storage addresses of a plurality of class files are acquired. (4) Searching the files, namely searching the plurality of class files according to the storage addresses of the plurality of class files; if the data are found, executing the step (5); if not, executing the step (7). (5) organizing class files in a directory structure. (6) outputting the deployment file (file to be deployed). (7) success or failure reason for output.
In order to achieve the above embodiments, an embodiment of the present disclosure provides a packaging apparatus for an application program.
Fig. 4 is a schematic structural diagram of a packaging apparatus for an application program according to a third embodiment of the present disclosure, and referring to fig. 4, the packaging apparatus 400 for an application program, applied to a local packaging tool, may include: a first acquisition module 410, an organization processing module 420, and a transmission module 430.
The first obtaining module 410 is configured to obtain a plurality of class files of the target application program; the class files are compiled from source files and dependent items of the target application program in a cross-system language environment and are used for platforms in different formats; the organization processing module 420 is configured to perform organization processing on the plurality of class files according to a directory structure, so as to obtain a file to be deployed of the target application program; the sending module 430 is configured to send the file to be deployed to a portable packaging tool corresponding to the local packaging tool on a target platform, instruct the portable packaging tool to interact with the target platform through a cross-system language environment, obtain a target format of the target platform, and package the file to be deployed according to the target format, so as to obtain an executable file in the target format.
As one possible implementation manner of the embodiments of the present disclosure, the first obtaining module 410 is specifically configured to obtain a file path of the target file from the specified address; the specified address is preset or is obtained through determination according to the operation of the object; according to the file path, obtaining storage addresses of the plurality of class files from the target file; and acquiring the plurality of class files from the local platform through a cross-system language environment according to the storage addresses of the plurality of class files.
As one possible implementation manner of the embodiments of the present disclosure, the apparatus further includes: the system comprises a second acquisition module, a compiling processing module and a storage processing module; the second acquisition module is used for acquiring a source file and a dependent item of the target application program; the compiling processing module is used for compiling the source file and the dependent item in a cross-system language environment to obtain a plurality of class files of the target application program; the storage processing module is used for carrying out storage processing on the plurality of class files and storing the storage addresses of the plurality of class files into one file.
As one possible implementation of the embodiments of the present disclosure, the cross-system language environment includes a go language environment.
As one possible implementation of the embodiments of the present disclosure, the target platform includes at least one of the following: windows platform, macOS platform and Linux platform.
In summary, the local packaging tool obtains a plurality of class files of the target application program; the plurality of class files are compiled from source files and dependent items of a target application program in a cross-system language environment and are used for platforms in different formats; organizing the plurality of class files according to a directory structure to obtain files to be deployed of the target application program; the method comprises the steps of sending a file to be deployed to a portable packaging tool corresponding to a local packaging tool on a target platform, indicating the portable packaging tool to interact with the target platform through a cross-system language environment, obtaining a target format of the target platform, and packaging the file to be deployed according to the target format to obtain an executable file of the target format; the organization of class files does not need an independent server; the portable packaging tool corresponding to the local packaging tool generates the executable file in the target format, and the executable file is deployed and processed, so that the cross-system deployment can be realized without depending on the environment configuration of a system platform, the packaging cost of the application program is reduced, and the packaging efficiency of the application program is improved.
Fig. 5 is a schematic structural diagram of a packaging apparatus for an application program according to a fourth embodiment of the present disclosure, and referring to fig. 5, the packaging apparatus 500 for an application program, which is applied to a portable packaging tool on a target platform, may include: a receiving module 510, an obtaining module 520 and a packing processing module 530.
The receiving module 510 is configured to receive a file to be deployed of a target application program; the files to be deployed are obtained by organizing a plurality of class files of the target application program according to a directory structure; the class files are compiled from source files and dependent items of the target application program in a cross-system language environment and are used for platforms in different formats; the acquiring module 520 is configured to interact with a target platform through a cross-system language environment, and acquire a target format of the target platform; and the packaging processing module 530 is configured to perform packaging processing on the file to be deployed according to the target format, so as to obtain an executable file in the target format.
As one possible implementation manner of the embodiment of the present disclosure, the receiving module 510 is specifically configured to determine a local packaging tool corresponding to the portable packaging tool; and receiving the file to be deployed from the local platform deployed with the local packaging tool.
As one possible implementation of the embodiments of the present disclosure, the cross-system language environment includes a go language environment.
In summary, the portable packaging tool on the target platform receives the file to be deployed of the target application program; the files to be deployed are obtained by organizing a plurality of class files of the target application program according to a directory structure; the multiple class files are compiled from source files and dependent items of the target application program in a cross-system language environment and are used for platforms in different formats; the method comprises the steps of obtaining a target format of a target platform through interaction between a cross-system language environment and the target platform; packaging the files to be deployed according to the target format to obtain executable files in the target format; the organization of class files does not need an independent server; the portable packaging tool generates the executable file in the target format for deployment processing, and the configuration of the environment of the system platform is not relied on, so that cross-system deployment can be realized, the packaging cost of the application program is reduced, and the packaging efficiency of the application program is improved.
Fig. 6 is a block diagram of an electronic device executing a packaging method of an application program.
As shown in fig. 6, the electronic device 600 includes:
a memory 610 and a processor 620, a bus 630 connecting the different components (including the memory 610 and the processor 620), the memory 610 storing a computer program that when executed by the processor 620 implements the method of packaging applications described in embodiments of the present disclosure.
Bus 630 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 600 typically includes a variety of electronic device readable media. Such media can be any available media that is accessible by electronic device 600 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 610 may also include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 640 and/or cache memory 650. The electronic device 600 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 660 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, commonly referred to as a "hard disk drive"). Although not shown in fig. 6, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 630 through one or more data medium interfaces. Memory 610 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of the various embodiments of the disclosure.
A program/utility 680 having a set (at least one) of program modules 670 may be stored in, for example, memory 610, such program modules 670 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 670 generally perform the functions and/or methods in the embodiments described in this disclosure.
The electronic device 600 may also communicate with one or more external devices 690 (e.g., keyboard, pointing device, display 691, etc.), one or more devices that enable a user to interact with the electronic device 600, and/or any device (e.g., network card, modem, etc.) that enables the electronic device 600 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 692. Also, the electronic device 600 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through a network adapter 693. As shown in fig. 6, the network adapter 693 communicates with other modules of the electronic device 600 over the bus 630. It should be appreciated that although not shown in fig. 6, other hardware and/or software modules may be used in connection with electronic device 600, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processor 620 executes various functional applications and data processing by running programs stored in the memory 610.
It should be noted that, the implementation process and the technical principle of the electronic device in this embodiment refer to the foregoing explanation of the application program packaging method in the embodiment of the disclosure, and are not repeated herein.
The electronic device provided by the embodiment of the disclosure can execute the packaging method of the application program as described above, and the local packaging tool obtains a plurality of class files of the target application program; the plurality of class files are compiled from source files and dependent items of a target application program in a cross-system language environment and are used for platforms in different formats; organizing the plurality of class files according to a directory structure to obtain files to be deployed of the target application program; the method comprises the steps of sending a file to be deployed to a portable packaging tool corresponding to a local packaging tool on a target platform, indicating the portable packaging tool to interact with the target platform through a cross-system language environment, obtaining a target format of the target platform, and packaging the file to be deployed according to the target format to obtain an executable file of the target format; the organization of class files does not need an independent server; the portable packaging tool corresponding to the local packaging tool generates the executable file in the target format, and the executable file is deployed and processed, so that the cross-system deployment can be realized without depending on the environment configuration of a system platform, the packaging cost of the application program is reduced, and the packaging efficiency of the application program is improved.
In order to implement the above-described embodiments, the present disclosure also proposes a storage medium.
Wherein the instructions in the storage medium, when executed by the processor of the electronic device, enable the electronic device to perform the method of packaging an application as described above.
To achieve the above embodiments, the present disclosure also provides a computer program product comprising a computer program which, when executed by a processor of an electronic device, enables the electronic device to perform the method of packaging an application program as described above.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any adaptations, uses, or adaptations of the disclosure following the general principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims (19)
1. A method for packaging an application program, applied to a local packaging tool, comprising:
acquiring a plurality of class files of a target application program; the class files are compiled from source files and dependent items of the target application program in a cross-system language environment and are used for platforms in different formats;
organizing the plurality of class files according to a directory structure to obtain files to be deployed of the target application program;
and sending the file to be deployed to a portable packaging tool corresponding to the local packaging tool on a target platform, indicating the portable packaging tool to interact with the target platform through a cross-system language environment, acquiring a target format of the target platform, and packaging the file to be deployed according to the target format to obtain an executable file of the target format.
2. The method of claim 1, wherein the obtaining a plurality of class files for the target application comprises:
acquiring a file path of a target file from a designated address; the specified address is preset or is obtained through determination according to the operation of the object;
according to the file path, obtaining storage addresses of the plurality of class files from the target file;
and acquiring the plurality of class files from the local platform through a cross-system language environment according to the storage addresses of the plurality of class files.
3. The method of claim 1 or 2, wherein prior to obtaining the plurality of class files of the target application, the method further comprises:
acquiring a source file and a dependent item of the target application program;
compiling the source file and the dependent items in a cross-system language environment to obtain a plurality of class files of the target application program;
and storing the plurality of class files, and storing the storage addresses of the plurality of class files into one file.
4. The method of claim 3, wherein the cross-system language environment comprises a go language environment.
5. The method of claim 1, wherein the target platform comprises at least one of: windows platform, macOS platform and Linux platform.
6. A method for packaging an application program, wherein the portable packaging tool applied to a target platform comprises:
receiving a file to be deployed of a target application program; the files to be deployed are obtained by organizing a plurality of class files of the target application program according to a directory structure; the class files are compiled from source files and dependent items of the target application program in a cross-system language environment and are used for platforms in different formats;
the method comprises the steps of obtaining a target format of a target platform through interaction between a cross-system language environment and the target platform;
and packaging the files to be deployed according to the target format to obtain executable files in the target format.
7. The method of claim 6, wherein receiving the file to be deployed for the target application comprises:
determining a local packaging tool corresponding to the portable packaging tool;
and receiving the file to be deployed from the local platform deployed with the local packaging tool.
8. The method of claim 6, wherein the cross-system language environment comprises a go language environment.
9. An application program packaging device, which is applied to a local packaging tool, comprising:
the first acquisition module is used for acquiring a plurality of class files of the target application program; the class files are compiled from source files and dependent items of the target application program in a cross-system language environment and are used for platforms in different formats;
the organization processing module is used for organizing the plurality of class files according to a directory structure to obtain files to be deployed of the target application program;
the sending module is used for sending the file to be deployed to a portable packaging tool corresponding to the local packaging tool on a target platform, indicating the portable packaging tool to interact with the target platform through a cross-system language environment, acquiring a target format of the target platform, and packaging the file to be deployed according to the target format to obtain an executable file of the target format.
10. The apparatus of claim 9, wherein the first acquisition module is configured to,
acquiring a file path of a target file from a designated address; the specified address is preset or is obtained through determination according to the operation of the object;
according to the file path, obtaining storage addresses of the plurality of class files from the target file;
and acquiring the plurality of class files from the local platform through a cross-system language environment according to the storage addresses of the plurality of class files.
11. The apparatus according to claim 9 or 10, characterized in that the apparatus further comprises: the system comprises a second acquisition module, a compiling processing module and a storage processing module;
the second acquisition module is used for acquiring a source file and a dependent item of the target application program;
the compiling processing module is used for compiling the source file and the dependent item in a cross-system language environment to obtain a plurality of class files of the target application program;
the storage processing module is used for carrying out storage processing on the plurality of class files and storing the storage addresses of the plurality of class files into one file.
12. The apparatus of claim 11, wherein the cross-system language environment comprises a go language environment.
13. The apparatus of claim 9, wherein the target platform comprises at least one of: windows platform, macOS platform and Linux platform.
14. An application program packaging device, characterized by being applied to a portable packaging tool on a target platform, comprising:
the receiving module is used for receiving a file to be deployed of the target application program; the files to be deployed are obtained by organizing a plurality of class files of the target application program according to a directory structure; the class files are compiled from source files and dependent items of the target application program in a cross-system language environment and are used for platforms in different formats;
the acquisition module is used for acquiring a target format of the target platform through interaction between the cross-system language environment and the target platform;
and the packaging processing module is used for packaging the files to be deployed according to the target format to obtain executable files in the target format.
15. The apparatus of claim 14, wherein the receiving means is specifically configured to,
determining a local packaging tool corresponding to the portable packaging tool;
and receiving the file to be deployed from the local platform deployed with the local packaging tool.
16. The apparatus of claim 14, wherein the cross-system language environment comprises a go language environment.
17. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method of packaging an application as claimed in any one of claims 1-8.
18. A storage medium, which when executed by a processor of an electronic device, causes the electronic device to perform the method of packaging an application as claimed in any one of claims 1-8.
19. A computer program product comprising a computer program which, when executed by a processor of an electronic device, enables the electronic device to perform the method of packaging an application program according to any one of claims 1-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311304941.XA CN117331571A (en) | 2023-10-10 | 2023-10-10 | Application program packaging method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311304941.XA CN117331571A (en) | 2023-10-10 | 2023-10-10 | Application program packaging method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117331571A true CN117331571A (en) | 2024-01-02 |
Family
ID=89276838
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311304941.XA Pending CN117331571A (en) | 2023-10-10 | 2023-10-10 | Application program packaging method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117331571A (en) |
-
2023
- 2023-10-10 CN CN202311304941.XA patent/CN117331571A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110764945B (en) | Crash log processing method, device, equipment and storage medium | |
CN111061489B (en) | Multi-platform compiling detection method, device, equipment and medium | |
CN110688096B (en) | Method and device for constructing application program containing plug-in, medium and electronic equipment | |
CN110727581B (en) | Crash positioning method and electronic equipment | |
CN111414231A (en) | Method and equipment for mutual conversion between virtual machine mirror image and container mirror image | |
CN112169326B (en) | Picture processing method, device, electronic equipment and storage medium | |
CN110659210A (en) | Information acquisition method and device, electronic equipment and storage medium | |
CN110781159B (en) | Ceph directory file information reading method and device, server and storage medium | |
CN112667246A (en) | Application function extension method and device and electronic equipment | |
CN109086097B (en) | Method and device for starting small program, server and storage medium | |
US9009684B2 (en) | Method, apparatus and product for porting applications to embedded platforms | |
CN114003269A (en) | Component processing method and device, electronic equipment and storage medium | |
CN109509467B (en) | Code generation method and device | |
CN117331571A (en) | Application program packaging method and device, electronic equipment and storage medium | |
CN111262727B (en) | Service capacity expansion method, device, equipment and storage medium | |
US20230185464A1 (en) | Method for determining a hard disk connection slot connected to a hard disk and terminal device | |
CN113626099B (en) | Application program starting method and device and electronic equipment | |
CN115705294B (en) | Method, device, electronic equipment and medium for acquiring function call information | |
CN115080114A (en) | Application program transplanting processing method, device and medium | |
CN110753136B (en) | Domain name resolution method, device, equipment and storage medium | |
CN112748930A (en) | Compilation detection method, device, equipment and storage medium | |
US7330870B1 (en) | Streaming computer system and method with multi-version protocol compatibility | |
CN113687878B (en) | Information interaction method, device, equipment and storage medium | |
CN112612754B (en) | File searching method, system, device and computer storage medium | |
CN117118962B (en) | Method and system for deploying user methods across multiple cloud platforms |
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 |