Application construction method, system, electronic device and storage medium
By building a central configuration repository to manage dependency version mappings and automating the download of dependency packages for different terminal types, the maintenance and stability issues in building multi-terminal applications are resolved. This achieves unified dependency management and automated distribution, improving the reliability and efficiency of application building.
Patent Information
- Application Number
- CN202511686148.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-18
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2045-11-18
AI Technical Summary
When developing applications in parallel across multiple terminal types, existing technologies lack unified dependency management, resulting in poor maintainability and stability of application builds, high maintenance costs, and difficulties in synchronizing dependency versions.
By building a central configuration repository to manage dependency version mappings, automatically querying and injecting target dependency coordinates based on terminal type identifiers, and dynamically downloading and compiling application installation packages, unified dependency management and automated distribution are achieved.
It improves the maintainability and stability of application builds, reduces maintenance costs, and ensures consistency of dependency versions and system compatibility.
Smart Images

Figure CN121143829B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of software development technology, and in particular to an application building method, system, electronic device and storage medium. Background Technology
[0002] As software systems become increasingly complex, terminal applications are typically developed based on a unified platform codebase, while each application can be adapted to different types of terminals through differentiated configurations. Especially in development models involving multiple product lines, multiple customer customizations, and multiple regional deployments, different build variants of applications may require relying on different versions of third-party libraries, security components, or authentication modules to meet the functionalities and requirements of specific deployment terminals. For example, when building applications for different customers, different regions, or different vehicle models, it is necessary to integrate specific versions of encryption components or identity authentication libraries to adapt to the security policies or regulatory requirements of the corresponding backend services.
[0003] In related technologies, each application on a terminal manually imports the corresponding version of the dependency package in its build configuration according to the terminal type. When a new dependency package is added or the dependency version of a certain type of terminal is updated, the application developer needs to manually modify the dependency configuration of all terminal applications adapted to that terminal type and recompile and republish. However, this approach has the problem of high application maintenance costs, and the synchronization of dependency versions among terminal applications is difficult and easily overlooked, making it difficult to adapt to the actual needs of parallel development of multiple applications under multiple terminal types. Summary of the Invention
[0004] This application discloses an application building method, system, electronic device, and storage medium to solve the technical problem of poor maintainability and stability of application building caused by the lack of unified dependency management when multiple applications are developed in parallel under multiple terminal types.
[0005] This application provides an application building method, the method comprising: obtaining a type identifier of a deployment terminal corresponding to an application to be built, wherein the application to be built is at least one; calling a pre-built central configuration library, and querying the corresponding target dependency coordinates from a dependency version mapping relationship according to the type identifier, wherein the central configuration library manages the dependency version mapping relationship, and the dependency version mapping relationship includes the correspondence between different type identifiers and dependency coordinates; injecting the target dependency coordinates into the dependency manager of the application to be built, and downloading the target dependency package corresponding to the type identifier based on the injected target dependency coordinates; and compiling an application installation package adapted to the deployment terminal according to the target dependency package, thereby completing the building of the application to be built.
[0006] In one embodiment of this application, the step of calling a pre-built central configuration library and querying the corresponding target dependency coordinates from the dependency version mapping relationship based on the type identifier includes: introducing a dependency configuration script into the build configuration script of the application to be built, wherein the dependency configuration script is published by the central configuration library and encapsulates the dependency version mapping relationship and the central configuration interface; executing the dependency configuration script, passing the type identifier as an input parameter to the central configuration interface, thereby querying the target dependency coordinates corresponding to the type identifier from the dependency version mapping relationship.
[0007] In one embodiment of this application, the implementation of the central configuration interface includes: defining a private configuration interface in the central configuration library, wherein the input parameters of the private configuration interface include dependency management instance parameters and identifier parameters; integrating the dependency version mapping relationship into the execution logic of the private configuration interface, and encapsulating the integrated private configuration interface into the central configuration interface.
[0008] In one embodiment of this application, injecting the target dependency coordinates into the dependency manager of the application to be built includes: passing the dependency manager as an input parameter to a central configuration interface, wherein the dependency manager provides a dependency injection method, and the central configuration interface is provided by the central configuration library; and calling the dependency injection method in the central configuration interface to inject the target dependency coordinates into the dependency manager.
[0009] In one embodiment of this application, after calling the pre-built central configuration library, the method further includes: if the target dependency coordinates corresponding to the type identifier are not found, injecting the default dependency coordinates corresponding to the type identifier into the dependency manager, and performing the build operation of the application to be built according to the default dependency coordinates; associating the type identifier and the corresponding target dependency coordinates in the dependency version mapping relationship, so that in the subsequent build operation of the application to be built, the corresponding target dependency coordinates can be found according to the type identifier.
[0010] In one embodiment of this application, the management of the dependency version mapping relationship includes: in response to a dependency package release event, associating the type identifier corresponding to the newly added dependency package with the dependency coordinates and writing it into the dependency version mapping relationship; and / or in response to a dependency package version update event, updating the original dependency coordinates of the updated dependency package in the dependency version mapping relationship to the corresponding new dependency coordinates.
[0011] In one embodiment of this application, obtaining the type identifier corresponding to the application to be built includes: responding to the build instruction of the application to be built, parsing the tasks to be executed in the build instruction, and generating a task name list; traversing the task name list, identifying target task names in the task name list that conform to a preset format, and extracting the type identifier from the target task names.
[0012] This application also provides an application building system, the system comprising: an acquisition module, configured to acquire a type identifier corresponding to an application to be built, wherein the application to be built is at least one; a matching module, configured to call a pre-built central configuration library, and query the corresponding target dependency coordinates from a dependency version mapping relationship according to the type identifier, wherein the central configuration library manages the dependency version mapping relationship, and the dependency version mapping relationship includes the correspondence between different type identifiers and dependency coordinates; a download module, configured to inject the target dependency coordinates into the dependency manager of the application to be built, and download the target dependency package corresponding to the type identifier based on the injected target dependency coordinates; and a build module, configured to compile an application installation package adapted to the terminal type corresponding to the type identifier according to the target dependency package, thereby completing the building of the application to be built.
[0013] This application also provides an electronic device, including: a processor; and a storage device for storing a program, which, when executed by the processor, causes the electronic device to implement the application building method described above.
[0014] This application also provides a computer storage medium storing a computer program that, when executed by a computer's processor, causes the computer to perform the application building method described above.
[0015] The beneficial effects of this application are as follows: This application provides an application building method, system, electronic device, and storage medium. First, it obtains the type identifier of the deployment terminal corresponding to the application to be built. There are at least one application to be built. Then, it calls a pre-built central configuration library and queries the corresponding target dependency coordinates from the dependency version mapping relationship according to the type identifier. The central configuration library manages the dependency version mapping relationship, which includes the correspondence between different type identifiers and dependency coordinates. Then, it injects the target dependency coordinates into the dependency manager of the application to be built and downloads the target dependency package corresponding to the type identifier based on the injected target dependency coordinates. Finally, it compiles an application installation package adapted to the deployment terminal based on the target dependency package, thus completing the construction of the application to be built. By building a central configuration library, it centrally manages the dependency version mapping relationship between different terminal types and corresponding dependency packages. In the scenario of parallel development of multiple applications and multiple terminal types, it integrates a unified dependency management mechanism, which can automatically match the corresponding dependency coordinates according to the type identifier of the deployment terminal and dynamically download the corresponding dependency package to complete the application construction. It realizes the unified maintenance and automated, seamless distribution of dependency packages, effectively improving the maintainability and stability of application construction. Attached Figure Description
[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0017] In the attached diagram:
[0018] Figure 1 It is a flowchart of a construction method applied in existing technology;
[0019] Figure 2 This is a schematic diagram illustrating the implementation environment of an application building system, as shown in an exemplary embodiment of this application.
[0020] Figure 3 This is a flowchart illustrating an application construction method in an exemplary embodiment of this application;
[0021] Figure 4 This is a flowchart illustrating a specific application construction method in an exemplary embodiment of this application;
[0022] Figure 5 This is a flowchart illustrating another specific application construction method as shown in an exemplary embodiment of this application;
[0023] Figure 6This is a block diagram illustrating an application building system as shown in an exemplary embodiment of this application;
[0024] Figure 7 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this application. Detailed Implementation
[0025] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0026] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this application. The drawings only show the components related to this application and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0027] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the present application. However, it will be apparent to those skilled in the art that embodiments of the present application may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the present application.
[0028] As software systems become increasingly complex, terminal applications are typically developed based on a unified platform codebase, allowing each application to adapt to different terminal types through differentiated configurations. However, the inventors of this application have discovered that when terminal applications manually import the corresponding version of dependency packages in their build configurations based on the terminal type, and a new dependency package is added or the dependency version for a certain terminal type is updated, application developers need to manually modify the dependency configurations of all terminal applications adapted to that terminal type and recompile and release them. This approach results in high application maintenance costs, and the synchronization of dependency versions among terminal applications is difficult and prone to omissions, making it difficult to meet the actual needs of parallel development of multiple applications across multiple terminal types.
[0029] Please see Figure 1 , Figure 1 This is a flowchart illustrating the application of a construction method in existing technology. For example... Figure 1As shown, taking in-vehicle applications as an example, the application building method in this existing technology is as follows: Each time a new vehicle model dependency package is released or an existing vehicle model dependency package is updated, dependency package developers write the dependency package according to the platform vehicle model and release the dependency package version to a remote dependency repository. Then, the relevant application developers are notified through the business group, and the application developers manually add or update the corresponding dependency package version. The build engine then downloads the corresponding dependency package from the dependency repository and integrates it to obtain the application installation package. This dependency management and application building process highly relies on the proactive response and execution of developers in each team, lacking a unified dependency management mechanism and automated building methods. This model has a significant risk of human error, easily leading to situations where some applications are not upgraded in time or even remain on older versions for extended periods. This results in inconsistent dependency versions between different applications, and dependency version fragmentation not only causes system compatibility issues but may also trigger functional abnormalities, interface call failures, or potential malfunctions. Furthermore, with the continuous growth in the number of vehicle models and applications, the maintenance cost and coordination difficulty of this model will increase significantly, hindering long-term sustainable iteration and efficient collaboration.
[0030] Therefore, please see Figure 2 , Figure 2 This is a schematic diagram illustrating an implementation environment of an application building system, as shown in an exemplary embodiment of this application. Figure 2 As shown, the implementation environment may include an application build system 210 and a computer device 220. The application build system 210 can be located within the computer device 220 for application building. The computer device 220 can be at least one of a desktop graphics processing unit (GPU) computer, a GPU computing cluster, or a neural network computer. The application build system 210, by building a central configuration library, centrally manages the dependency version mapping relationship between different terminal types and their corresponding dependency packages. In scenarios involving parallel development of multiple applications and multiple terminal types, it integrates a unified dependency management mechanism, which can automatically match the corresponding dependency coordinates based on the type identifier of the deployed terminal and dynamically download the corresponding dependency package to complete the application build. This achieves unified maintenance and automated, seamless distribution of dependency packages, effectively improving the maintainability and stability of application building.
[0031] Please see Figure 3 , Figure 3 This is a flowchart illustrating an exemplary embodiment of an application construction method. This method can be applied to... Figure 2 The implementation environment shown is specifically executed by the application building system 210 within that implementation environment. It should be understood that this method can also be applied to other exemplary implementation environments and executed by devices in other implementation environments; this embodiment does not limit the implementation environment to which the method is applicable.
[0032] like Figure 3 As shown, in an exemplary embodiment, the application construction method includes at least steps S310 to S340, which are described in detail below:
[0033] Step S310: Obtain the type identifier of the deployment terminal corresponding to the application to be built, wherein the application to be built is at least one.
[0034] Step S320: Call the pre-built central configuration library, and query the corresponding target dependency coordinates from the dependency version mapping relationship according to the type identifier. The central configuration library manages the dependency version mapping relationship, which includes the correspondence between different type identifiers and dependency coordinates.
[0035] Step S330: Inject the target dependency coordinates into the dependency manager of the application to be built, and download the target dependency package corresponding to the type identifier based on the injected target dependency coordinates.
[0036] Step S340: Compile an application installation package adapted to the deployment terminal based on the target dependency package to complete the construction of the application to be built.
[0037] The type identifier is used to characterize the terminal type of the deployment terminal corresponding to the application to be built; there is at least one application to be built, and when there are multiple applications to be built, the multiple applications to be built can be applications deployed under the same terminal type or applications deployed under different terminal types; the dependency coordinates refer to the metadata combination that uniquely identifies a dependency package, which may include the version number of the dependency package, the type identifier of the deployment terminal, and the address of the dependency package; the dependency manager refers to the component responsible for parsing, managing, and downloading application dependencies in the application build; the dependency package refers to the external code library or module required in the application build, which is pre-written and packaged by the developers.
[0038] In step S310, there can be one or more applications to be built. The type identifier of the deployment terminal corresponding to the application to be built is obtained, which aims to identify the deployment terminal type of at least one application that needs to be built so as to match the corresponding target dependency coordinates.
[0039] In step S320, after obtaining the type identifier of the deployment terminal, the central configuration library is called. Based on the obtained type identifier, the corresponding dependency coordinates are searched in the unified management and maintenance dependency version mapping relationship. If multiple applications to be built are applications deployed under the same terminal type, they correspond to the same target dependency coordinates. If they are applications deployed under different terminal types, they each correspond to a target dependency coordinate.
[0040] In step S330, the target dependency coordinates obtained from the query are passed to the dependency manager of the application to be built so as to register the target dependency coordinates to the build context of the application to be built. After the target dependency coordinates are successfully injected, the dependency resolution process is triggered. Based on the target dependency coordinates, the corresponding target dependency package is downloaded from the remote dependency repository to the local cache to ensure that each application can accurately obtain the dependency version that matches its terminal type during the build process.
[0041] In step S340, after obtaining the target dependency package of the application to be built, the compilation stage is entered, that is, the source code and the target dependency package are compiled and packaged together to generate the final application installation package. Since the dependency package has been accurately matched according to the terminal type, the generated installation package has functional adaptability and compatibility with the terminal environment.
[0042] In this embodiment, a central configuration library is built to centrally manage the dependency version mapping relationship between different terminal types and corresponding dependency packages. In the scenario of parallel development of multiple applications and multiple terminal types, a unified dependency management mechanism is integrated. It can automatically match the corresponding dependency coordinates according to the type identifier of the deployed terminal for dynamic injection and download the corresponding dependency package to complete the application construction. This realizes the unified maintenance and automated, seamless distribution of dependency packages, effectively improving the maintainability and stability of application construction.
[0043] In addition, by using a unified dependency management mechanism, dependency decision-making logic is separated from the application side, enabling centralized release, on-demand loading, and seamless dynamic injection of dependency configurations. This significantly improves the automation level, accuracy, and maintenance efficiency of application building across multiple terminal types, especially when dependency packages are frequently iterated or extremely unstable in the early stages.
[0044] For example, in scenarios where multiple application dependency versions need unified management, such as building differentiated application products for different customers, regions, business lines (enterprise version, personal version, overseas version, government-specific version), and vehicle models, applications deployed in different terminal environments of different customers, regions, business lines, or vehicle models can all be defined as deployed on different terminal types. A central configuration repository centrally manages the mapping relationship between the required dependency packages and dependency coordinates for each terminal type. This means that by using type identifiers (such as customer identity identifiers, region codes, product line names, and vehicle model identifiers), the configuration can be automatically queried and the precisely matching dependency packages downloaded to complete the construction of each application.
[0045] Furthermore, the operating systems for various types of terminals include, but are not limited to, the Android operating system (a free and open-source mobile operating system based on the Linux kernel, i.e., the open-source computer operating system kernel). This application is also applicable to the construction of terminal applications under other operating systems. Taking the construction of applications in the Android operating system as an example, the construction process may involve Gradle (an open-source tool for automated project construction based on Apache Maven, i.e., a project management and automated build tool concept), SDK (a collection of development tools for building application software for specific software packages, software frameworks, hardware platforms, operating systems, etc.), AAR files (a binary archive file for Android library projects), Maven repositories (a centralized storage system for storing and managing Java (a programming language) project dependency libraries), Git repositories (an open-source distributed version control system that can effectively and quickly handle version management of projects ranging from very small to very large), and APK (an application package file format used by the Android operating system for distributing and installing mobile applications and middleware).
[0046] Please see Figure 4 , Figure 4 This is a flowchart illustrating a specific application construction method as shown in an exemplary embodiment of this application. For example... Figure 4 As shown, the componentized hierarchical structure throughout the application building process includes the application project layer, the build engine layer, the central configuration layer, and the resource repository layer. The application project layer carries the business logic and functional implementation for various terminal types. This layer does not contain any hard-coded dependency package version configurations; it only accesses the central configuration mechanism through a unified build script. During application building, the application triggers the corresponding dependency loading logic by passing in the terminal type identifier, achieving seamless dependency injection. The build engine layer integrates custom build logic, i.e., the build engine, which dynamically resolves dependencies based on type identifiers during the build process. By introducing the central configuration script, it automatically retrieves the required dependency packages for the corresponding terminal type from the central configuration repository during application building and completes the download and integration of these dependency packages. The central configuration layer is the core control hub, uniformly managing the dependency version mapping relationship between type identifiers and dependency coordinates. The dependency version mapping relationship is stored in a structured form in an independent repository, supporting version and branch control. During application building, this layer is called to dynamically obtain the target dependency coordinates. The resource repository layer is the storage center for dependency package versions, centrally storing all secondary compatibility and adaptation dependency packages corresponding to all terminal types, and classifying and managing them according to terminal type and version.
[0047] Please continue reading Figure 4Taking in-vehicle applications as an example, developers develop and configure dependency packages adapted to various car models, which are stored in a dependency repository. They also configure the car model identifier / dependency coordinate mapping relationship, which is managed through a central configuration library. During application building, the application project provides a car model identifier and, through the build engine, dynamically queries and injects target dependency coordinates from the central configuration library based on the car model identifier. Then, based on the injected target dependency coordinates, the corresponding target dependency package is downloaded from the dependency repository. Finally, an application installation package adapted to different car models is generated based on the downloaded target dependency package.
[0048] In one embodiment, the process involves invoking a pre-built central configuration library and querying the corresponding target dependency coordinates from the dependency version mapping relationship based on the type identifier. This includes: introducing a dependency configuration script into the build configuration script of the application to be built, wherein the dependency configuration script is published by the central configuration library and encapsulates the dependency version mapping relationship and the central configuration interface; executing the dependency configuration script and passing the type identifier as an input parameter to the central configuration interface to query the target dependency coordinates corresponding to the type identifier from the dependency version mapping relationship.
[0049] Among them, the dependency configuration script can be implemented through the external script import mechanism.
[0050] In this embodiment, the query logic for dependency version mapping is decoupled from the application side through automated integration at the script level, realizing centralized management of dependency query logic. The application side only needs to import the dependency configuration script to complete the automated integration, which improves the reusability and maintainability of the build script and avoids configuration errors caused by manual modification. When the dependency version changes, only the mapping relationship in the central configuration library needs to be updated. All application projects that reference this configuration can automatically obtain the latest version in the next build, which significantly reduces the maintenance cost of application build and improves the stability of application build.
[0051] In one embodiment, the implementation of the central configuration interface includes: defining a private configuration interface in the central configuration library, wherein the input parameters of the private configuration interface include dependency management instance parameters and identification parameters; integrating the dependency version mapping relationship into the execution logic of the private configuration interface; and encapsulating the integrated private configuration interface into the central configuration interface.
[0052] The private configuration interface can be represented as pkiConfigDependenciesForBuildType(depHandler, buildType), where depHandler and buildType are two input parameters. The depHandler parameter represents the dependency management instance parameter, and the buildType parameter represents the identifier parameter. The central configuration interface can be represented as configPkiDependenciesForBuildType.
[0053] In this embodiment, by defining a standardized private configuration interface and integrating dependency version mapping relationships, the dependency coordinate query logic is centrally encapsulated to realize a central configuration interface, thereby achieving unified release and global management of dependencies.
[0054] In one embodiment, injecting the target dependency coordinates into the dependency manager of the application to be built includes: passing the dependency manager as an input parameter to a central configuration interface, wherein the dependency manager provides a dependency injection method, and the central configuration interface is provided by a central configuration library; and calling the dependency injection method in the central configuration interface to inject the target dependency coordinates into the dependency manager.
[0055] In this embodiment, the automatic injection of dependency coordinates is achieved through a standardized interface, avoiding errors that may be caused by manual modification of the build script. Specifically, the dependency manager is passed as a parameter to the central configuration interface, which decouples the dependency injection process from the specific build tool, improves the versatility of the solution, and is suitable for multi-variant build scenarios that require frequent updates of dependency versions. The corresponding dependency coordinates are dynamically obtained by the central configuration interface and injected into the application's dependency manager in real time, realizing on-demand loading of dependencies, which can effectively improve the reliability and efficiency of the application build process.
[0056] In one embodiment, after calling the pre-built central configuration library, the method further includes: if the target dependency coordinates corresponding to the type identifier are not found, injecting the default dependency coordinates corresponding to the type identifier into the dependency manager, and performing the build operation of the application to be built according to the default dependency coordinates; associating the type identifier and the corresponding target dependency coordinates in the dependency version mapping relationship, so that the corresponding target dependency coordinates can be found according to the type identifier in the subsequent build operation of the application to be built.
[0057] The default dependency coordinates refer to the coordinates of the dependency packages in the general or basic versions.
[0058] In this embodiment, when the central configuration interface cannot match the target dependency coordinates corresponding to the type identifier in the dependency version mapping relationship, it will automatically fall back to the preset default dependency coordinates, inject the default dependency coordinates into the dependency manager, and execute the build operation of the application to be built according to the default dependency coordinates, ensuring that the build process will not be interrupted due to missing dependencies and guaranteeing successful compilation. In addition, the current type identifier and its corresponding target dependency coordinates need to be associated and written into the dependency version mapping relationship to clearly define the dependency version used by the terminal type corresponding to the type identifier in the dependency version mapping relationship, ensuring that the target dependency coordinates can be obtained and dynamically injected into the dependency manager during the next compilation.
[0059] In this way, by introducing a mechanism to downgrade to the default dependency when dependency query fails and a dynamic mapping update mechanism, the problem of build interruption caused by missing dependency versions in multi-build variant scenarios is effectively solved, ensuring the flexibility and fault tolerance of application builds.
[0060] In one embodiment, the management of dependency version mapping includes: in response to a dependency package release event, associating the type identifier corresponding to the new dependency package with the dependency coordinates and writing it into the dependency version mapping; and / or in response to a dependency package version update event, updating the original dependency coordinates of the updated dependency package in the dependency version mapping to the corresponding new dependency coordinates.
[0061] In this embodiment, in response to a dependency package release event, the central configuration library can persistently store the type identifier and dependency coordinates corresponding to the dependency package in key-value pairs in the mapping database. In response to a dependency package update event, the central configuration library can update the original dependency coordinates to the new dependency coordinates by comparing the dependency coordinates before and after the update through the dependency package version comparison.
[0062] In this way, through an event-driven automated maintenance mechanism, centralized management of version updates is supported, ensuring that new or upgraded dependencies take effect in a timely manner, and optimizing the dynamic synchronization and centralized management of dependency configurations.
[0063] In one embodiment, obtaining the type identifier corresponding to the application to be built includes: responding to the build instruction of the application to be built and parsing the tasks to be executed in the build instruction to generate a list of task names; traversing the list of task names, identifying target task names in the list of task names that conform to a preset format, and extracting the type identifier from the target task names.
[0064] The default format of the task name is specified via command line. Taking the construction of the vehicle system application as an example, it can be assembleCar1Release or assembleRelease--PVEHICLE=Car1. The target task name in the task name list that conforms to the default format can be identified by regular expression matching. The type identifier is extracted from the target task name, such as extracting the type identifier Car1. The traversal of the task name list can adopt a parallel processing mechanism to improve the traversal efficiency.
[0065] In this embodiment, by standardizing task naming rules and automating the parsing process, the build instructions are parsed and type identifiers are extracted, providing reliable identifier input for subsequent dependency matching and avoiding errors or omissions that may be caused by manual configuration.
[0066] Additionally, if no target task name matching the preset format is found after iterating through the task name list, it means that the application build does not have specific terminal type requirements and no subsequent dependency matching operation is needed.
[0067] In one possible implementation, after the type identifier is extracted, it is stored in a global project extended property so that the type identifier can be read throughout the entire build lifecycle, such as for subsequent build phases.
[0068] Please see Figure 5 , Figure 5 This is a flowchart illustrating another specific application construction method as shown in an exemplary embodiment of this application. For example... Figure 5 As shown, taking in-vehicle application construction as an example, this other specific application construction method is detailed as follows: First, developers write dependency packages according to the platform vehicle models and publish the dependency package version to the remote dependency repository; in addition, developers publish the vehicle model identifier / dependency coordinate mapping relationship configuration to the central configuration library for management; then, the central configuration script is introduced into the application project of the application to be built to obtain the central configuration interface; after the build starts, the build engine obtains the vehicle model identifier and calls the central configuration interface to decide the dependencies based on the vehicle model identifier, that is, to match the corresponding target dependency coordinates from the dependency coordinate mapping relationship, and download the corresponding target dependency package from the dependency repository according to the target dependency coordinates by dynamically injecting the target dependency coordinates; finally, the build engine automatically integrates and compiles the dependencies, generates and outputs the application installation package adapted to the specific vehicle model.
[0069] The application building method described above first obtains the type identifier of the deployment terminal corresponding to the application to be built. There is at least one application to be built. Then, it calls a pre-built central configuration library and queries the corresponding target dependency coordinates from the dependency version mapping relationship based on the type identifier. The central configuration library manages the dependency version mapping relationship, which includes the correspondence between different type identifiers and dependency coordinates. Then, it injects the target dependency coordinates into the dependency manager of the application to be built and downloads the target dependency package corresponding to the type identifier based on the injected target dependency coordinates. Finally, it compiles the application installation package adapted to the deployment terminal based on the target dependency package, thus completing the construction of the application to be built. By building a central configuration library, the dependency version mapping relationship between different terminal types and corresponding dependency packages is centrally managed. In the scenario of parallel development of multiple applications and multiple terminal types, a unified dependency management mechanism is integrated. It can automatically match the corresponding dependency coordinates according to the type identifier of the deployment terminal and dynamically download the corresponding dependency package to complete the application construction. It realizes the unified maintenance and automated, seamless distribution of dependency packages, effectively improving the maintainability and stability of application building.
[0070] Please see Figure 6 , Figure 6 This is a block diagram illustrating an application building system as an exemplary embodiment of this application. The system can be applied to... Figure 2 The implementation environment shown is intended to illustrate the system, but it should be understood that the system can also be applied to other exemplary implementation environments. This embodiment does not limit the implementation environment to which the system is applicable.
[0071] like Figure 6 As shown, in an exemplary embodiment, the application building system 600 includes at least an acquisition module 610, a matching module 620, a download module 630, and a building module 640, which are described in detail below:
[0072] The acquisition module 610 is used to acquire the type identifier of the deployment terminal corresponding to the application to be built, wherein the application to be built is at least one;
[0073] The matching module 620 is used to call the pre-built central configuration library and query the corresponding target dependency coordinates from the dependency version mapping relationship according to the type identifier. The central configuration library manages the dependency version mapping relationship, which includes the correspondence between different type identifiers and dependency coordinates.
[0074] Download module 630 is used to inject target dependency coordinates into the dependency manager of the application to be built, and download the target dependency package corresponding to the type identifier based on the injected target dependency coordinates;
[0075] Module 640 is used to compile an application installation package adapted to the deployment terminal based on the target dependency package, thus completing the construction of the application to be built.
[0076] It should be noted that the application building system provided in the above embodiments and the application building method provided in the above embodiments belong to the same concept. The content of the operation performed by each module has been described in detail in the method embodiments, and will not be repeated here.
[0077] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this application. Figure 7 A schematic diagram of a computer system suitable for implementing the embodiments of this application is shown. It should be noted that... Figure 7 The computer system 700 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0078] like Figure 7 As shown, the computer system 700 includes a Central Processing Unit (CPU) 701, which can perform various appropriate actions and processes, such as executing the methods described in the above embodiments, based on programs stored in Read-Only Memory (ROM) 702 or programs loaded from storage portion 708 into Random Access Memory (RAM) 703. The RAM 703 also stores various programs and data required for system operation. The CPU 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0079] The following components are connected to I / O interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to I / O interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 710 as needed so that computer programs read from it can be installed into storage section 708 as needed.
[0080] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program including a computer program for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 709, and / or installed from removable medium 711. When the computer program is executed by central processing unit (CPU) 701, it performs various functions defined in the system of this application.
[0081] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a computer's processor, causes the computer to perform the application building method described above. This computer-readable storage medium may be included in the vehicle-mounted terminal described in the above embodiments, or it may exist independently and not deployed within the vehicle-mounted terminal.
[0082] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable computer program. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.
[0083] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.
Claims
1. An application construction method, characterized in that, The method includes: Obtain the type identifier of the deployment terminal corresponding to the application to be built, wherein the application to be built is at least one; The pre-built central configuration library is invoked, and the corresponding target dependency coordinates are queried from the dependency version mapping relationship according to the type identifier. The central configuration library publishes a dependency configuration script, which encapsulates the dependency version mapping relationship and the central configuration interface. The dependency version mapping relationship includes the correspondence between different type identifiers and dependency coordinates. In the central configuration interface, a method is called to inject the target dependency coordinates into the dependency manager of the application to be built, and the target dependency package corresponding to the type identifier is downloaded based on the injected target dependency coordinates; Based on the target dependency package, compile an application installation package adapted to the deployment terminal to complete the construction of the application to be built; The step of calling the pre-built central configuration library and querying the corresponding target dependency coordinates from the dependency version mapping relationship based on the type identifier includes: introducing the dependency configuration script into the build configuration script of the application to be built; executing the dependency configuration script and passing the type identifier as an input parameter to the central configuration interface, thereby querying the target dependency coordinates corresponding to the type identifier from the dependency version mapping relationship.
2. The application construction method according to claim 1, characterized in that, The implementation methods of the central configuration interface include: A private configuration interface is defined in the central configuration library, wherein the input parameters of the private configuration interface include dependency management instance parameters and identification parameters; The dependency version mapping relationship is integrated into the execution logic of the private configuration interface, and the integrated private configuration interface is encapsulated as the central configuration interface.
3. The application construction method according to claim 1, characterized in that, The step of calling a method in the central configuration interface to inject the target dependency coordinates into the dependency manager of the application to be built includes: The dependency manager is passed as an input parameter to the central configuration interface, wherein the dependency manager provides a dependency injection method; The dependency injection method is called in the central configuration interface to inject the target dependency coordinates into the dependency manager.
4. The application construction method according to claim 1, characterized in that, Following the invocation of the pre-built central configuration library, the following is also included: If the target dependency coordinates corresponding to the type identifier are not found, the default dependency coordinates corresponding to the type identifier are injected into the dependency manager, and the build operation of the application to be built is performed according to the default dependency coordinates. The type identifier and the corresponding target dependency coordinates are associated and written into the dependency version mapping relationship so that the corresponding target dependency coordinates can be queried based on the type identifier in the subsequent build operation of the application to be built.
5. The application construction method according to any one of claims 1 to 4, characterized in that, The management of the dependency version mapping relationship includes: In response to a dependency package release event, the type identifier and dependency coordinates corresponding to the new dependency package are associated and written into the dependency version mapping relationship; and / or In response to a dependency package version update event, the original dependency coordinates of the updated dependency package in the dependency version mapping relationship are updated to the corresponding new dependency coordinates.
6. The application construction method according to claim 5, characterized in that, The step of obtaining the type identifier corresponding to the application to be built includes: In response to the build command of the application to be built, and by parsing the tasks to be executed in the build command, a list of task names is generated; Traverse the task name list, identify target task names in the task name list that conform to a preset format, and extract the type identifier from the target task name.
7. An application building system, characterized in that, The system includes: The acquisition module is used to acquire the type identifier of the deployment terminal corresponding to the application to be built, wherein the application to be built is at least one; The matching module is used to call a pre-built central configuration library and query the corresponding target dependency coordinates from the dependency version mapping relationship according to the type identifier. The central configuration library publishes a dependency configuration script, which encapsulates the dependency version mapping relationship and the central configuration interface. The dependency version mapping relationship includes the correspondence between different type identifiers and dependency coordinates. The download module is used to call methods in the central configuration interface to inject the target dependency coordinates into the dependency manager of the application to be built, and download the target dependency package corresponding to the type identifier based on the injected target dependency coordinates; The build module is used to compile an application installation package adapted to the deployment terminal based on the target dependency package, thereby completing the construction of the application to be built; The matching module is specifically used to introduce the dependency configuration script into the build configuration script of the application to be built; execute the dependency configuration script, pass the type identifier as an input parameter to the central configuration interface, and thereby query the target dependency coordinates corresponding to the type identifier in the dependency version mapping relationship.
8. An electronic device, characterized in that, include: processor; A storage device for storing a program that, when executed by the processor, causes the electronic device to implement the application building method as described in any one of claims 1 to 6.
9. A computer storage medium, characterized in that, It stores a computer program that, when executed by the computer's processor, causes the computer to perform the application building method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Automatic interface testing method and device, computer equipment and storage medium
CN112162924A
Project dependency relationship display method and device, terminal equipment and storage medium
CN115705187A