CN115934151A - Method and device for building multi-terminal small program - Google Patents

Method and device for building multi-terminal small program Download PDF

Info

Publication number
CN115934151A
CN115934151A CN202211457022.1A CN202211457022A CN115934151A CN 115934151 A CN115934151 A CN 115934151A CN 202211457022 A CN202211457022 A CN 202211457022A CN 115934151 A CN115934151 A CN 115934151A
Authority
CN
China
Prior art keywords
version information
file
information
version
code
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.)
Pending
Application number
CN202211457022.1A
Other languages
Chinese (zh)
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 Zhenshi Information Technology Co Ltd
Original Assignee
Beijing Jingdong Zhenshi 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 Zhenshi Information Technology Co Ltd filed Critical Beijing Jingdong Zhenshi Information Technology Co Ltd
Priority to CN202211457022.1A priority Critical patent/CN115934151A/en
Publication of CN115934151A publication Critical patent/CN115934151A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Abstract

The invention discloses a method and a device for constructing a multi-terminal small program, wherein a specific implementation mode of the method comprises the following steps: acquiring file information of an applied project engineering code file through a file system interface, and carrying out construction environment verification; analyzing code branch information from the project engineering code file by using a command line execution tool, and performing code branch verification; under the condition that the construction environment check and the code branch check are both passed, analyzing the current version information of the application from the project engineering code file by using a command line execution tool, and determining the construction version information according to the current version information by using a version number tool; and constructing the multi-terminal applet of the application by using a multi-terminal applet framework according to the constructed version information. The implementation method can automatically realize the construction environment verification, the code branch verification and the construction version management, realize the parallel construction of the multi-terminal small programs, avoid the problem of low fault tolerance rate caused by manual operation, and greatly improve the construction efficiency.

Description

Method and device for building multi-terminal small program
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for constructing a multi-terminal applet.
Background
And (3) building the applet, namely compiling and packaging the source code of the applet application, and finally obtaining the program package which can be used for deployment and release. With the development of software specifications, the application building phase often includes other nodes, such as building environment checking, version management, branch checking, and the like. The existing multi-terminal applet construction scheme mainly comprises the steps that a developer manually conducts untracked code management, then manually conducts construction environment verification, version management, branch verification and the like, finally serially conducts applet construction, and finally obtains a production package of each terminal applet.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
the developer manually checks each link in the construction stage, the fault tolerance rate is low, and the final production package construction error can be caused by negligence of any link, so that the deployment and the release of the small program are influenced finally; when a multi-terminal applet is constructed, developers need to carry out applet construction and packaging according to terminals, manual serial operation is carried out, and packaging efficiency is low.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for building a multi-end applet, which can automatically implement building environment verification, code branch verification, and building version management, can implement parallel building of the multi-end applet, avoid a problem of low fault tolerance rate caused by manual operation, and greatly improve building efficiency.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method of multi-endpoint applet construction, including:
acquiring file information of the applied project engineering code file through a file system interface, and carrying out construction environment verification;
analyzing code branch information from the project engineering code file by using a command line execution tool, and performing code branch verification;
under the condition that the construction environment check and the code branch check are both passed, analyzing the current version information of the application from the project engineering code file by using a command line execution tool, and determining the construction version information according to the current version information by using a version number tool;
and constructing the multi-terminal applet of the application by using a multi-terminal applet framework according to the constructed version information.
Optionally, after determining the constructed version information according to the current version information, the method further includes: and generating a constructed version identification according to the constructed version information.
Optionally, after determining the constructed version information according to the current version information, the method further includes: and generating a change log according to the constructed version information.
Optionally, before obtaining the file information of the project engineering code file of the application through the file system interface, the method further includes:
creating a release script file in the project code directory of the application to obtain a project code file of the application; and submitting the project engineering code file of the application to a local warehouse by using a command line execution tool, and acquiring the project engineering code file of the application from the local warehouse through a file system interface.
Optionally, the obtaining of the file information of the project code file of the application through the file system interface, and the checking of the construction environment, include:
acquiring the file information line by line through a file system interface to perform regular matching so as to check whether the information content of the current line is matched with the environment variable of the production environment; if so, the constructed environment passes the verification, otherwise, the constructed environment does not pass the verification.
Optionally, determining, by using a version number tool, to construct version information according to the current version information, including:
and determining one or more candidate version information according to the current version information by using a version number tool, and taking the candidate version information selected by a user from the one or more candidate version information as the constructed version information.
Optionally, after determining one or more candidate version information according to the current version information by using a version number tool, the method further includes:
presenting the one or more candidate version information via an interactive command line tool for selection by a user.
According to a second aspect of the embodiments of the present invention, there is provided an apparatus for multi-port applet construction, including:
the construction environment checking module is used for acquiring the file information of the project engineering code file of the application through a file system interface and carrying out construction environment checking;
the code branch checking module analyzes code branch information from the project engineering code file by using a command line execution tool and performs code branch checking;
the construction version determining module is used for analyzing the current version information of the application from the project engineering code file by using a command line execution tool under the condition that the construction environment check and the code branch check are passed, and determining the construction version information according to the current version information by using a version number tool;
and the multi-terminal program building module is used for building the multi-terminal applet of the application by using a multi-terminal applet framework according to the built version information.
Optionally, the apparatus further includes a version identifier generating module, configured to: and after the constructed version information is determined according to the current version information, a constructed version identifier is generated according to the constructed version information.
Optionally, the apparatus further comprises a change log generation module, configured to: and after the constructed version information is determined according to the current version information, generating a change log according to the constructed version information.
Optionally, the apparatus further comprises an engineering code submission module configured to: before file information of an applied project engineering code file is acquired through a file system interface, a release script file is created in an applied project code directory to obtain the applied project engineering code file; submitting the project engineering code file of the application to a local repository using a command line execution tool;
and the construction environment checking module acquires the project engineering code file of the application from a local warehouse through a file system interface.
Optionally, the creating environment checking module obtains file information of the project engineering code file of the application through a file system interface to perform creating environment checking, including:
acquiring the file information line by line through a file system interface to perform regular matching so as to check whether the information content of the current line is matched with the environmental variable of the production environment; if so, the constructed environment passes the verification, otherwise, the constructed environment does not pass the verification.
Optionally, the determining the constructed version information by the constructed version determining module according to the current version information by using a version number tool includes:
and determining one or more candidate version information according to the current version information by using a version number tool, and taking the candidate version information selected by a user from the one or more candidate version information as the constructed version information.
Optionally, the build version determination module is further configured to: after determining one or more candidate version information from the current version information using a version number tool, the one or more candidate version information is presented for user selection via an interactive command line tool.
According to a third aspect of an embodiment of the present invention, there is provided an electronic device constructed by a multi-terminal applet, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method provided by the first aspect of the embodiments of the present invention.
According to a fourth aspect of embodiments of the present invention, there is provided a computer readable medium, on which a computer program is stored, which when executed by a processor, implements the method provided by the first aspect of embodiments of the present invention.
One embodiment of the above invention has the following advantages or benefits: the file system interface is used for acquiring the file information of the applied project engineering code file to carry out construction environment verification, and the command line execution tool and the version number tool are used for carrying out code branch verification and determining construction version information, so that the construction environment verification, the code branch verification and the construction version management can be automatically realized, and the problem of low fault tolerance rate caused by manual operation is avoided; by constructing the multi-terminal applet through the multi-terminal applet framework, the parallel construction of the multi-terminal applet can be realized, and the construction efficiency is greatly improved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic flow chart of a method for building a multi-port applet, in accordance with an embodiment of the present invention;
FIG. 2 is a flow diagram illustrating code management in an alternative embodiment of the invention;
FIG. 3 is a schematic flow chart illustrating verification of a build environment in an alternative embodiment of the present invention;
FIG. 4 is a flow diagram illustrating the checking of code branches in an alternative embodiment of the present invention;
FIG. 5 is a flow diagram illustrating the implementation of build version management in an alternative embodiment of the present invention;
FIG. 6 is a schematic flow chart of generating a build version identification in an alternative embodiment of the present invention;
FIG. 7 is a schematic flow chart of generating an application change log in an alternative embodiment of the present invention;
FIG. 8 is a flow diagram of a multi-terminal compilation build in an alternative embodiment of the invention;
FIG. 9 is a schematic flow chart diagram of a method for multi-terminal applet construction in an alternative embodiment of the present invention;
FIG. 10 is a schematic diagram of the main modules of a multi-port applet build apparatus according to an embodiment of the present invention;
FIG. 11 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 12 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
According to one aspect of the embodiment of the invention, a method for constructing a multi-terminal small program is provided.
Fig. 1 is a schematic main flow diagram of a method for building a multi-port applet according to an embodiment of the present invention, and as shown in fig. 1, the method for building a multi-port applet according to an embodiment of the present invention includes: step S101, step S102, step S103, and step S104.
And S101, acquiring file information of the project engineering code file of the application through a file system interface, and verifying a construction environment.
The method comprises the following steps of obtaining a project code file of an application through a file system interface, and analyzing file information of the project code file. The project code file of the application contains the source code of the application, and after the path information of the project file of the application is determined, the project code file can be directly obtained through a file system interface. In order to facilitate automatic execution, before file information of a project engineering code file of an application is acquired through a file system interface, a release script file may be created in a project code directory of the application to obtain the project engineering code file of the application.
The project code file may be stored in a specific location, for example, the project code file of the application may be submitted to a local repository using a command line execution tool, or may be submitted to a repository temporary storage area and then submitted to the local repository, and the project code file of the application may be obtained from the local repository through a file system interface.
Fig. 2 shows a flow diagram of code management in an alternative embodiment of the present invention, and in the embodiment shown in fig. 2, untracked code (i.e., code that is not committed to the repository staging or local repository) management is performed through node. Js is a JavaScript running environment based on a Chrome V8 engine, and an event-driven and non-blocking I/O model is used to enable the JavaScript to run on a development platform of a server. git is an open source distributed version control system, can process project version management, and is open source version control software. Referring to fig. 2, a node.js script file is created, that is, a JavaScript file related to the script file is added to the project code directory of the project code file, then a command line execution tool library execa is introduced, the project code file is submitted to the code warehouse buffer by executing a git command "execa (' git ', [ ' add ', ' ])" command (or by using other tools), and the project code file is submitted to the local warehouse by executing a command "execa (' git ', [ ' commit ', ' -m ', ' eat: last commit ' ])".
When a developer creates an applet, the developer will generally customize the environment variables of the production environment according to the actual situation. And performing construction environment check on the applied project engineering code file, wherein the purpose is to check whether the information content in the project engineering code file is matched with the environment variable of the production environment. In the actual application process, the file information can be acquired line by line through a file system interface for regular matching so as to check whether the information content of the current line is matched with the environmental variable of the production environment; if so, the constructed environment passes the verification, otherwise, the constructed environment does not pass the verification. By acquiring the file information line by line, omission can be avoided, and the result accuracy of the constructed environment verification is improved. The character string information meeting the specific format can be quickly acquired through regular matching, and the checking efficiency is improved. Of course, those skilled in the art may select other ways according to actual situations to obtain the string information satisfying the specific format.
FIG. 3 is a flow chart illustrating verification of a build environment in an alternative embodiment of the invention. In the alternative embodiment shown in fig. 3, file path information of the project engineering code file of the application is determined first, and then according to the file path information, file information content is acquired through node. And then performing regular matching, checking whether the information content of the current line is matched with a PRODUCTION environment "PRODUCTION" environment variable (the environment variable is usually set by a developer in a self-defined way), and performing subsequent construction flow if the checking is passed.
And S102, analyzing code branch information from the project engineering code file by using a command line execution tool, and performing code branch verification.
In this step, what kind of command line execution tool is used may be set by itself as long as the code branch information can be analyzed. Fig. 4 is a flow chart illustrating the operation of performing code branch checking in an alternative embodiment of the present invention. As shown in fig. 4, when performing code branch checking, first, the command line execution tool library execa is introduced, then the branch command "git rev-part — abbrev-ref HEAD" is obtained through the execa execution git (which may be realized by other command line tools), the code branch information of the current project code file is obtained, and then whether the current branch is the legal construction branch "master" is checked. And if the current code branch information is matched with the preset construction branch information, the current project engineering code file is considered to be a legal construction branch, and the code branch is verified to be passed.
And step S103, under the condition that the construction environment check and the code branch check are passed, analyzing the current version information of the application from the project engineering code file by using a command line execution tool, and determining the construction version information according to the current version information by using a version number tool.
The current version information refers to version information of an application program that has been built, that is, version information of a previous version of the project code file, such as a version number. This step determines version information of the application currently being built based on version information of the application already built. In the actual application process, the version information can be automatically determined and constructed according to the current version information according to the preset version number determination rule. For example, the preset version number determination rule is "automatically add 1 to the major version number", and if the version number of the application program already built is v1.0.0, the build version number of the application program currently being built is v2.0.0. For another example, the preset version number determination rule is "the minor version number is automatically added by 1", and if the version number of the application program that has already been built is v1.0.0, the built version number of the application program that is currently being built is v1.1.0.
Optionally, determining, by using a version number tool, to construct version information according to the current version information, includes: and determining one or more candidate version information according to the current version information by using a version number tool, and taking the candidate version information selected by a user from the one or more candidate version information as the constructed version information. Illustratively, a plurality of version number determination rules are preset, after the current version information is determined, a candidate version number is determined according to the preset version number determination rules, each determined candidate version number is displayed to a user, and a version number selected by the user from the candidate version numbers or a version number obtained by modifying the displayed candidate version number is used as a constructed version number.
After determining one or more candidate version information from the current version information using a version number tool for easy user viewing and selection, the one or more candidate version information may be presented for user selection via an interactive command line tool.
Fig. 5 is a flow diagram illustrating the implementation of build version management in an alternative embodiment of the invention. As shown in fig. 5, first, a current version information of an application is obtained through a package json file (a package json file is generally located below a root directory of each node js item, and various modules required by the item and configuration information (metadata such as a name, a version, a license and the like) of the item are defined, then candidate version information is generated through a semver version number tool (a version management specification tool, where candidate version information may also be generated in other ways), then the candidate version information is displayed through an inquirer interactive command line tool, and after a user selects corresponding version information, the constructed version information is obtained.
After determining the constructed version information according to the current version information, the embodiment of the present invention may further generate a constructed version identifier according to the constructed version information. FIG. 6 is a flow diagram of generating a build version identification in an alternative embodiment of the present invention. As shown in FIG. 6, the command line execution tool library execa is introduced first, and then the tag command "git push-follow-tags" is generated by execa executing git, generating the build version identification. The constructed version identification in this embodiment refers to constructed version tag information, and the version tag is a concept in git code management and points to a commit file commit of the code repository. And a tag corresponding to the latest commit of the online version is added after the application program of the new version is constructed, so that the application rollback is facilitated.
After determining the constructed version information according to the current version information, the embodiment of the present invention may further generate a change log (application changelog information) according to the constructed version information. FIG. 7 is a flow diagram illustrating the generation of an application change log in an alternative embodiment of the invention. As shown in fig. 7, a command line execution tool library execa is introduced first, then a version number management tool standby-version is introduced, and then application changelog information is generated by executing commands "execa (' standby-version ', [ ' -r ', newVersion ', ' -no-version ', ' -t ', getTagPrefix (currbranch) ], { stdio: ' inherit '). For example, the code base in the current project engineering code file and the code difference of the last commmit version are obtained through git, then the message (submission description), time and other information submitted by each commit are obtained, and finally the information is written into the file with the format md through node. In addition to executing the tool library execa and the version number management tool standard-version, those skilled in the art may generate changelog information in other ways.
And step S104, constructing the multi-terminal applet of the application by using a multi-terminal applet framework according to the constructed version information. The multi-end applet framework can be selected based on the actual situation, such as chameleon, taro, uni-app, mpvue, wePY, etc.
Fig. 8 is a schematic flow chart of multi-end compiling and building in an alternative embodiment of the present invention, and the embodiment uses a Taro multi-end applet framework to build a multi-end applet of the application. Taro is an open cross-end cross-frame solution, and supports the development of various applets and applications such as H5 by using a read/Vue/Nerv and other frames. In this embodiment, a command line tool library execa is introduced first, and then a Taro cli command "npm run build: xxx" is executed through the execa, so as to concurrently construct a production package of a multi-end applet, such as a weapp production package, a swan production package, a jd production package, and the like.
FIG. 9 is a flow diagram illustrating a method for multi-ported applet build in an alternative embodiment of the invention, as shown in FIG. 9, the present embodiment performs untracked code submission by script execution git command; reading an application construction environment information file through a node.js file system API, and constructing environment information through regular verification; then, obtaining current branch information through a git command, and checking the code branch information; then reading the current version information of the application, generating candidate version information through a version management tool, and displaying and acquiring the constructed version information through an interactive command line; adding the tag information of the new version through a git command; and finally, performing multi-end small program parallel construction through a Taro cli command to realize small program construction. Please refer to the foregoing related description for a specific implementation manner of each step, which is not described herein again.
According to the embodiment of the invention, the file system interface is used for acquiring the file information of the applied project engineering code file to carry out construction environment verification, and the command line execution tool and the version number tool are used for carrying out code branch verification and determining construction version information, so that the construction environment verification, the code branch verification and the construction version management can be automatically realized, and the problem of low fault tolerance rate caused by manual operation is avoided; by constructing the multi-terminal applet through the multi-terminal applet framework, the parallel construction of the multi-terminal applet can be realized, and the construction efficiency is greatly improved.
According to a second aspect of the embodiments of the present invention, there is provided an apparatus for implementing the above method. Fig. 10 is a schematic block diagram of a multi-port applet constructing apparatus according to an embodiment of the present invention, and as shown in fig. 10, the multi-port applet constructing apparatus 1000 according to the embodiment of the present invention includes:
a construction environment verification module 1001 for obtaining file information of the project engineering code file of the application through a file system interface and performing construction environment verification;
the code branch checking module 1002 is used for analyzing code branch information from the project engineering code file by using a command line execution tool and checking code branches;
a build version determining module 1003, configured to, when both the build environment check and the code branch check pass, analyze, by using a command line execution tool, the current version information of the application from the project engineering code file, and determine, by using a version number tool, the build version information according to the current version information;
and a multi-terminal program constructing module 1004 for constructing the multi-terminal applet of the application by using the multi-terminal applet framework according to the constructed version information.
Optionally, the apparatus further includes a version identifier generating module, configured to: and after the constructed version information is determined according to the current version information, a constructed version identifier is generated according to the constructed version information.
Optionally, the apparatus further comprises a change log generation module, configured to: and after the constructed version information is determined according to the current version information, generating a change log according to the constructed version information.
Optionally, the apparatus further comprises an engineering code submission module configured to: before file information of an applied project engineering code file is acquired through a file system interface, a release script file is created in an applied project code directory to obtain the applied project engineering code file; submitting the project engineering code file of the application to a local repository using a command line execution tool;
and the construction environment checking module acquires the project engineering code file of the application from a local warehouse through a file system interface.
Optionally, the creating environment checking module obtains file information of the project engineering code file of the application through a file system interface to perform creating environment checking, including:
acquiring the file information line by line through a file system interface to perform regular matching so as to check whether the information content of the current line is matched with the environmental variable of the production environment; if so, the constructed environment passes the verification, otherwise, the constructed environment does not pass the verification.
Optionally, the determining the constructed version information by the constructed version determining module according to the current version information by using a version number tool includes:
and determining one or more candidate version information according to the current version information by using a version number tool, and taking the candidate version information selected by a user from the one or more candidate version information as the constructed version information.
Optionally, the build version determination module is further configured to: after determining one or more candidate version information from the current version information using a version number tool, the one or more candidate version information is presented for user selection via an interactive command line tool.
According to a third aspect of the embodiments of the present invention, there is provided an electronic device constructed by a multi-terminal applet, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method provided by the first aspect of the embodiments of the present invention.
According to a fourth aspect of embodiments of the present invention, there is provided a computer readable medium, on which a computer program is stored, which when executed by a processor, implements the method provided by the first aspect of embodiments of the present invention.
FIG. 11 illustrates an exemplary system architecture 1100 of a multi-portlet construction method or apparatus to which embodiments of the present invention may be applied.
As shown in fig. 11, the system architecture 1100 may include terminal devices 1101, 1102, 1103, a network 1104, and a server 1105. The network 1104 is a medium to provide communication links between the terminal devices 1101, 1102, 1103 and the server 1105. Network 1104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may use the terminal devices 1101, 1102, 1103 to interact with a server 1105, via a network 1104, to receive or send messages or the like. Various messaging client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, etc. (examples only) may be installed on the terminal devices 1101, 1102, 1103.
The terminal devices 1101, 1102, 1103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 1105 may be a server that provides various services, such as a backend management server (for example only) that provides support for shopping-like websites browsed by users using the terminal devices 1101, 1102, 1103. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the method for building a multi-port applet provided by the embodiment of the present invention is generally executed by the server 1105, and accordingly, the apparatus for building a multi-port applet is generally disposed in the server 1105. The method for constructing the multi-port applet provided by the embodiment of the present invention can also be executed by the terminal devices 1101, 1102, and 1103, and accordingly, the apparatus for constructing the multi-port applet is disposed in the terminal devices 1101, 1102, and 1103.
It should be understood that the number of terminal devices, networks, and servers in fig. 11 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 12, shown is a block diagram of a computer system 1200 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 12 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 12, the computer system 1200 includes a Central Processing Unit (CPU) 1201, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM) 1202 or a program loaded from a storage section 1208 into a Random Access Memory (RAM) 1203. In the RAM 1203, various programs and data necessary for the operation of the system 1200 are also stored. The CPU 1201, ROM 1202, and RAM 1203 are connected to each other by a bus 1204. An input/output (I/O) interface 1205 is also connected to bus 1204.
The following components are connected to the I/O interface 1205: an input section 1206 including a keyboard, a mouse, and the like; an output portion 1207 including a display device such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 1208 including a hard disk and the like; and a communication section 1209 including a network interface card such as a LAN card, a modem, or the like. The communication section 1209 performs communication processing via a network such as the internet. A driver 1210 is also connected to the I/O interface 1205 as needed. A removable medium 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like, is mounted on the drive 1210 as necessary, so that a computer program read out therefrom is mounted into the storage section 1208 as necessary.
In particular, according to embodiments of the present disclosure, the processes described above with reference to the flow diagrams 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 1209, and/or installed from the removable medium 1211. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 1201.
It should be noted that the computer readable medium shown in the present invention 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 context of the present invention, 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 invention, 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.
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 invention. 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 or flowchart illustration, and combinations of blocks in the block diagrams 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 modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor comprising: the system comprises a construction environment checking module, a code branch checking module, a construction version determining module and a multi-terminal program constructing module. The names of these modules do not in some cases constitute a limitation on the module itself, for example, the build environment check module may also be described as a "module that performs code branch checking".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: acquiring file information of an applied project engineering code file through a file system interface, and carrying out construction environment verification; analyzing code branch information from the project engineering code file by using a command line execution tool, and performing code branch verification; under the condition that the construction environment check and the code branch check are both passed, analyzing the current version information of the application from the project engineering code file by using a command line execution tool, and determining the construction version information according to the current version information by using a version number tool; and constructing the multi-terminal applet of the application by using a multi-terminal applet framework according to the constructed version information.
According to the technical scheme of the embodiment of the invention, the file system interface is used for acquiring the file information of the applied project engineering code file to carry out construction environment verification, and the command line execution tool and the version number tool are used for carrying out code branch verification and determining construction version information, so that the construction environment verification, the code branch verification and the construction version management can be automatically realized, and the problem of low fault tolerance rate caused by manual operation is avoided; by constructing the multi-terminal applet through the multi-terminal applet framework, the parallel construction of the multi-terminal applet can be realized, and the construction efficiency is greatly improved.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for building a multi-end applet, comprising:
acquiring file information of the applied project engineering code file through a file system interface, and carrying out construction environment verification;
analyzing code branch information from the project engineering code file by using a command line execution tool, and performing code branch verification;
under the condition that the construction environment check and the code branch check are both passed, analyzing the current version information of the application from the project engineering code file by using a command line execution tool, and determining the construction version information according to the current version information by using a version number tool;
and constructing the multi-terminal applet of the application by using a multi-terminal applet framework according to the constructed version information.
2. The method of claim 1, wherein after determining build version information from the current version information, the method further comprises: and generating a constructed version identification according to the constructed version information.
3. The method of claim 1, wherein after determining build version information from the current version information, the method further comprises: and generating a change log according to the constructed version information.
4. The method of claim 1, prior to obtaining file information for a project engineering code file of an application through a file system interface, the method further comprising:
creating a release script file in the project code directory of the application to obtain a project code file of the application; and submitting the project engineering code file of the application to a local warehouse by using a command line execution tool, and acquiring the project engineering code file of the application from the local warehouse through a file system interface.
5. The method of claim 1, wherein obtaining file information of a project engineering code file of an application through a file system interface to perform a build environment check comprises:
acquiring the file information line by line through a file system interface to perform regular matching so as to check whether the information content of the current line is matched with the environment variable of the production environment; if so, the constructed environment passes the verification, otherwise, the constructed environment does not pass the verification.
6. The method of claim 1, wherein determining, using a version number tool, build version information from the current version information comprises:
and determining one or more candidate version information according to the current version information by using a version number tool, and taking the candidate version information selected by a user from the one or more candidate version information as the constructed version information.
7. The method of claim 6, after determining one or more candidate version information from the current version information using a version number tool, further comprising:
presenting the one or more candidate version information via an interactive command line tool for selection by a user.
8. An apparatus for multi-terminal applet construction, comprising:
the construction environment checking module is used for acquiring the file information of the project engineering code file of the application through a file system interface and carrying out construction environment checking;
the code branch checking module analyzes code branch information from the project engineering code file by using a command line execution tool and performs code branch checking;
the construction version determining module is used for analyzing the current version information of the application from the project engineering code file by using a command line execution tool under the condition that the construction environment check and the code branch check are passed, and determining the construction version information according to the current version information by using a version number tool;
and the multi-terminal program building module is used for building the multi-terminal applet of the application by using a multi-terminal applet framework according to the built version information.
9. An electronic device built by a multi-terminal applet, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
10. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN202211457022.1A 2022-11-21 2022-11-21 Method and device for building multi-terminal small program Pending CN115934151A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211457022.1A CN115934151A (en) 2022-11-21 2022-11-21 Method and device for building multi-terminal small program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211457022.1A CN115934151A (en) 2022-11-21 2022-11-21 Method and device for building multi-terminal small program

Publications (1)

Publication Number Publication Date
CN115934151A true CN115934151A (en) 2023-04-07

Family

ID=86553192

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211457022.1A Pending CN115934151A (en) 2022-11-21 2022-11-21 Method and device for building multi-terminal small program

Country Status (1)

Country Link
CN (1) CN115934151A (en)

Similar Documents

Publication Publication Date Title
CN106815031B (en) Kernel module loading method and device
CN109359194B (en) Method and apparatus for predicting information categories
US10169005B2 (en) Consolidating and reusing portal information
CN107643984B (en) Method and apparatus for outputting information
CN110780874B (en) Method and device for generating information
CN111324833A (en) Page display method, device, electronic design and computer readable medium
CN110543297A (en) method and apparatus for generating source code
CN113031946A (en) Method and device for rendering page component
CN111125064A (en) Method and device for generating database mode definition statement
CN113626223A (en) Interface calling method and device
CN115599386A (en) Code generation method, device, equipment and storage medium
CN113094625B (en) Page element positioning method and device, electronic equipment and storage medium
CN113377342B (en) Project construction method and device, electronic equipment and storage medium
CN110795331A (en) Software testing method and device
CN112181408A (en) Method and device for displaying view list on front page of application program
CN113312900A (en) Data verification method and device
CN115934151A (en) Method and device for building multi-terminal small program
CN114527993A (en) Application deployment method, device, equipment and medium
CN113656041A (en) Data processing method, device, equipment and storage medium
CN112988583A (en) Method and device for testing syntax compatibility of database
CN113297081A (en) Execution method and device of continuous integration assembly line
CN113760695A (en) Method and device for positioning problem code
CN112579151A (en) Method and device for generating model file
CN113420037B (en) Asset data real-time changing method and device
CN113760706B (en) Webpage debugging 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