CN110554876A - Method and device for compiling android project - Google Patents

Method and device for compiling android project Download PDF

Info

Publication number
CN110554876A
CN110554876A CN201810548519.1A CN201810548519A CN110554876A CN 110554876 A CN110554876 A CN 110554876A CN 201810548519 A CN201810548519 A CN 201810548519A CN 110554876 A CN110554876 A CN 110554876A
Authority
CN
China
Prior art keywords
shared library
preset
android project
maven
target android
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.)
Granted
Application number
CN201810548519.1A
Other languages
Chinese (zh)
Other versions
CN110554876B (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 projects. One embodiment of the method comprises: the method comprises the steps of obtaining storage address information of each shared library file depended by a target android project in a preset Maven warehouse; downloading each shared library file depended by 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 implementation method realizes android engineering compiling under the condition of reducing the size of the code warehouse.

Description

Method and device for compiling android project
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 projects.
Background
If there is a dependency on a shared library file (i.e., so file) in the code of current Android (Android) applications, the shared library file is typically stored in the Git code repository and downloaded from the Git code repository and stored for compilation use prior to compilation, typically in order to speed up compilation.
However, the Git repository is adapted to store different versions of text files, and only difference files can be stored when storing text files, which in turn can reduce storage space. However, the Git repository is not dedicated to storing binary files, and when storing binary files, differential files cannot be stored, and full files must be stored each time. And the shared library file is a binary file, and the volume of the Git warehouse can be rapidly expanded due to the fact that different versions of the shared library file are submitted for many times.
Disclosure of Invention
The embodiment of the application provides a method and a device for compiling android projects.
In a first aspect, an embodiment of the present application provides a method for compiling an android project, where the method includes: the method comprises the steps of obtaining storage address information of each shared library file depended by a target android project in a preset Maven warehouse; downloading each shared library file depended by 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 into 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 relied on by the target android project in a preset Maven repository includes: and reading the storage address information of each shared library file depended by the target android project in a preset Maven warehouse from the Gradle configuration file corresponding to the target android project.
In some embodiments, downloading, from a preset Maven repository, each shared library file on which the target android project depends according to the storage address information includes: and downloading the task plug-in by using a preset shared library, and downloading and storing each shared library file depended by the target android project from a preset Maven warehouse according to the storage address information.
In some embodiments, the storage address information includes a shared library file name and a version number.
in a second aspect, an embodiment of the present application provides an apparatus for compiling an android project, where the apparatus includes: the obtaining unit is configured to obtain storage address information of each shared library file depended by the target android project in a preset Maven warehouse; the downloading unit is configured to download each shared library file depended by the target android project 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 the installation files corresponding to the target android project.
in some embodiments, each shared library file on which the target android project depends is uploaded into 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 obtaining unit is further configured to: and reading the storage address information of each shared library file depended by the target android project in a preset Maven warehouse from the Gradle configuration file corresponding to the target android project.
In some embodiments, the download unit is further configured to: and downloading the task plug-in by using a preset shared library, and downloading and storing each shared library file depended by the target android project from a preset Maven warehouse according to the storage address information.
In some embodiments, the storage address information includes a shared library file name and a version number.
In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors; a storage device, on which one or more programs are stored, which, when executed by the one or more processors, cause the one or more processors to implement the method as described in any implementation manner of the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium on which a computer program is stored, where the computer program, when executed by one or more processors, implements the method as described in any implementation manner of the first aspect.
According to the method and the device for compiling the android project, the shared library file is stored in the Maven warehouse, the characteristic that the Maven warehouse stores the binary file is fully utilized, and the problem of volume expansion possibly caused by the fact that the shared library file is stored in the Git warehouse is solved. In addition, in the process of compiling the Android project to obtain the installation files, the storage address information of each shared library file depended by the target Android project in a preset Maven warehouse is firstly obtained, then each shared library file depended by the target Android project is downloaded from the preset Maven warehouse according to the storage address information, then 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 files corresponding to the target Android project. Therefore, under the condition of reducing the size of the code warehouse, the shared library stored in the Maven warehouse is acquired in an automatic mode, then the shared library is stored in a preset Android engineering catalog, and finally the shared library is packaged into a complete Apk application.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for compiling an android project, in accordance with the present application;
FIG. 3 is a flow diagram of yet another embodiment of a method for compiling an android project in accordance with the application;
FIG. 4 is a block diagram illustrating an embodiment of a pre-defined shared library download task plug-in according to the present application;
FIG. 5 is a schematic diagram illustrating one embodiment of an apparatus for compiling android projects in accordance with the subject application;
FIG. 6 is a schematic block diagram of a computer system suitable for use in implementing an electronic device according to embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
fig. 1 illustrates an exemplary system architecture 100 to which embodiments of the present method for or apparatus for compiling android projects may be applied.
as shown in fig. 1, the system architecture 100 may include upload terminal devices 101, 102, 103, a network 104, a Maven repository server 105, a network 106, and a download terminal device 107, the network 104 being a medium to provide a communication link between the upload terminal devices 101, 102, 103 and the Maven repository server 105. The network 106 serves as a medium for providing a communication link between the Maven repository server 105 and the download terminal device 107. Network 104 and network 106 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may use the upload terminal device 101, 102, 103 to interact with the Maven repository server 105 over the network 104 to receive or send messages or the like. The upload terminal devices 101, 102, 103 may have various communication client applications installed thereon, such as a Maven repository client, a web browser, a code editing application, a shared library compiling application, an Integrated Development Environment (IDE), and so on.
The user may also use the download terminal device 107 to interact with the Maven repository server 105 over the network 106 to receive or send messages or the like. The download terminal 107 may have various communication client applications installed thereon, such as a Maven warehouse client, a web browser, an integrated development environment (e.g., Android Studio, Gradle), and so on.
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 having a display screen and supporting uploading of shared library files, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like. When the upload terminal apparatuses 101, 102, and 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented as multiple pieces of software or software modules (e.g., to provide a shared library upload class service) or as a single piece of software or software module. And is not particularly limited herein.
The download terminal apparatus 107 may be hardware or software. When the download terminal device 107 is hardware, it may be various electronic devices having a display screen and supporting shared library file downloading and android project compilation, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like. When the download terminal device 107 is software, it can be installed in the electronic devices listed above. It may be implemented as multiple software or software modules (e.g., to provide shared library file download and android project compilation services) or as a single software or software module. And 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 upload terminal apparatuses 101, 102, and 103, and the Maven repository server 105 may analyze and process data such as a shared library file download request received from the download terminal apparatus 107, and feed back a processing result (for example, the shared library file) to the download terminal apparatus 107.
It should be noted that the Maven repository server 105 may be hardware or software. When Maven repository server 105 is hardware, it may be implemented as a distributed server cluster composed of multiple servers, or may be implemented as a single server. When the Maven repository server 105 is software, it may be implemented as multiple pieces of software or software modules (e.g., to provide Maven repository services) or as a single piece of software or software module. And is not particularly limited herein.
It should be noted that the method for compiling an android project provided in the embodiment of the present application is generally executed by the downloading terminal device 107, and accordingly, the apparatus for compiling an android project is generally disposed in the downloading terminal device 107.
It should be understood that the number of uploading end devices, networks, Maven servers and downloading end devices in fig. 1 is merely illustrative. There may be any number of upload terminal devices, networks, Maven servers, and download terminal devices, as desired for implementation. In addition, the uploading terminal device shown in fig. 1 may also be a downloading terminal device, and the downloading terminal device shown in fig. 1 may also be an uploading terminal device.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for compiling an android project in accordance with the subject application is illustrated. The method for compiling the android project comprises the following steps:
Step 201, obtaining storage address information of each shared library file depended by the target android project in a preset Maven warehouse.
In this embodiment, an execution subject (for example, the downloading terminal 107 shown in fig. 1) of the method for compiling an android project may locally obtain storage address information of each shared library file depended by the target android project in a preset Maven repository.
Here, the preset Maven repository may be a local repository, i.e. where Maven is at the local storage means.
Here, the preset Maven warehouse may also be a remote warehouse. The preset Maven warehouse can be a central warehouse or a private server. The central warehouse is a default remote warehouse, and when Maven is installed, the Maven is self-contained in the central warehouse. The private server is a special remote warehouse which is a warehouse service erected in the local area network and acts on the remote warehouse on the wide area network for the Maven user in the local area network to use. When Maven needs to download the component, the Maven requests from the private server, if the component does not exist on the private server, the Maven downloads the component from an external remote warehouse, and after the component is cached on the private server, the Maven provides service for the download request of the Maven.
Here, the execution agent may be installed with an integrated development environment (e.g., Android Studio) for generating an Android project, and the target Android project may be any one of the integrated development environments installed in the execution agent, and only the target Android project is described herein as an example.
It will be appreciated that an android project may include various files required to compile android application installation files, for example, and may include, but is not limited to, the following files:
(1) Code files of the src folder;
(2) R files stored in the gen folder;
(3) Resource files stored in the assets folder, such as picture, 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) xml, a file stored in a values folder, for example, string, wherein a character string is placed in the file;
(10) xml, a style file stored in a styles file, for example, storing dp values;
(11) Xml, this file is called a manifest file in android, and contains configuration information of the entire application.
The storage address information of each shared library file depended by the target android project in the preset Maven warehouse can be stored in any one of the configuration files specified in the target android project.
in some optional implementations of this embodiment, a Gradle may be further installed in the execution main body. Here, Gradle is a project automation building tool based on the concepts of Apache Ant and Apache major, which declares project settings using a Groovy-based Domain-Specific Language (DSL), and discards various cumbersome configurations based on XML (Extensible Markup Language). Then, the storage address information of each shared library file depended by the target android project in the preset Maven repository can be read from the Gradle configuration file (e.g., build.
Here, each shared library file relied on by the target android project stored in the preset Maven repository may be uploaded to the electronic device in which the preset Maven repository is located by another electronic device network-connected to the electronic device in which the preset Maven repository is located.
In some optional implementations of the 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 relied on by the target android project may also be uploaded to a preset Maven repository by accessing a preset website (e.g., a website providing a Maven repository service).
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. Where the file name is used to identify the shared library file and the version number is used to identify the specific version of the shared library. In practice, the storage address information of the shared library file in the preset Maven repository can be expressed as three fields of "group: name: version", and a specific shared library file is located on the preset Maven repository through the three fields.
And 202, downloading each shared library file depended by the target android project from a preset Maven warehouse according to the storage address information.
In this embodiment, the executing entity (for example, the downloading terminal device 107 shown in fig. 1) may download, from the preset Maven repository, each shared library file on which the target android project depends according to the storage address information obtained in step 201. In practice, the execution body may have an application installed therein to support the Maven warehouse downloading, for example, the application may be a Maven warehouse client, or may also be a Gradle, which also supports various operations of the Maven warehouse. In this way, the executing agent may utilize an application supporting Maven repository download to download the various shared library files 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 execution subject 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 the jniLibs folder 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 main body may compile a target Android project by using various implementation manners, and 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 is directly transmitted to the Android simulator or the Android mobile phone to be executed, and then installation can be carried out.
it should be noted that compiling the android project to obtain the installation file is a prior art widely studied and applied at present, and is not described herein again. For example, when the integrated development environment is installed in the execution agent, the target android project can be compiled by using the compiling function provided in the integrated development environment.
the method provided by the embodiment of the application fully utilizes the characteristic that the Maven warehouse stores binary files by storing the shared library files in the Maven warehouse, solves the problem of volume expansion possibly caused by storing the shared library files in the Git warehouse, and sets the address information of the shared library files in the Maven warehouse in an Android project depending on the shared library files, so that the shared libraries stored in the Maven warehouse are acquired in an automatic mode, then are stored in a preset Android project catalog, and finally are packaged into a complete Apk application.
With further reference to FIG. 3, a flow 300 of yet another embodiment of a method for compiling an android project is illustrated. The flow 300 of the method for compiling an android project includes the following steps:
Step 301, obtaining storage address information of each shared library file depended by the target android project in a preset Maven warehouse.
In this embodiment, an execution subject (e.g., a server shown in fig. 1) of the method for compiling an android project may locally obtain storage address information of each shared library file relied on by a target android project in a preset Maven repository.
And 302, downloading the task plug-in by using a preset shared library, and downloading each shared library file depended by the target android project from a preset Maven warehouse according to the storage address information.
In this embodiment, the execution main body may download the task plug-in by using a preset shared library, and download each shared library file that the target android project depends on from a preset Maven warehouse according to the storage address information. For example, the preset shared library download task plug-in may be a Gradle plug-in.
Referring to fig. 4, fig. 4 is a schematic structural diagram illustrating an embodiment of downloading a task plug-in from a pre-defined shared library according to the present application. The preset shared library download task plug-in 'NDPlugin' is a Gradle plug-in and is a main logic control module, and the task plug-in controls the following two parts: the structures "ndextension" and the Gradle task "ndresolveftask".
The structure "ndextension" is an interface exposed to a user, for example, the user may use the interface exposed by the structure "ndextension" to specify storage address information of each shared library file depended by the target android project in a preset Maven repository.
The Gradle task "NDResolverTask" is responsible for downloading locally the various shared library files that the target android project relies on. The task plug-in 'NDPlugin' adds the Gradle task 'NDResolverTask' into 'afterEvente' in the Android compiling task chain, so that each shared library file depended by the target Android project can be downloaded to the local through the task module before 'prebuild' in the Android compiling task chain.
And 303, storing each downloaded shared library file into a preset shared library folder corresponding to the target android project.
And step 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 the operations of step 203 and step 204 in the embodiment shown in fig. 2, and are not described again here.
as can be seen from fig. 3, compared with the embodiment corresponding to fig. 2, the flow 300 of the method for compiling an android project in this embodiment highlights a step of downloading task plug-ins using a preset shared library, and downloading each shared library file relied on by a target android project from a preset Maven repository according to 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 above-mentioned figures, the present application provides an embodiment of an apparatus for compiling an android project, 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 an android project of the present embodiment includes: an acquisition unit 501, a download unit 502, a storage unit 503, and a compiling unit 504. The obtaining unit 501 is configured to obtain storage address information of each shared library file depended by the target android project in a preset Maven warehouse; a downloading unit 502, configured to download, from the preset Maven repository, each shared library file on which the target android project depends according to the storage address information; a storage unit 503, configured to store each downloaded shared library file into a preset shared library folder corresponding to the target android project; and a compiling unit 504 configured to compile the target android project to obtain an installation file corresponding to the target android project.
in this embodiment, for specific processing of the obtaining unit 501, the downloading unit 502, the storing unit 503 and the compiling unit 504 of the apparatus 500 for compiling an android project and technical effects brought by the processing, reference may be made to the related descriptions of step 201, step 202, step 203 and step 204 in the corresponding embodiment of fig. 2, which are not described herein again.
In some optional implementations of the 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 implementation manners 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 obtaining unit 501 may be further configured to: and reading the storage address information of each shared library file depended by the target android project in a preset Maven warehouse from the Gradle configuration file corresponding to the target android project.
In some optional implementations of this embodiment, the downloading unit 504 may be further configured to: and downloading a task plug-in by using a preset shared library, and downloading and storing each shared library file depended by the target android project from the preset Maven warehouse according to the storage address information.
In some optional implementations of this embodiment, the storage address information may include a shared library file name and a version number.
It should be noted that, for details of implementation and technical effects of each unit in the apparatus for compiling an android project provided in the embodiment of the present application, reference may be made to descriptions of other embodiments in the present application, and details are not described herein again.
Referring now to FIG. 6, shown is a block diagram of a computer system 600 suitable for use in implementing the electronic device of an embodiment of the present application. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
as shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601, which 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 section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM602, and RAM 603 are connected to each other via 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, a mouse, and the like; an output section 607 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; 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 driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the 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 illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the method of the present application when executed by a Central Processing Unit (CPU) 601. It should be noted that the computer readable medium described herein can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination 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 present application, 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 this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. 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 for aspects 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 + + or the like 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 type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart 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 described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes an acquisition unit, a download unit, a storage unit, and a compiling unit. Here, the names of these units do not constitute a limitation to 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, which may be contained in the apparatus described in the above embodiments; or may be present separately and not assembled into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to: the method comprises the steps of obtaining storage address information of each shared library file depended by a target android project in a preset Maven warehouse; downloading each shared library file depended by 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 a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (14)

1. A method for compiling android projects, comprising:
The method comprises the steps of obtaining storage address information of each shared library file depended by a target android project in a preset Maven warehouse;
downloading each shared library file depended by the target android project from the 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.
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 storage address information of each shared library file depended by the target android project in a preset Maven repository comprises:
And reading the storage address information of each shared library file depended by the target android project in a preset Maven warehouse from the Gradle configuration file corresponding to the target android project.
5. The method of claim 1, wherein the downloading, from the preset Maven repository according to the storage address information, each shared library file on which the target android project depends includes:
and downloading task plug-ins by using a preset shared library, and downloading and storing each shared library file depended by the target android project from the preset Maven warehouse according to the storage address information.
6. The method of any of claims 1-5, wherein the storage address information comprises a shared library file name and a version number.
7. An apparatus for compiling android projects, comprising:
The obtaining unit is configured to obtain storage address information of each shared library file depended by the target android project in a preset Maven warehouse;
the downloading unit is configured to download each shared library file depended by the target android project from the preset Maven warehouse according to the storage address information;
a storage unit 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.
8. The apparatus of claim 7, wherein the respective shared library files on which the target android project depends are uploaded into the preset Maven repository through a Maven tool.
9. The apparatus of claim 7, wherein each shared library file on which the target android project depends is uploaded into the preset Maven repository by accessing a preset website.
10. the apparatus of claim 7, wherein the obtaining unit is further configured to:
And reading the storage address information of each shared library file depended by the target android project in a preset Maven warehouse from the Gradle configuration file corresponding to the target android project.
11. The apparatus of claim 7, wherein the download unit is further configured to:
And downloading task plug-ins by using a preset shared library, and downloading and storing each shared library file depended by the target android project from the preset Maven warehouse according to the storage address information.
12. The apparatus of any of claims 7-11, wherein the storage address information comprises a shared library file name and a version number.
13. 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 recited in any of claims 1-6.
14. a computer-readable storage medium, on which a computer program is stored, wherein the computer program, when executed by one or more processors, implements the method of any one of claims 1-6.
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 true CN110554876A (en) 2019-12-10
CN110554876B 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)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110990023A (en) * 2019-12-16 2020-04-10 上海钧正网络科技有限公司 aar file dependency uploading method and device, storage medium and electronic equipment
CN111158750A (en) * 2019-12-26 2020-05-15 北京金山安全软件有限公司 Unity-based game installation package packaging method and device
CN111596951A (en) * 2020-04-09 2020-08-28 北京五八信息技术有限公司 Method and device for configuring engineering file
CN112052028A (en) * 2020-08-20 2020-12-08 北京智游网安科技有限公司 Android application package generation method, terminal and storage medium
CN112148303A (en) * 2020-09-28 2020-12-29 Oppo(重庆)智能科技有限公司 File generation method, device, terminal and storage medium
CN112328241A (en) * 2020-03-16 2021-02-05 北京五八信息技术有限公司 Method and device for creating Android library module dependency relationship in application development
CN112463123A (en) * 2020-11-25 2021-03-09 北京字跳网络技术有限公司 Task compiling method, device, network node, system and storage medium
CN112925562A (en) * 2021-02-19 2021-06-08 京东方科技集团股份有限公司 Application generation method and device based on android system and storage medium
CN113050984A (en) * 2021-03-26 2021-06-29 挂号网(杭州)科技有限公司 Resource calling method and device, electronic equipment and storage medium
CN113094086A (en) * 2021-04-13 2021-07-09 北京房江湖科技有限公司 Component integration method and device, computer-readable storage medium and electronic equipment
CN113342355A (en) * 2021-08-06 2021-09-03 北京达佳互联信息技术有限公司 Code compiling method and device, electronic equipment and storage medium
CN113760338A (en) * 2020-06-05 2021-12-07 北京字跳网络技术有限公司 Method and device for switching application program binary interface ABI and electronic equipment
CN117251165A (en) * 2023-08-24 2023-12-19 上海合芯数字科技有限公司 Method, device, terminal and medium for compiling building

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140074849A1 (en) * 2012-09-07 2014-03-13 Ondrej Zizka Remote artifact repository
CN106095523A (en) * 2016-06-03 2016-11-09 北京奇虎科技有限公司 A kind of method and system realizing Android compiling isolation
CN106104467A (en) * 2014-06-30 2016-11-09 北京新媒传信科技有限公司 A kind of Automation arranging method and terminal
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

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140074849A1 (en) * 2012-09-07 2014-03-13 Ondrej Zizka Remote artifact repository
CN106104467A (en) * 2014-06-30 2016-11-09 北京新媒传信科技有限公司 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

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
饮茶仙人: ""[Android Studio系列(三)]Android Studio 编译、同步慢的解决方法"", pages 1, Retrieved from the Internet <URL:www.360doc.com/content/17/0311/13/21535613_635804707.shtml> *

Cited By (20)

* 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
CN110990023A (en) * 2019-12-16 2020-04-10 上海钧正网络科技有限公司 aar file dependency uploading method and device, storage medium and electronic equipment
CN111158750A (en) * 2019-12-26 2020-05-15 北京金山安全软件有限公司 Unity-based game installation package packaging method and device
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
CN112328241A (en) * 2020-03-16 2021-02-05 北京五八信息技术有限公司 Method and device for creating Android library module dependency relationship in application development
CN111596951A (en) * 2020-04-09 2020-08-28 北京五八信息技术有限公司 Method and device for configuring engineering file
CN113760338A (en) * 2020-06-05 2021-12-07 北京字跳网络技术有限公司 Method and device for switching application program binary interface ABI and electronic equipment
CN112052028A (en) * 2020-08-20 2020-12-08 北京智游网安科技有限公司 Android application package generation method, terminal and storage medium
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
CN112148303A (en) * 2020-09-28 2020-12-29 Oppo(重庆)智能科技有限公司 File generation method, device, terminal and storage medium
CN112463123A (en) * 2020-11-25 2021-03-09 北京字跳网络技术有限公司 Task compiling method, device, network node, system and storage medium
CN112925562A (en) * 2021-02-19 2021-06-08 京东方科技集团股份有限公司 Application generation method and device based on android system 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
CN113094086A (en) * 2021-04-13 2021-07-09 北京房江湖科技有限公司 Component integration method and 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
CN113342355A (en) * 2021-08-06 2021-09-03 北京达佳互联信息技术有限公司 Code compiling method and device, electronic equipment and storage medium
CN117251165A (en) * 2023-08-24 2023-12-19 上海合芯数字科技有限公司 Method, device, terminal and medium for compiling building

Also Published As

Publication number Publication date
CN110554876B (en) 2024-07-16

Similar Documents

Publication Publication Date Title
CN110554876B (en) Method and device for compiling android engineering
US8612947B2 (en) System and method for remotely compiling multi-platform native applications for mobile devices
CN110990023B (en) Dependency uploading method and device of aar file, storage medium and electronic equipment
CN110389762B (en) Method and device for processing AAR package in Android engineering
CN111221572B (en) Method, device, medium and equipment for automatically adapting to running environment
CN110960855B (en) Communication protocol code updating method and device, electronic equipment and storage medium
CN110780874B (en) Method and device for generating information
CN112631590B (en) Component library generation method, device, electronic equipment and computer readable medium
WO2019029451A1 (en) Method for publishing mobile applications and electronic apparatus
CN111309375A (en) Method, device, medium and electronic equipment for generating remote procedure call toolkit
CN110489162B (en) Method, device, medium and equipment for simplifying installation package SO (storage and retrieval) file
CN111309304B (en) Method, device, medium and electronic equipment for generating IDL file
CN113127000B (en) Compiling method, compiling device, compiling equipment and compiling storage medium for application program component
US10171627B2 (en) Download of a package of code
US9135001B2 (en) Dynamically configuring an integrated development environment
CN113296828A (en) Method, server and system for issuing application
CN112597134A (en) Configuration method and device of distributed configuration center, electronic equipment and medium
CN112181408A (en) Method and device for displaying view list on front page of application program
CN110851194A (en) Method and device for acquiring code for realizing new interface
CN111124523A (en) Method and apparatus for initializing applications
CN115080077A (en) Plug-in updating method, device, electronic equipment, system and storage medium
CN113656050B (en) Method and apparatus for generating version number
CN113741951B (en) Local packing method and device
CN113760706B (en) Webpage debugging method and device
CN111767237B (en) Inter-module communication method and device

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