[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN110554876B - Method and device for compiling android engineering - Google Patents

Method and device for compiling android engineering Download PDF

Info

Publication number
CN110554876B
CN110554876B CN201810548519.1A CN201810548519A CN110554876B CN 110554876 B CN110554876 B CN 110554876B CN 201810548519 A CN201810548519 A CN 201810548519A CN 110554876 B CN110554876 B CN 110554876B
Authority
CN
China
Prior art keywords
shared library
preset
maven
target android
android project
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810548519.1A
Other languages
Chinese (zh)
Other versions
CN110554876A (en
Inventor
张志强
黄鹏
陈泓屹
李廷昌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201810548519.1A priority Critical patent/CN110554876B/en
Publication of CN110554876A publication Critical patent/CN110554876A/en
Application granted granted Critical
Publication of CN110554876B publication Critical patent/CN110554876B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/441Register allocation; Assignment of physical memory space to logical memory space
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application discloses a method and a device for compiling android engineering. One embodiment of the method comprises the following steps: acquiring storage address information of each shared library file on which the target android project depends in a preset Maven warehouse; downloading each shared library file relied on the target android project from a preset Maven warehouse according to the storage address information; storing each downloaded shared library file into a preset shared library folder corresponding to the target android project; and compiling the target android project to obtain an installation file corresponding to the target android project. According to the method and the device, the compiling android project is realized under the condition of reducing the size of a code warehouse.

Description

Method and device for compiling android engineering
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method and a device for compiling android engineering.
Background
In current Android (Android) application code, if there is a dependency on a shared library file (i.e., so file), in order to increase the compiling speed, the shared library file is usually stored in a Git code repository, and is downloaded and stored for compiling and use from the Git code repository before compiling.
However, the Git repository is adapted to store text files of different versions, and only difference files may be stored when Chu Wen present files are stored, which in turn may reduce storage space. However, the Git repository is not dedicated to storing binary files, and when storing binary files, it is not possible to store difference files, and it is necessary to store full files each time. While the shared library file is a binary file, multiple submissions of shared library files of different versions can cause the Git warehouse to expand rapidly.
Disclosure of Invention
The embodiment of the application provides a method and a device for compiling android engineering.
In a first aspect, an embodiment of the present application provides a method for compiling android projects, where the method includes: acquiring storage address information of each shared library file on which the target android project depends in a preset Maven warehouse; downloading each shared library file relied on the target android project from a preset Maven warehouse according to the storage address information; storing each downloaded shared library file into a preset shared library folder corresponding to the target android project; and compiling the target android project to obtain an installation file corresponding to the target android project.
In some embodiments, each shared library file on which the target android project depends is uploaded to a preset Maven repository through a Maven tool.
In some embodiments, each shared library file on which the target android project depends is uploaded into a preset Maven repository by accessing a preset website.
In some embodiments, obtaining storage address information of each shared library file on which the target android project depends in a preset Maven warehouse includes: and reading the storage address information of each shared library file on which the target android project depends in a preset Maven warehouse from the Gradle configuration file corresponding to the target android Zhuo Gongcheng.
In some embodiments, downloading each shared library file on which the target android project depends from a preset Maven warehouse according to the storage address information includes: and downloading and storing each shared library file on which the target android project depends from a preset Maven warehouse according to the storage address information by using a preset shared library downloading task plug-in.
In some embodiments, the storage address information includes a shared library file name and version number.
In a second aspect, an embodiment of the present application provides an apparatus for compiling android projects, where the apparatus includes: the acquisition unit is configured to acquire storage address information of each shared library file on which the target android project depends in a preset Maven warehouse; the downloading unit is configured to download each shared library file on which the target android project depends from a preset Maven warehouse according to the storage address information; the storage unit is configured to store each downloaded shared library file into a preset shared library folder corresponding to the target android project; and the compiling unit is configured to compile the target android project to obtain an installation file corresponding to the target android project.
In some embodiments, each shared library file on which the target android project depends is uploaded to a preset Maven repository through a Maven tool.
In some embodiments, each shared library file on which the target android project depends is uploaded into a preset Maven repository by accessing a preset website.
In some embodiments, the acquisition unit is further configured to: and reading the storage address information of each shared library file on which the target android project depends in a preset Maven warehouse from the Gradle configuration file corresponding to the target android Zhuo Gongcheng.
In some embodiments, the download unit is further configured to: and downloading and storing each shared library file on which the target android project depends from a preset Maven warehouse according to the storage address information by using a preset shared library downloading task plug-in.
In some embodiments, the storage address information includes a shared library file name and version number.
In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors; and a storage device having one or more programs stored thereon, which when executed by the one or more processors, cause the one or more processors to implement the method as described in any of the implementations of the first aspect.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium having stored thereon a computer program, wherein the computer program, when executed by one or more processors, implements a method as described in any of the implementations of the first aspect.
According to the method and the device for compiling the android project, the shared library files are stored in the Maven warehouse, so that the characteristics of the Maven warehouse for storing binary files are fully utilized, and the problem of volume expansion possibly caused by storing the shared library files in the Git warehouse is solved. In addition, in the process of compiling the Android project to obtain the installation file, the storage address information of each shared library file relied on by the target Android project in a preset Maven warehouse is firstly obtained, then each shared library file relied on by the target Android project is downloaded from the preset Maven warehouse according to the storage address information, each downloaded shared library file is stored in a preset shared library folder corresponding to the target Android project, and finally the target Android project is compiled to obtain the installation file corresponding to the target Android project. Under the condition of reducing the size of the code warehouse, the shared libraries stored in the Maven warehouse are acquired in an automatic mode, then stored in a preset Android engineering catalog, and finally packaged into a complete Apk application.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the detailed description of non-limiting embodiments, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which an embodiment of the present application may be applied;
FIG. 2 is a flow chart of one embodiment of a method for compiling android engineering in accordance with the present application;
FIG. 3 is a flow chart of yet another embodiment of a method for compiling android engineering in accordance with the present application;
FIG. 4 is a schematic diagram illustrating one embodiment of a preset shared library download task plugin in accordance with the present application;
FIG. 5 is a schematic diagram of an embodiment of an apparatus for compiling android projects in accordance with the present application;
Fig. 6 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the application.
Detailed Description
The application is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be noted that, for convenience of description, only the portions related to the present application are shown in the drawings.
It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other. The application will be described in detail below with reference to the drawings in connection with embodiments.
FIG. 1 illustrates an exemplary system architecture 100 in which embodiments of a method for compiling android engineering or an apparatus for compiling android engineering of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include uploading end devices 101, 102, 103, a network 104, a Maven repository server 105, a network 106, and a downloading end device 107, the network 104 being a medium used to provide a communication link between the uploading end devices 101, 102, 103 and the Maven repository server 105. The network 106 is a medium used to provide a communication link between the Maven repository server 105 and the download terminal device 107. The networks 104 and 106 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the Maven repository server 105 via the network 104 using the uploading terminal devices 101, 102, 103 to receive or send messages etc. Various communication client applications, such as a Maven repository client, a web browser, a code editing class application, a shared library compiling class application, an integrated development environment (IDE, INTEGRATED DEVELOPMENT ENVIRONMENT), and the like, may be installed on the uploading terminal devices 101, 102, 103.
The user may also interact with the Maven repository server 105 via the network 106 using the download terminal 107 to receive or send messages, etc. Various communication client applications may be installed on the download terminal device 107, such as a Maven repository client, a web browser, an integrated development environment (e.g., android Studio, gradle), and so forth.
The uploading terminal devices 101, 102, 103 may be hardware or software. When the uploading terminal devices 101, 102, 103 are hardware, they may be various electronic devices with a display screen and supporting the uploading of shared library files, including but not limited to smartphones, tablet computers, laptop and desktop computers, etc. When the uploading terminal devices 101, 102, 103 are software, they can be installed in the above-listed electronic devices. Which may be implemented as multiple software or software modules (e.g., to provide a shared library upload class service), or as a single software or software module. The present invention is not particularly limited herein.
The download terminal 107 may be hardware or software. When the download terminal device 107 is hardware, it may be a variety of electronic devices having a display screen and supporting shared library file download and android engineering compilation, including but not limited to smartphones, tablet computers, laptop and desktop computers, and the like. When the download terminal device 107 is software, it can be installed in the above-listed electronic devices. It may be implemented as multiple software or software modules (e.g., to provide shared library file downloads and android engineering compilation services), or as a single software or software module. The present invention is not particularly limited herein.
The Maven repository server 105 may be a server that provides various Maven repository storage and download services. The Maven repository server 105 may provide a storage service for the shared library file uploaded by the uploading terminal devices 101, 102, 103, or the Maven repository server 105 may analyze and process data such as a shared library file download request received from the downloading terminal device 107, and feed back a processing result (for example, a shared library file) to the downloading terminal device 107.
The Maven repository server 105 may be hardware or software. When the Maven repository server 105 is hardware, it may be implemented as a distributed server cluster composed of a plurality of servers, or as a single server. When the Maven repository server 105 is software, it may be implemented as a plurality of software or software modules (e.g., to provide Maven repository services), or as a single software or software module. The present invention is not particularly limited herein.
It should be noted that, the method for compiling android engineering provided in the embodiment of the present application is generally executed by the download terminal device 107, and accordingly, the apparatus for compiling android engineering is generally disposed in the download terminal device 107.
It should be understood that the numbers of uploading terminal devices, networks, maven servers and downloading terminal devices in fig. 1 are merely illustrative. Any number of uploading terminal devices, networks, maven servers and downloading terminal devices may be provided according to implementation requirements. In addition, the uploading terminal device shown in fig. 1 may be a downloading terminal device at the same time, and the downloading terminal device shown in fig. 1 may be an uploading terminal device at the same time.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for compiling android engineering in accordance with the present application is shown. The method for compiling the android project comprises the following steps of:
and step 201, obtaining storage address information of each shared library file relied by the target android project in a preset Maven warehouse.
In this embodiment, an execution body (for example, the download terminal 107 shown in fig. 1) of the method for compiling the android project may locally obtain the storage address information of each shared library file on which the target android project depends in the preset Maven repository.
Here, the preset Maven repository may be a local repository, i.e. where Maven is locally storing components.
Here, the preset Maven repository may also be a remote repository. The preset Maven warehouse may be a central warehouse or a private service. Wherein, the central warehouse is a default remote warehouse, and Maven is self-contained in the configuration of the central warehouse when installing. The private service is a special remote warehouse, which is a warehouse service erected in the local area network, and the private service is used for a Maven user in the local area network by proxy of the remote warehouse on the wide area network. When Maven needs to download a component, it requests from the private service, if the component does not exist on the private service, downloads from an external remote warehouse, buffers the component on the private service, and then provides service for the download request of Maven.
Here, an integrated development environment (for example, android Studio) for generating an Android project may be installed in the execution body, and the target Android project may be any one of the integrated development environments installed in the execution body, and only the target Android project is described herein as an example, in practice, the method for compiling an Android project of the present application may be applied to any one of the integrated development environments (Android project) installed in the execution body.
It will be appreciated that an android project may include various files required to compile android application installation files, for example, the following may be included, but not limited to:
(1) Code files of the src folder;
(2) R files stored in the gen folder;
(3) assets resource files stored in the folder, such as pictures, video, audio, or database files, etc.;
(4) Files stored in the bin folder;
(5) Jar files stored in the libs folder;
(6) Picture files stored in the res folder;
(7) layout files stored in the layout folder;
(8) menu files stored in the menu folder;
(9) Files stored in the values folder, for example string. Xml, are strings;
(10) style files stored in styles files, e.g., segments. Xml, with dp values stored in the file;
(11) Android Mainfest. Xml, this file is called manifest file in android, and contains configuration information of the whole application.
The storage address information of each shared library file on which the target android project depends in the preset Maven warehouse can be stored in any one of the designated configuration files in the target android project.
In some optional implementations of this embodiment, a Gradle may also be installed in the execution body. Here, gradle is a project automation build tool based on APACHE ANT and APACHE MAVEN concepts that uses a Groovy-based Domain-specific language (DSL, domain-Specific Languages) to declare project settings, discarding various cumbersome configurations based on XML (extensible markup language ). Then, the storage address information of each shared library file on which the target android project depends in the preset Maven repository can be read from the Gradle configuration file (e.g. build. Gradle file) corresponding to the target android Zhuo Gongcheng.
Here, each shared library file on which the target android project stored in the preset Maven repository depends may be uploaded to the electronic device where the preset Maven repository is located by other electronic devices connected to the electronic device where the preset Maven repository is located through a network.
In some optional implementations of this embodiment, each shared library file on which the target android project depends may be uploaded to a preset Maven repository through a Maven tool.
In some optional implementations of this embodiment, each shared library file on which the target android project depends may also be uploaded into the preset Maven repository by accessing a preset website (e.g., a website providing Maven repository services).
In some optional implementations of this embodiment, the storage address information of the shared library file in the preset repository may include a shared library file name and a version number of the shared library file. Wherein the file name is used to identify the shared library file and the version number is used to identify a specific version of the shared library. In practice, the storage address information of the shared library file in the preset Maven warehouse can be expressed as three fields of "group: name: version", and the specific shared library file is located on the preset Maven warehouse through the three fields.
And 202, downloading each shared library file on which the target android project depends from a preset Maven warehouse according to the storage address information.
In this embodiment, the executing body (for example, the download terminal device 107 shown in fig. 1) may download, according to the storage address information obtained in step 201, each shared library file on which the target android project depends from the preset Maven repository. In practice, the execution body may be provided with an application supporting the download of the Maven repository, for example, the execution body may be a client of the Maven repository, or may be a Gradle, where the Gradle also supports various operations of the Maven repository. In this way, the execution body can utilize the application supporting Maven warehouse downloading to download each shared library file on which the target android project depends. In practice, the shared library file is the so file.
And 203, storing each downloaded shared library file into a preset shared library folder corresponding to the target android project.
In this embodiment, the executing body may store each downloaded shared library file in a preset shared library folder corresponding to the target android project. For example, it may be stored in jniLibs folders of the target android project.
And 204, compiling the target android project to obtain an installation file corresponding to the target android project.
In this embodiment, the execution body may compile the target Android project by adopting various implementation manners, so as to obtain an installation file corresponding to the target Android project, that is, an Android installation package APK file. APK is an abbreviation for AndroidPackage. The APK file can be directly transmitted to the Android simulator or the Android mobile phone for execution, and then the APK file can be installed.
It should be noted that compiling android engineering to obtain installation files is a prior art for widely researching and applying at present, and will not be described here again. For example, when the integrated development environment is installed in the execution subject described above, the target android project may be compiled using the compiling function provided in the integrated development environment.
According to the method provided by the embodiment of the application, the characteristics of storing binary files in the Maven warehouse are fully utilized by storing the shared library files in the Maven warehouse, the problem of volume expansion possibly caused by storing the shared library files in the Git warehouse is solved, and the address information of the shared library files in the Maven warehouse is set in Android projects depending on the shared library files, so that the shared library stored in the Maven warehouse is acquired in an automatic mode, and then the shared library is stored in a preset Android project catalog, and finally the complete Apk application is packed.
With further reference to FIG. 3, a flow 300 of yet another embodiment of a method for compiling android projects is shown. The process 300 of the method for compiling android projects comprises the following steps:
Step 301, obtaining storage address information of each shared library file relied on by the target android project in a preset Maven warehouse.
In this embodiment, an execution body (for example, a server shown in fig. 1) of the method for compiling the android project may locally obtain storage address information of each shared library file on which the target android project depends in a preset Maven repository.
And step 302, downloading each shared library file on which the target android project depends from a preset Maven warehouse according to the storage address information by utilizing a preset shared library downloading task plugin.
In this embodiment, the executing body may download, by using a preset shared library download task plugin, each shared library file on which the target android project depends from a preset Maven repository according to the storage address information. For example, the preset shared library download task plugin may be a Gradle plugin.
Referring to fig. 4, fig. 4 is a schematic diagram illustrating an embodiment of a preset shared library download task plugin according to the present application. The preset shared library download task plugin NDPlugin is a Gradle plugin, which is a main logic control module and controls the following two parts: structure "NDExtention" and Gradle task "NDResolverTask".
Where the structure "NDExtention" is an interface exposed to the user available, for example, the user may use the interface exposed by the structure "NDExtention" to specify storage address information of each shared library file on which the target android project depends in the preset Maven repository.
The Gradle task 'NDResolverTask' is responsible for downloading each shared library file relied on by the target android project to the local. The task plugin NDPlugin adds the Gradle task NDResolverTask into the afterEvalute of the Android compiling task chain, so that each shared library file on which the target Android project depends can be downloaded to the local through the task module before the prebuild of the Android compiling task chain.
And step 303, storing each downloaded shared library file into a preset shared library folder corresponding to the target android project.
And 304, compiling the target android project to obtain an installation file corresponding to the target android project.
The specific operations of step 303 and step 304 in this embodiment are substantially the same as those of step 203 and step 204 in the embodiment shown in fig. 2, and will not be described here again.
As can be seen from fig. 3, compared with the embodiment corresponding to fig. 2, the process 300 of the method for compiling android projects in this embodiment highlights the step of downloading, by using the preset shared library download task plugins, each shared library file on which the target android project depends from the preset Maven repository according to the storage address information. Therefore, the scheme described in this embodiment can independently use the step of downloading each shared library file relied on by the target android project from the preset Maven warehouse as a plug-in, and when the code of the plug-in needs to be modified, the modification of the target android project is not involved, so that the flexibility of software modification can be improved, and the cost of software modification can be reduced.
With further reference to fig. 5, as an implementation of the method shown in the foregoing drawings, the present application provides an embodiment of an apparatus for compiling android engineering, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 5, the apparatus 500 for compiling android engineering of the present embodiment includes: an acquisition unit 501, a download unit 502, a storage unit 503, and a compiling unit 504. The acquiring unit 501 is configured to acquire storage address information of each shared library file on which the target android project depends in a preset Maven warehouse; a downloading unit 502 configured to download each shared library file on which the target android project depends from the preset Maven repository according to the storage address information; a storage unit 503 configured to store each of the downloaded shared library files into a preset shared library folder corresponding to the target android project; and the compiling unit 504 is configured to compile the target android project to obtain an installation file corresponding to the target android project.
In this embodiment, the specific processes of the obtaining unit 501, the downloading unit 502, the storage unit 503 and the compiling unit 504 of the apparatus 500 for compiling android engineering and the technical effects thereof may refer to the relevant descriptions of the steps 201, 202, 203 and 204 in the corresponding embodiment of fig. 2, and are not repeated herein.
In some optional implementations of this embodiment, each shared library file on which the target android project depends may be uploaded to the preset Maven repository through a Maven tool.
In some optional implementations of this embodiment, each shared library file on which the target android project depends may be uploaded to the preset Maven repository by accessing a preset website.
In some optional implementations of this embodiment, the acquiring unit 501 may be further configured to: and reading the storage address information of each shared library file on which the target android project depends in a preset Maven warehouse from the Gradle configuration file corresponding to the target android Zhuo Gongcheng.
In some optional implementations of this embodiment, the downloading unit 504 may be further configured to: and downloading and storing each shared library file relied on by the target android project from the preset Maven warehouse according to the storage address information by using a preset shared library downloading task plug-in.
In some alternative implementations of the present embodiment, the storage address information may include a shared library filename and version number.
It should be noted that, the implementation details and technical effects of each unit in the device for compiling android engineering provided by the embodiment of the present application may refer to the descriptions of other embodiments in the present application, and are not repeated herein.
Referring now to FIG. 6, there is illustrated a schematic diagram of a computer system 600 suitable for use in implementing an electronic device of an embodiment of the present application. The electronic device shown in fig. 6 is only an example and should not be construed as limiting the functionality and scope of use of the embodiments of the application.
As shown in fig. 6, the computer system 600 includes a central processing unit (CPU, central Processing Unit) 601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage portion 608 into a random access Memory (RAM, random Access Memory) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other through a bus 604. An Input/Output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, mouse, etc.; an output portion 607 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN (local area network ) card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The drive 610 is also connected to the I/O interface 605 as needed. Removable media 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on drive 610 so that a computer program read therefrom is installed as needed into storage section 608.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network through the communication portion 609, and/or installed from the removable medium 611. The above-described functions defined in the method of the present application are performed when the computer program is executed by a Central Processing Unit (CPU) 601. The computer readable medium according to the present application may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present application, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present application may be implemented in software or in hardware. The described units may also be provided in a processor, for example, described as: a processor includes an acquisition unit, a download unit, a storage unit, and a compiling unit. The names of these units do not constitute a limitation on the unit itself in some cases, and for example, the acquisition unit may also be described as "a unit that acquires storage address information".
As another aspect, the present application also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to: acquiring storage address information of each shared library file on which the target android project depends in a preset Maven warehouse; downloading each shared library file relied on the target android project from a preset Maven warehouse according to the storage address information; storing each downloaded shared library file into a preset shared library folder corresponding to the target android project; and compiling the target android project to obtain an installation file corresponding to the target android project.
The above description is only illustrative of the preferred embodiments of the present application and of the principles of the technology employed. It will be appreciated by persons skilled in the art that the scope of the application referred to in the present application is not limited to the specific combinations of the technical features described above, but also covers other technical features formed by any combination of the technical features described above or their equivalents without departing from the inventive concept described above. Such as the above-mentioned features and the technical features disclosed in the present application (but not limited to) having similar functions are replaced with each other.

Claims (12)

1. A method for compiling android projects, comprising:
acquiring storage address information of each shared library file on which the target android project depends in a preset Maven warehouse;
Downloading and storing all shared library files depending on the target android project from a preset Maven warehouse according to the storage address information by utilizing a preset shared library downloading task plugin, wherein the preset shared library downloading task plugin is a Gradle plugin, the Gradle plugin controls a structure body and Gradle tasks, the structure body is an interface exposed to a user, the interface is used for enabling the user to specify the storage address information of all shared library files depending on the target android project in the preset Maven warehouse, and the Gradle tasks are used for downloading all shared library files depending on the target android project to the local;
storing each downloaded shared library file into a preset shared library folder corresponding to the target android project;
compiling the target android project to obtain an installation file corresponding to the target android project.
2. The method of claim 1, wherein each shared library file on which the target android project depends is uploaded into the preset Maven repository through a Maven tool.
3. The method of claim 1, wherein each shared library file on which the target android project depends is uploaded into the preset Maven repository by accessing a preset website.
4. The method of claim 1, wherein the obtaining the storage address information of each shared library file on which the target android project depends in the preset Maven repository comprises:
and reading the storage address information of each shared library file on which the target android project depends in a preset Maven warehouse from the Gradle configuration file corresponding to the target android Zhuo Gongcheng.
5. The method of any of claims 1-4, wherein storing address information includes sharing a library file name and version number.
6. An apparatus for compiling android projects, comprising:
The acquisition unit is configured to acquire storage address information of each shared library file on which the target android project depends in a preset Maven warehouse;
The downloading unit is configured to download and store all shared library files depending on the target android project from the preset Maven warehouse according to the storage address information by using a preset shared library download task plugin, wherein the preset shared library download task plugin is a Gradle plugin, the Gradle plugin controls a structure body and Gradle tasks, the structure body is an interface exposed to a user, the interface is used for the user to specify the storage address information of all shared library files depending on the target android project in the preset Maven warehouse, and the Gradle tasks are used for downloading all shared library files depending on the target android project to the local;
the storage unit is configured to store each downloaded shared library file into a preset shared library folder corresponding to the target android project;
And the compiling unit is configured to compile the target android project to obtain an installation file corresponding to the target android project.
7. The apparatus of claim 6, wherein each shared library file on which the target android project depends is uploaded into the preset Maven repository by a Maven tool.
8. The apparatus of claim 6, wherein each shared library file on which the target android project depends is uploaded into the preset Maven repository by accessing a preset website.
9. The apparatus of claim 6, wherein the acquisition unit is further configured to:
and reading the storage address information of each shared library file on which the target android project depends in a preset Maven warehouse from the Gradle configuration file corresponding to the target android Zhuo Gongcheng.
10. The apparatus of any of claims 6-9, wherein the storage address information includes a shared library filename and version number.
11. An electronic device, comprising:
One or more processors;
a storage device having one or more programs stored thereon,
The one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-5.
12. A computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by one or more processors implements the method of any of claims 1-5.
CN201810548519.1A 2018-05-31 2018-05-31 Method and device for compiling android engineering Active CN110554876B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810548519.1A CN110554876B (en) 2018-05-31 2018-05-31 Method and device for compiling android engineering

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810548519.1A CN110554876B (en) 2018-05-31 2018-05-31 Method and device for compiling android engineering

Publications (2)

Publication Number Publication Date
CN110554876A CN110554876A (en) 2019-12-10
CN110554876B true CN110554876B (en) 2024-07-16

Family

ID=68735264

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810548519.1A Active CN110554876B (en) 2018-05-31 2018-05-31 Method and device for compiling android engineering

Country Status (1)

Country Link
CN (1) CN110554876B (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110990023B (en) * 2019-12-16 2023-06-30 上海钧正网络科技有限公司 Dependency uploading method and device of aar file, storage medium and electronic equipment
CN111158750B (en) * 2019-12-26 2023-09-26 北京金山安全软件有限公司 Packing method and device of game installation package based on Unity
CN112328241B (en) * 2020-03-16 2023-12-12 北京五八信息技术有限公司 Method and device for creating Android library module dependency relationship in application program development
CN111596951A (en) * 2020-04-09 2020-08-28 北京五八信息技术有限公司 Method and device for configuring engineering file
CN113760338B (en) * 2020-06-05 2023-07-18 北京字跳网络技术有限公司 Method and device for switching application binary interface ABI and electronic equipment
CN112052028B (en) * 2020-08-20 2024-05-14 北京智游网安科技有限公司 Android application program package generation method, terminal and storage medium
CN112148303B (en) * 2020-09-28 2024-05-28 Oppo(重庆)智能科技有限公司 File generation method, device, terminal and storage medium
CN112463123B (en) * 2020-11-25 2023-07-14 北京字跳网络技术有限公司 Task compiling method, device, network node, system and storage medium
CN112925562B (en) * 2021-02-19 2024-09-17 京东方科技集团股份有限公司 Android system-based application generation method, android system-based application generation device and storage medium
CN113050984A (en) * 2021-03-26 2021-06-29 挂号网(杭州)科技有限公司 Resource calling method and device, electronic equipment and storage medium
CN113094086B (en) * 2021-04-13 2024-01-19 贝壳找房(北京)科技有限公司 Component integration method, device, computer readable storage medium and electronic equipment
CN113342355B (en) * 2021-08-06 2021-12-07 北京达佳互联信息技术有限公司 Code compiling method and device, electronic equipment and storage medium
CN114090064A (en) * 2021-11-26 2022-02-25 福建星网视易信息系统有限公司 Automatic generation method and storage medium for version number of android application program
CN117251165B (en) * 2023-08-24 2024-06-25 上海合芯数字科技有限公司 Buildroot compiling method, buildroot compiling device, terminal and medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10102212B2 (en) * 2012-09-07 2018-10-16 Red Hat, Inc. Remote artifact repository
CN106104467B (en) * 2014-06-30 2019-09-27 北京新媒传信科技有限公司 A kind of Automation arranging method and terminal
CN106095523A (en) * 2016-06-03 2016-11-09 北京奇虎科技有限公司 A kind of method and system realizing Android compiling isolation
CN106528258A (en) * 2016-10-28 2017-03-22 武汉斗鱼网络科技有限公司 Method and system for improving compiling speed of Android project
CN107783765A (en) * 2017-10-17 2018-03-09 杭州迪普科技股份有限公司 file compiling method and device

Also Published As

Publication number Publication date
CN110554876A (en) 2019-12-10

Similar Documents

Publication Publication Date Title
CN110554876B (en) Method and device for compiling android engineering
US8893077B1 (en) Service to generate API libraries from a description
CN110389762B (en) Method and device for processing AAR package in Android engineering
CN110990023B (en) Dependency uploading method and device of aar file, storage medium and electronic equipment
CN109766099A (en) Front end source code Compilation Method, device, storage medium and computer equipment
GB2589658A (en) Method and apparatus for running an applet
CN110960855B (en) Communication protocol code updating method and device, electronic equipment and storage medium
CN111309304B (en) Method, device, medium and electronic equipment for generating IDL file
CN110780874B (en) Method and device for generating information
WO2019029451A1 (en) Method for publishing mobile applications and electronic apparatus
CN112631590B (en) Component library generation method, device, electronic equipment and computer readable medium
CN108089870B (en) Method and apparatus for repairing applications
CN110489162B (en) Method, device, medium and equipment for simplifying installation package SO (storage and retrieval) file
US10171627B2 (en) Download of a package of code
US20140007053A1 (en) Dynamically configuring an integrated development environment
CN110502251B (en) Application installation method and device
US9075679B1 (en) Creating a prerequisite checklist corresponding to a software application
CN110457040B (en) Method and device for distributed construction of source code
CN112181408A (en) Method and device for displaying view list on front page of application program
CN115080077A (en) Plug-in updating method, device, electronic equipment, system and storage medium
CN114153462A (en) Client source code processing method and device, storage medium and electronic equipment
EP3001311A1 (en) Method for automatically converting web applications into application that can be installed automatically on a plurality of platforms
CN113760706B (en) Webpage debugging method and device
US20240329971A1 (en) Method, apparatus, device, medium and product for application package generation
CN111078324B (en) Method and apparatus for prefetching page data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TG01 Patent term adjustment
TG01 Patent term adjustment