Software compiling and sharing method and system

By compiling and sharing the compiled files of each version of the software on the server, the problem of time waste and server resource waste caused by multiple people compiling at the same time is solved, a ready-to-use compilation method is realized, and the development/testing efficiency and project progress are improved.

CN118605879APending Publication Date: 2024-09-06SHANGHAI LIXIN SOFTWARE TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410688769.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-30
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

During the software development process, multiple developers/testers have requirements for the same compiled version. However, the existing technology requires each person to pull the source code from the server for compilation, which results in long compilation time and a large number of generated binary compiled packages. Waste of server memory resources.

Method used

Provide a software compilation and sharing method and system, which generates a compiled package by compiling the source code of each version of the software, uploads it to the server shared directory, decompresses it, configures it as an executable file, and receives user input parameters through a script to call the corresponding compiled file. Run, eliminating the need for local compilation and realizing resource sharing.

Benefits of technology

It greatly saves local compilation time, reduces server pressure, and improves the efficiency of developers/testers and project development progress.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118605879A
    Figure CN118605879A
Patent Text Reader

Abstract

The invention provides a software compiling and sharing method and system.The method comprises the steps that source codes of all versions of software are compiled to obtain corresponding compilation packages, and the compilation packages are uploaded to a shared directory of a server and then decompressed to obtain corresponding compilation files; the compiling file is configured into an executable file through a preset script, and the path of the script is configured in the system environment of the server; and receiving a user input parameter through the script, and calling the corresponding compiling file under the shared directory to run based on the user input parameter. Compared with a local compiling and using mode, the method has the advantages that a local compiling link can be omitted, local compiling time is greatly saved, and server pressure caused by simultaneous compiling of a large number of personnel is relieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a software compilation sharing method and system. Background Art

[0002] During the software development process, a complex software usually has dozens of compiled versions, which can be updated daily and / or per commit, and one version is compiled to generate a binary compiled package. When developers / tester are debugging / testing software, multiple developers / tester may need to use the same compiled version. Currently, each developer / tester needs to pull the corresponding version of the software source code from the server to the local computer for compilation before using it (ready-to-use compilation mode). Each user needs to spend a long time compiling (up to 1 hour), and each compilation generates a binary compiled package, resulting in a large number of compiled packages, thereby wasting server memory resources. Summary of the invention

[0003] In view of the above-mentioned deficiencies in the prior art, an object of the present invention is to provide a software compilation sharing method and system to reduce the number of software compilations.

[0004] In order to achieve the above object, the present invention adopts the following technical solutions:

[0005] In a first aspect, the present invention provides a software compilation sharing method, comprising:

[0006] Compile the source code of each version of the software to obtain the corresponding compilation package, upload the compilation package to the shared directory of the server and then decompress it to obtain the corresponding compilation file;

[0007] Configuring the compiled file into an executable file through a preset script, wherein the path of the script is configured in the system environment of the server;

[0008] The script receives user input parameters, and calls the corresponding compiled file in the shared directory to run based on the user input parameters.

[0009] Furthermore, the compiled file is version named according to a preset version naming rule;

[0010] The user input parameters include a specified version parameter;

[0011] The calling of the corresponding compiled file to run based on the user input parameters includes:

[0012] Search for a compiled file whose version naming result matches the specified version parameter, and call the found compiled file to run.

[0013] Furthermore, the method further comprises: updating the version of the software on a daily basis and / or on a per-commit basis;

[0014] The version naming rules include: naming according to the version number and date mark or commit mark corresponding to the corresponding version software.

[0015] Furthermore, the specified version parameters include: a specified version number and a date identifier or a commit identifier; or,

[0016] The specified version parameters include: the latest version updated every day or every commit.

[0017] Furthermore, the method further comprises:

[0018] After decompressing the compilation package into the corresponding compilation file, deleting the original compilation package; and / or,

[0019] Clean up the compiled files under the shared target according to preset cleaning rules.

[0020] In a second aspect, the present invention provides a software compilation sharing system, comprising:

[0021] The system task module is used to compile the source code of each version of the software to obtain the corresponding compilation package, and then upload the compilation package to the shared directory of the server and decompress it to obtain the corresponding compilation file;

[0022] A script module is used to configure the compiled file into an executable file through a preset script, and then receive user input parameters through the script, and call the corresponding compiled file under the shared target to run based on the user input parameters, wherein the path of the script is configured in the system environment of the server.

[0023] Furthermore, the compiled file is version named according to a preset version naming rule;

[0024] The user input parameters include a specified version parameter;

[0025] The script calls the corresponding compiled file to run based on the user input parameters, including:

[0026] Search for a compiled file whose version naming result matches the specified version parameter, and call the found compiled file to run.

[0027] Furthermore, the system task module is also used to update the version of the software on a daily basis and / or per commit basis;

[0028] The version naming rules include: naming according to the version number and date mark or commit mark corresponding to the corresponding version software.

[0029] Furthermore, the specified version parameters include: a specified version number and a date identifier or a commit identifier; or,

[0030] The specified version parameters include: the latest version updated every day or every commit.

[0031] Furthermore, the system task module is also used for:

[0032] After decompressing the compilation package into the corresponding compilation file, deleting the original compilation package; and / or,

[0033] Clean up the compiled files under the shared target according to preset cleaning rules.

[0034] By adopting the above technical solution, the present invention has the following beneficial effects:

[0035] The present invention first compiles the source code of each version of the software to obtain the corresponding compilation package, and uploads the compilation package to the shared directory of the server and then decompresses it to obtain the corresponding compilation file, so that the compilation file of each version of the software can be provided to each internal developer / tester for common use; then, the compilation file is configured into an executable file through a script configured in the system environment of the server, and then the user input parameters are received through the script, and the corresponding compilation file is called to run based on the user input parameters. In this way, the present invention can directly call the compilation file in the shared directory through a script command. Compared with the local ready-to-use and ready-to-use method of traditional developers / testers, the local compilation link (ready-to-use method) can be omitted, which greatly saves local compilation time, and at the same time reduces the server pressure caused by a large number of people compiling at the same time, improves the test efficiency of testers and the debugging efficiency of developers, and users can use the corresponding compilation files in the shared directory at any time according to needs, which improves the project development progress to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 This is a flowchart of the software compilation sharing method according to Embodiment 1 of the present invention;

[0037] Figure 2 This is a structural block diagram of a software compilation sharing system according to Embodiment 2 of the present invention. DETAILED DESCRIPTION

[0038] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0039] The terms used in the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present disclosure. The singular forms "a", "the" and "the" used in the present disclosure and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0040] Example 1

[0041] This embodiment provides a software compilation sharing method, such as Figure 1 As shown, the method specifically comprises the following steps:

[0042] S1, compile the source code of each version of the software to obtain the corresponding compilation package.

[0043] In this embodiment, the software version can be updated every day and / or every commit. Specifically, the software version update is triggered by daily tag or through webhook (when the main branch of the software warehouse merges new changes), and each version of the software is stored in the software warehouse.

[0044] This step pulls the software source code of the corresponding tag or commit in the software repository for compilation, that is, obtains the binary compilation package corresponding to each version.

[0045] The software in this embodiment includes but is not limited to EDA software and the like.

[0046] S2, upload the compiled package to the shared directory of the server, and then decompress it to obtain the corresponding compiled file.

[0047] In this embodiment, the server includes but is not limited to a Linux server, etc., and it may be a server of a distributed system.

[0048] In this embodiment, the compiled package can be named according to the preset version naming rules and then uploaded to the shared directory (Xshare directory) of the Linux server, and then the compiled package is decompressed to obtain the corresponding compiled file. In this way, each compiled file can be used together on multiple internal Linux machines to achieve resource sharing.

[0049] Preferably, in order to reduce the memory pressure of the server, the present embodiment can delete the original compiled package after decompressing the compiled package into the corresponding compiled file. In addition, the compiled files under the shared target can be cleaned up according to the preset cleanup rules. The cleanup rules include, for example: deleting the compiled files corresponding to the software version updated every day after saving for a first period (such as 180 days), and deleting the compiled files corresponding to the software version updated by each commit after saving for a second period (such as 30 days).

[0050] S3, configuring the compiled file into an executable file through a preset script.

[0051] In this embodiment, the script should be a server executable script (such as a Shell script), and its path is pre-configured in the server's system environment (specifically configured in the server's system environment variable path) for global use.

[0052] In this step, the permissions of each compiled file are changed to executable files through a script so that all internal Linux machines can run each compiled file.

[0053] S4, receiving user input parameters through the script, and calling the corresponding compiled file to run based on the user input parameters.

[0054] In this embodiment, developers / testers can pass in user input parameters through scripts, so that the script can directly start the corresponding compiled files saved in the server shared directory in the local directory to work for testing or scheduling. Compared with the traditional steps of pulling the source code to the local, switching to the specified version and then compiling, it saves compilation time, realizes ready-to-use, and improves work efficiency.

[0055] In this embodiment, the compiled file and the compiled package have the same version naming, that is, the version naming is performed according to a preset version naming rule. The user input parameter input by the user includes a specified version parameter.

[0056] In one practicable manner, the version naming rule includes: naming according to the version number and date identifier or commit identifier corresponding to the corresponding version of the software.

[0057] In an implementable manner, the specified version parameter received by the script includes: a specified version number and a date identifier or a commit identifier.

[0058] In an practicable manner, the specified version parameter received by the script includes: the latest version updated daily or per commit. For example, if the specified version parameter is latest_daily, it indicates that the latest version of the default version number is specified to be updated daily; if the specified version parameter is latest, it indicates that the latest version of the default version number is specified to be updated per commit.

[0059] In this embodiment, the specific process of the script calling the corresponding compiled file to run based on the user input parameters includes: first searching for a compiled file whose version naming result matches the specified version parameter, and then calling the found compiled file to run for software testing or debugging.

[0060] For example, when the specified version parameter includes the specified version number and date identifier (or commit identifier), it is checked whether there is a version naming result of the compiled file (including the version number and date identifier or commit identifier) ​​that matches the specified version parameter. If so, the script calls the matching compiled file to run.

[0061] For another example, when the specified version parameter includes latest_daily, a compiled file corresponding to the latest software version with a default version number and updated daily is searched in the shared directory.

[0062] When calling a compiled file, you can directly call it according to the path of the compiled file, or you can concatenate the tcl path to the path of the compiled file and directly run tcl to call it. This method of passing parameters is concise and clear, which can solve the confusion caused by too many versions and make the control package version easier to use.

[0063] In addition, the functions implemented by the script configured in this embodiment include but are not limited to: a directory of compiled files corresponding to different compiled versions, info (information) / warn (warning) / error (error) prompt functions, a log saving function, a function of running compiled files of different versions, a function of configuring environment variables required for compiled files of different versions, a function of displaying a list of available versions, and script usage help instructions (including a compiled file calling method and a description of specified version parameters), etc.

[0064] This embodiment first compiles the source code of each version of the software to obtain the corresponding compilation package, and then uploads the compilation package to the shared directory of the server and decompresses it to obtain the corresponding compilation file, so that the compilation file of each version of the software can be provided to each internal developer / tester for common use; then, the compilation file is configured into an executable file through a script configured in the system environment of the server, and then the user input parameters are received through the script, and the corresponding compilation file is called to run based on the user input parameters. In this way, the present invention can directly call the compilation file in the shared directory through a script command. Compared with the local ready-to-use and ready-to-use method of traditional developers / testers, the local compilation link (ready-to-use method) can be omitted, which greatly saves local compilation time, and at the same time reduces the server pressure caused by a large number of people compiling at the same time, improves the test efficiency of testers and the debugging efficiency of developers, and users can use the corresponding compilation files in the shared directory at any time according to needs, which improves the project development progress to a certain extent.

[0065] Example 2

[0066] This embodiment provides a software compilation sharing system, such as Figure 2 As shown, the system specifically includes a system task module and a script module.

[0067] In this embodiment, the system task module is used to compile the source code of each version of the software to obtain a corresponding compilation package, and then upload the compilation package to a shared directory of the server and decompress it to obtain a corresponding compilation file.

[0068] The system task module of this embodiment can update the software version every day and / or every commit. Specifically, the daily tag is triggered or the software version update is triggered through a webhook (when the main branch of the software warehouse merges new changes), and each version of the software is stored in the software warehouse. The system task module pulls the software source code of the corresponding tag or commit in the software warehouse for compilation, and obtains the binary compilation package corresponding to each version.

[0069] It should be noted that the software in this embodiment includes but is not limited to EDA software, etc. The server in this embodiment includes but is not limited to Linux server, etc., and it can be a server of a distributed system.

[0070] The system task module of this embodiment can name the compiled package according to the preset version naming rules and then upload it to the shared directory (Xshare directory) of the Linux server, and then decompress the compiled package to obtain the corresponding compiled file. In this way, each compiled file can be used together on multiple internal Linux machines to achieve resource sharing.

[0071] Preferably, in order to reduce the memory pressure of the server, the system task module of this embodiment can delete the original compiled package after decompressing the compiled package into the corresponding compiled file. In addition, the compiled files under the shared target can also be cleaned up according to the preset cleanup rules. The cleanup rules include, for example: the compiled files corresponding to the software version updated every day are saved for a first period (such as 180 days) and then deleted, and the compiled files corresponding to the software version updated by each commit are saved for a second period (such as 30 days) and then deleted.

[0072] In this embodiment, the script module is used to configure the compiled file into an executable file through a preset script, and then receive user input parameters through the script, and call the corresponding compiled file to run based on the user input parameters, wherein the script is configured in the system environment of the server.

[0073] In this embodiment, the script should be a server executable script (such as a Shell script), and its path is pre-configured in the server's system environment (specifically configured in the server's system environment variable path) for global use.

[0074] In this embodiment, the permission of each compiled file is changed to an executable file through a script, so that all internal Linux machines can run each compiled file.

[0075] In this embodiment, developers / testers can pass in user input parameters through scripts, so that the script can directly start the corresponding compiled files saved in the server shared directory in the local directory to work for testing or scheduling. Compared with the traditional steps of pulling the source code to the local, switching to the specified version and then compiling, it saves compilation time, realizes ready-to-use, and improves work efficiency.

[0076] In this embodiment, the compiled file and the compiled package have the same version naming, that is, the version naming is performed according to a preset version naming rule. The user input parameter input by the user includes a specified version parameter.

[0077] In one practicable manner, the version naming rule includes: naming according to the version number and date identifier or commit identifier corresponding to the corresponding version of the software.

[0078] In an implementable manner, the specified version parameter received by the script includes: a specified version number and a date identifier or a commit identifier.

[0079] In an practicable manner, the specified version parameter received by the script includes: the latest version updated daily or per commit. For example, if the specified version parameter is latest_daily, it indicates that the latest version of the default version number is specified to be updated daily; if the specified version parameter is latest, it indicates that the latest version of the default version number is specified to be updated per commit.

[0080] In this embodiment, the specific process of the script calling the corresponding compiled file to run based on the user input parameters includes: first searching for a compiled file whose version naming result matches the specified version parameter, and then calling the found compiled file to run for software testing or debugging.

[0081] For example, when the specified version parameter includes the specified version number and date identifier (or commit identifier), it is checked whether there is a version naming result of the compiled file (including the version number and date identifier or commit identifier) ​​that matches the specified version parameter. If so, the script calls the matching compiled file to run.

[0082] For another example, when the specified version parameter includes latest_daily, a compiled file corresponding to the latest software version with a default version number and updated daily is searched in the shared directory.

[0083] When calling a compiled file, you can directly call it according to the path of the compiled file, or you can concatenate the tcl path to the path of the compiled file and directly run tcl to call it. This method of passing parameters is concise and clear, which can solve the confusion caused by too many versions and make the control package version easier to use.

[0084] In addition, the functions implemented by the script configured in this embodiment include but are not limited to: a directory of compiled files corresponding to different compiled versions, info (information) / warn (warning) / error (error) prompt functions, a log saving function, a function of running compiled files of different versions, a function of configuring environment variables required for compiled files of different versions, a function of displaying a list of available versions, and script usage help instructions (including a compiled file calling method and a description of specified version parameters), etc.

[0085] In this embodiment, the source code of each version of the software is compiled by the system task module to obtain the corresponding compilation package, and the compilation package is uploaded to the shared directory of the server and then decompressed to obtain the corresponding compilation file, so that the compilation file of each version of the software can be provided to each internal developer / tester for common use; then, the script module configures the compilation file into an executable file through the script configured in the system environment of the server, and then receives the user input parameters through the script, and calls the corresponding compilation file to run based on the user input parameters. In this way, the present invention can directly call the compilation file in the shared directory through the script command. Compared with the local ready-to-use and ready-to-use method of the traditional developer / tester, the local compilation link (ready-to-use method) can be omitted, which greatly saves the local compilation time, and at the same time reduces the server pressure caused by a large number of people compiling at the same time, improves the test efficiency of the tester and the debugging efficiency of the developer, and the user can use the corresponding compilation file in the shared directory at any time according to the demand, which improves the project development progress to a certain extent.

[0086] Although the specific embodiments of the present invention are described above, it should be understood by those skilled in the art that this is only for illustration and the protection scope of the present invention is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, but these changes and modifications all fall within the protection scope of the present invention.

Claims

1. A software compilation sharing method, characterized in that: include: Compile the source code of each version of the software to obtain the corresponding compilation package, upload the compilation package to the shared directory of the server and then decompress it to obtain the corresponding compilation file; Configuring the compiled file into an executable file through a preset script, wherein the path of the script is configured in the system environment of the server; The script receives user input parameters, and calls the corresponding compiled file in the shared directory to run based on the user input parameters.

2. The software compilation sharing method according to claim 1, characterized in that: The compiled file is version named according to a preset version naming rule; The user input parameters include a specified version parameter; The calling of the corresponding compiled file to run based on the user input parameters includes: Search for a compiled file whose version naming result matches the specified version parameter, and call the found compiled file to run.

3. The software compilation sharing method according to claim 2, characterized in that: The method further comprises: updating the version of the software on a daily basis and / or on a per-commit basis; The version naming rules include: naming according to the version number and date mark or commit mark corresponding to the corresponding version software.

4. The software compilation sharing method according to claim 3, characterized in that: The specified version parameters include: a specified version number and a date identifier or a commit identifier; or, The specified version parameters include: the latest version updated every day or every commit.

5. The software compilation sharing method according to claim 1, characterized in that: The method further comprises: After the compilation package is decompressed into the corresponding compilation file, the original compilation package is deleted; and / or, the compilation file under the shared target is cleaned up according to a preset cleaning rule.

6. A software compilation sharing system, characterized in that: include: The system task module is used to compile the source code of each version of the software to obtain the corresponding compilation package, and then upload the compilation package to the shared directory of the server and decompress it to obtain the corresponding compilation file; A script module is used to configure the compiled file into an executable file through a preset script, and then receive user input parameters through the script, and call the corresponding compiled file under the shared target to run based on the user input parameters, wherein the path of the script is configured in the system environment of the server.

7. The software compilation sharing system according to claim 6, characterized in that: The compiled file is version named according to a preset version naming rule; The user input parameters include a specified version parameter; The script calls the corresponding compiled file to run based on the user input parameters, including: Search for a compiled file whose version naming result matches the specified version parameter, and call the found compiled file to run.

8. The software compilation sharing system according to claim 7, characterized in that: The system task module is also used to update the version of the software every day and / or every commit; The version naming rules include: naming according to the version number and date mark or commit mark corresponding to the corresponding version software.

9. The software compilation sharing system according to claim 8, characterized in that: The specified version parameters include: a specified version number and a date identifier or a commit identifier; or, The specified version parameters include: the latest version updated every day or every commit.

10. The software compilation sharing system according to claim 6, characterized in that: The system task module is also used for: After decompressing the compilation package into the corresponding compilation file, deleting the original compilation package; and / or, Clean up the compiled files under the shared target according to preset cleaning rules.

Citation Information

Cited By

  • Software operation and installation package generation method and device, computer equipment and storage medium

    CN119806681A

  • Software running and installation package generation method and device, computer equipment and storage medium

    CN119806681B