CN105302531A - Source code simplifying method and apparatus - Google Patents

Source code simplifying method and apparatus Download PDF

Info

Publication number
CN105302531A
CN105302531A CN201410270010.7A CN201410270010A CN105302531A CN 105302531 A CN105302531 A CN 105302531A CN 201410270010 A CN201410270010 A CN 201410270010A CN 105302531 A CN105302531 A CN 105302531A
Authority
CN
China
Prior art keywords
source code
code file
simplifying
file
simplify
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
CN201410270010.7A
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201410270010.7A priority Critical patent/CN105302531A/en
Publication of CN105302531A publication Critical patent/CN105302531A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The present invention discloses a source code simplifying method and apparatus, and belongs to the technical field of computers. The method comprises: acquiring at least one source code file to be published; during the publishing process, simplifying the at least one source code file to obtain a simplified source code file; and according to the simplified source code file, performing publishing. The apparatus comprises: an acquisition module, a simplification module and a publishing module. According to the present invention, by acquiring the to-be-published source code file and simplifying the source code file during the publishing process, the simplified source code file is published; the problems that in the prior art, a developer needs to manually simplify the source code file and the operation is trivial are solved; and not only are the automatic publishing process and the simplifying process combined into one process and the developer does not need to manually carry out simplification, but also when an error is found during the publishing process, the error can be positioned based on the source code file which is not simplified, and thus, the problem is easy to position and debuggability of the source code file is improved.

Description

Source code compressing method and device
Technical field
The present invention relates to field of computer technology, particularly a kind of source code compressing method and device.
Background technology
In the process of development sources code file, in order to ensure readability and the cleaning of source code, developer can add the redundant informations such as annotation, space and null in source code file.These contents, before issue source code file, can be simplified, to reduce the file size of source code file without any impact the function of this source code file by these redundant informations usually from source code file.
Conventional source code compressing method is: before issue source code file, and the source code file comprising redundant information uses the instrument of simplifying online to simplify by each developer, is not comprised the source code file of redundant information; Then, the source code file not comprising redundant information is uploaded to robotization delivery system by each developer, and robotization delivery system is issued the plurality of source code file not comprising redundant information.
Realizing in process of the present invention, inventor finds that prior art at least exists following problem: said method not only needs developer manually to simplify source code file, complex operation; And owing to being just simplified before issue, if cause finding any problem in issuing process, be all difficult to debug based on the source code file after simplifying.Because redundant informations such as the source code file after simplifying does not annotate, space and nulls, be difficult to read and carry out positioning problems.
Summary of the invention
Developer is not only needed manually to simplify source code file in order to solve prior art, complex operation; And owing to being just simplified before issue, if cause finding any problem in issuing process, be all difficult to debug based on the source code file after simplifying.Because redundant informations such as the source code file after simplifying does not annotate, space and nulls, be difficult to the problem of reading and carrying out positioning problems, embodiments provide a kind of source code compressing method and device.Described technical scheme is as follows:
On the one hand, provide a kind of source code compressing method, described method comprises:
Obtain at least one source code file to be released;
In issuing process, this at least one source code file is simplified, obtains the source code file after simplifying;
Source code file after simplifying according to this is issued.
On the other hand, provide a kind of source code compact device, described device comprises:
Acquisition module, for obtaining at least one source code file to be released;
Simplify module, in issuing process, this at least one source code file is simplified, obtains the source code file after simplifying;
Release module, issues for the source code file after simplifying according to this.
The beneficial effect that the technical scheme that the embodiment of the present invention provides is brought is:
By obtaining source code file to be released, in issuing process, this source code file being simplified, and then it is issued; Solving prior art needs developer manually to simplify source code file, the problem of complex operation; Not only robotization issuing process and the process of simplifying are combined into 1 process, do not need developer manually to simplify, and when finding mistake in issuing process, based on the source code file before simplifying, it can be positioned, therefore positioning problems is easy, improves the adjustable of source code file.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, below the accompanying drawing used required in describing embodiment is briefly described, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the structural representation of a kind of implementation environment involved by source code compressing method that each embodiment of the present invention provides;
Fig. 2 is the method flow diagram of the source code compressing method that one embodiment of the invention provides;
Fig. 3 is the method flow diagram of the source code compressing method that another embodiment of the present invention provides;
Fig. 4 is that the detection resources code file that provides of another embodiment of the present invention is the need of simplifying and the method flow diagram of the method for the source code file of not yet simplifying;
Fig. 5 is the schematic diagram of a kind of configuration file that another embodiment of the present invention provides;
Fig. 6 is the method flow diagram to the method that source code file is simplified that another embodiment of the present invention provides;
Fig. 7 is that a kind of needs that another embodiment of the present invention provides are simplified and the schematic diagram of the source code file of not yet simplifying;
Fig. 8 be that another embodiment of the present invention provides a kind of source code file shown in Fig. 7 is simplified after the schematic diagram of source code file;
Fig. 9 is the method flow diagram that the method for report is simplified in generation that another embodiment of the present invention provides;
Figure 10 is a kind of schematic diagram of simplifying daily record that another embodiment of the present invention provides;
Figure 11 is a kind of schematic diagram issuing result mail effect that another embodiment of the present invention provides;
Figure 12 is the structural representation of the source code compact device that one embodiment of the invention provides;
Figure 13 is the structural representation of the source code compact device that another embodiment of the present invention provides.
Embodiment
For making the object, technical solutions and advantages of the present invention clearly, below in conjunction with accompanying drawing, embodiment of the present invention is described further in detail.
Please refer to Fig. 1, it illustrates the structural representation of a kind of implementation environment involved by source code compressing method that each embodiment of the present invention provides.This implementation environment comprises at least one terminal 120 and at least one server 140, is made up of the executive agent robotization delivery system 160 of various embodiments of the present invention this at least one terminal 120 and at least one server 140.
Terminal 120 can be the electronic equipment with source code file exploitation and upload function.This electronic equipment can be smart mobile phone, panel computer, E-book reader, pocket computer on knee or desk-top computer etc.
Can be connected by cable network, wireless network or LAN (Local Area Network) between terminal 120 with server 140.
Server 140 can be a station server, or the server cluster be made up of some station servers, or a cloud computing service center.This server 140 is can the source code file uploaded of receiving terminal 120, simplify script by execution automatically to simplify the source code file that this terminal 120 is uploaded, and in the process of simplifying, this source code file is issued, obtain the server of corresponding application program.
Please refer to Fig. 2, it illustrates the method flow diagram of the source code compressing method that one embodiment of the invention provides.The present embodiment is applied in server 140 illustrated in fig. 1 with this source code compressing method and illustrates.The method comprises:
201, at least one source code file to be released is obtained.
202, in issuing process, this at least one source code file is simplified, obtains the source code file after simplifying.
203, the source code file after simplifying according to this is issued.
In sum, the source code compressing method that the embodiment of the present invention provides, by obtaining source code file to be released, simplifies this source code file, and then issues the source code file after simplifying in issuing process; Solving prior art needs developer manually to simplify source code file, the problem of complex operation; Not only robotization issuing process and the process of simplifying are combined into 1 process, do not need developer manually to simplify, and when finding mistake in issuing process, based on the source code file before simplifying, it can be positioned, therefore positioning problems is easy, improves the adjustable of source code file.
Whether alternatively, for each source code file, detecting this source code file is need to simplify and the source code file of not yet simplifying;
If this source code file needs to simplify and the source code file of not yet simplifying, then this source code file is simplified.
Alternatively, should for each source code file, whether be need simplify and the source code file of not yet simplifying, comprising if detecting this source code file:
For each source code file, obtain the file path of this source code file;
Whether the file path detecting this source code file hits the file path in configuration file, and this configuration file comprises the file path that pre-configured needs carry out the source code file of simplifying.
Alternatively, this is simplified this source code file, comprising:
That specifies the execution of this source code file simplifies script, and obtain the source code file after simplifying, what this was specified simplifies script is the pre-configured script for simplifying this source code file;
Source code file after using this to simplify covers this source code file.
Alternatively, this is simplified this at least one source code file, after obtaining the source code file after simplifying, also comprises:
In the process of simplifying, that adds up this source code file simplifies parameter, and this is simplified parameter and comprises the rate of simplifying and simplify consuming time;
According to this simplify parameter generate simplify report;
Export this and simplify report.
Above-mentioned all alternatives, can adopt and combine arbitrarily formation optional embodiment of the present invention, this is no longer going to repeat them.
Please refer to Fig. 3, it illustrates the method flow diagram of the source code compressing method that another embodiment of the present invention provides.The present embodiment is applied in server 140 illustrated in fig. 1 with this source code compressing method and illustrates.The method comprises:
301, at least one source code file to be released is obtained.
In the invention process, when the operational order to the deployment button in terminal 120 being detected, server 140 obtains this source code file to be released.Wherein, this source code file to be released may be one, also may be multiple.
Before source code file is issued, PM (ProjectManagement, project management) personnel can establish the issue list of source code file to be released in advance, and by clicking the deployment button in terminal 120, source code file in this issue list is uploaded onto the server 140, and then the source code file that server 140 is uploaded by receiving terminal 120, realizes the acquisition to this source code file to be released.
Wherein, this issue can be singly the issue list of the filename only including this source code file to be released; It can also be the issue list of the file directory comprising this source code file to be released, when this issue is singly the issue list of the file directory comprising this source code file to be released, can the sequence number of this source code file to be released, the filename of source code file to be released etc. in this issue list.
Alternatively, this issue can be singly the issue list shown in following table 1:
Sequence number Filename
1 accessory.js
2 qbossInfo.js
3 music_QQ.js
4 music_QQ_v8.js
Table 1
When the operational order to the deployment button in terminal 120 being detected, terminal 120 uploads each source code file according to the filename in this issue list, and server 140, by receiving this source code file, obtains it; Or terminal 120 is according to the file directory in this issue list, uploads each source code file, server 140, by receiving this source code file, obtains it.
Wherein, when terminal 120 uploads each source code file according to the file directory in this issue list, terminal 120 according to issuing the sequence number provided in list, upload this each source code file according to the order of sequence, thus server 140 can obtain by this source code file of ordered pair.Certainly, terminal 120 can also upload this each source code file according to other order, and also, server 140 can also obtain this each source code file according to other order.The acquisition of the present invention to this source code file is not construed as limiting.
It should be noted that, terminal 120 is when uploading the source code file issued in list, and this issue list also can be uploaded to server 140 simultaneously.
302, whether for each source code file, detecting this source code file is need to simplify and the source code file of not yet simplifying.
In embodiments of the present invention, this source code file to be released can be simplified in advance, also can not simplify in advance, therefore, consuming time in order to reduce simplifying of all source code file, before simplifying source code file, whether server 140 detection resources code file is need to simplify but the source code file of not yet simplifying.
Please refer to Fig. 4, it illustrates detection resources code file that another embodiment of the present invention provides the need of simplifying and the method flow diagram of the method for the source code file of not yet simplifying.The present embodiment with this detection resources code file the need of to simplify and the method for the source code file of not yet simplifying is applied in server 140 illustrated in fig. 1 and illustrates.The method comprises:
401, for each source code file, the file path of this source code file is obtained.
The issue list that server 140 recurrence PM personnel are uploaded by terminal 120, obtains the file path of each source code file to be released in this issue list.
Be described for the issue list in above-mentioned steps 301, suppose that the file path of above four source code file that server 140 gets is the file path shown in following table 2:
Sequence number Source code file File path
1 accessory.js D:/data/imgcache/htdocs/qfs/v1/icenter/accessory.js
2 qbossInfo.js D:/data/imgcache/htdocs/qfs/v1/icenter/qbossInfo.js
3 music_QQ.js D:/urs/local/imgcache/htdocs/QQ/music/music_QQ.js
4 music_QQ_v8.js D:/urs/local/imgcache/htdocs/QQ/music/music_QQ_v8.js
Table 2
Whether the file path 402, detecting this source code file hits the file path in configuration file, and this configuration file comprises the file path that pre-configured needs carry out the source code file of simplifying.
Wherein, this configuration file is the file carrying out the file path of the source code file of simplifying for storing pre-configured needs, and alternatively, this configuration file can be the .txt file that a file content comprises at least one file path.
Particularly, when server 140 gets the file path of source code file, server 140 can according to the file path of source code file, in this configuration file, search the file path identical with the file path of this source code file, thus whether the file path realizing detecting this source code file hits the operation of the file path in configuration file.
If server 140 finds the file path identical with the file path of this source code file in configuration file, then illustrate that the file path of this source code file has hit the file path in configuration file; If server 140 does not find the file path identical with the file path of this source code file in configuration file, then the file path in the miss configuration file of the file path of this source code file is described.
Please refer to Fig. 5, it illustrates the schematic diagram of a kind of configuration file that another embodiment of the present invention provides.File path and the configuration file shown in this Fig. 5 of each source code file shown in above table 2 are that example is described.
Can find out, in above-mentioned four source code file, only have sequence number be 2 source code file, the file path namely in the miss configuration file of qbossInfo.js file, its excess-three source code file has all hit the file path in this configuration file.
If 303 these source code file need to simplify and the source code file of not yet simplifying, then this source code file is simplified.
In above-mentioned steps 402, if server 140 detects that the file path of source code file has hit the file path in configuration file, then this source code file needs to simplify and the source code file of not yet simplifying.
When server 140 determine source code file be need simplify and the source code file of not yet simplifying time, server 140 is simplified this source code file automatically.
Please refer to Fig. 6, it illustrates the method flow diagram to the method that source code file is simplified that another embodiment of the present invention provides.The present embodiment to be applied in server 140 illustrated in fig. 1 the method that source code file is simplified to illustrate with this.The method comprises:
That 601, specifies source code file execution simplifies script, and obtain the source code file after simplifying, what this was specified simplifies script is the pre-configured script for simplifying this source code file.
In embodiments of the present invention, server 140 by perform specify simplify script, needs to be simplified and the source code file of not yet simplifying is simplified.Wherein, to this execution of simplifying script of specifying be server 140 detect source code file be need simplify and after the source code file of not yet simplifying, automatically perform.
Particularly, what server 140 was specified by execution simplifies script, removes the redundant information in this source code file, and as annotation, space and null etc., and then server 140 obtains the source code file after simplifying this source code file.
Please refer to Fig. 7, a kind of needs that it illustrates another embodiment of the present invention provides are simplified and the schematic diagram of the source code file of not yet simplifying.Can find out, in the source code file shown in this Fig. 7, have the redundant informations such as annotation, space and null.
Please refer to Fig. 8, it illustrates that another embodiment of the present invention provides a kind of source code file shown in Fig. 7 is simplified after the schematic diagram of source code file.Can find out, compared to the source code file shown in Fig. 7, to have there is not redundant informations such as simplifying annotation, space and null in the source code file after simplifying shown in this Fig. 8, or only there is the redundant information of minute quantity.
602, the source code file after simplifying is used to cover source code file.
Particularly, the data in the source code file after simplifying are kept in the source code file before simplifying by server 140, realize the covering of the source code file before simplifying this.
Alternatively, the source code file after simplifying first can be saved to temporary file by server 140, and then covers the source code file before simplifying with this temporary file, and deletes this temporary file.
304, the source code file after simplifying according to this is issued.
In embodiments of the present invention, at the end of source code file is simplified, server 140 automatically this is simplified after source code file issue.
It should be noted that, when detecting that source code file is not simplified and the source code file of not yet simplifying for needing in step 302, that is, when this source code file is the source code file of simplifying in advance, server 140 can directly be issued it.
Also it should be noted that, this server 140 can be right to getting after all source code file are all simplified, and issue this all source code file, also can simplify while issue, the present embodiment is not construed as limiting this.
It should be added that, in above step 303 (step 601 and step 602), server 140, in the process of simplifying source code file, can generate and simplify report.
Please refer to Fig. 9, the method flow diagram of the method for report is simplified in the generation that it illustrates another embodiment of the present invention provides.The present embodiment is applied in server 140 illustrated in fig. 1 with the method that report is simplified in this generation and illustrates.The method comprises:
901, in the process of simplifying, Statistic Source code file simplify parameter, this simplify parameter comprise the rate of simplifying and simplify consuming time.
Wherein, the rate of simplifying is the ratio of the size of the data of simplifying and the size of this source code file; Simplify the difference between finish time for simplifying current source code file consuming time and start time.
Such as, for the source code file music_QQ.js in upper table 2, suppose that the size of this source code file is 300kb, when simplifying this source code file, the size of the data of simplifying is 128kb, then the rate of simplifying of this source code file is just 128kb/300kb=42%.
Again such as, the start time that this source code file is simplified be 2 points 45 seconds, finish time be 2 points 46 seconds, then this source code file simplify consuming time be just 2 points 46 seconds-2 points 45 seconds=6 seconds=60 milliseconds.
It should be noted that, this is simplified parameter and can also comprise, simplify result, source code file size, simplify after the size etc. of source code file.Wherein, this simplifies result is be successfully to simplifying of this source code file, or failure.
902, report is simplified according to simplifying parameter generation.
Server 140 simplifies parameter according to what count on, generates and simplifies report.
Wherein, this simplifies in report, can comprise the file path of source code file, simplifies parameter for what count in above-mentioned steps 901, and the report of simplifying of this source code file music_QQ.js can be as shown in table 3 below:
Table 3
903, report is simplified in output.
After report is simplified in generation, this server 140 exports this and simplifies report.Alternatively, this can be simplified report and be sent to terminal 120 by server 140, and is presented on the display screen of terminal 120, checks for PM personnel.
Such as, for source code file music_QQ.js, server 140 will export one and simplify report as above shown in table 3.
Also it should be added that, in above step 303 (step 601 and step 602), when there is mistake in server 140 in the process of simplifying source code file, this server 140 stops simplifying current source code file, and according to current simplify result generate simplify daily record.Alternatively, this simplify daily record can for simplifying daily record shown in Figure 10.
Please refer to Figure 10, it illustrates a kind of schematic diagram of simplifying daily record that another embodiment of the present invention provides.Can find out, for needing in table 2 to simplify and for three source code file accessory.js, music_QQ.js and music_QQ_v8.js not yet simplifying, server 140 couples of source code file accessory.js simplify unsuccessfully, and failed reason is that this accessory.js file has the blacklist configuration file not being JS and simplifying; All successful to simplifying of source code file music_QQ.js and music_QQ_v8.js.It can also be seen that, this performs the finish time of simplifying script is 2014052812:59:33.
When server 140 according to simplify result generate simplify daily record time, can be exported this and simplify daily record, this be simplified Log Sender to terminal 120, and be presented on the display screen of terminal 120, check for PM personnel.
Finally it should be added that, at the end of all issuing all source code file, server 140 can this issue result issued of mail notification PM personnel.In this mail, the file path of announced source code file can be comprised, issue result, simplify the size of front and back source code file, simplify rate, simplify the information such as consuming time and remarks.
Please refer to Figure 11, it illustrates a kind of schematic diagram issuing result mail effect that another embodiment of the present invention provides.This schematic diagram is described for the issue result of four source code file shown in his-and-hers watches 1.And suppose source code file accessory.js simplify before size be a1, the size after simplifying is b1; Source code file music_QQ.js file simplify before size be a2, the size after simplifying is b2; Source code file music_QQ_v8.js file simplify before size be a3, the size after simplifying is b3.Consuming timely t1 is respectively, t2 and t3 to this source code file accessory.js, simplifying of music_QQ.js and music_QQ_v8.js.The schematic diagram of this issue result mail effect can be the schematic diagram shown in Figure 11.
In sum, the source code compressing method that the embodiment of the present invention provides, by obtaining source code file to be released, simplifies this source code file, and then issues the source code file after simplifying in issuing process; Solving prior art needs developer manually to simplify source code file, the problem of complex operation; Not only robotization issuing process and the process of simplifying are combined into 1 process, do not need developer manually to simplify, and when finding mistake in issuing process, based on the source code file before simplifying, it can be positioned, therefore positioning problems is easy, improves the adjustable of source code file.
Whether further, by whether hitting the file path in configuration file according to source code file, detecting this source code file is need to simplify and the source code file of not yet simplifying, and then simplifies these needs and the source code file of not yet simplifying is simplified; Save needing to simplify but the source code file of having simplified time of again simplifying.
Further, simplifying parameter by statistics in the process of simplifying, simplify report according to simplifying parameter generation, and report is simplified in output; Or simplify daily record according to simplifying result generation, and notify the issue result of PM personnel source code file in the mode of mail; Improve simplify parameter can statistically, metrizability bring the saving of flow for user.
Please refer to Figure 12, it illustrates the structural representation of the source code compact device that one embodiment of the invention provides.The present embodiment is applied in server 140 illustrated in fig. 1 with this source code compact device and illustrates.This source code compact device comprises: acquisition module 1201, simplify module 1202 and release module 1203.
Acquisition module 1201, for obtaining at least one source code file to be released.
Simplify module 1202, in issuing process, at least one source code file that this acquisition module 1201 gets is simplified, obtains the source code file after simplifying.
Release module 1203, issues for the source code file after simplifying according to this.
In sum, the source code compact device that the embodiment of the present invention provides, by obtaining source code file to be released, simplifies this source code file, and then issues the source code file after simplifying in issuing process; Solving prior art needs developer manually to simplify source code file, the problem of complex operation; Not only robotization issuing process and the process of simplifying are combined into 1 process, do not need developer manually to simplify, and when finding mistake in issuing process, based on the source code file before simplifying, it can be positioned, therefore positioning problems is easy, improves the adjustable of source code file.
Alternatively, this simplifies module, comprising:
Detecting unit, whether for for each source code file, detecting this source code file is need to simplify and the source code file of not yet simplifying;
Simplify unit, for when this source code file be need simplify and the source code file of not yet simplifying time, this source code file is simplified.
Alternatively, this detecting unit, comprising:
Obtain subelement, for for each source code file, obtain the file path of this source code file;
Detection sub-unit, whether the file path for detecting this source code file hits the file path in configuration file, and this configuration file comprises the file path that pre-configured needs carry out the source code file of simplifying.
Alternatively, this simplifies unit, comprising:
Perform subelement, simplify script for what specify the execution of this source code file, obtain the source code file after simplifying, what this was specified simplifies script is the pre-configured script for simplifying this source code file;
Cover subelement, the source code file after simplifying for using this covers this source code file.
Alternatively, this device, also comprises:
Statistical module, in the process of simplifying, that adds up this source code file simplifies parameter, and this is simplified parameter and comprises the rate of simplifying and simplify consuming time;
Generation module, for according to this simplify parameter generate simplify report;
Output module, simplifies report for exporting this.
Please refer to Figure 13, it illustrates the structural representation of the source code compact device that another embodiment of the present invention provides.The present embodiment is applied in server 140 illustrated in fig. 1 with this source code compact device and illustrates.This source code compact device comprises: acquisition module 1301, simplify module 1302 and release module 1303.
Acquisition module 1301, for obtaining at least one source code file to be released.
Simplify module 1302, in issuing process, at least one source code file that this acquisition module 1301 gets is simplified, obtains the source code file after simplifying.
Release module 1303, issues for the source code file after simplifying according to this.
This simplifies module 1302, comprising:
Detecting unit 1304, whether for for each source code file, detecting this source code file is need to simplify and the source code file of not yet simplifying;
Simplify unit 1305, for when this source code file be need simplify and the source code file of not yet simplifying time, this source code file is simplified.
This detecting unit 1304, comprising:
Obtain subelement 1306, for for each source code file, obtain the file path of this source code file;
Detection sub-unit 1307, whether the file path for detecting this source code file hits the file path in configuration file, and this configuration file comprises the file path that pre-configured needs carry out the source code file of simplifying.
This simplifies unit 1305, comprising:
Perform subelement 1308, simplify script for what specify the execution of this source code file, obtain the source code file after simplifying, what this was specified simplifies script is the pre-configured script for simplifying this source code file;
Cover subelement 1309, the source code file after simplifying for using this covers this source code file.
This device, also comprises:
Statistical module 1310, in the process of simplifying, that adds up this source code file simplifies parameter, and this is simplified parameter and comprises the rate of simplifying and simplify consuming time;
Generation module 1311, for according to this simplify parameter generate simplify report;
Output module 1312, simplifies report for exporting this.
In sum, the source code compact device that the embodiment of the present invention provides, by obtaining source code file to be released, simplifies this source code file, and then issues the source code file after simplifying in issuing process; Solving prior art needs developer manually to simplify source code file, the problem of complex operation; Not only robotization issuing process and the process of simplifying are combined into 1 process, do not need developer manually to simplify, and when finding mistake in issuing process, based on the source code file before simplifying, it can be positioned, therefore positioning problems is easy, improves the adjustable of source code file.
Whether further, by whether hitting the file path in configuration file according to source code file, detecting this source code file is need to simplify and the source code file of not yet simplifying, and then simplifies these needs and the source code file of not yet simplifying is simplified; Save needing to simplify but the source code file of having simplified time of again simplifying.
Further, simplifying parameter by statistics in the process of simplifying, simplify report according to simplifying parameter generation, and report is simplified in output; Improve simplify parameter can statistically, metrizability bring the saving of flow for user.
It should be noted that: the source code compact device that above-described embodiment provides is when simplifying source code, only be illustrated with the division of above-mentioned each functional module, in practical application, can distribute as required and by above-mentioned functions and be completed by different functional modules, inner structure by equipment is divided into different functional modules, to complete all or part of function described above.In addition, the source code compact device that above-described embodiment provides and source code compressing method embodiment belong to same design, and its specific implementation process refers to embodiment of the method, repeats no more here.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
One of ordinary skill in the art will appreciate that all or part of step realizing above-described embodiment can have been come by hardware, the hardware that also can carry out instruction relevant by program completes, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium mentioned can be ROM (read-only memory), disk or CD etc.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (10)

1. a source code compressing method, is characterized in that, described method comprises:
Obtain at least one source code file to be released;
In issuing process, at least one source code file described is simplified, obtains the source code file after simplifying;
Issue according to the source code file after described simplifying.
2. method according to claim 1, is characterized in that, describedly simplifies at least one source code file described, obtains the source code file after simplifying, comprising:
Whether for each source code file, detecting described source code file is need to simplify and the source code file of not yet simplifying;
If described source code file needs to simplify and the source code file of not yet simplifying, then described source code file is simplified.
3. method according to claim 2, is characterized in that, described for each source code file, and whether be need simplify and the source code file of not yet simplifying, comprising if detecting described source code file:
For each source code file, obtain the file path of described source code file;
Whether the file path detecting described source code file hits the file path in configuration file, and described configuration file comprises the file path that pre-configured needs carry out the source code file of simplifying.
4. method according to claim 2, is characterized in that, describedly simplifies described source code file, comprising:
That specifies described source code file execution simplifies script, and obtain the source code file after simplifying, described script of simplifying of specifying is the pre-configured script for simplifying described source code file;
Source code file after simplifying described in using covers described source code file.
5. according to the arbitrary described method of Claims 1-4, it is characterized in that, described at least one source code file described to be simplified, after obtaining the source code file after simplifying, also comprise:
In the process of simplifying, that adds up described source code file simplifies parameter, described in simplify parameter comprise the rate of simplifying and simplify consuming time;
According to described simplify parameter generate simplify report;
Report is simplified described in output.
6. a source code compact device, is characterized in that, described device comprises:
Acquisition module, for obtaining at least one source code file to be released;
Simplify module, in issuing process, at least one source code file described is simplified, obtains the source code file after simplifying;
Release module, issues for the source code file after simplifying described in basis.
7. device according to claim 6, is characterized in that, described in simplify module, comprising:
Detecting unit, whether for for each source code file, detecting described source code file is need to simplify and the source code file of not yet simplifying;
Simplify unit, for when described source code file be need simplify and the source code file of not yet simplifying time, described source code file is simplified.
8. device according to claim 7, is characterized in that, described detecting unit, comprising:
Obtain subelement, for for each source code file, obtain the file path of described source code file;
Detection sub-unit, whether the file path for detecting described source code file hits the file path in configuration file, and described configuration file comprises the file path that pre-configured needs carry out the source code file of simplifying.
9. device according to claim 7, is characterized in that, described in simplify unit, comprising:
Perform subelement, simplify script for what specify described source code file execution, obtain the source code file after simplifying, described script of simplifying of specifying is the pre-configured script for simplifying described source code file;
Cover subelement, cover described source code file for the source code file after simplifying described in using.
10., according to the arbitrary described device of claim 6 to 9, it is characterized in that, described device, also comprises:
Statistical module, in the process of simplifying, that adds up described source code file simplifies parameter, described in simplify parameter comprise the rate of simplifying and simplify consuming time;
Generation module, simplifies report for simplifying parameter generation described in basis;
Output module, simplifies report described in exporting.
CN201410270010.7A 2014-06-17 2014-06-17 Source code simplifying method and apparatus Pending CN105302531A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410270010.7A CN105302531A (en) 2014-06-17 2014-06-17 Source code simplifying method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410270010.7A CN105302531A (en) 2014-06-17 2014-06-17 Source code simplifying method and apparatus

Publications (1)

Publication Number Publication Date
CN105302531A true CN105302531A (en) 2016-02-03

Family

ID=55199835

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410270010.7A Pending CN105302531A (en) 2014-06-17 2014-06-17 Source code simplifying method and apparatus

Country Status (1)

Country Link
CN (1) CN105302531A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110096262A (en) * 2019-03-16 2019-08-06 平安城市建设科技(深圳)有限公司 Generation method, device, terminal and the computer readable storage medium of city system
US11138094B2 (en) 2020-01-10 2021-10-05 International Business Machines Corporation Creation of minimal working examples and environments for troubleshooting code issues
US11163592B2 (en) 2020-01-10 2021-11-02 International Business Machines Corporation Generation of benchmarks of applications based on performance traces
CN115757077A (en) * 2022-12-22 2023-03-07 深圳国家金融科技测评中心有限公司 System clipping degree and service component minimization evaluation method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
JINDW: "几种脚本文本压缩方式压缩比率和解压性能的比较", 《HTTP://WWW.ITEYE.COM/TOPIC/82153》 *
LORENCE ZHANG: "maven实现JS+CSS自动压缩", 《HTTPS://WWW.CNBLOGS.COM/LORENCE/ARTICLES/2750001.HTML》 *
一次一粒沙: "Yui.Compressor高性能ASP.NET开发:自动压缩CSS、JS", 《HTTPS://WWW.CNBLOGS.COM/TIMY/ARCHIVE/2011/10/30/2229640.HTML》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110096262A (en) * 2019-03-16 2019-08-06 平安城市建设科技(深圳)有限公司 Generation method, device, terminal and the computer readable storage medium of city system
US11138094B2 (en) 2020-01-10 2021-10-05 International Business Machines Corporation Creation of minimal working examples and environments for troubleshooting code issues
US11163592B2 (en) 2020-01-10 2021-11-02 International Business Machines Corporation Generation of benchmarks of applications based on performance traces
CN115757077A (en) * 2022-12-22 2023-03-07 深圳国家金融科技测评中心有限公司 System clipping degree and service component minimization evaluation method
CN115757077B (en) * 2022-12-22 2023-09-05 深圳国家金融科技测评中心有限公司 System clipping degree and service assembly minimization evaluation method

Similar Documents

Publication Publication Date Title
CN108255847B (en) Page generation method and device
CN112311617A (en) Configured data monitoring and alarming method and system
CN104699598A (en) Automatic testing method, device, equipment and system
CN109828905B (en) Automatic test method, device, computer device and storage medium
CN103927338A (en) Log information storage processing method and log information storage processing device
WO2014206289A1 (en) Method and apparatus for outputting log information
US10664443B2 (en) Method and apparatus for presenting to-be-cleaned data, and electronic device
CN102694861A (en) Cloud technology based method, cloud technology based device and cloud technology based system for classification of terminal application software
CN105302531A (en) Source code simplifying method and apparatus
CN104298579A (en) Logic chip and board card device with same
CN106453402B (en) A kind of data processing method and equipment
CN109408309B (en) Multi-terminal testing method and device
CN111026572A (en) Fault processing method and device of distributed system and electronic equipment
CN106293842B (en) Software installation method and device
CN112636992A (en) Dynamic routing method, device, equipment and storage medium
CN104133761A (en) Memory usage analysis method, device and system of mobile terminal
CN113704790A (en) Abnormal log information summarizing method and computer equipment
CN104750585A (en) Terminal detecting method and terminal detecting device
CN111782728B (en) Data synchronization method, device, electronic equipment and medium
CN104516890A (en) Business processing method, business processing device and electronic equipment
CN111130828B (en) Intelligent network distribution method and device and terminal equipment
CN107861821B (en) Mining method and device for module call relation and computer readable medium
CN114546676A (en) Cloud desktop file copying method, device and equipment
CN108540582A (en) A kind of processing method of terminal iidentification, server and terminal
US10938771B2 (en) Determining physical locations of devices in a data center

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20160203