Installation package generation method and device

By compiling the Flutter code file package and relying on information processing, mobile application library files are generated, which solves the problem of high difficulty in introducing Flutter and realizes the rapid generation of Android application installation packages.

CN114527988BActive Publication Date: 2025-08-19BOE TECHNOLOGY GROUP CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210158415.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-21
Publication Date
2025-08-19
Estimated Expiration
2042-02-21

AI Technical Summary

Technical Problem

When applying Flutter to Android projects, you need to configure the Flutter development environment, which increases the difficulty of introducing Flutter into native projects and the time for application installation package generation.

Method used

Obtain the pending code file package, compile it into the first compiled file in the target format, obtain dependency information, generate the mobile application library file, and store it in a preset location. The second device directly uses the library file and the target application code to generate the installation package.

Benefits of technology

There is no need to configure the Flutter development environment on native projects, which reduces the difficulty of introducing Flutter and shortens the generation time of application installation packages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114527988B_ABST
    Figure CN114527988B_ABST
Patent Text Reader

Abstract

This specification provides a method and device for generating an installation package, the method comprising: obtaining at least one code file package to be processed; wherein the code file package to be processed comprises a mobile application framework module file package; compiling each of the code file packages to be processed respectively to obtain a first compiled file whose file format is a target format corresponding to each of the code file packages to be processed; obtaining dependency information corresponding to each of the first compiled files respectively; packaging all of the first compiled files according to the dependency information corresponding to each of the first compiled files to generate a mobile application library file, and storing the mobile application library file in a preset storage location, so that a second device obtains the mobile application library file from the preset storage location, and generates a target application installation package based on the mobile application library file and the target application code file, thereby realizing rapid generation of the application installation package.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of computer technology, and in particular to a method and device for generating an installation package. Background Art

[0002] Flutter is an open source mobile user interface (UI) framework that allows you to quickly build high-quality native user interfaces on Android projects.

[0003] Currently, when applying Flutter to Android projects, relevant developers configure the Flutter development environment in the native project development environment, that is, in the environment for developing Android applications, to strongly associate with Flutter, and then use the relevant Flutter module files to generate the Android application installation package.

[0004] However, since the Flutter development environment needs to be configured, relevant personnel need to learn related configuration methods, which increases the difficulty of introducing Flutter into native projects and increases the time to generate application installation packages. Summary of the Invention

[0005] To overcome the problems existing in the related art, this specification provides a method and device for generating an installation package.

[0006] According to a first aspect of an embodiment of this specification, a method for generating an installation package is provided, the method comprising:

[0007] Obtain at least one code file package to be processed; wherein the code file package to be processed includes a mobile application framework module file package;

[0008] Compiling each of the code file packages to be processed respectively to obtain a first compiled file whose file format corresponding to each of the code file packages to be processed is a target format; wherein the target format indicates a file format applicable to a target operating system;

[0009] Obtaining dependency information corresponding to each first compiled file respectively; wherein the dependency information indicates information about files used by the first compiled file when implementing a set function;

[0010] According to the dependency information corresponding to each of the first compiled files, all the first compiled files are packaged to generate a mobile application library file, and the mobile application library file is stored in a preset storage location, so that the second device obtains the mobile application library file from the preset storage location, and generates a target application installation package based on the mobile application library file and the target application code file; wherein, the target application is suitable for the target operating system.

[0011] Optionally, respectively obtaining dependency information corresponding to each of the first compiled files includes:

[0012] For each first compiled file, obtaining a configuration file corresponding to the first compiled file;

[0013] Parsing the configuration file to extract dependencies corresponding to the first compiled file in the configuration file; wherein the dependencies include dependency fields; and the dependency fields include one or more of a file package identifier, a file identifier, and a file version;

[0014] Dependency information corresponding to the first compiled file is generated according to the dependency field in the dependency item.

[0015] Optionally, the dependencies include local dependencies and / or remote dependencies; the dependency information indicates a local dependency command and / or a remote dependency command; wherein the local dependency command is used to determine a local dependency file corresponding to the first compiled file, and the remote dependency command is used to generate a dependency configuration file corresponding to the first compiled file;

[0016] The generating dependency information corresponding to the first compiled file according to the dependency field in the dependency item includes:

[0017] encapsulating the dependency field in the local dependency item according to a first preset command format to obtain a local dependency command corresponding to the first compiled file; and / or,

[0018] The dependency field in the remote dependency item is encapsulated according to a second preset command format to obtain a remote dependency command corresponding to the first compiled file.

[0019] Optionally, packaging all the first compiled files according to the dependency information corresponding to each of the first compiled files to generate a mobile application library file includes:

[0020] For each first compiled file, determining a dependent file corresponding to the first compiled file according to dependency information corresponding to the first compiled file;

[0021] All the first compiled files and the dependent files corresponding to the first compiled files are packaged to generate the mobile application library file.

[0022] Optionally, the dependency information includes local dependency information; the dependency file includes a local dependency file;

[0023] The determining, based on the dependency information corresponding to the first compiled file, the dependent file corresponding to the first compiled file includes:

[0024] Based on the local dependency information, a target compiled file is obtained from the second compiled file in the local storage location, and a local dependent file corresponding to the first compiled file is determined according to the target compiled file.

[0025] Optionally, the dependency information includes remote dependency information; the dependency file includes a dependency configuration file; wherein the dependency configuration file indicates configuration information of the remote dependency file;

[0026] The determining, based on the dependency information corresponding to the first compiled file, the dependent file corresponding to the first compiled file includes:

[0027] Based on the remote dependency configuration information, a dependency configuration file corresponding to the first compiled file is generated.

[0028] Optionally, the method further includes:

[0029] The first compiled file is saved in a local storage location; wherein the local storage location includes a local warehouse.

[0030] Optionally, the code file package to be processed further includes a custom code file and / or a plug-in code file.

[0031] According to a second aspect of an embodiment of this specification, a method for generating an installation package is provided, which is applied to a second device, and the method includes:

[0032] Obtain a target mobile application library file from a preset storage location; wherein the target mobile application library file is obtained by the method described in the first aspect and various possible designs of the first aspect;

[0033] Based on the mobile application library file and the target application code file, a target application installation package is generated; wherein the target application is applicable to a target operating system.

[0034] Optionally, the target mobile application library file includes a dependency configuration file;

[0035] The method further comprises:

[0036] Obtaining remote dependency files from a target storage location based on the dependency configuration file;

[0037] Compile the remote dependency file.

[0038] According to a third aspect of an embodiment of this specification, there is provided an installation package generation apparatus, applied to a first device, the apparatus comprising:

[0039] A file acquisition module, configured to acquire a code file package to be processed; wherein the code file package to be processed includes at least one mobile application framework module file;

[0040] a dependency determination module, configured to respectively obtain dependency information corresponding to each of the first compiled files; wherein the dependency information indicates information about files used by the first compiled file when implementing a set function;

[0041] A file packaging module is used to package all the first compiled files according to the dependency information corresponding to each of the first compiled files, generate a mobile application library file, and store the mobile application library file in a preset storage location, so that the second device can obtain the mobile application library file from the preset storage location and generate a target application installation package based on the mobile application library file and the target application code file; wherein, the target application is suitable for the target operating system.

[0042] Optionally, the dependency determination module is specifically configured to:

[0043] For each first compiled file, obtaining a configuration file corresponding to the first compiled file;

[0044] Parsing the configuration file to extract dependencies corresponding to the first compiled file in the configuration file; wherein the dependencies include dependency fields; and the dependency fields include one or more of a file package identifier, a file identifier, and a file version;

[0045] Dependency information corresponding to the first compiled file is generated according to the dependency field in the dependency item.

[0046] Optionally, the dependencies include local dependencies and / or remote dependencies; the dependency information indicates a local dependency command and / or a remote dependency command; wherein the local dependency command is used to determine a local dependency file corresponding to the first compiled file, and the remote dependency command is used to generate a dependency configuration file corresponding to the first compiled file;

[0047] The dependency determination module is further configured to:

[0048] encapsulating the dependency field in the local dependency item according to a first preset command format to obtain a local dependency command corresponding to the first compiled file; and / or,

[0049] The dependency field in the remote dependency item is encapsulated according to a second preset command format to obtain a remote dependency command corresponding to the first compiled file.

[0050] Optionally, the file packaging module is specifically used to:

[0051] For each first compiled file, determining a dependent file corresponding to the first compiled file according to dependency information corresponding to the first compiled file;

[0052] All the first compiled files and the dependent files corresponding to the first compiled files are packaged to generate the mobile application library file.

[0053] Optionally, the dependency information includes local dependency information; the dependency file includes a local dependency file;

[0054] The file packaging module is also used to:

[0055] Based on the local dependency information, a target compiled file is obtained from the second compiled file in the local storage location, and a local dependent file corresponding to the first compiled file is determined according to the target compiled file.

[0056] Optionally, the dependency information includes remote dependency information; the dependency file includes a dependency configuration file; wherein the dependency configuration file indicates configuration information of the remote dependency file;

[0057] The file packaging module is also used to:

[0058] Based on the remote dependency configuration information, a dependency configuration file corresponding to the first compiled file is generated.

[0059] Optionally, the file compilation module is further used to:

[0060] The first compiled file is saved in a local storage location; wherein the local storage location includes a local warehouse.

[0061] Optionally, the code file package to be processed further includes a custom code file and / or a plug-in code file.

[0062] According to a fourth aspect of the embodiments of this specification, there is provided an installation package generation apparatus, applied to a second device, the apparatus comprising:

[0063] An installation package download module, configured to download a target mobile application library file from a preset storage location; wherein the target mobile application library file is obtained by the method described in the first aspect and various possible designs of the first aspect;

[0064] The installation package generation module is used to generate a target application installation package based on the target mobile application library file and the target application file; wherein, the target application installation package is applicable to the target operating system.

[0065] Optionally, the target mobile application library file includes a dependency configuration file;

[0066] The installation package generation module is also used to:

[0067] Obtaining remote dependency files from a target storage location based on the dependency configuration file;

[0068] Compile the remote dependency file.

[0069] According to a fifth aspect of the embodiments of this specification, an electronic device is provided, including:

[0070] processor;

[0071] a memory for storing processor-executable instructions;

[0072] Wherein, the processor is configured to:

[0073] Obtain at least one code file package to be processed; wherein the code file package to be processed includes a mobile application framework module file package;

[0074] Compiling each of the code file packages to be processed respectively to obtain a first compiled file whose file format corresponding to each of the code file packages to be processed is a target format; wherein the target format indicates a file format applicable to a target operating system;

[0075] Obtaining dependency information corresponding to each first compiled file respectively; wherein the dependency information indicates information about files used by the first compiled file when implementing a set function;

[0076] According to the dependency information corresponding to each of the first compiled files, all the first compiled files are packaged to generate a mobile application library file, and the mobile application library file is stored in a preset storage location, so that the second device obtains the mobile application library file from the preset storage location, and generates a target application installation package based on the mobile application library file and the target application code file; wherein, the target application is suitable for the target operating system.

[0077] According to a sixth aspect of the embodiments of this specification, there is provided an electronic device, including:

[0078] processor;

[0079] a memory for storing processor-executable instructions;

[0080] Wherein, the processor is configured to:

[0081] Downloading a target mobile application library file from the remote warehouse; wherein the target mobile application library file is obtained by the method described in the first aspect and various possible designs of the first aspect;

[0082] A target application installation package is generated according to the target mobile application library file and the target application file; wherein the target application installation package is applicable to a target operating system.

[0083] According to the seventh aspect of the embodiments of this specification, a computer-readable storage medium is provided, in which computer-executable instructions are stored. When the processor executes the computer-executable instructions, the installation package generation method described in the first aspect and various possible designs of the first aspect is implemented.

[0084] According to the eighth aspect of the embodiments of this specification, a computer-readable storage medium is provided, in which computer-executable instructions are stored. When the processor executes the computer-executable instructions, the installation package generation method described in the second aspect and various possible designs of the second aspect is implemented.

[0085] According to a ninth aspect of the embodiments of this specification, a computer program product is provided, comprising a computer program. When the computer program is executed by a processor, the installation package generation method described in the first aspect and various possible designs of the first aspect is implemented.

[0086] According to the tenth aspect of the embodiments of this specification, a computer program product is provided, including a computer program. When the computer program is executed by a processor, it implements the installation package generation method described in the first aspect and various possible designs of the first aspect.

[0087] The technical solutions provided by the embodiments of this specification may have the following beneficial effects:

[0088] In the embodiment of this specification, a code file related to the mobile application framework is obtained, that is, a code file package to be processed, each code file package to be processed is compiled to obtain a first compiled file with a target file format, and the first compiled file can be directly applied to the native project corresponding to the target application, that is, the target operating system. According to the dependency information corresponding to the first compiled file, all the first compiled files are packaged to obtain a mobile application library file suitable for the target operating system, and the mobile application library file is saved to a preset storage location. When it is necessary to use the mobile application framework to develop an application suitable for the target operating system (that is, the target application), the second device obtains the mobile application library file from the preset storage location. Since the mobile application library file is suitable for the target operating system, that is, it can be directly applied to the native project of the target application, the mobile application library file can be directly introduced, thereby generating a target application installation package based on the target application code file, that is, based on the native project code, combined with the relevant code files in the mobile application library file, without the need to configure the development environment of the mobile application framework on the native project, reducing the difficulty of introducing the mobile application framework, thereby effectively shortening the generation time of the application installation package.

[0089] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0090] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the specification and, together with the description, serve to explain the principles of the specification.

[0091] Figure 1 This is an application scenario diagram of an installation package generation method according to an exemplary embodiment of this specification.

[0092] Figure 2 This is a flowchart of a method for generating an installation package according to an exemplary embodiment of this specification.

[0093] Figure 3 This is a flowchart of another installation package generation method according to an exemplary embodiment of this specification.

[0094] Figure 4 This is a flowchart of another method for generating an installation package according to an exemplary embodiment of this specification.

[0095] Figure 5 This is a hardware structure diagram of the electronic device where the installation package generation device according to the embodiment of this specification is located.

[0096] Figure 6This is a block diagram of an installation package generation device according to an exemplary embodiment of the present specification.

[0097] Figure 7 This is a block diagram of another installation package generation device according to an exemplary embodiment of the present specification. DETAILED DESCRIPTION

[0098] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with this specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of this specification, as detailed in the appended claims.

[0099] The terms used in this specification are for the purpose of describing specific embodiments only and are not intended to limit this specification. As used in this specification and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

[0100] It should be understood that although the terms first, second, third, etc. may be used in this specification to describe various information, such information should not be limited to these terms. These terms are merely used to distinguish information of the same type from one another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information without departing from the scope of this specification. Depending on the context, the term "if" as used herein may be interpreted as "when," "when," or "in response to determining."

[0101] Next, the embodiments of this specification are described in detail.

[0102] like Figure 1 As shown, Figure 1 This is a scenario application diagram of an installation package generation method according to an exemplary embodiment of this specification. The first device 101 performs relevant processing (for example, compiling and packaging) on the code file package to be processed (i.e., Flutter-related files), generates a corresponding mobile application library file, and saves the mobile application library file to the preset storage location 102. When developing the target application, the second device 103 downloads the required mobile application library file from the preset storage location 102, so that the mobile application library file can be directly used to generate the target application installation package in the native project corresponding to the target application.

[0103] The first device 101 includes electronic devices such as servers and terminal devices (eg, computers), and the second device includes electronic devices such as servers and terminal devices (eg, computers).

[0104] The preset storage location 102 includes a remote warehouse.

[0105] like Figure 2 As shown, Figure 2 This is a flowchart of a method for installing a package according to an exemplary embodiment of the present specification, which is applied to a first device. The method includes the following steps:

[0106] Step 201: Obtain at least one code file package to be processed, wherein the code file package to be processed includes a mobile application framework module file package.

[0107] Step 202: Compile each code file package to be processed to obtain a first compiled file corresponding to each code file package to be processed in a target format, wherein the target format indicates a file format suitable for a target operating system.

[0108] In this embodiment, code files related to the mobile application framework (i.e., Flutter) are obtained, that is, a code file package to be processed is obtained. For each code file package to be processed, the code file to be processed is compiled to obtain a compiled file corresponding to the code file package to be processed, and the compiled file is used as the first compiled file.

[0109] Among them, the file format of the first compiled file is the target format, and the target format indicates a file format applicable to the target operating system. That is, the first compiled file is applicable to the target operating system. In other words, the first compiled file is applicable to the native project corresponding to the application corresponding to the target operating system. Therefore, when developing the application corresponding to the target operating system, the first compiled file can be directly used in the native project corresponding to the application (that is, the native development environment) without the need to configure the Flutter development environment in the native development environment for developing the application.

[0110] Optionally, the target operating system includes an Android operating system. Accordingly, the application corresponding to the target operating system is an Android application, the target format is an aar format, and the native project is a native Android project.

[0111] Specifically, when compiling the code file package to be processed, a corresponding compilation instruction may be executed, for example, flutter build aar, to generate a corresponding compilation file for the code file package to be processed.

[0112] Optionally, the code file package to be processed includes at least one of a mobile application framework module file package, a custom code file package, and a plug-in code file package.

[0113] Optionally, the mobile application framework module file package indicates the source code file of the Flutter framework, that is, the basic module file; the custom code file package indicates the code file developed based on the Flutter framework; the plug-in code file package indicates the code file corresponding to the third-party plug-in used to implement a certain function, which can be implemented based on the Flutter framework and / or Android code.

[0114] The file package includes at least one file. For example, the code file package to be processed includes at least one file, and the mobile application framework module file package includes at least one mobile application framework module file.

[0115] Optionally, the first compiled file includes one or more of a compiled file corresponding to a mobile application framework module file package, a compiled file corresponding to a custom code file package, and a compiled file corresponding to a plug-in code file package. For example, when the code file package to be processed includes a mobile application framework module file package, the first compiled file includes the compiled file corresponding to the mobile application framework module file package; for another example, when the code file package to be processed includes a custom code file package, the first compiled file includes the compiled file corresponding to the custom code file package; and for another example, when the code file package to be processed includes a plug-in code file package, the first compiled file includes the compiled file corresponding to the plug-in code file package.

[0116] Step 203: Obtain dependency information corresponding to each first compiled file respectively; wherein the dependency information indicates information about files used by the first compiled file when implementing a set function.

[0117] In this embodiment, since other files are needed to implement related functions when using the first compiled file, that is, the first compiled file needs to rely on other files, for each first compiled file, dependency information corresponding to the first compiled file is determined, so that the files that the first compiled file needs to rely on can be determined using the dependency information.

[0118] Step 204: Based on the dependency information corresponding to each first compiled file, all first compiled files are packaged to generate a mobile application library file, and the mobile application library file is stored in a preset storage location, so that the second device obtains the mobile application library file from the preset storage location and generates a target application installation package based on the mobile application library file and the target application code file. The target application is applicable to the target operating system.

[0119] In this embodiment, based on the dependency information corresponding to each first compiled file, all first compiled files are packaged to generate a corresponding mobile application library file. After the mobile application library file is generated, it is uploaded to a preset storage location. When the second device develops the target application, the corresponding mobile application library file is downloaded from the preset storage location for use with the mobile application library file and the target application code file to generate a corresponding target application installation package. That is, the mobile application library file can be directly introduced into the native project of the target application, thereby using the Flutter-related content (e.g., methods, components, etc.) in the mobile application library file to develop the target application and generate a target application installation package.

[0120] The mobile application library file is equivalent to a component package, and its file format is also the target format. For example, if the target application is an Android application, the mobile application library file is an aar file, which is suitable for native Android projects. Therefore, the mobile application library file can be directly imported into the native project corresponding to the Android application (i.e., the target application code file), and then the target application installation package can be generated using the mobile application library file.

[0121] Optionally, the target application installation package is applicable to the target operating system, and its corresponding file format may be apk (Android Package).

[0122] Optionally, the preset storage location includes a remote warehouse. Specifically, the remote warehouse is a remote Maven warehouse. Of course, the preset storage location can also be other storage locations, and this application does not limit it.

[0123] In this embodiment, based on the dependency information corresponding to each first compiled file, all first compiled files are packaged to generate corresponding mobile application library files, so that when the second device uses the mobile application library files, it can use the relevant first compiled files and the files on which the first compiled files depend, thereby successfully implementing the relevant functions and ensuring the successful application of Flutter.

[0124] In this embodiment, since the mobile application library file is applicable to the target operating system, that is, it is applicable to the native development environment corresponding to the application corresponding to the target operating system (that is, the target application), when the second device needs to develop the target application, it directly introduces the mobile application library file on the basis of the native project (that is, the native development environment), so that the Flutter-related content in the mobile application library file can be directly utilized without configuring the Flutter development environment in the native development environment of the target application, and thus will not change the structure of the native project, that is, will not change the structure of the target application code file, and on the basis of reducing the difficulty of introducing Flutter, zero intrusion into the native project (for example, the native Android project) is achieved.

[0125] From the above description, it can be seen that the code files related to the mobile application framework, that is, the code file packages to be processed, are obtained, each code file package to be processed is compiled, and a first compiled file with a target format is obtained. The first compiled file can be directly applied to the native project corresponding to the target application, that is, the target operating system. According to the dependency information corresponding to the first compiled file, all the first compiled files are packaged to obtain a mobile application library file suitable for the target operating system, and the mobile application library file is saved to a preset storage location. When it is necessary to use the mobile application framework to develop an application suitable for the target operating system (that is, the target application), the second device obtains the mobile application library file from the preset storage location. Since the mobile application library file is suitable for the target operating system, that is, it can be directly applied to the native project of the target application, the mobile application library file can be directly introduced, thereby generating a target application installation package based on the target application code file, that is, based on the native project code, combined with the relevant code files in the mobile application library file, without the need to configure the development environment of the mobile application framework on the native project, reducing the difficulty of introducing the mobile application framework, thereby effectively shortening the generation time of the application installation package.

[0126] like Figure 3 FIG. 1 is a flow chart of another method for generating an installation package according to an exemplary embodiment. This embodiment describes a process of determining dependency information corresponding to a first compiled file based on the aforementioned embodiment. The following will describe this process in detail with reference to a specific embodiment. Figure 3 As shown, the method includes the following steps:

[0127] Step 301: Obtain at least one code file package to be processed, wherein the code file package to be processed includes a mobile application framework module file package.

[0128] Step 302: Compile each code file package to be processed to obtain a first compiled file corresponding to each code file package to be processed in a target format, wherein the target format indicates a file format suitable for a target operating system.

[0129] In this embodiment, after obtaining the first compiled file corresponding to the code file package to be processed, the first compiled file is saved to a local storage location to facilitate management of the first compiled file.

[0130] Optionally, the local storage location includes a local warehouse, specifically, a local Maven warehouse. The first device creates a Maven warehouse locally and uses it as the local warehouse. After obtaining the first compiled file, it saves it to the local warehouse to facilitate management of the compiled files in the local warehouse by relevant personnel.

[0131] For the convenience of description, the compiled file stored in the local storage location is referred to as the second compiled file.

[0132] Step 303: For each first compiled file, obtain a configuration file corresponding to the first compiled file. Parse the configuration file to extract dependencies corresponding to the first compiled file in the configuration file. The dependencies include a dependency field; the dependency field includes one or more of a file package identifier, a file identifier, and a file version.

[0133] Step 304: Generate dependency information corresponding to the first compiled file according to the dependency field in the dependency item.

[0134] In this embodiment, when determining dependency information corresponding to a first compiled file, a configuration file corresponding to each first compiled file is obtained. This configuration file is parsed based on a preset parsing script to extract all dependencies corresponding to the first compiled file. Each dependency is composed of dependency fields. For each of these dependencies, dependency information corresponding to the first compiled file is generated based on the dependency. Specifically, one dependency can be used to generate dependency information corresponding to the first compiled file.

[0135] The dependency field includes one or more of a file package identifier (groupId), a file identifier (artifactId), and a file version (version).

[0136] Specifically, the file package identifier indicates the file package identifier (for example, file package number, file package name) to which the file that the first compiled file depends belongs; the file identifier indicates the identifier of the file that the first compiled file depends on, for example, file name, file number, etc.; the file version indicates the version of the file that the first compiled file depends on.

[0137] Optionally, the dependency field may also include a processing scope identifier (scope), which is generally a compile identifier. The processing scope identifier indicates the method for processing files that the first compiled file depends on. When the processing scope identifier is a compile identifier, it indicates that when the first device packages the first compiled file, it needs to compile (i.e., package) the files that the first compiled file depends on.

[0138] Optionally, the dependencies include local dependencies and / or remote dependencies. Accordingly, the dependency information includes local dependency information and / or remote dependency information. Accordingly, the dependency information indicates a local dependency command and / or a remote dependency command. The local dependency command is used to determine the local dependency file corresponding to the first compiled file, and the remote dependency command is used to generate a dependency configuration file corresponding to the first compiled file.

[0139] Specifically, local dependency information is generated based on the local dependencies, i.e., a local dependency command is generated. The local dependency command can be used to obtain the corresponding compiled file, i.e., the local dependency file, from the local storage location. Remote dependency information is generated based on the remote dependencies, i.e., a remote dependency command is generated. The remote dependency command can be used to generate a dependency configuration file. The dependency configuration file is used to obtain the remote dependency file corresponding to the first compiled file.

[0140] Optionally, generating dependency information corresponding to the first compiled file according to the dependency field includes:

[0141] The dependency fields in the local dependency item are encapsulated according to a first preset command format to obtain a local dependency command corresponding to the first compiled file. And / or, the dependency fields in the remote dependency item are encapsulated according to a second preset command format to obtain a remote dependency command corresponding to the first compiled file.

[0142] The first preset command format is embed(file package identifier: file identifier: file version). Correspondingly, the local dependency command is the embed command. The second preset command format is implementation(file package identifier: file identifier: file version){exclude group: file package identifier, module: argifactId}.

[0143] Optionally, the configuration file corresponding to the first compiled file can be a pom file, and the file path of the configuration file corresponding to the first compiled file is obtained. The configuration file corresponding to the file path is obtained using a preset parsing script, and is parsed to generate a corresponding local dependency command, i.e., an embed command, and / or a remote dependency command, i.e., an implementation command. The source code for generating the local dependency command (i.e., the embed command) is as follows:

[0144]

[0145] Optionally, the source code for generating remote dependency commands (i.e., implementation commands) is as follows:

[0146]

[0147]

[0148] Optionally, the first compiled file is in aar format, which is equivalent to a compressed package. The configuration file corresponding to the first configuration file (i.e., the pom file) is located in the first compiled file, and the corresponding configuration file can be determined from a specific location in the first configuration file. For example, the path of the configuration file is build / output / repo / file package identifier (i.e., the file package identifier to which the configuration file belongs) / flutter_release / 1.0 / flutter_release-1.0.pom (configuration file name).

[0149] Optionally, to package the first compiled file, i.e., perform a secondary compilation, you also need to build a native project (e.g., a native Android project). Create an Android Library module in the native project, and add a reference to the local storage location in the build.gradle module of the native project to utilize the second compiled file in the local storage location.

[0150] Among them, the construction of the native project, the creation of the Android Library module, and the addition of a reference to the local storage location can be performed by relevant personnel, or can be automatically performed by the first device according to relevant scripts, and this application does not limit them.

[0151] Optionally, you may also need to modify the Library module's build.gradle file. After obtaining local dependencies, use the fat-aar plugin to generate statements within the dependencies section of the Library module's build.gradle file to combine these local dependencies, generating the corresponding embed commands. Similarly, you also need to generate statements within the dependencies section of the Library module's build.gradle file to combine remote dependencies, generating the implementation commands.

[0152] Step 305: Pack all first compiled files according to the dependency information corresponding to each first compiled file to generate a mobile application library file, and store the mobile application library file in a preset storage location.

[0153] Optionally, when packaging based on the dependency information corresponding to the first compiled files, for each first compiled file, the dependent files corresponding to the first compiled file are determined based on the dependency information corresponding to the first compiled file. All first compiled files and the dependent files corresponding to each first compiled file are packaged, i.e., compiled and recompiled, to generate a mobile application library file.

[0154] Optionally, the dependency file includes a local dependency file and / or a dependency configuration file, wherein the dependency configuration file indicates configuration information of a remote dependency file.

[0155] Accordingly, determining the dependent files corresponding to the first compiled file according to the dependency information corresponding to the first compiled file includes:

[0156] Based on the local dependency information, the target compiled file is obtained from the second compiled file in the local storage location, and the local dependency file corresponding to the first compiled file is determined based on the target compiled file. And / or, based on the remote dependency configuration information, a dependency configuration file corresponding to the first compiled file is generated.

[0157] Specifically, the first compiled file corresponds to at least one dependency information item, each dependency information item corresponding to a file on which the first compiled file depends. For each dependency information item corresponding to the first compiled file, if the dependency information item is local dependency information, indicating that the file indicated by the dependency information item can be directly obtained from a local storage location, the second compiled file corresponding to the local dependency information item is searched from the local storage location, thereby obtaining the target compiled file. The target compiled file is treated as a local file on which the first compiled file depends, namely, a local dependency file.

[0158] In the case where the dependency information is remote dependency information, it indicates that the file on which the first compiled file indicated by the dependency information depends is remote, that is, not in the local storage device. Then, a corresponding dependency configuration file is generated based on the dependency information, that is, the remote dependency information, so as to use the dependency configuration file to determine the remote dependency file of the first compiled file.

[0159] Optionally, the dependency configuration file can be a pom file. Each first compiled file corresponds to a pom file, that is, a pom file can only determine one remote dependency file. Alternatively, all first compiled files can correspond to one pom file (that is, one pom file contains all remote dependencies corresponding to the first compiled files) to reduce resource waste. This is not restricted here.

[0160] Optionally, when generating a dependency configuration file, it is generated by executing the implementation command. The source code for executing the implementation command is as follows:

[0161]

[0162] Optionally, add a script to upload the mobile application library file to the preset storage location (ie, remote warehouse) in the build.gradle of the Library module to execute the corresponding upload command, so that after obtaining the mobile application library file, it can be successfully uploaded to the remote warehouse.

[0163] Optionally, a target file including dependency information, that is, a dependency item, may be directly generated, and the target file and the mobile application library file may be packaged.

[0164] Optionally, after obtaining the mobile application library file, the version number corresponding to the mobile application library file is determined based on a preset version naming rule. Since the version number corresponds to the entire mobile application library file, it is convenient to manage the version of the mobile application library file. When the mobile application library file is uploaded to the remote warehouse, since each first compiled file does not need to be uploaded to the remote warehouse, each first compiled file has a corresponding version number. This can avoid the inconvenience of file management caused by too many files and the high probability of version number conflicts with compiled files uploaded by other devices. This can effectively reduce the probability of version conflicts and facilitate the management of files in the remote warehouse by relevant personnel.

[0165] In this embodiment, based on the dependency information corresponding to the first compiled file, the first compiled file is compiled for the second time, that is, it is packaged to obtain a mobile application library file. The mobile application library file is an aar file. Therefore, the native Android project can directly introduce the mobile application library file to implement the introduction of Flutter, so that the relevant content of Flutter can be used to generate a target application installation package, reducing the difficulty of introducing Flutter in the native Android project and improving the development efficiency of the target application, that is, shortening the time required to obtain the target application installation package.

[0166] like Figure 4 As shown, Figure 4 This is a flowchart of another method for installing a package according to an exemplary embodiment of the present specification, which is applied to a second device. The method includes the following steps:

[0167] Step 401: Obtain a target mobile application library file from a preset storage location.

[0168] Step 402: Generate a target application installation package based on the mobile application library file and the target application code file; wherein the target application is applicable to the target operating system.

[0169] In this embodiment, when developing a target application, if it is indicated that the relevant content of Flutter needs to be applied, the required mobile application framework installation, that is, the target mobile application library file, is downloaded from the preset storage location. Since the file format of the target mobile framework installation package is the target format, it is applicable to the target operating system, that is, to the native project corresponding to the target application. Therefore, the target mobile framework installation package can be directly referenced in the native project corresponding to the target application, and the Flutter development environment can be configured in the native development environment of the target application.

[0170] Optionally, when the first compiled file in the target mobile application library file has a remote dependency, it indicates that the target mobile application library file includes a dependency configuration file, and the remote dependency file needs to be determined. Then, the remote dependency file is downloaded from the target storage location based on the dependency configuration file; the remote dependency file is compiled to ensure that the corresponding first compiled file can run successfully.

[0171] Optionally, in the process of generating the target application installation package using the target mobile application library file, the remote dependent files can be determined and compiled, that is, the remote dependent files and the target mobile application library file are packaged; or after obtaining the target application installation package, that is, when running the target application installation package, the remote dependent files can be determined and compiled.

[0172] Optionally, when the user needs to use the target application, he can download the target application installation package on the mobile terminal, and when the mobile terminal runs the target application installation package, determine the remote dependent files and compile the remote dependent files.

[0173] Optionally, the target storage location may be a remote warehouse, or other storage locations, which will not be described in detail here.

[0174] Optionally, in response to the received download request, that is, after receiving the download request, the installation package identifier and the installation package version in the download request are extracted, thereby downloading the mobile application library file corresponding to the installation package identifier and the installation package version from a preset storage location.

[0175] In this embodiment, when developing a target application, the required mobile application library file is downloaded from a preset storage location and directly introduced into the native project of the target application, so that relevant developers can use the relevant Flutter content in the target application framework installation package to develop the target application. There is no need for relevant developers to configure the Flutter development environment, which reduces the difficulty of introducing Flutter, thereby effectively improving the development efficiency of the target application.

[0176] Corresponding to the aforementioned method embodiments, this specification also provides embodiments of an apparatus and an electronic device to which the apparatus is applied.

[0177] The embodiments of the file processing device of this specification can be applied to electronic devices, such as servers or terminal devices. The device embodiments can be implemented through software, hardware, or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor in which the file is processed to read the corresponding computer program instructions in the non-volatile memory into the memory and run them. From the hardware level, if Figure 5 The figure is a hardware structure diagram of the computer device where the installation package generation device of the embodiment of this specification is located, except Figure 5 In addition to the processor 510, memory 530, network interface 520, and non-volatile memory 540 shown, the server or electronic device where the device 531 is located in the embodiment may also include other hardware according to the actual function of the electronic device, which will not be described in detail.

[0178] like Figure 6 As shown, Figure 6 This is a block diagram of an installation package generation device according to an exemplary embodiment of the present specification, which is applied to a first device and includes:

[0179] The file acquisition module 610 is configured to acquire at least one code file package to be processed, wherein the code file package to be processed includes a mobile application framework module file package.

[0180] The file compiling module 620 is configured to compile each code file package to be processed to obtain a first compiled file corresponding to each code file package to be processed in a target format, wherein the target format indicates a file format suitable for a target operating system.

[0181] The dependency determination module 630 is configured to obtain dependency information corresponding to each first compiled file, wherein the dependency information indicates information about files used by the first compiled file when implementing a set function.

[0182] The file packaging module 640 is configured to package all first compiled files according to dependency information corresponding to each first compiled file to generate a mobile application library file, and store the mobile application library file in a preset storage location, so that the second device can obtain the mobile application library file from the preset storage location and generate a target application installation package based on the mobile application library file and the target application code file. The target application is applicable to the target operating system.

[0183] Optionally, the dependency determination module 630 is specifically configured to:

[0184] For each first compiled file, obtain a configuration file corresponding to the first compiled file.

[0185] The configuration file is parsed to extract dependencies corresponding to the first compiled file in the configuration file, wherein the dependencies include dependency fields, and the dependency fields include one or more of a file package identifier, a file identifier, and a file version.

[0186] Generate dependency information corresponding to the first compiled file according to the dependency field in the dependency item.

[0187] Optionally, the dependencies include local dependencies and / or remote dependencies. The dependency information indicates local dependency commands and / or remote dependency commands. The local dependency commands are used to determine the local dependency files corresponding to the first compiled file, and the remote dependency commands are used to generate dependency configuration files corresponding to the first compiled file.

[0188] The dependency determination module 630 is further configured to:

[0189] According to the first preset command format, the dependency field in the local dependency item is encapsulated to obtain the local dependency command corresponding to the first compiled file. And / or,

[0190] The dependency field in the remote dependency item is encapsulated according to the second preset command format to obtain a remote dependency command corresponding to the first compiled file.

[0191] Optionally, the file packaging module 640 is specifically configured to:

[0192] For each first compiled file, a dependent file corresponding to the first compiled file is determined according to the dependency information corresponding to the first compiled file.

[0193] All first compiled files and dependent files corresponding to each first compiled file are packaged to generate a mobile application library file.

[0194] Optionally, the dependency information includes local dependency information, and the dependency files include local dependency files.

[0195] The file packaging module 640 is further configured to:

[0196] Based on the local dependency information, a target compiled file is obtained from the second compiled file in the local storage location, and a local dependent file corresponding to the first compiled file is determined according to the target compiled file.

[0197] Optionally, the dependency information includes remote dependency information. The dependency file includes a dependency configuration file. The dependency configuration file indicates configuration information of the remote dependency file.

[0198] The file packaging module 640 is further configured to:

[0199] Based on the remote dependency configuration information, a dependency configuration file corresponding to the first compiled file is generated.

[0200] Optionally, the file compilation module 620 is further configured to:

[0201] The first compiled file is saved to a local storage location, wherein the local storage location includes a local warehouse.

[0202] Optionally, the code file package to be processed also includes custom code files and / or plug-in code files.

[0203] like Figure 7 As shown, Figure 7 This is a block diagram of another installation package generation device according to an exemplary embodiment of this specification, which is applied to a second device and includes:

[0204] The installation package downloading module 710 is used to download the target mobile application library file from a preset storage location. The target mobile application library file is obtained based on the method described above.

[0205] The installation package generation module 720 is configured to generate a target application installation package based on the target mobile application library file and the target application file, wherein the target application installation package is applicable to the target operating system.

[0206] Optionally, the target mobile application library file includes a dependency configuration file.

[0207] The installation package generation module 720 is further configured to:

[0208] Get remote dependency files from the target storage location based on the dependency configuration file.

[0209] Compile remote dependency files.

[0210] Accordingly, this specification also provides an electronic device, comprising a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to:

[0211] Obtain at least one code file package to be processed; wherein the code file package to be processed includes a mobile application framework module file package;

[0212] Compiling each of the code file packages to be processed respectively to obtain a first compiled file whose file format corresponding to each of the code file packages to be processed is a target format; wherein the target format indicates a file format applicable to a target operating system;

[0213] Obtaining dependency information corresponding to each first compiled file respectively; wherein the dependency information indicates information about files used by the first compiled file when implementing a set function;

[0214] According to the dependency information corresponding to each of the first compiled files, all the first compiled files are packaged to generate a mobile application library file, and the mobile application library file is stored in a preset storage location, so that the second device obtains the mobile application library file from the preset storage location, and generates a target application installation package based on the mobile application library file and the target application code file; wherein, the target application is suitable for the target operating system.

[0215] or,

[0216] Downloading a target mobile application library file from the remote warehouse; wherein the target mobile application library file is obtained based on the above method;

[0217] A target application installation package is generated according to the target mobile application library file and the target application file; wherein the target application installation package is applicable to a target operating system.

[0218] In another embodiment, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the installation package generation method described above is implemented.

[0219] In another embodiment, the present application further provides a computer program product, including a computer program, which, when executed by a processor, implements the installation package generation method described above.

[0220] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0221] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the partial description of the method embodiments. The device embodiments described above are merely illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this specification. A person of ordinary skill in the art can understand and implement it without paying any creative work.

[0222] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0223] Other embodiments of the present invention will readily occur to those skilled in the art upon consideration of the present invention and practice of the invention claimed herein. This specification is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of this specification and include common knowledge or customary techniques in the art not claimed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present invention being indicated by the following claims.

[0224] It should be understood that the present description is not limited to the exact structure that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present description is limited only by the appended claims.

[0225] The above description is only a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this specification should be included in the scope of protection of this specification.

Claims

1. A method for generating an installation package, characterized in that: Applied to a first device, the method includes: Obtain at least one code file package to be processed; wherein the code file package to be processed includes a mobile application framework module file package; Compiling each of the code file packages to be processed respectively to obtain a first compiled file whose file format corresponding to each of the code file packages to be processed is a target format; wherein the target format indicates a file format applicable to a target operating system; Obtaining dependency information corresponding to each first compiled file respectively; wherein the dependency information indicates information about files used by the first compiled file when implementing a set function; According to the dependency information corresponding to each of the first compiled files, all the first compiled files are packaged to generate a mobile application library file, and the mobile application library file is stored in a preset storage location, so that the second device obtains the mobile application library file from the preset storage location, and generates a target application installation package based on the mobile application library file and the target application code file; wherein, the target application is suitable for the target operating system.

2. The method according to claim 1, characterized in that The obtaining dependency information corresponding to each of the first compiled files includes: For each first compiled file, obtaining a configuration file corresponding to the first compiled file; Parsing the configuration file to extract dependencies corresponding to the first compiled file in the configuration file; wherein the dependencies include dependency fields; and the dependency fields include one or more of a file package identifier, a file identifier, and a file version; Dependency information corresponding to the first compiled file is generated according to the dependency field in the dependency item.

3. The method according to claim 2, characterized in that The dependencies include local dependencies and / or remote dependencies; the dependency information indicates a local dependency command and / or a remote dependency command; wherein the local dependency command is used to determine a local dependency file corresponding to the first compiled file, and the remote dependency command is used to generate a dependency configuration file corresponding to the first compiled file; The generating dependency information corresponding to the first compiled file according to the dependency field in the dependency item includes: encapsulating the dependency field in the local dependency item according to a first preset command format to obtain a local dependency command corresponding to the first compiled file; and / or, The dependency field in the remote dependency item is encapsulated according to a second preset command format to obtain a remote dependency command corresponding to the first compiled file.

4. The method according to claim 1, wherein The step of packaging all the first compiled files according to the dependency information corresponding to each of the first compiled files to generate a mobile application library file includes: For each first compiled file, determining a dependent file corresponding to the first compiled file according to dependency information corresponding to the first compiled file; All the first compiled files and the dependent files corresponding to the first compiled files are packaged to generate the mobile application library file.

5. The method according to claim 4, characterized in that The dependency information includes local dependency information; the dependency files include local dependency files; The determining, based on the dependency information corresponding to the first compiled file, the dependent file corresponding to the first compiled file includes: Based on the local dependency information, a target compiled file is obtained from the second compiled file in the local storage location, and a local dependent file corresponding to the first compiled file is determined according to the target compiled file.

6. The method according to claim 4, characterized in that The dependency information includes remote dependency information; the dependency file includes a dependency configuration file; wherein the dependency configuration file indicates configuration information of the remote dependency file; The determining, based on the dependency information corresponding to the first compiled file, the dependent file corresponding to the first compiled file includes: Based on the remote dependency information, a dependency configuration file corresponding to the first compiled file is generated.

7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: The first compiled file is saved in a local storage location; wherein the local storage location includes a local warehouse.

8. The method according to any one of claims 1 to 6, characterized in that The code file package to be processed also includes custom code files and / or plug-in code files.

9. A method for generating an installation package, characterized in that: Applied to the second device, the method includes: Obtaining a target mobile application library file from a preset storage location; wherein the target mobile application library file is obtained according to the method according to any one of claims 1 to 8; Based on the mobile application library file and the target application code file, a target application installation package is generated; wherein the target application is applicable to a target operating system.

10. An installation package generating device, characterized in that: Applied to a first device, the apparatus includes: A file acquisition module, configured to acquire at least one code file package to be processed; wherein the code file package to be processed includes a mobile application framework module file package; A file compiling module, configured to compile each of the code file packages to be processed, respectively, to obtain a first compiled file whose file format corresponding to each of the code file packages to be processed is a target format; wherein the target format indicates a file format applicable to a target operating system; a dependency determination module, configured to respectively obtain dependency information corresponding to each of the first compiled files; wherein the dependency information indicates information about files used by the first compiled file when implementing a set function; A file packaging module is used to package all the first compiled files according to the dependency information corresponding to each of the first compiled files, generate a mobile application library file, and store the mobile application library file in a preset storage location, so that the second device can obtain the mobile application library file from the preset storage location and generate a target application installation package based on the mobile application library file and the target application code file; wherein, the target application is suitable for the target operating system.

11. An installation package generating device, characterized in that: Applied to the second device, the apparatus includes: An installation package download module, configured to obtain a target mobile application library file from a preset storage location; wherein the target mobile application library file is obtained according to the method according to any one of claims 1 to 8; The installation package generation module is used to generate a target application installation package based on the mobile application library file and the target application code file; wherein, the target application is applicable to the target operating system.

12. An electronic device, characterized in that: The invention comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the following method is implemented: Obtain at least one code file package to be processed; wherein the code file package to be processed includes a mobile application framework module file package; Compiling each of the code file packages to be processed respectively to obtain a first compiled file whose file format corresponding to each of the code file packages to be processed is a target format; wherein the target format indicates a file format applicable to a target operating system; Obtaining dependency information corresponding to each first compiled file respectively; wherein the dependency information indicates information about files used by the first compiled file when implementing a set function; According to the dependency information corresponding to each of the first compiled files, all the first compiled files are packaged to generate a mobile application library file, and the mobile application library file is stored in a preset storage location, so that the second device obtains the mobile application library file from the preset storage location, and generates a target application installation package based on the mobile application library file and the target application code file; wherein, the target application is suitable for the target operating system.

13. An electronic device, characterized in that: The invention comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the following method is implemented: Obtaining a target mobile application library file from a preset storage location; wherein the target mobile application library file is obtained according to the method according to any one of claims 1 to 8; Based on the mobile application library file and the target application code file, a target application installation package is generated; wherein the target application is applicable to a target operating system.

14. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the installation package generation method according to any one of claims 1 to 8 is implemented.

15. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions. When the processor executes the computer-executable instructions, the installation package generation method according to claim 9 is implemented.

Citation Information

Patent Citations

  • Application construction method and system, computer equipment and storage medium

    CN108287694A

  • Index file generation method, terminal equipment, electronic equipment and medium

    CN112395253A