CN105760208A - Computer program compiling method and apparatus - Google Patents

Computer program compiling method and apparatus Download PDF

Info

Publication number
CN105760208A
CN105760208A CN201610223340.XA CN201610223340A CN105760208A CN 105760208 A CN105760208 A CN 105760208A CN 201610223340 A CN201610223340 A CN 201610223340A CN 105760208 A CN105760208 A CN 105760208A
Authority
CN
China
Prior art keywords
compiling
compilation
script
module
compilation script
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
CN201610223340.XA
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.)
Shanghai Simcom Wireless Solutions Co Ltd
Original Assignee
Shanghai Simcom Wireless Solutions 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 Shanghai Simcom Wireless Solutions Co Ltd filed Critical Shanghai Simcom Wireless Solutions Co Ltd
Priority to CN201610223340.XA priority Critical patent/CN105760208A/en
Publication of CN105760208A publication Critical patent/CN105760208A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

The invention discloses a computer program compiling method and apparatus. The computer program compiling method comprises: S1, pre-configuring a compiling environment; S2, configuring a compiling script; S3, setting a computer task for starting the compiling script; S4, starting the computer task, and entering a compiling process, wherein the compiling process comprises: T1, detecting whether a server code is updated, executing T2 if yes, and if no, executing T3; T2, updating a local code, and then executing T4; T3, stopping compiling; T4, starting the compiling script, starting to compile and recording compile output information. According to the invention, the defect of time and labor waste caused by manual code update and manual computer program compiling in the prior art is overcome, time required for program compiling can be greatly shortened, and the computer program compiling method and apparatus have the advantages of reducing workload of a programmer, saving labor and improving working efficiency.

Description

Computer program Compilation Method and device
Technical field
The present invention relates to computer realm, particularly relate to a kind of computer program Compilation Method and device.
Background technology
Computer program (Computerprogram), also referred to as software (software), abbreviation program (Program) refer to one group of instruction computer or other there is the instruction of each step action of information processing capability device, typically by certain programming languages, run on certain target architecture.Generally, computer program to pass through compiling and link and become that a kind of people are not readily understood and the form of computer understanding, then runs.At present, the compiling work of computer program is generally all artificially manually complete, and loses time and manpower.Especially, present stage wooden unit project platform is numerous, and software version is numerous, and code update is frequent, and artificial regeneration code increases the workload of programmer especially, reduces work efficiency.
Summary of the invention
The technical problem to be solved in the present invention is to overcome the artificial defect with manpower of losing time that manually more fresh code and compiling computer program cause in prior art, it is provided that a kind of computer program Compilation Method that can automatically update code and compiling computer program and saving time and manpower and device.
The present invention solves above-mentioned technical problem by the following technical programs:
The present invention provides a kind of computer program Compilation Method, is characterized in, including:
S1, pre-configured translation and compiling environment;
S2, configuration compilation script;
S3, be arranged to start compilation script computer task;
S4, start described computer task, enter compilation process;
Described compilation process includes:
T1, check code server whether update, if having, then perform T2If, nothing, then perform T3
T2, update local code, then perform T4
T3, stop compiling;
T4, start compilation script, start compiling and record compiling output information.
Wherein, translation and compiling environment configures according to the needs of the computer software used, to ensure that software translating is properly functioning.The technical program can automatically check code update and significantly shorten the required time of compiler, has the workload reducing programmer, saves manpower, the advantage improving work efficiency.
It is preferred that T2Also include: before updating local code, close local program file, and, after having updated local code, remove the read only attribute of compilation script.
The technical program can ensure that being smoothed out of code update and subsequent process.
It is preferred that S2The compilation script of configuration includes target (event attribute) side compilation script and PC (computer) side compilation script, T4Including:
T41, start target side compilation script, change software version number, start compiling and record compiling output information;
T42, judge compiling whether pass through, if passing through, then perform T43If not passing through, then perform T44
T43, the file that compiles out of copy target side, form Software Compression bag and also preserve, then perform T45
T44, resolve and make mistakes reason output error message, then perform T45
T45, compiling PC side compilation script record compiling result.
It is preferred that S2The compilation script of middle configuration is configured with the life cycle of Software Compression bag, T43Also include: delete the Software Compression bag exceeding life cycle.
It is preferred that S2The compilation script of middle configuration is configured with the server address for receiving mail or address of the addressee, is also configured with sender address and password, and described compilation process is additionally included in T4Perform afterwards:
T5, utilize sender address send mail to server address or address of the addressee, described mail record has compiling result.
Compiling result can be reported without delay to programmer by the technical program in the way of mail, allows programmer be more effectively carried out error detection work during particularly in generation compile error situation.
The present invention also provides for a kind of computer program compilation device, is characterized in, including:
Translation and compiling environment provisioning module, for pre-configured translation and compiling environment;
Compilation script configuration module, is used for configuring compilation script;
Task arranges module, for being arranged to start the computer task of compilation script;
Start module, be used for starting described computer task, enter compilation process;
Described compilation process includes calling more new module, and described more new module is used for checking whether code server updates, if having, then updating local code, then calling collector, if nothing, then stops compiling;
Collector, described collector is used for starting compilation script, starts compiling and records compiling output information.
It is preferred that described more new module is additionally operable to before updating local code closes local program file, and, after having updated local code, remove the read only attribute of compilation script.
It is preferred that the compilation script of described compilation script configuration module configuration includes target side compilation script and PC side compilation script, described collector includes:
Target side collector, is used for starting target side compilation script, changes software version number, starts compiling and records compiling output information;
Judge module, is used for judging whether compiling is passed through, if passing through, then calling copy module, if not passing through, then calling parsing module;
Copy module, for copying the file that target side compiles out, forms Software Compression bag and preserves, then calling PC side collector;
Parsing module, reason of makeing mistakes for parsing output error message, then call PC side collector;
PC side collector, is used for compiling PC side compilation script and recording compiling result.
It is preferred that the compilation script of described compilation script configuration module configuration is configured with the life cycle of Software Compression bag, described copy module is additionally operable to delete the Software Compression bag exceeding life cycle.
Preferably, the compilation script of described compilation script configuration module configuration is configured with the server address for receiving mail or address of the addressee, it is also configured with sender address and password, described compilation process is additionally included in after calling described collector and calls e-mail module, described e-mail module is used for utilizing sender address to send mail to server address or address of the addressee, and described mail record has compiling result.
Meeting on the basis of this area general knowledge, above-mentioned each optimum condition, can combination in any, obtain the preferred embodiments of the invention.
The actively progressive effect of the present invention is in that: the present invention can not only significantly shorten the required time of compiler, there is the workload reducing programmer, save manpower, the advantage improving work efficiency, additionally it is possible to allow programmer be more effectively carried out error detection work when there is compile error situation.
Accompanying drawing explanation
Fig. 1 is the flow chart of the computer program Compilation Method of present pre-ferred embodiments.
Fig. 2 is the flow chart of the compilation process of the computer program Compilation Method of present pre-ferred embodiments.
Fig. 3 is the particular flow sheet of the step 24 of the computer program Compilation Method of present pre-ferred embodiments.
Fig. 4 is the schematic diagram of the computer program compilation device of present pre-ferred embodiments.
Detailed description of the invention
Mode by the examples below further illustrates the present invention, but does not therefore limit the present invention among described scope of embodiments.
Embodiment
A kind of computer program Compilation Method, as it is shown in figure 1, include:
Step 11, pre-configured translation and compiling environment.Translation and compiling environment configures according to the needs of the computer software used, to ensure that software translating is properly functioning.As, if computer program is embedded class and hardware-related, then need configuration ARM compiler, script-editor etc., if computer software does not need related hardware, simply application program, then need corresponding compiler is installed, such as VC (a kind of environment program, OO visualization integrated programming system) etc..General platform provider can be provided with detailed environment configurations explanation.
Step 12, configuration compilation script.Being specifically as follows the compiling file being arranged to start compilation process, described compiling file is available for multiple project and is used in conjunction with.The compilation script of configuration includes target (event attribute) side compilation script and PC (computer) side compilation script.Target side representation program is relevant with hardware, and usual platform provider can provide basic compilation script, and the present embodiment only need to provide a script file being easy to externally used unified interface.PC side representation program and hardware are unrelated, it is possible to be the pure software comprising repertoire, it is also possible to be the load hardware program of running simulated environment (such as the PC simulation etc. of keyboard, but some can not be simulated).
In this step, the compilation script of configuration is configured with following parameter:
Code path, project name, project compiled activations file, compiling whether pass through character string, code storage timestamp file, for preserving account name and the password of the server of code;
And, the life cycle of Software Compression bag;
And, for receiving server address or the address of the addressee of mail, and sender address and password.
Step 13, be arranged to start compilation script computer task.If there being multiple project procedure, then multiple computer task can be used to carry out timesharing and to start, it is to avoid intersect.
Step 14, start described computer task, enter compilation process.
As in figure 2 it is shown, described compilation process includes:
Whether step 21, inspection code server update, if having, then perform step 22, if nothing, then perform step 23.Code is stored on server and is read only attribute, so ensure that the safety of code, and the account name of server and password all have configuration in step 12.
Step 22, closedown local program file, renewal local code, and after having updated local code, remove the read only attribute of compilation script, then perform step 24.Wherein, described renewal local code refers to that the code by updating on server is locally downloading.This step can ensure that being smoothed out of code update and subsequent process.
Step 23, stopping compiling.
Step 24, startup compilation script, start compiling and record compiling output information.Specifically, as it is shown on figure 3, step 24 includes:
Step 241, startup target side compilation script, change software version number, starts compiling and records compiling output information.
Step 242, judge compiling whether pass through, if passing through, then perform step 243, if not passing through, then perform step 244.
The file that step 243, copy target side compile out, forms Software Compression bag and preserves, deleting the Software Compression bag exceeding life cycle, then performs step 245.The Software Compression bag formed in this step can be named for current date, and preserves on the server.The file compiled out can be that binary file or one group perform file and ancillary data file, described binary file or described execution file and ancillary data file is transferred into the network node specified.
Step 244, resolve and make mistakes reason output error message, then perform step 245.
Step 245, compiling PC side compilation script also record compiling result.
Step 25, utilize sender address send mail to server address or address of the addressee, described mail record has compiling result.Such as, if compilation process only proceeds to step 23 and just stops compiling, then mail will show such as word or other prompting of " not having file to update, wouldn't compile ", with advising process designer;And for example, the compiling result of step display 245 record in mail.
The computer program compilation device of the present invention, as shown in Figure 4, including: translation and compiling environment provisioning module 31, compilation script configuration module 32, task arrange module 33 and start module 34.
Translation and compiling environment provisioning module 31, for pre-configured translation and compiling environment.Translation and compiling environment configures according to the needs of the computer software used, to ensure that software translating is properly functioning.As, if computer program is embedded class and hardware-related, then need configuration ARM compiler, script-editor etc., if computer software does not need related hardware, simply application program, then need corresponding compiler is installed, such as VC (a kind of environment program, OO visualization integrated programming system) etc..General platform provider can be provided with detailed environment configurations explanation.
Compilation script configuration module 32, is used for configuring compilation script.Specifically may be used for the compiling file being arranged to start compilation process, described compiling file is available for multiple project and is used in conjunction with.The compilation script of configuration includes target (event attribute) side compilation script and PC (computer) side compilation script.Target side representation program is relevant with hardware, and usual platform provider can provide basic compilation script, and the present embodiment only need to provide a script file being easy to externally used unified interface.PC side representation program and hardware are unrelated, it is possible to be the pure software comprising repertoire, it is also possible to be the load hardware program of running simulated environment (such as the PC simulation etc. of keyboard, but some can not be simulated).
The compilation script of described compilation script configuration module 32 configuration is configured with following parameter:
Code path, project name, project compiled activations file, compiling whether pass through character string, code storage timestamp file, for preserving account name and the password of the server of code;
And, the life cycle of Software Compression bag;
And, for receiving server address or the address of the addressee of mail, and sender address and password.
Task arranges module 33, for being arranged to start the computer task of compilation script.If there being multiple project procedure, then multiple computer task can be used to carry out timesharing and to start, it is to avoid intersect.
Start module 34, be used for starting described computer task, enter compilation process.
Described compilation process includes calling more new module 41, described more new module 41 is used for checking whether code server updates, if having, then close local program file, renewal local code, and after having updated local code, remove the read only attribute of compilation script, then call collector 42, if nothing, then stop compiling.Code is stored on server and is read only attribute, so ensure that the safety of code, and the account name of server and password configure in module 32 at compilation script all configuration.
Described collector 42 is used for starting compilation script, starts compiling and records compiling output information.Specifically, described collector 42 includes: target side collector 421, judge module 422, copy module 423, parsing module 424 and PC side collector 425.
Target side collector 421, is used for starting target side compilation script, changes software version number, starts compiling and records compiling output information.
Judge module 422, is used for judging whether compiling is passed through, if passing through, then calling copy module 423, if not passing through, then calling parsing module 424.
Copy module 423, for copying the file that target side compiles out, forms Software Compression bag and preserves, deleting the Software Compression bag exceeding life cycle, then call PC side collector 425.Wherein, the Software Compression bag of formation can be named for current date, and preserves on the server.The file compiled out can be that binary file or one group perform file and ancillary data file, described binary file or described execution file and ancillary data file is transferred into the network node specified.
Parsing module 424, reason of makeing mistakes for parsing output error message, then call PC side collector 425.
PC side collector 425, is used for compiling PC side compilation script and recording compiling result.
E-mail module 43, is used for utilizing sender address to send mail to server address or address of the addressee, and described mail record has compiling result.Such as, if compilation process only proceeds to step 23 and just stops compiling, then mail will show such as word or other prompting of " not having file to update, wouldn't compile ", with advising process designer;And for example, in mail, show the compiling result of PC side collector 425 record.
Although the foregoing describing the specific embodiment of the present invention, it will be appreciated by those of skill in the art that these are merely illustrative of, protection scope of the present invention is defined by the appended claims.Those skilled in the art is under the premise without departing substantially from principles of the invention and essence, it is possible to these embodiments are made various changes or modifications, but these change and amendment each falls within protection scope of the present invention.

Claims (10)

1. a computer program Compilation Method, it is characterised in that including:
S1, pre-configured translation and compiling environment;
S2, configuration compilation script;
S3, be arranged to start compilation script computer task;
S4, start described computer task, enter compilation process;
Described compilation process includes:
T1, check code server whether update, if having, then perform T2If, nothing, then perform T3
T2, update local code, then perform T4
T3, stop compiling;
T4, start compilation script, start compiling and record compiling output information.
2. computer program Compilation Method as claimed in claim 1, it is characterised in that T2Also include: before updating local code, close local program file, and, after having updated local code, remove the read only attribute of compilation script.
3. computer program Compilation Method as claimed in claim 1, it is characterised in that S2The compilation script of configuration includes target side compilation script and PC side compilation script, T4Including:
T41, start target side compilation script, change software version number, start compiling and record compiling output information;
T42, judge compiling whether pass through, if passing through, then perform T43If not passing through, then perform T44
T43, the file that compiles out of copy target side, form Software Compression bag and also preserve, then perform T45
T44, resolve and make mistakes reason output error message, then perform T45
T45, compiling PC side compilation script record compiling result.
4. computer program Compilation Method as claimed in claim 3, it is characterised in that S2The compilation script of middle configuration is configured with the life cycle of Software Compression bag, T43Also include: delete the Software Compression bag exceeding life cycle.
5. computer program Compilation Method as claimed in claim 1, it is characterised in that S2The compilation script of middle configuration is configured with the server address for receiving mail or address of the addressee, is also configured with sender address and password, and described compilation process is additionally included in T4Perform afterwards:
T5, utilize sender address send mail to server address or address of the addressee, described mail record has compiling result.
6. a computer program compilation device, it is characterised in that including:
Translation and compiling environment provisioning module, for pre-configured translation and compiling environment;
Compilation script configuration module, is used for configuring compilation script;
Task arranges module, for being arranged to start the computer task of compilation script;
Start module, be used for starting described computer task, enter compilation process;
Described compilation process includes calling more new module, and described more new module is used for checking whether code server updates, if having, then updating local code, then calling collector, if nothing, then stops compiling;
Collector, described collector is used for starting compilation script, starts compiling and records compiling output information.
7. computer program compilation device as claimed in claim 6, it is characterised in that described more new module is additionally operable to before updating local code and closes local program file, and, after having updated local code, remove the read only attribute of compilation script.
8. computer program compilation device as claimed in claim 6, it is characterised in that the compilation script of described compilation script configuration module configuration includes target side compilation script and PC side compilation script, and described collector includes:
Target side collector, is used for starting target side compilation script, changes software version number, starts compiling and records compiling output information;
Judge module, is used for judging whether compiling is passed through, if passing through, then calling copy module, if not passing through, then calling parsing module;
Copy module, for copying the file that target side compiles out, forms Software Compression bag and preserves, then calling PC side collector;
Parsing module, reason of makeing mistakes for parsing output error message, then call PC side collector;
PC side collector, is used for compiling PC side compilation script and recording compiling result.
9. computer program compilation device as claimed in claim 8, it is characterised in that the compilation script of described compilation script configuration module configuration is configured with the life cycle of Software Compression bag, and described copy module is additionally operable to delete the Software Compression bag exceeding life cycle.
10. computer program compilation device as claimed in claim 6, it is characterized in that, the compilation script of described compilation script configuration module configuration is configured with the server address for receiving mail or address of the addressee, it is also configured with sender address and password, described compilation process is additionally included in after calling described collector and calls e-mail module, described e-mail module is used for utilizing sender address to send mail to server address or address of the addressee, and described mail record has compiling result.
CN201610223340.XA 2016-04-12 2016-04-12 Computer program compiling method and apparatus Pending CN105760208A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610223340.XA CN105760208A (en) 2016-04-12 2016-04-12 Computer program compiling method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610223340.XA CN105760208A (en) 2016-04-12 2016-04-12 Computer program compiling method and apparatus

Publications (1)

Publication Number Publication Date
CN105760208A true CN105760208A (en) 2016-07-13

Family

ID=56334819

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610223340.XA Pending CN105760208A (en) 2016-04-12 2016-04-12 Computer program compiling method and apparatus

Country Status (1)

Country Link
CN (1) CN105760208A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106648812A (en) * 2016-08-31 2017-05-10 上海锐鸿通信技术有限公司 Method and system of automatic compilation
CN107145377A (en) * 2017-03-17 2017-09-08 广州视源电子科技股份有限公司 Software compilation method and system
CN107526621A (en) * 2017-08-07 2017-12-29 深圳芯邦科技股份有限公司 A kind of external memory master control code Compilation Method and device
CN109343989A (en) * 2018-09-19 2019-02-15 郑州云海信息技术有限公司 Internal-memory detection method, device and the equipment of User space Network File System
CN109933330A (en) * 2019-03-06 2019-06-25 青岛海信电子设备股份有限公司 A kind of more host device software compilation run method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101963915A (en) * 2010-09-25 2011-02-02 中兴通讯股份有限公司 Building method of compilation and system thereof
CN103019772A (en) * 2012-11-23 2013-04-03 东方网力科技股份有限公司 Automatic compilation method and system in software development
CN105138387A (en) * 2015-08-31 2015-12-09 惠州Tcl移动通信有限公司 Method, device and system for compiling software
CN105468428A (en) * 2015-12-04 2016-04-06 上海斐讯数据通信技术有限公司 Android source code compiling method and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101963915A (en) * 2010-09-25 2011-02-02 中兴通讯股份有限公司 Building method of compilation and system thereof
CN103019772A (en) * 2012-11-23 2013-04-03 东方网力科技股份有限公司 Automatic compilation method and system in software development
CN105138387A (en) * 2015-08-31 2015-12-09 惠州Tcl移动通信有限公司 Method, device and system for compiling software
CN105468428A (en) * 2015-12-04 2016-04-06 上海斐讯数据通信技术有限公司 Android source code compiling method and system

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106648812A (en) * 2016-08-31 2017-05-10 上海锐鸿通信技术有限公司 Method and system of automatic compilation
CN107145377A (en) * 2017-03-17 2017-09-08 广州视源电子科技股份有限公司 Software compilation method and system
CN107526621A (en) * 2017-08-07 2017-12-29 深圳芯邦科技股份有限公司 A kind of external memory master control code Compilation Method and device
CN107526621B (en) * 2017-08-07 2020-09-04 深圳芯邦科技股份有限公司 External memory master control code compiling method and device
CN109343989A (en) * 2018-09-19 2019-02-15 郑州云海信息技术有限公司 Internal-memory detection method, device and the equipment of User space Network File System
CN109933330A (en) * 2019-03-06 2019-06-25 青岛海信电子设备股份有限公司 A kind of more host device software compilation run method and system

Similar Documents

Publication Publication Date Title
CN105760208A (en) Computer program compiling method and apparatus
CN102402427B (en) A kind of update method of java application and device
Dig et al. The role of refactorings in API evolution
CN111090433B (en) Data processing method, device and storage medium
US20090288070A1 (en) Maintenance For Automated Software Testing
CN113434158B (en) Custom management method, device, equipment and medium for big data component
US20110209131A1 (en) Method and device for replacing a component of a computer system
US7337435B2 (en) Efficient configuration data migration technique
CN110955431A (en) Processing method and device of compiling environment
CN103309683A (en) Software patch embedding method and device for hardware equipment
US9542173B2 (en) Dependency handling for software extensions
CN112148278A (en) Visual block chain intelligent contract framework and intelligent contract development and deployment method
CN103077111A (en) Method and system for locating continuous integration failed case
CN111966366A (en) Cluster deployment method and device of multi-CPU architecture
CN101937335B (en) Method for generating Widget icon, method for generating Widget summary document and Widget engine
CN110795091B (en) Modularized route decoupling method, storage medium, electronic equipment and system
CN111158743B (en) Big data operation and maintenance management platform
Sandobalin et al. End-to-end automation in cloud infrastructure provisioning
CN111610974A (en) Cross-system platform compiling method facing edge calculation
Di Ruscio et al. Managing the coupled evolution of metamodels and textual concrete syntax specifications
CN109933410A (en) A kind of fictitious order delivery method and system based on virtualization technology
CN108228266A (en) Start the method and apparatus of Fragment components under a kind of Android card cages between different plug-in units
Krasnogolowy et al. Flexible debugging of behavior models
CN113031964B (en) Big data application management method, device, equipment and storage medium
CN104699618A (en) Method and device used for automatically testing high-privilege progress by designated user

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20160713