Application Compilation Method and Device

By selecting the target compilation tool from a variety of compilation tools and creating code configuration files based on development task information, the complex adaptation of compilation tools in the existing technology is solved, and the compilation efficiency and compatibility are improved.

CN114968261BActive Publication Date: 2025-06-27BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210731077.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-24
Publication Date
2025-06-27
Estimated Expiration
2042-06-24

AI Technical Summary

Technical Problem

The existing technology is difficult to adapt to multiple compilation tools at the same time, resulting in the compilation process being complex and inefficient when using the same code base and open source demo project.

Method used

By responding to the application's compilation request, select the target compilation tool from a variety of compilation tools, create code configuration files based on development task information, and compile and develop through the target compilation tool to generate the application.

Benefits of technology

It improves the compatibility of multiple compilation tools for the same code library and the same open source style library, enhances the flexibility and efficiency of engineering compilation, and does not require the adaptation of open source code every time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114968261B_ABST
    Figure CN114968261B_ABST
Patent Text Reader

Abstract

The present disclosure provides an application compilation method and apparatus, relating to the field of computer technologies, specifically to the fields of software development technologies and code compilation technologies. The specific implementation solution is as follows: First, in response to receiving a compilation request for an application, a target compilation tool is selected from multiple compilation tools, and the compilation request includes development task information of the application. Then, based on the open-source code library corresponding to the development task information, a corresponding code configuration file is created through the target compilation tool, and based on the preset operations corresponding to the compilation tool, it is determined whether the target compilation tool meets the compilation conditions. Finally, in response to determining that the target compilation tool meets the compilation conditions, based on the component information corresponding to the development task information and the code configuration file, compilation and development are performed through the target compilation tool to generate an application. For the same repository and the same project, multiple compilation chain configurations can be supported, which can improve the flexibility and compatibility of project compilation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technologies, specifically to the fields of software development technologies and code compilation technologies, and particularly to an application program compilation method and apparatus. Background Art

[0002] An open-source component (open-source Demo) project includes the registration of mini-programs, mini-program function interfaces, component implementation layers, and mini-program capability extensions. Currently, the open-source Demo project is used to provide an integration reference for the open-source alliance host and the framework upgrade of mini-programs, and needs to adapt to multiple compilation tools at the same time. Different compilation tools need to use the same code library and open-source Demo project simultaneously.

[0003] Currently, if multiple compilation tools need to be used simultaneously, some open-source code adaptation work can be done in advance; or, the integration of the SDK can be referred to the open-source Demo project of other compilation tools. Summary of the Invention

[0004] The present disclosure provides an application program compilation method, apparatus, electronic device, storage medium, and computer program product.

[0005] According to one aspect of the present disclosure, there is provided an application program compilation method, the method including: in response to receiving a compilation request for an application program, selecting a target compilation tool from multiple compilation tools, where the compilation request includes development task information of the application program; creating a corresponding code configuration file through the target compilation tool based on the open-source code library corresponding to the development task information; determining whether the target compilation tool meets the compilation conditions based on a preset operation corresponding to the compilation tool; and in response to determining that the target compilation tool meets the compilation conditions, performing compilation development through the target compilation tool based on the component information corresponding to the development task information and the code configuration file to generate an application program.

[0006] According to another aspect of the present disclosure, there is provided an application program compilation apparatus, the apparatus including: a selection module configured to select a target compilation tool from multiple compilation tools in response to receiving a compilation request for an application program, where the compilation request includes development task information of the application program; a creation module configured to create a corresponding code configuration file through the target compilation tool based on the open-source code library corresponding to the development task information; a determination module configured to determine whether the target compilation tool meets the compilation conditions based on a preset operation corresponding to the compilation tool; and a generation module configured to, in response to determining that the target compilation tool meets the compilation conditions, perform compilation development through the target compilation tool based on the component information corresponding to the development task information and the code configuration file to generate an application program.

[0007] According to another aspect of the present disclosure, there is provided an electronic device, which includes at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the above application program compilation method.

[0008] According to another aspect of the present disclosure, there is provided a computer-readable medium, on which computer instructions are stored, and the computer instructions are used to enable a computer to execute the above application program compilation method.

[0009] According to another aspect of the present disclosure, an embodiment of the present application provides a computer program product, which includes computer programs / instructions, and when the computer programs / instructions are executed by a processor, the above application program compilation method is implemented.

[0010] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. Description of the Drawings

[0011] The drawings are used to better understand the solution and do not constitute a limitation to the present disclosure. Among them:

[0012] Figure 1 is a flowchart of an embodiment of the application program compilation method according to the present disclosure;

[0013] Figure 2 is a schematic diagram of an application scenario of the application program compilation method according to the present disclosure;

[0014] Figure 3 is a flowchart of another embodiment of the application program compilation method according to the present disclosure;

[0015] Figure 4 is a flowchart of an embodiment of generating an application program according to the present disclosure;

[0016] Figure 5 is a flowchart of another embodiment of generating an application program according to the present disclosure;

[0017] Figure 6 is a flowchart of another embodiment of the application program compilation method according to the present disclosure;

[0018] Figure 7 is a schematic structural diagram of an embodiment of the application program compilation device according to the present disclosure;

[0019] Figure 8 is a block diagram of an electronic device for implementing the application program compilation method of the embodiments of the present disclosure. Specific Embodiments

[0020] The following describes exemplary embodiments of the present disclosure with reference to the accompanying drawings. Various details of the embodiments of the present disclosure are included to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, descriptions of well-known functions and structures are omitted below for clarity and conciseness.

[0021] Reference Figure 1 , Figure 1 FIG. 100 is a schematic flowchart showing an embodiment of an application compilation method that can be applied to the present disclosure. The application compilation method includes the following steps:

[0022] Step 110: In response to receiving a compilation request for an application, select a target compilation tool from multiple compilation tools.

[0023] In this embodiment, the execution entity (such as a terminal device) on which the application compilation method runs can display a development interface of the application to the developer through the screen. The developer can fill in the development task information of the application in the development interface. The development task information of the application can include name information and function information of the application, etc., and a compilation request for the application can be generated according to the development task information of the application. The above execution entity can receive the compilation request for the application from the developer, and can extract the development task information of the application in the compilation request to obtain the development task information of the application.

[0024] The above execution entity installs multiple compilation tools, and the compilation tools can include tools for developing and compiling applications, such as Cocoapods and Easybox, etc.

[0025] The developer can select a certain compilation tool in the development interface. The above execution entity can receive the selection operation of a certain compilation tool by the developer, and determine the compilation tool corresponding to the selection operation as the target compilation tool for application compilation. Thus, the above execution entity selects the target compilation tool from multiple compilation tools according to the selection operation of the developer, and the compilation tools other than the target compilation tool among the multiple compilation tools are candidate compilation tools.

[0026] Alternatively, the above execution entity may store a relationship table in which development task information is stored corresponding to a compilation tool, and each type of development task information may correspond to a compilation tool. The above execution entity may perform type analysis on the development task information of the application program, determine the type of the development task information submitted by the developer, and based on the relationship table in which the development task information is stored corresponding to the compilation tool, determine the compilation tool corresponding to the type of the development task information, and select the compilation tool from multiple compilation tools as the target compilation tool for compiling the application program. Then, the compilation tools other than the target compilation tool among the multiple compilation tools are candidate compilation tools.

[0027] Step 120: Based on the open source code library corresponding to the development task information, create a corresponding code configuration file through the target compilation tool.

[0028] In this embodiment, after the above execution entity determines the target compilation tool for compiling the application program, it may send a request for obtaining an open source code library to the server according to the development task information of the application program. The request for obtaining includes the development task information of the application program. After receiving the request for obtaining from the above execution entity, the server may return the open source code library corresponding to the development task information according to the development task information in the request for obtaining, and may return the reference information of the open source code library or the code information of the open source code library, etc.

[0029] After receiving the open source code library corresponding to the development task information, the above execution entity may create and compile the open source code library corresponding to the development task information through the selected target compilation tool to generate a corresponding code configuration file. The code configuration file may include the open source code library and version information required by the application program, etc. If the target compilation tool is CocoaPods, the code configuration file may be a Podfile; if the target compilation tool is Easybox, the code configuration file may be a Boxfile.

[0030] Step 130: Based on the preset operations corresponding to the compilation tool, determine whether the target compilation tool meets the compilation conditions.

[0031] In this embodiment, after the above execution entity determines the target compilation tool for compiling the application program, it may perform information analysis on the target compilation tool to determine whether the target compilation tool has completed the preset operations corresponding to the compilation tool. The preset operations may represent operations in which multiple compilation tools can perform development compilation on the same open source code library and the same component information library on the same client, and may include operations such as deleting the project configuration files corresponding to the candidate compilation tools among the multiple compilation tools and installing the project configuration files of the multiple compilation tools in the same target project directory.

[0032] The above execution entity determines whether the target compilation tool meets the compilation conditions by judging whether the target compilation tool has completed the preset operations corresponding to the compilation tool. The compilation conditions can represent the conditions under which the target compilation tool can perform the compilation and development of the application program. That is, if the above execution entity determines that the target compilation tool has completed the preset operations corresponding to the compilation tool, it determines that the target compilation tool meets the compilation conditions and can perform the subsequent steps; if it determines that the target compilation tool has not completed the preset operations corresponding to the compilation tool, it determines that the target compilation tool does not meet the compilation conditions, and the target compilation tool needs to complete the preset operations first before it can perform the subsequent steps.

[0033] Step 140, in response to determining that the target compilation tool meets the compilation conditions, based on the component information corresponding to the development task information and the code configuration file, perform compilation and development through the target compilation tool to generate an application program.

[0034] In this embodiment, if the above execution entity determines that the target compilation tool meets the compilation conditions by judgment, it can send a request for obtaining component information to the server according to the development task information of the application program. The obtaining request includes the development task information of the application program. After receiving the obtaining request from the above execution entity, the server can return the component information corresponding to the development task information according to the development task information in the obtaining request, and can return the reference information of the component information, etc.

[0035] After the above execution entity receives the component information corresponding to the development task information, it can perform compilation and development on the component information corresponding to the development task information and the code configuration file through the selected target compilation tool. The above execution entity can use the target compilation tool to generate xcconfig (environment variables) by executing the install instruction, and generate build settings (build settings) for configuring the entire project, including search path, library path, etc. At the same time, two scripts will be generated and inserted into the Build Phases of the compilation, so that the above execution entity can obtain the project configuration file corresponding to the application program through the target compilation tool and generate the corresponding application program.

[0036] Continue to refer to Figure 2 , Figure 2 which is a schematic diagram of an application scenario of the application program compilation method according to this embodiment.

[0037] In Figure 2In the application scenario, the terminal 201 can display the development interface of the application program to the developer through the screen. The developer can fill in the development task information of the application program in the development interface. The development task information of the application program can include the name information and function information of the application program, etc. The terminal 201 can generate a compilation request for the application program based on the development task information of the application program, obtain the development task information of the application program, and select a target compilation tool from multiple compilation tools according to the selection operation of the developer. Then, the terminal 201 obtains the open source code library corresponding to the development task information from the server 202 based on the development task information, and creates a corresponding code configuration file through the target compilation tool. After that, the terminal 201 determines whether the target compilation tool meets the compilation conditions based on the preset operation corresponding to the compilation tool. If it is determined that the target compilation tool meets the compilation conditions, the terminal 201 can obtain the component information corresponding to the development task information from the server 202 based on the development task information, and perform compilation and development on the component information and the code configuration file through the target compilation tool to generate the application program.

[0038] The application program compilation method provided by the embodiment of the present disclosure selects a target compilation tool from multiple compilation tools in response to receiving a compilation request for the application program. The compilation request includes the development task information of the application program. Then, based on the open source code library corresponding to the development task information, a corresponding code configuration file is created through the target compilation tool, and it is determined whether the target compilation tool meets the compilation conditions based on the preset operation corresponding to the compilation tool. Finally, in response to determining that the target compilation tool meets the compilation conditions, compilation and development are performed through the target compilation tool based on the component information and the code configuration file corresponding to the development task information to generate the application program. For the same repository and the same project, multiple compilation chain configurations can be supported. Users can select the target compilation tool they need, which improves the compatibility of multiple compilation tools for the same code library and the same open source style library, thereby improving the flexibility and compatibility of project compilation. In addition, for projects that only use one compilation tool, the project configuration of another compilation tool can be referred to during the compilation process, which improves the open source version synchronization efficiency and eliminates the need to perform open source code adaptation work every time, improving the efficiency of application program compilation.

[0039] Reference Figure 3 , Figure 3 FIG. 300 shows a flowchart of another embodiment of the application program compilation method. The application program compilation method may include the following steps:

[0040] Step 310, in response to receiving a compilation request for the application program, select a target compilation tool from multiple compilation tools.

[0041] Step 310 of this embodiment may be in accordance with Figure 1The step 110 in the illustrated embodiment is executed in a similar manner and will not be elaborated here.

[0042] Step 320: Based on the open-source code library corresponding to the development task information, create a corresponding code configuration file through the target compilation tool.

[0043] The step 320 of this embodiment can be executed in a similar manner as Figure 1 the step 120 in the illustrated embodiment and will not be elaborated here.

[0044] Step 330: Detect whether the candidate compilation tool is used for the first time.

[0045] In this embodiment, after the above-mentioned execution entity selects the target compilation tool, it can analyze and judge the candidate compilation tools among multiple compilation tools to detect whether the candidate compilation tool is used for the first time. The above-mentioned execution entity can judge by checking the local storage information to detect whether the local storage information includes the files generated during the use of the candidate compilation tool. If there are files generated during the use of the candidate compilation tool, it is determined that the candidate compilation tool is not used for the first time. If there are no files generated during the use of the candidate compilation tool, it is determined that the candidate compilation tool has not been used and is used for the first time.

[0046] Step 340: In response to determining that the candidate compilation tool is not used for the first time, judge whether to delete the project configuration file corresponding to the candidate compilation tool to determine that the target compilation tool meets the compilation conditions.

[0047] In this embodiment, the above-mentioned execution entity detects through the local storage information that the candidate compilation tool is not used for the first time, and further analyzes the local storage information to determine whether it includes the project configuration file corresponding to the candidate compilation tool. This project configuration file can be a configuration file generated by the compilation tool during the compilation and development process, and judge whether to delete the project configuration file corresponding to the candidate compilation tool to determine that the target compilation tool meets the compilation conditions.

[0048] Step 350: In response to determining to delete the project configuration file corresponding to the candidate compilation tool, perform compilation and development through the target compilation tool based on the component information and the code configuration file corresponding to the development task information to generate an application program.

[0049] In this embodiment, the above-mentioned execution entity further analyzes the locally stored information and determines that it no longer includes the project configuration file corresponding to the candidate compilation tool, that is, determines to delete the project configuration file corresponding to the candidate compilation tool. If it can be determined that the target compilation tool meets the compilation conditions, a request for obtaining component information can be sent to the server according to the development task information of the application program, and the request for obtaining includes the development task information of the application program. After receiving the above-mentioned request for obtaining from the execution entity, the server can return the component information corresponding to the development task information according to the development task information in the request for obtaining, and can return the reference information of the component information, etc.

[0050] After receiving the component information corresponding to the development task information, the above-mentioned execution entity can compile and develop the component information and the code configuration file corresponding to the development task information through the selected target compilation tool. The above-mentioned execution entity can use the target compilation tool to generate xcconfig (environment variables) and build settings (build settings) for configuring the entire project by executing the install instruction, including search path, library path, etc. At the same time, two scripts will also be generated and inserted into the Build Phases of the compilation, so that the above-mentioned execution entity can obtain the project configuration file corresponding to the application program through the target compilation tool and generate the corresponding application program.

[0051] In this embodiment, by detecting and judging the candidate compilation tool, it is possible to ensure the deletion of the project configuration file of the candidate compilation tool before the target compilation tool executes the compilation and development process, which can ensure the normal use of the target compilation tool, thereby improving the compatibility of multiple compilation tools for the same code library and the same open-source style library. In addition, for a project that only uses one compilation tool, during the compilation process, the target compilation tool can also refer to the project configuration of the candidate compilation tool, which improves the open-source version synchronization efficiency and eliminates the need to perform open-source code adaptation work every time, thus improving the efficiency of application program compilation.

[0052] Reference Figure 4 , Figure 4 shows a flowchart 400 of an embodiment for generating an application program, that is, the above-mentioned step 350. In response to determining to delete the project configuration file corresponding to the candidate compilation tool, based on the component information corresponding to the development task information and the code configuration file, compile and develop through the target compilation tool to generate an application program, which may include the following steps:

[0053] Step 410, in response to determining that CocoaPods is not used for the first time, extract information from the project configuration file corresponding to CocoaPods to obtain the component workspace file, code configuration file, framework configuration file, and configuration file for the build phase generated by CocoaPods during compilation.

[0054] The above target compilation tool may include Easybox, and the above candidate compilation tool may include CocoaPods. Among them, the candidate compilation tool CocoaPods can generate project configuration files such as a code configuration file (Podfile file), a component workspace file (SwanAppDemo.workspace), a framework configuration file (Pods folder and Framework folder), and a configuration file for the build phase (Build Phases) during compilation.

[0055] In this embodiment, the above execution subject can determine by detection that CocoaPods is not used for the first time, extract information from the project configuration file corresponding to CocoaPods, analyze and extract the files in the project configuration file corresponding to CocoaPods that affect the normal use of the target compilation tool Easybox, and obtain that the candidate compilation tool CocoaPods can generate project configuration files such as a code configuration file (Podfile file), a component workspace file (SwanAppDemo.workspace), a framework configuration file (Pods folder and Framework folder), and a configuration file for the build phase (Build Phases) during compilation.

[0056] Among them, the code configuration file (Podfile file) may include Podfile.lock in the project folder (a Podfile lock file automatically generated by the candidate compilation tool CocoaPods for saving the versions of the installed Pods open source code libraries) and the Pods folder (the folder where all the open source code libraries automatically generated by the candidate compilation tool CocoaPods are located); the framework configuration file (Pods folder and Framework folder) may include the Pods folder and the Framework folder in the project folder (SwanAppDemo.project); the configuration file for the build phase (BuildPhases) may include Check Pods Manifest.lock (a script for configuring the project), Copy Pods Resources (a resource copy script), and Embeded Pods Frameworks (framework reference links) in the Build Phases option.

[0057] Step 420: Delete the component workspace file, code configuration file, framework configuration file, and configuration file in the build phase generated by CocoaPods during compilation.

[0058] In this embodiment, after the above-mentioned execution entity obtains the component workspace file, code configuration file, framework configuration file, and configuration file in the build phase generated by CocoaPods during compilation, it can delete the component workspace file, code configuration file, framework configuration file, and configuration file in the build phase generated by CocoaPods during compilation.

[0059] Step 430: In response to determining to delete the project configuration file corresponding to CocoaPods, based on the component information corresponding to the development task information and the code configuration file, perform compilation and development through Easybox to generate an application program.

[0060] In this embodiment, by deleting the component workspace file, code configuration file, framework configuration file, and configuration file in the build phase generated by CocoaPods during compilation, and determining to delete the project configuration file corresponding to CocoaPods, the above-mentioned execution entity can perform compilation and development on the component information and code configuration file corresponding to the development task information through Easybox. The above-mentioned execution entity can use Easybox to generate xcconfig (environment variables) and build settings (build settings) for configuring the entire project, including search path, library path, etc., by executing the install instruction. At the same time, two scripts will be generated and inserted into the BuildPhases of the compilation. Therefore, the above-mentioned execution entity can obtain the project configuration file corresponding to the application program through Easybox and generate the corresponding application program.

[0061] In this embodiment, by detecting and judging CocoaPods, it is possible to ensure the deletion of the project configuration file of CocoaPods before the compilation and development process of Easybox is executed, which can ensure the normal use of Easybox. Thus, the compatibility of multiple compilation tools for the same code library and the same open-source style library is improved. In addition, for projects that only use Easybox, during the compilation process, Easybox can also refer to the project configuration of CocoaPods, which improves the synchronization efficiency of the open-source version and eliminates the need to perform open-source code adaptation work every time, thereby improving the compilation efficiency of the application program.

[0062] Reference Figure 5 , Figure 5The flowchart 500 showing another embodiment of generating an application, that is, the above step 350, in response to determining to delete the project configuration file corresponding to the candidate compilation tool, based on the component information corresponding to the development task information and the code configuration file, performs compilation and development through the target compilation tool to generate an application, and may further include the following steps:

[0063] Step 510, in response to determining that Easybox is not used for the first time, extracts information from the project configuration file corresponding to Easybox to obtain the component workspace file, code configuration file, framework configuration file, and box configuration file in the project generated during the compilation of Easybox.

[0064] The above target compilation tool may include CocoaPods, and the above candidate compilation tool may include Easybox. Among them, the candidate compilation tool Easybox may generate project configuration files such as a code configuration file (boxfile file), a component workspace file (SwanAppDemo.workspace), a framework configuration file (resource copy script and Framework folder), and a box configuration file in the project (SwanAppDemo.Debug.xcconfig) during the compilation process.

[0065] In this embodiment, the above execution subject can determine by detection that Easybox is not used for the first time, extract information from the project configuration file corresponding to Easybox, analyze and extract the files in the project configuration file corresponding to Easybox that affect the normal use of the target compilation tool CocoaPods, and obtain that the candidate compilation tool Easybox may generate project configuration files such as a code configuration file (boxfile file), a component workspace file (SwanAppDemo.workspace), a framework configuration file (resource copy script and Framework folder), and a box configuration file in the project (SwanAppDemo.Debug.xcconfig) during the compilation process.

[0066] Among them, the code configuration file (boxfile file) may include an automatically generated.easybox folder (a file automatically generated by the candidate compilation tool Easybox for caching the open-source code library) and a.mgit folder (a git multi-repository management cache file relied on by the candidate compilation tool Easybox for saving git hook scripts and git logs, etc.); the framework configuration file (resource copy script and Framework folder) may include the resource copy script in the project folder (SwanAppDemo.project) and the frameworks reference link; the box configuration file (SwanAppDemo.Debug.xcconfig) in the project may include the box configuration in SwanAppDemo.project, such as SwanAppDemo.Debug.xcconfig and so on.

[0067] Step 520: Delete the component workspace file, code configuration file, framework configuration file, and the box configuration file in the project generated by Easybox during the compilation process.

[0068] In this embodiment, after the above execution entity obtains the component workspace file, code configuration file, framework configuration file, and the box configuration file in the project generated by Easybox during the compilation process, it may delete the component workspace file, code configuration file, framework configuration file, and the box configuration file in the project generated by Easybox during the compilation process.

[0069] Step 530: In response to determining to delete the project configuration file corresponding to Easybox, perform compilation and development through CocoaPods based on the component information corresponding to the development task information and the code configuration file to generate an application program.

[0070] In this embodiment, the above-mentioned execution entity deletes the project configuration file corresponding to Easybox based on the component information and code configuration file corresponding to the development task information, and determines to delete the project configuration file corresponding to Easybox. It can compile and develop the component information and code configuration file corresponding to the development task information through CocoaPods. The above-mentioned execution entity can use CocoaPods to generate xcconfig (environment variables) and build settings (build settings) for configuring the entire project, including search path, library path, etc. by executing the install instruction. At the same time, two scripts will be generated and inserted into the Build Phases of the compilation. Thus, the above-mentioned execution entity can obtain the project configuration file corresponding to the application through CocoaPods and generate the corresponding application.

[0071] In this embodiment, by detecting and judging Easybox, it is possible to ensure the deletion of the project configuration file of Easybox before the compilation and development process of CocoaPods is executed, which can ensure the normal use of CocoaPods. Thus, the compatibility of multiple compilation tools for the same code library and the same open-source style library is improved. Moreover, for projects that only use CocoaPods, during the compilation process, CocoaPods can also refer to the project configuration of Easybox, which improves the synchronization efficiency of the open-source version and eliminates the need to perform open-source code adaptation work every time, thereby improving the efficiency of application compilation.

[0072] Reference Figure 6 , Figure 6 shows a flowchart 600 of another embodiment of the application compilation method. The application compilation method may include the following steps:

[0073] Step 610, in response to receiving a compilation request for an application, select a target compilation tool from multiple compilation tools.

[0074] Step 610 of this embodiment can be executed in a manner similar to that of Figure 1 step 110 in the shown embodiment, and details are not described here.

[0075] Step 620, based on the open-source code library corresponding to the development task information, create a corresponding code configuration file through the target compilation tool.

[0076] Step 620 of this embodiment can be executed in a manner similar to that of Figure 1 step 120 in the shown embodiment, and details are not described here.

[0077] Step 630: Determine whether the project configuration files of multiple compilation tools are installed in the same target project directory to determine whether the target compilation tool meets the compilation conditions.

[0078] In this step, the preset operations of the compilation tool may also include installing the project configuration files of multiple compilation tools in the same target project directory. Then, the above-mentioned execution entity can analyze the installation locations of the project configuration files of multiple compilation tools to determine whether the project configuration files of multiple compilation tools are installed in the same target project directory, so as to determine whether the target compilation tool meets the compilation conditions.

[0079] The above-mentioned execution entity can analyze the installation locations of project configuration files such as the project files and component workspace files of multiple compilation tools to determine whether the project configuration files such as the project files and component workspace files of multiple compilation tools are installed in the same target project directory, so as to determine whether the target compilation tool meets the compilation conditions.

[0080] Step 640: In response to determining that the project configuration files of multiple compilation tools are installed in the same target project directory, select the project files and component workspace files corresponding to the target compilation tool in the target project directory.

[0081] In this step, after the above-mentioned execution entity determines through judgment that the project configuration files of multiple compilation tools are installed in the same target project directory, it can select the project files and component workspace files corresponding to the target compilation tool from this target project directory.

[0082] Step 650: Based on the project files corresponding to the target compilation tool, component workspace files, component information corresponding to the development task information, and code configuration files, perform compilation and development through the target compilation tool to generate an application program.

[0083] In this step, after the above-mentioned execution entity selects the project files and component workspace files corresponding to the target compilation tool from this target project directory, it can perform compilation and development on the component information and code configuration files corresponding to the development task information by using the corresponding project files and component workspace files through the target compilation tool. The above-mentioned execution entity can use the target compilation tool to generate xcconfig (environment variables) and build settings (build settings) for configuring the entire project by executing the install instruction, including search path, library path, etc. At the same time, two scripts will also be generated and inserted into the Build Phases of the compilation. Thus, the above-mentioned execution entity can obtain the project configuration files corresponding to the application program through the target compilation tool and generate the corresponding application program.

[0084] In this embodiment, by detecting and judging the configuration files of multiple compilation tools, it is possible to ensure that the project configuration files of multiple compilation tools are installed in the same target project directory before the target compilation tool executes the compilation and development process, which can ensure the normal use of the target compilation tool, thereby improving the compatibility of multiple compilation tools for the same code library and the same open-source style library. Moreover, for a project that only uses one compilation tool, during the compilation process, the target compilation tool can also refer to the project configuration of the candidate compilation tool, which improves the open-source version synchronization efficiency and eliminates the need to perform open-source code adaptation work every time, thus improving the efficiency of application compilation.

[0085] Further referring to Figure 7 , as an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of an application compilation device. This device embodiment corresponds to Figure 1 the method embodiment shown, and this device can be specifically applied to various electronic devices.

[0086] As Figure 7 shown, the application compilation device 700 in this embodiment includes: a selection module 710, a creation module 720, a determination module 730, and a generation module 740.

[0087] Among them, the selection module 710 is configured to select a target compilation tool from multiple compilation tools in response to receiving a compilation request for an application, where the compilation request includes the development task information of the application;

[0088] The creation module 720 is configured to create a corresponding code configuration file through the target compilation tool based on the open-source code library corresponding to the development task information;

[0089] The determination module 730 is configured to determine whether the target compilation tool meets the compilation conditions based on the preset operations corresponding to the compilation tool;

[0090] The generation module 740 is configured to, in response to determining that the target compilation tool meets the compilation conditions, perform compilation and development through the target compilation tool based on the component information corresponding to the development task information and the code configuration file to generate an application.

[0091] In some alternative ways of this embodiment, the preset operation includes deleting the project configuration file corresponding to the candidate compilation tool among multiple compilation tools; and, the determination module is further configured to: detect whether the candidate compilation tool is used for the first time; in response to determining that the candidate compilation tool is not used for the first time, determine whether to delete the project configuration file corresponding to the candidate compilation tool to determine that the target compilation tool meets the compilation conditions; and, the generation module is further configured to: in response to determining to delete the project configuration file corresponding to the candidate compilation tool, perform compilation and development through the target compilation tool based on the component information and the code configuration file corresponding to the development task information, and generate an application program.

[0092] In some alternative ways of this embodiment, the target compilation tool includes Easybox; the candidate compilation tool includes CocoaPods; and, the generation module is further configured to: in response to determining that CocoaPods is not used for the first time, extract information from the project configuration file corresponding to CocoaPods to obtain the component workspace file, code configuration file, framework configuration file, and the configuration file in the build phase generated by CocoaPods during compilation; delete the component workspace file, code configuration file, framework configuration file, and the configuration file in the build phase generated by CocoaPods during compilation; in response to determining to delete the project configuration file corresponding to CocoaPods, perform compilation and development through Easybox based on the component information and the code configuration file corresponding to the development task information, and generate an application program.

[0093] In some alternative ways of this embodiment, the target compilation tool includes CocoaPods; the candidate compilation tool includes Easybox; and, the generation module is further configured to: in response to determining that Easybox is not used for the first time, extract information from the project configuration file corresponding to Easybox to obtain the component workspace file, code configuration file, framework configuration file, and the box configuration file in the project generated by Easybox during compilation; delete the component workspace file, code configuration file, framework configuration file, and the box configuration file in the project generated by Easybox during compilation; in response to determining to delete the project configuration file corresponding to Easybox, perform compilation and development through CocoaPods based on the component information and the code configuration file corresponding to the development task information, and generate an application program.

[0094] In some alternative embodiments of the present embodiment, the preset operation further includes installing the project configuration files of multiple compilation tools in the same target project directory; and, the determination module is further configured to: determine whether the project configuration files of multiple compilation tools are installed in the same target project directory to determine whether the target compilation tool meets the compilation conditions; and, the generation module is further configured to: in response to determining that the project configuration files of multiple compilation tools are installed in the same target project directory, select the project file and the component workspace file corresponding to the target compilation tool in the target project directory; and based on the project file corresponding to the target compilation tool, the component workspace file, the component information corresponding to the development task information, and the code configuration file, perform compilation and development through the target compilation tool to generate an application program.

[0095] The application program compilation device provided by the embodiment of the present disclosure selects a target compilation tool from multiple compilation tools in response to receiving a compilation request for an application program. The compilation request includes the development task information of the application program. Then, based on the open source code library corresponding to the development task information, a corresponding code configuration file is created through the target compilation tool, and based on the preset operation corresponding to the compilation tool, it is determined whether the target compilation tool meets the compilation conditions. Finally, in response to determining that the target compilation tool meets the compilation conditions, based on the component information corresponding to the development task information and the code configuration file, compilation and development are performed through the target compilation tool to generate an application program. It can support multiple compilation chain configurations for the same repository and the same project. Users can select the required target compilation tool, which improves the compatibility of multiple compilation tools for the same code library and the same open source style library, thereby improving the flexibility and compatibility of project compilation. Also, for a project that only uses one compilation tool, the project configuration of another compilation tool can be referred to during the compilation process, which improves the synchronization efficiency of the open source version and eliminates the need to perform open source code adaptation work each time, thus improving the efficiency of application program compilation.

[0096] Those skilled in the art can understand that the above device also includes some other well-known structures, such as a processor, a memory, etc. To avoid unnecessarily obscuring the embodiments of the present disclosure, these well-known structures are not shown in Figure 7 It is not shown.

[0097] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision, and disclosure of the user's personal information involved all comply with the provisions of relevant laws and regulations and do not violate public order and good customs.

[0098] According to the embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0099] Figure 8FIG. shows a schematic block diagram of an exemplary electronic device 800 that can be used to implement embodiments of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as, for example, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, for example, personal digital processors, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely exemplary and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0100] As Figure 8 shown, the electronic device 800 includes a computing unit 801 that can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0101] A plurality of components in the electronic device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a magnetic disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0102] The computing unit 801 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 executes the various methods and processes described above, such as the application compilation method. For example, in some embodiments, the application compilation method can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the application compilation method described above can be executed. Alternatively, in other embodiments, the computing unit 801 can be configured to execute the application compilation method in any other suitable manner (e.g., by means of firmware).

[0103] Various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuitry, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special or general-purpose programmable processor that receives data and instructions from a storage system, at least one input device, and at least one output device, and transmits the data and instructions to the storage system, the at least one input device, and the at least one output device.

[0104] The program code for implementing the methods of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the program codes are executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0105] In the context of this disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0106] For purposes of providing an interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can also be used to provide for interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic, speech, or tactile input).

[0107] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of a communication network include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0108] A computer system can include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, a server of a distributed system, or a server incorporating a blockchain.

[0109] It should be understood that the various forms of processes shown above can be used, with steps reordered, added or deleted. For example, the steps described in the present disclosure can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution disclosed in the present disclosure can be achieved, and no limitation is imposed herein.

[0110] The above specific embodiments do not constitute a limitation on the protection scope of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub - combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure shall be included within the protection scope of the present disclosure.

Claims

1. An application compilation method, comprising: Responding to receiving a compilation request for an application, selecting a target compilation tool from multiple compilation tools, wherein the compilation request includes development task information of the application; Based on the open source code library corresponding to the development task information, creating a corresponding code configuration file through the target compilation tool; Based on a preset operation corresponding to the compilation tool, determining whether the target compilation tool meets the compilation conditions, the preset operation includes deleting the project configuration file corresponding to a candidate compilation tool in the multiple compilation tools, the candidate compilation tool being a compilation tool other than the target compilation tool in the multiple compilation tools, including: detecting whether the candidate compilation tool is used for the first time; responding to determining that the candidate compilation tool is not used for the first time, determining whether to delete the project configuration file corresponding to the candidate compilation tool to determine that the target compilation tool meets the compilation conditions; Responding to determining that the target compilation tool meets the compilation conditions, based on the component information corresponding to the development task information and the code configuration file, performing compilation and development through the target compilation tool to generate the application.

2. The method according to claim 1, wherein The step of responding to determining that the target compilation tool meets the compilation conditions, based on the component information corresponding to the development task information and the code configuration file, performing compilation and development through the target compilation tool to generate the application, includes: Responding to determining to delete the project configuration file corresponding to the candidate compilation tool, based on the component information corresponding to the development task information and the code configuration file, performing compilation and development through the target compilation tool to generate the application.

3. The method according to claim 2, wherein, The target compilation tool includes Easybox; the candidate compilation tool includes CocoaPods; And, The step of responding to determining to delete the project configuration file corresponding to the candidate compilation tool, based on the component information corresponding to the development task information and the code configuration file, performing compilation and development through the target compilation tool to generate the application, includes: Responding to determining that CocoaPods is not used for the first time, extracting information from the project configuration file corresponding to CocoaPods to obtain the component workspace file, code configuration file, framework configuration file, and configuration file in the build phase generated by CocoaPods during compilation; Deleting the component workspace file, code configuration file, framework configuration file, and configuration file in the build phase generated by CocoaPods during compilation; Responding to determining to delete the project configuration file corresponding to CocoaPods, based on the component information corresponding to the development task information and the code configuration file, performing compilation and development through Easybox to generate the application.

4. The method according to claim 2, wherein, The target compilation tool includes CocoaPods; the candidate compilation tool includes Easybox; And, In response to determining to delete the project configuration file corresponding to the candidate compilation tool, based on the component information corresponding to the development task information and the code configuration file, compile and develop through the target compilation tool to generate the application program, including: In response to determining that the Easybox is not used for the first time, extract information from the project configuration file corresponding to the Easybox to obtain the component workspace file, code configuration file, framework configuration file, and box configuration file in the project generated during the compilation of the Easybox; Delete the component workspace file, code configuration file, framework configuration file, and box configuration file in the project generated during the compilation of the Easybox; In response to determining to delete the project configuration file corresponding to the Easybox, based on the component information corresponding to the development task information and the code configuration file, compile and develop through the CocoaPods to generate the application program.

5. The method according to claim 1, wherein, The preset operation further includes installing the project configuration files of the multiple compilation tools in the same target project directory; And, Based on the preset operation corresponding to the compilation tool, determine whether the target compilation tool meets the compilation conditions, including: Judge whether the project configuration files of the multiple compilation tools are installed in the same target project directory to determine that the target compilation tool meets the compilation conditions.

6. The method according to claim 5, wherein In response to determining that the target compilation tool meets the compilation conditions, based on the component information corresponding to the development task information and the code configuration file, compile and develop through the target compilation tool to generate the application program, including: In response to determining that the project configuration files of the multiple compilation tools are installed in the same target project directory, select the project file and component workspace file corresponding to the target compilation tool in the target project directory; Based on the project file corresponding to the target compilation tool, the component workspace file, the component information corresponding to the development task information, and the code configuration file, compile and develop through the target compilation tool to generate the application program.

7. An application program compilation device, including: A selection module, configured to select a target compilation tool from multiple compilation tools in response to receiving a compilation request for an application program, where the compilation request includes the development task information of the application program; A creation module, configured to create a corresponding code configuration file through the target compilation tool based on the open source code library corresponding to the development task information; A determination module, configured to determine whether the target compilation tool meets the compilation conditions based on a preset operation corresponding to the compilation tool. The preset operation includes deleting the project configuration file corresponding to the candidate compilation tool among the multiple compilation tools. The candidate compilation tool is a compilation tool other than the target compilation tool among the multiple compilation tools, and includes: detecting whether the candidate compilation tool is used for the first time; in response to determining that the candidate compilation tool is not used for the first time, determining whether to delete the project configuration file corresponding to the candidate compilation tool to determine that the target compilation tool meets the compilation conditions; A generation module, configured to, in response to determining that the target compilation tool meets the compilation conditions, perform compilation and development through the target compilation tool based on the component information corresponding to the development task information and the code configuration file, and generate the application program.

8. The apparatus according to claim 7, wherein The generation module is further configured to: in response to determining to delete the project configuration file corresponding to the candidate compilation tool, perform compilation and development through the target compilation tool based on the component information corresponding to the development task information and the code configuration file, and generate the application program.

9. The apparatus according to claim 8, wherein, The target compilation tool includes Easybox; the candidate compilation tool includes CocoaPods; and, The generation module is further configured to: in response to determining that CocoaPods is not used for the first time, extract information from the project configuration file corresponding to CocoaPods to obtain the component workspace file, code configuration file, framework configuration file, and configuration file in the build phase generated by CocoaPods during compilation; delete the component workspace file, code configuration file, framework configuration file, and configuration file in the build phase generated by CocoaPods during compilation; in response to determining to delete the project configuration file corresponding to CocoaPods, perform compilation and development through Easybox based on the component information corresponding to the development task information and the code configuration file, and generate the application program.

10. The apparatus according to claim 8, wherein, The target compilation tool includes CocoaPods; the candidate compilation tool includes Easybox; and, The generation module is further configured to: in response to determining that Easybox is not used for the first time, extract information from the project configuration file corresponding to Easybox to obtain the component workspace file, code configuration file, framework configuration file, and box configuration file in the project generated by Easybox during compilation; Delete the component workspace file, code configuration file, framework configuration file, and box configuration file in the project generated by Easybox during compilation; In response to determining to delete the project configuration file corresponding to Easybox, perform compilation and development through CocoaPods based on the component information corresponding to the development task information and the code configuration file, and generate the application program.

11. The device according to claim 7, wherein, The preset operation further includes installing the project configuration files of the multiple compilation tools in the same target project directory; and, The determining module is further configured to: determine whether the project configuration files of the multiple compilation tools are installed in the same target project directory to determine whether the target compilation tool meets the compilation conditions.

12. The apparatus according to claim 11, wherein The generating module is further configured to: in response to determining that the project configuration files of the multiple compilation tools are installed in the same target project directory, select the project file and the component workspace file corresponding to the target compilation tool in the target project directory; Based on the project file corresponding to the target compilation tool, the component workspace file, the component information corresponding to the development task information, and the code configuration file, perform compilation and development through the target compilation tool to generate the application program.

13. An electronic device, comprising: At least one processor; And A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method according to any one of claims 1-6.

14. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to execute the method according to any one of claims 1-6.

15. A computer program product, comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, the steps of the method according to claim 1 are implemented.

Citation Information

Patent Citations

  • Target engineering compiling method, device and apparatus

    CN110377290A

  • Application program compiling method and device, electronic equipment and storage medium

    CN114168150A