Third-party dependency library isolation method and device, electronic device, and storage medium

By implementing the isolation method of third-party dependency library in Android projects and obtaining and adding third-party dependency libraries to the target task, the problem that the specific implementation of third-party dependency libraries in the existing technology cannot be hidden, and the work enthusiasm of developers and the efficiency of Android engineering development is improved.

CN111475148BActive Publication Date: 2025-05-16BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN201910069342.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-01-24
Publication Date
2025-05-16
Estimated Expiration
2039-01-24

AI Technical Summary

Technical Problem

In the existing Android project, the specific implementation of third-party dependency libraries cannot be hidden, which makes developers' labor results easily obtained by others and reduces developers' enthusiasm for work.

Method used

By implementing the third-party dependency library isolation method in Android engineering, we obtain the identification information and dependencies of the task, determine the task type based on the identification information, and when the task is a target task, we obtain and add the third-party dependency library to the target task.

Benefits of technology

It hides the specific implementation of third-party dependency libraries, protects the labor results of developers, improves the work enthusiasm of developers, and improves the efficiency of Android engineering development without affecting the compilation of target tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111475148B_ABST
    Figure CN111475148B_ABST
Patent Text Reader

Abstract

The present invention provides a third-party dependency library isolation method and device, electronic device, and storage medium for Android projects, and relates to the field of computer technology. The third-party dependency library isolation method includes: in response to a task in the Android project relying on a third-party dependency library, obtaining identification information of the task and a corresponding dependency relationship; determining the type of the task according to the identification information; when determining that the task is a target task, obtaining the third-party dependency library; and adding the third-party dependency library that the task depends on to the target task through the dependency relationship. The technical solution of the embodiment of the present invention can hide the specific implementation of the third-party dependency library without affecting the compilation process.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] With the rapid development of intelligent terminal devices, people pay more and more attention to the development process of related systems and applications used in intelligent terminal devices.

[0003] In existing Android projects, when relying on a third-party dependency library, all classes or interfaces of the third-party dependency library are directly exposed to the relying party, and the specific implementation of the third-party dependency library cannot be hidden, so that others can easily obtain the work results of the developers who developed the third-party dependency library, reducing the developers' work enthusiasm.

[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0005] The purpose of the embodiments of the present invention is to provide a third-party dependency library isolation method, a third-party dependency library isolation device, an electronic device and a computer-readable storage medium for Android projects, thereby at least to a certain extent overcoming the problem that the prior art cannot hide the specific implementation of the third-party dependency library.

[0006] Other features and advantages of the present invention will become apparent from the following detailed description, or may be learned in part by practice of the present invention.

[0007] According to a first aspect of an embodiment of the present invention, a method for isolating a third-party dependency library for an Android project is provided, comprising: in response to a task in the Android project being dependent on a third-party dependency library, obtaining identification information of the task and a corresponding dependency relationship; determining the type of the task based on the identification information; when it is determined that the task is a target task, obtaining the third-party dependency library; and adding the third-party dependency library that the task is dependent on to the target task through the dependency relationship.

[0008] In some example embodiments of the present invention, based on the aforementioned solution, the method further includes: when it is determined that the task is not a target task, obtaining an interface function library corresponding to the third-party dependency library; and adding the interface function library to the task.

[0009] In some example embodiments of the present invention, based on the aforementioned scheme, when it is determined that the task is not the target task, obtaining the interface function library corresponding to the third-party dependency library also includes: when it is determined that the type corresponding to the task is not the target task, the integrated development environment prompts the dependency request instruction of the task.

[0010] In some example embodiments of the present invention, based on the aforementioned scheme, the dependency relationship includes a build tool plug-in, and obtaining the third-party dependency library further includes: obtaining the third-party dependency library edited by the developer; and uploading the third-party dependency library to a target storage location for storage through the build tool plug-in.

[0011] In some example embodiments of the present invention, based on the aforementioned solution, determining the type of the task according to the identification information includes: determining the type of the task through the identification information based on the construction tool plug-in.

[0012] In some example embodiments of the present invention, based on the aforementioned solution, the method further includes: configuring the build tool plug-in based on a listener in the Android project.

[0013] In some example embodiments of the present invention, based on the aforementioned solution, the interface function library includes a file in Jar format.

[0014] According to a second aspect of an embodiment of the present invention, a third-party dependency library isolation device is provided, including: a first acquisition unit, used to obtain identification information and corresponding dependency relationships of the task in response to the task in the Android project being dependent on a third-party dependency library; a determination unit, used to determine the type of the task based on the identification information; a second acquisition unit, used to obtain the third-party dependency library when it is determined that the task is a target task; and an execution unit, used to add the third-party dependency library that the task is dependent on to the target task through the dependency relationship.

[0015] In an exemplary embodiment of the present invention, based on the aforementioned scheme, the third-party dependency library isolation device includes: an interface function library acquisition unit, used to acquire the interface function library corresponding to the third-party dependency library when it is determined that the task is not the target task; and an interface function library adding unit, used to add the interface function library to the task.

[0016] In an exemplary embodiment of the present invention, based on the above-mentioned solution, the interface function library acquisition unit is configured to: when it is determined that the type corresponding to the task is not the target task, the integrated development environment IDE prompts the dependency request instruction of the task.

[0017] In an exemplary embodiment of the present invention, based on the above-mentioned solution, the first acquisition unit is configured to: acquire a third-party dependency library edited by a developer; and upload the third-party dependency library to a target storage location for storage through the build tool plug-in.

[0018] In an exemplary embodiment of the present invention, based on the above solution, the determining unit is configured to: determine the type of the task through the identification information based on the construction tool plug-in.

[0019] In an exemplary embodiment of the present invention, based on the above-mentioned solution, the third-party dependency library isolation device is configured to: configure the build tool plug-in based on the listener in the Android project.

[0020] According to a third aspect of an embodiment of the present invention, there is provided an electronic device, comprising: a processor; and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the third-party dependency library isolation method described above is implemented.

[0021] According to a fourth aspect of an embodiment of the present invention, there is provided a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the third-party dependency library isolation method according to any one of the above items is implemented.

[0022] The technical solution provided by the embodiment of the present invention may have the following beneficial effects:

[0023] The third-party dependency library isolation method in the example embodiment of the present invention, when a task in an Android project depends on a third-party dependency library, obtains the identification information of the corresponding task and the corresponding dependency relationship, and determines the type of the task based on the obtained identification information. When it is determined that the task is a target task, obtains the third-party dependency library, and adds the third-party dependency library to the corresponding target task through the corresponding dependency relationship. On the one hand, by determining the type of task requesting dependency on the third-party dependency library through identification information, the specific implementation of the third-party dependency library can be hidden, the labor results of the third-party dependency library developers can be protected, and the work enthusiasm of the developers can be improved; on the other hand, when the task is determined to be a target task, the third-party dependency library is added to the target task, which can hide the specific implementation of the third-party dependency library while not affecting the compilation of the target task, thereby improving the efficiency of Android project development.

[0024] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The drawings herein are incorporated into and constitute a part of the specification, showing embodiments consistent with the present invention, and together with the specification, are used to explain the principles of the present invention. Obviously, the drawings described below are only some embodiments of the present invention, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0026] Figure 1 A schematic diagram schematically illustrates a third-party dependency library isolation method according to some embodiments of the present invention;

[0027] Figure 2 A schematic diagram schematically shows the overall process of relying on a third-party dependency library according to some embodiments of the present invention;

[0028] Figure 3 A schematic diagram schematically illustrates a construction tool plug-in configuration phase according to some embodiments of the present invention;

[0029] Figure 4 A schematic diagram of a third-party dependency library isolation device according to some embodiments of the present invention is schematically shown;

[0030] Figure 5 A schematic diagram schematically shows a structure of a computer system of an electronic device according to some embodiments of the present invention;

[0031] Figure 6 A schematic diagram of a computer-readable storage medium according to some embodiments of the present invention is schematically shown. DETAILED DESCRIPTION

[0032] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the present invention will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.

[0033] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present invention. However, those skilled in the art will appreciate that the technical solution of the present invention can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring various aspects of the present invention.

[0034] Furthermore, the drawings are only schematic illustrations and are not necessarily drawn to scale. The block diagrams shown in the drawings are only functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0035] In the existing technical solution, the Android project relies on the third-party dependency library in the following way: in the build tool plug-in Android Gradle Plugin 2.X, when the third-party dependency library is relied on through the keyword Compile, the specific implementation of the third-party dependency library is visible when the application is packaged and compiled into the final application package APK; when the third-party dependency library is relied on through the keyword Provided, the specific implementation of the third-party dependency library is visible during the development stage, but the specific implementation of the third-party dependency library is not packaged into the APK during the final compilation. The above two dependency methods will directly expose all the classes or interfaces of the third-party dependency library to the dependent party, and cannot hide the specific implementation of the third-party dependency library, so that others can easily obtain the labor results of the developers who developed the third-party dependency library, which reduces the work enthusiasm of the developers.

[0036] Based on this, in this example embodiment, firstly, a method for isolating third-party dependency libraries for Android projects is provided. The method can be applied to terminal devices with an Android development platform, such as computers. Figure 1 The schematic diagram schematically shows the process of the third-party dependency library isolation method according to some embodiments of the present invention. Figure 1 As shown, the third-party dependency library isolation method may include the following steps:

[0037] Step S110, in response to the task in the Android project being dependent on a third-party dependency library, obtaining identification information of the task and a corresponding dependency relationship;

[0038] Step S120, determining the type of the task according to the identification information;

[0039] Step S130, when it is determined that the task is a target task, obtaining the third-party dependency library;

[0040] Step S140: adding the third-party dependency library that the task depends on to the target task through the dependency relationship.

[0041] According to the third-party dependency library isolation method in this example embodiment, on the one hand, by determining the task type that requests dependency on the third-party dependency library through identification information, the specific implementation of the third-party dependency library can be hidden, the labor results of the third-party dependency library developers can be protected, and the work enthusiasm of the developers can be improved; on the other hand, when the target task is determined, the third-party dependency library is added to the target task, which can hide the specific implementation of the third-party dependency library without affecting the compilation of the target task, thereby improving the efficiency of Android project development.

[0042] Next, the third-party dependency library isolation method in this example embodiment will be further described.

[0043] In step S110 , in response to a task in the Android project being dependent on a third-party dependency library, identification information of the task and a corresponding dependency relationship are obtained.

[0044] In an exemplary embodiment of the present invention, an Android project may refer to a program code for developing and producing related applications on an Android platform, which may include an application project Application and a library project Library, implemented in the programming language Java. A third-party dependency library may refer to a collection of data such as all classes and interface functions developed by third-party developers for use by an Android project. The identification information of a task Task may be pre-set information that can distinguish the corresponding task type. For example, the identification information of a task may be the name of the task, or the function type that starts the task. The present invention does not make any special limitations on this. A dependency relationship may refer to a corresponding relationship between a task and a third-party dependency library. For example, a dependency relationship may be an interface function of a task dependency library, or a build tool plug-in of a task dependency library. The present invention does not make any special limitations on this.

[0045] Specifically, the system plug-in monitors the source code in the Android project, and when it is detected that a task in the source code of the Android project depends on a third-party dependency library, the system plug-in records the identification information of the task and the corresponding dependency relationship.

[0046] In step S120, the type of the task is determined according to the identification information.

[0047] In an exemplary embodiment of the present invention, the type of task may refer to specific tasks corresponding to different stages of an Android project. For example, the type of task may be a task corresponding to the development stage of an Android project, or a task corresponding to the compilation stage of an Android project. According to the identification information of the task obtained in step S110, the type corresponding to the task is determined by a preset relationship table or the name of the task, and the present invention does not make any special limitation on this.

[0048] Optionally, based on the build tool plug-in, the type of the task is determined by identification information. The identification information is identified by the corresponding dependency relationship obtained in step S110 to determine the type corresponding to the task. For example, the dependency relationship can be a pre-configured build tool plug-in Gradle, and the build tool plug-in detects whether the task needs to add a specific implementation of a third-party dependency library based on the identification information of the task to determine the type of the corresponding task.

[0049] In step S130 , when it is determined that the task is a target task, the third-party dependent library is obtained.

[0050] In an exemplary embodiment of the present invention, the target task may include a task that needs to be implemented by adding a third-party dependency library, for example, the target task type is a compilation task. When it is determined that the type of the task is a target task, the third-party dependency library that the target task depends on through the dependency relationship is obtained. Specifically, the target storage location can be a Maven warehouse (a tool for managing binary files, with relevant official websites provided to developers around the world), or it can be a local folder, and the present invention does not make special restrictions on this. When it is determined that the type of the task is a target task, the corresponding third-party dependency library is obtained from the target storage location through the build tool plug-in Gradle.

[0051] Optionally, obtain the third-party dependency library edited by the developer, and upload the third-party dependency library to the target storage location for storage through the build tool plug-in Gradle. Uploading the third-party dependency library through the build tool plug-in Gradle enables the build tool plug-in Gradle to quickly and accurately obtain the third-party dependency library in the target storage location according to the dependency relationship when determining that the type of the task is the target task, thereby improving the compilation efficiency.

[0052] In another exemplary embodiment of the present invention, when it is determined that the type of the task is not the target task, the interface function library corresponding to the third-party dependency library is obtained through the dependency relationship corresponding to the task (such as the build tool plug-in Gradle), and the interface function library is added to the task. When it is determined that the type of the task does not require the specific implementation of the third-party dependency library, the corresponding dependent interface function is added to the corresponding task, while hiding the specific implementation of the third-party dependency library, it does not affect the editing and interpretation of the task by the developers of the Android project, thereby improving the user experience of the developers of the Android project.

[0053] It should be noted that the file type in the interface function library can be a Jar format file. When the file format of the interface function library is Jar format, it is possible to rely only on the third-party dependency library without compiling, that is, the aforementioned dependency mode through the keyword Provided.

[0054] Specifically, when it is determined that the type corresponding to the task is not the target task, the integrated development environment IDE prompts the dependency request instructions of the task. The Integrated Development Environment (IDE) is an application for providing a program development environment. When it is determined that the type of the task is not the target task, when it is detected that the source code of the task depends on a third-party dependency library, a prompt is given for the dependency or call instruction, such as marking it in red. The integrated development environment prompts the dependency request instructions of the task so that developers can better understand the task source code and improve the developer experience.

[0055] refer to Figure 2 As shown, Figure 2 A schematic diagram of the overall process of relying on a third-party dependency library according to some embodiments of the present invention is schematically shown, and a detailed description is given below.

[0056] Step S210, the third-party developer edits the third-party dependency library in a standard Android development method according to specific needs;

[0057] Step S220, obtaining a third-party dependency library developed by a third-party developer, and uploading it through the build tool plug-in Gradle;

[0058] Step S230, storing the third-party dependency library in a Maven warehouse (remote warehouse) or a private server built by the company (individual);

[0059] Step S240, obtaining the third-party dependency library that the task depends on from the Maven warehouse (remote warehouse) or the private server built by the company (individual) through the build tool plug-in;

[0060] Step S250, storing the third-party dependency library obtained by the build tool plug-in in a local warehouse or a local folder for subsequent use;

[0061] Step S260, when it is determined that the type of the task is a target task, the build tool plug-in obtains the corresponding third-party dependency library from the local warehouse or local folder;

[0062] Step S270: The build tool plug-in adds the third-party dependency library to the corresponding target task according to the identification information and dependency relationship of the task.

[0063] In step S140, the third-party dependency library that the task depends on is added to the target task through the dependency relationship.

[0064] In an exemplary embodiment of the present invention, when it is determined that the task is a target task, the third-party dependency library on which the task depends is added to the target task through the dependency relationship.

[0065] Specifically, the build tool plug-in in the present invention can be configured through the listener Listener in the Android project. For example, the code of the build tool plug-in may include but is not limited to adding core code in the listener Listener:

[0066]

[0067]

[0068] Reference for specific implementation ideas of core code Figure 3 As shown, Figure 3A schematic diagram of the build tool plug-in configuration phase according to some embodiments of the present invention is schematically shown, which is described in detail below.

[0069] Step S310, obtaining identification information of the current startup task and the corresponding dependency relationship;

[0070] Step S320, determining whether the type of the started task is a target task that requires a specific implementation of a third-party dependent library;

[0071] Step S330, when it is determined that the type of the task is a target task, obtaining a third-party dependency library that the target task depends on through a dependency relationship, and adding a specific implementation of the third-party dependency library to the target task through the dependency relationship;

[0072] Step S340, ending the detection of the startup task in this round;

[0073] Step S350: When it is determined that the type of the task is not the target task, directly end this round of detection of the start task.

[0074] It should be noted that, although the steps of the method of the present invention are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0075] In addition, in this exemplary embodiment, a third-party dependency library isolation device is also provided. Figure 4 As shown, the third-party dependency library isolation device 400 includes: a first acquisition unit 410, a determination unit 420, a second acquisition unit 430 and an adding unit 440. Among them: the first acquisition unit 410 is used to respond to the task in the Android project relying on the third-party dependency library, and obtain the identification information of the task and the corresponding dependency relationship; the determination unit 420 is used to determine the type of the task according to the identification information; the second acquisition unit 430 is used to obtain the third-party dependency library when it is determined that the task is a target task; the adding unit 440 is used to add the third-party dependency library that the task depends on to the target task through the dependency relationship.

[0076] In an exemplary embodiment of the present invention, based on the aforementioned scheme, the third-party dependency library isolation device 400 includes: an interface function library acquisition unit, used to acquire the interface function library corresponding to the third-party dependency library when it is determined that the task is not the target task; and an interface function library adding unit, used to add the interface function library to the task.

[0077] In an exemplary embodiment of the present invention, based on the above-mentioned solution, the interface function library acquisition unit is configured to: when it is determined that the type corresponding to the task is not the target task, the integrated development environment IDE prompts the dependency request instruction of the task.

[0078] In an exemplary embodiment of the present invention, based on the above solution, the first acquisition unit 410 is configured to: acquire a third-party dependency library edited by a developer; and upload the third-party dependency library to a target storage location for storage through the build tool plug-in.

[0079] In an exemplary embodiment of the present invention, based on the above solution, the determining unit 420 is configured to: determine the type of the task through the identification information based on the construction tool plug-in.

[0080] In an exemplary embodiment of the present invention, based on the above-mentioned solution, the third-party dependency library isolation device 400 is configured to: configure the build tool plug-in based on the listener in the Android project.

[0081] The specific details of each module of the third-party dependency library isolation device mentioned above have been described in detail in the corresponding third-party dependency library isolation method, so they will not be repeated here.

[0082] It should be noted that although several modules or units of the third-party dependency library isolation device are mentioned in the above detailed description, this division is not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.

[0083] In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above-mentioned third-party dependency library isolation method is also provided.

[0084] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as systems, methods or program products. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: complete hardware embodiments, complete software embodiments (including firmware, microcode, etc.), or embodiments combining hardware and software aspects, which may be collectively referred to herein as "circuits", "modules" or "systems".

[0085] Refer to the following Figure 5 An electronic device 500 according to such an embodiment of the present invention is described. Figure 5 The electronic device 500 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0086] like Figure 5 As shown, the electronic device 500 is in the form of a general computing device. The components of the electronic device 500 may include but are not limited to: at least one processing unit 510, at least one storage unit 520, a bus 530 connecting different system components (including the storage unit 520 and the processing unit 510), and a display unit 540.

[0087] The storage unit stores program codes, which can be executed by the processing unit 510, so that the processing unit 510 performs the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification. For example, the processing unit 510 can perform the following steps: Figure 1 In step S110, in response to the task in the Android project being dependent on a third-party dependency library, the identification information of the task and the corresponding dependency relationship are obtained; in step S120, the type of the task is determined based on the identification information; in step S130, when it is determined that the task is a target task, the third-party dependency library is obtained; in step S140, the third-party dependency library on which the task is dependent is added to the target task through the dependency relationship.

[0088] The storage unit 520 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 521 and / or a cache memory unit 522 , and may further include a read-only memory unit (ROM) 523 .

[0089] The storage unit 520 may also include a program / utility 524 having a set (at least one) of program modules 525, such program modules 525 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0090] Bus 530 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0091] The electronic device 500 may also communicate with one or more external devices 570 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 500, and / or may communicate with any device that enables the electronic device 500 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 550. Furthermore, the electronic device 500 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 560. As shown, the network adapter 560 communicates with other modules of the electronic device 500 via a bus 530. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0092] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.

[0093] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible embodiments, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to perform the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of the present specification.

[0094] refer to Figure 6 As shown, a program product 600 for implementing the third-party dependency library isolation method according to an embodiment of the present invention is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited to this. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

[0095] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0096] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0097] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0098] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0099] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0100] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.

[0101] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

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

Claims

1. A third-party dependency library isolation method for Android engineering, characterized in that: include: In response to a task in the Android project being dependent on a third-party dependency library, obtaining identification information of the task and a corresponding dependency relationship; The identification information of the task includes the name of the task and / or the type of function that starts the task; Determining the type of the task according to the identification information includes: determining the type of the task through a preset relationship table or a name in the identification information of the task, and / or detecting whether the task needs to add a specific implementation of a third-party dependency library based on the identification information of the task based on a build tool plug-in to determine the type of the task; wherein the type of the task includes tasks corresponding to the development stage and / or tasks corresponding to the compilation stage; When it is determined that the task is a target task, obtaining the third-party dependency library, and adding the third-party dependency library that the task depends on to the target task through the dependency relationship; When it is determined that the task is not the target task, an interface function library corresponding to the third-party dependent library is obtained, and the interface function library is added to the task.

2. The third-party dependency library isolation method according to claim 1, characterized in that: When it is determined that the task is not a target task, obtaining the interface function library corresponding to the third-party dependency library further includes: When it is determined that the type corresponding to the task is not the target task, the integrated development environment prompts the dependency request instruction of the task.

3. The third-party dependency library isolation method according to claim 1, characterized in that: The dependency relationship includes a build tool plug-in, and obtaining the third-party dependency library further includes: Get third-party dependency libraries edited by developers; The third-party dependency library is uploaded to the target storage location for storage through the build tool plug-in.

4. The third-party dependency library isolation method according to claim 3 is characterized in that: The method further comprises: The build tool plug-in is configured based on the listener in the Android project.

5. The third-party dependency library isolation method according to claim 1, characterized in that: The interface function library includes a file in Jar format.

6. A third-party dependency library isolation device for Android engineering, characterized in that: include: A first acquisition unit, configured to acquire identification information of the task and a corresponding dependency relationship in response to the task in the Android project being dependent on a third-party dependency library; The identification information of the task includes the name of the task and / or the type of function that starts the task; A determination unit, configured to determine the type of the task according to the identification information, including: determining the type of the task through a preset relationship table or a name in the identification information of the task, and / or detecting whether the task needs to add a specific implementation of a third-party dependency library based on the identification information of the task based on a build tool plug-in to determine the type of the task; wherein the type of the task includes tasks corresponding to the development stage and / or tasks corresponding to the compilation stage; A second acquisition unit, configured to acquire the third-party dependency library when it is determined that the task is a target task; An execution unit, configured to add the third-party dependency library that the task depends on to the target task through the dependency relationship; An interface function library acquisition unit, used for acquiring an interface function library corresponding to the third-party dependency library when it is determined that the task is not a target task; The interface function library adding unit is used to add the interface function library to the task.

7. An electronic device, characterized in that: include: processor; as well as A memory having computer-readable instructions stored thereon, wherein the computer-readable instructions, when executed by the processor, implement the third-party dependency library isolation method as described in any one of claims 1 to 5.

8. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the third-party dependency library isolation method as described in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Compiling method and device of compiling system and terminal equipment

    CN107741851A