Software development environment building method and device and medium

By automatically collecting project technology stack information, generating engineering XML files and event response classes, and combining Jenkins and Docker to automatically generate environment template configuration files Makefiles, it solves the problem of cumbersome and error-prone traditional software development environment construction, and realizes efficient and automated environment construction, ensuring the consistency and reproducibility of the environment.

CN120122979APending Publication Date: 2025-06-10SICHUAN VOCATIONAL COLLEGE OF CHEM TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510195546.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-21
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

The traditional software development environment is cumbersome, time-consuming and easy to cause configuration errors, affecting project progress and quality.

Method used

Collect project technology stack information through user input or file parsing, generate project XML files and event response classes, combine Jenkins and Docker, automatically generate environment template configuration file Makefile, and generate installation scripts through Makefile to achieve automated installation and environment variable configuration.

Benefits of technology

It significantly improves the efficiency of software development environment construction, reduces the rate of human error, ensures the consistency and reproducibility of the environment, and improves the smoothness of teamwork.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120122979A_ABST
    Figure CN120122979A_ABST
Patent Text Reader

Abstract

The invention discloses a software development environment building method and device and a medium. The problems that a traditional building mode is tedious, time-consuming and prone to causing configuration errors are solved. Firstly, the system automatically collects technology stack information according to user input or project files and generates project XML files and event response classes, a predefined environment template is provided in combination with Jenkins and Docker systems, a user can select a proper template according to project types, the system can automatically generate a configuration file MakeFIle and provide a URL of the configuration file MakeFIle, and then the system can automatically execute the project operation according to the configuration file MakeFIle and the URL of the configuration file MakeFIle. The system utilizes Makefile to automatically generate installation scripts which comprise downloading and installation steps of dependency items and support various platforms, and through a configuration dialog box defined by a software platform, a user checks and modifies environment starting attributes, automatically executes the installation scripts, installation required tools and dependency, and completes environment variable configuration. According to the method, the efficiency of establishing the software development environment is remarkably improved, human errors are effectively reduced, the consistency and reproducibility of the environment are ensured, and team cooperation is promoted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of software development, and specifically, it relates to a method, device, and medium for building a software development environment. Background Art

[0002] During the software or website development process, it is first necessary to build the corresponding software development environment. Currently, developers generally adopt a manual method to build the development environment, retrieving and downloading the required software packages and plugins through an online search engine. Subsequently, developers need to execute the installation program one by one and manually configure the system variables and environment variables of the development tools. In addition, it is also necessary to set the workspace and configuration directory of each development tool and verify one by one whether the installed development tools are successful and meet the expected version.

[0003] Given the continuous growth of software development complexity, developers need to configure a variety of tools and environments during the project development phase. The traditional environment building method is usually cumbersome and time-consuming, and is prone to configuration errors, thus having a negative impact on the project progress and quality. Therefore, it is necessary to design an efficient and automated environment building solution to improve the development efficiency and ensure the consistency of the environment. Summary of the Invention

[0004] The purpose of the present invention is to provide a method, device, and medium for building a software development environment, mainly solving the problems that the traditional environment building method is cumbersome, time-consuming, and prone to configuration errors.

[0005] To achieve the above purpose, the technical solution adopted by the present invention is as follows:

[0006] A method for building a software development environment includes the following steps:

[0007] S1, based on the software development platform, collect the technology stack information of the project through user input or file parsing, and configure the project engineering XML file and event response class based on the SDK package;

[0008] S2, use the Jenkins open-source software combined with the Docker open-source software to compile and package the predefined environment templates adapted to the X86 architecture and the ARM architecture, and the user selects the environment template according to the project type;

[0009] S3, according to the technology stack information of the project and the selected environment template, use the incoming parameter template to automatically generate the configuration file Makefile of the environment template and perform advanced debugging to obtain the URL of the configuration file Makefile; where the Makefile file is placed in the directory where the project engineering XML file is located;

[0010] S4. Generate an installation script using the Makefile configuration file, which includes steps for downloading dependencies, verifying dependencies, and installation. Among them, dependency verification is used to convert hidden environment problems into explicit error messages.

[0011] S5. Launch the configuration dialog box through the run configuration and debug configuration defined by the software development platform. Users can view and modify the startup configuration properties of each environment, and then automatically execute the installation script to install the necessary tools and dependencies and complete the configuration of environment variables.

[0012] S6. Verify the built installation environment, automatically generate an environment setup document, and record the tools, versions, and configuration steps used.

[0013] Furthermore, in the present invention, the software development platform uses Eclipse or VSCode.

[0014] Furthermore, in the present invention, in step S1, configuring the project engineering XML file includes the following steps:

[0015] S11. Filter out the SDK packages with correct content based on the technology stack information of the project.

[0016] S12. Install the selected SDK packages on the software development platform.

[0017] S13. Refer to the XML sample project configuration file in the SDK package to build the project engineering XML file.

[0018] S14. List all the command-line properties of the event response classes.

[0019] S15. Use the SDK package to generate a new project engineering XML file.

[0020] Furthermore, in the present invention, in step S2, the generation process of the predefined environment template is as follows:

[0021] S21. For the X86 and ARM architectures, respectively construct Dockerfile templates.

[0022] S22. Use the Buildx tool of Docker to achieve support for building multi-architecture images.

[0023] S23. Select a base image compatible with multiple architectures to enable the image to run smoothly on the X86 and ARM platforms.

[0024] S24. Customize Jenkinsfile templates for different project categories so that users can select appropriate templates according to specific project requirements.

[0025] S25. In the Jenkins pipeline, according to the architecture selected by the user, the corresponding Dockerfile and environment configuration are dynamically loaded to generate a predefined environment template.

[0026] Further, in step S22, during the multi-architecture image building process, the Docker image management and distribution process is as follows:

[0027] Push the built Docker image to Docker Hub or a private image repository and tag it as an image of different architectures;

[0028] Create an image manifest containing multiple architectures through Docker Manifest, enabling users to pull the image matching their architecture with just one image tag;

[0029] Optimize the image building speed with the help of Docker's layer caching mechanism and reduce the time required for repeated builds.

[0030] Further, in the present invention, in step S24, allow users to select the project type and target architecture through the Jenkins interface; and through the environment variable configuration of Jenkins, customize the compilation options and dependency versions, and at the same time store the Dockerfile and Jenkinsfile templates in the Git repository to achieve cloning and customizing the templates.

[0031] Further, in the present invention, in step S3, the parameter template is the information of the environment template passed in by the software development platform.

[0032] Further, in step S3, advanced debugging includes template debugging and adding parallel stages in the Jenkinsfile; among them, during the process of adding parallel stages in the Jenkinsfile, adopt the strategy of allocating independent working directories for each architecture task and pulling the base images in batches in advance to avoid conflicts that may be caused by shared resources.

[0033] Based on the above method, the present invention also provides a computer device, including a memory, a processor, and a computer program stored on the memory, and the processor is used to execute the computer program to implement the steps of the above method.

[0034] Further, based on the above method, the present invention also provides a computer-readable storage medium, on which a computer program / instructions are stored, and when the computer program / instructions are executed by the processor, the steps of the above method are implemented.

[0035] Compared with the prior art, the present invention has the following beneficial effects:

[0036] The present invention can assist users in quickly building the working environment required for software development. First, the system automatically collects technology stack information based on user input or project files, and generates an engineering XML file and event response classes, laying a foundation for environment setup. Subsequently, by integrating Jenkins and Docker, the system provides a series of predefined environment templates, and users can select an appropriate template according to the project type. Finally, based on the technology stack information and the selected template, the system automatically generates a configuration file Makefile and conducts advanced debugging, and then provides its URL for users to obtain conveniently. The solution of the present invention dynamically generates build configurations optimized for different architectures in Jenkins, while maintaining Docker multi-platform building. In this way, every time the code is submitted, the system will automatically generate a standardized build process that conforms to the target architecture.

[0037] In addition, the solution of the present invention can support the generation of cross-platform installation scripts by intelligently generating the download, dependency verification, and installation processes of all dependencies through Makefile, and the dependency verification can convert hidden environment problems into explicit error messages, thus significantly improving the reliability and maintainability of the automated process (especially in hybrid architecture and multi-platform scenarios); at the same time, with the built-in configuration interface of the software platform, users can easily view and adjust the environment startup settings, and the system will automatically execute the installation script, deploy the required tools and dependencies, and successfully complete the configuration of environment variables. Finally, the system verifies the built environment and automatically generates an environment setup document, completely recording information such as required tools, versions, and configuration steps for convenient subsequent maintenance and use.

[0038] In summary, the present invention greatly improves the efficiency of software development environment setup, significantly reduces the human error rate, ensures the consistency and reproducibility of the environment, further promotes the smooth progress of team collaboration, and meets the requirements of software development through automated scripts, environment templates, and user-friendly guidance mechanisms. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 It is a flowchart of Embodiment 1 of the present invention. DETAILED DESCRIPTION OF THE INVENTION

[0040] The present invention will be further described below in conjunction with the drawings and embodiments. The implementation manners of the present invention include but are not limited to the following embodiments.

[0041] Embodiment 1

[0042] As Figure 1As shown in the figure, this embodiment provides a method for setting up a software development environment. The software development platform on which this method is based is Eclipse or VSCode. Both Eclipse and VSCode are common open-source integrated development environments (IDEs), mainly used for developing application programs in various programming languages, especially Java.

[0043] In this embodiment, first, according to the project information provided by the requester, the technical stack information required for the project is collected by means of user input or file parsing. The software development platform will configure the XML file and event response classes of the project engineering based on the software development kit (SDK). As a tool class in software development, the purpose of the SDK is to promote code reuse to reduce repetitive workload. In this process, the required SDK will be accurately selected according to the technical stack information, and it will be ensured that it is correctly installed on the software development platform. Subsequently, referring to the XML sample project configuration file provided in the SDK, the XML file of the project engineering is constructed, and the command-line attributes of all event response classes are listed in detail. Finally, a new project engineering XML file is generated based on the SDK package.

[0044] In this embodiment, in the software development platform, the Jenkins open-source software is combined with the Docker open-source software to compile and package and adapt to the predefined environment templates for the X86 architecture and the ARM architecture. The user selects the environment template according to the project type; among them, the generation process of the predefined environment template is as follows:

[0045] First, Dockerfile templates are created for the X86 and ARM architectures respectively; these templates contain predefined compilation toolchains, dependency libraries, and runtime environments. Then, the Buildx tool of Docker is used to achieve the efficient construction of multi-architecture images. The configuration is as follows:

[0046] # Enable Docker Buildx

[0047] docker Buildx create --use --name multiarch-builder

[0048] # Install QEMU emulation support (build ARM on x86)

[0049] docker run --privileged --rm tonistiigi / binfmt --install all

[0050] Moreover, multi-stage builds can be defined in the same Dockerfile to generate different images for different architectures. During the multi-architecture image building process, the Docker image management and distribution process is as follows: Push the built Docker images to Docker Hub or a private image repository and tag them with different architectures at the same time; Use DockerManifest to create a multi-architecture image manifest, allowing users to pull the image suitable for their architecture through a single image tag (the main processes include building and pushing images for each architecture, creating a Manifest list, annotating platform information for each image, and pushing the Manifest to Docker Hub or a private image repository), and then leverage Docker's layer caching function to improve the image building efficiency and shorten the repetitive build cycle. In this way, by selecting a base image that supports multiple architectures, it is ensured that the image can run on both X86 and ARM platforms.

[0051] Subsequently, create Jenkinsfile templates for different project types. Users can select appropriate templates according to project requirements, and during template creation, allow users to select the project type and target architecture through the Jenkins interface, and then customize compilation options and dependency versions through Jenkins' environment variable configuration. At the same time, store the Dockerfile and Jenkinsfile templates in a Git repository to achieve cloning and customizing templates. Finally, the Jenkins pipeline will dynamically load the corresponding Dockerfile and environment configuration according to the architecture selected by the user to generate a predefined environment template.

[0052] After generating the predefined environment template, according to the project's technology stack information and the selected environment template, automatically generate the corresponding environment template configuration file Makefile through the passed-in parameter template and perform advanced debugging, and then obtain the URL of this Makefile. The URL provides the address information of the resource, enabling users to access resources such as files, web pages, and services on the network through a browser or other tools. In this embodiment, the Makefile file is placed in the directory where the XML file of the project engineering is located; the parameter template is the predefined environment template information passed in by the software development platform, and the main process of automatically generating the environment template configuration file Makefile includes: creating a Makefile template, creating a Docker configuration fragment template, writing a template generation script, and integrating with the Jenkins pipeline. In this embodiment, part of the code for creating the Docker configuration fragment template is as follows:

[0053]

[0054] Parameter description:

[0055]

[0056] In addition, the advanced debugging of this embodiment mainly includes template debugging and adding parallel stages in the Jenkinsfile. Among them, part of the code for template debugging is as follows:

[0057] # Display the template replacement process

[0058] sed -e "s / {{VAR}} / $VALUE / g" --debug Makefile.template

[0059] # Verify immediately after generation

[0060] make validate build --dry-run

[0061] Adding parallel stages in the Jenkinsfile can significantly improve the multi-architecture build efficiency (shortening the total elapsed time from the sum of the elapsed times of each architecture to the elapsed time of the slowest single architecture) without increasing the operation and maintenance complexity, providing support for continuous delivery in a hybrid environment. And during the process of adding parallel stages in the Jenkinsfile, shared resources (such as temporary directories and ports) may cause conflicts. Therefore, to solve this difficulty, this embodiment adopts the strategy of allocating independent working directories (isolated directories) for each architecture task and pre-batching the pulling of base images. The key code is as follows:

[0062]

[0063] In summary, the above solution can dynamically generate build configurations optimized for different architectures in Jenkins while maintaining Docker multi-platform builds. After each code commit, the system will automatically generate a standardized build process that conforms to the target architecture.

[0064] Next, use the Makefile configuration file to generate an installation script that includes dependency download, dependency verification, and installation steps (this script supports multiple platforms). The main process is as follows: (1) Write a template file for the installation script based on the Makefile configuration file; (2) Generate the specific commands for the installation script; (3) Add dependency verification; (4) Test and debug.

[0065] This embodiment cleverly adds dependency verification, which can convert hidden environmental problems into explicit error messages, thus significantly improving the reliability and maintainability of the automated process (especially in a hybrid architecture and multi-platform scenario). The relevant code is as follows:

[0066]

[0067] In this way, the complex dependency management logic can be encapsulated in the Makefile, and standardized installation scripts can be generated as needed, thus significantly improving the efficiency and consistency of cross-platform deployment.

[0068] Finally, for the convenience of subsequent modification and maintenance work, based on the run configuration and debug configuration defined in the software development platform, this embodiment launches a configuration dialog box to facilitate viewing and modifying the attributes of each environment startup configuration. At the same time, this embodiment can also automatically execute the installation script to install the required tools and dependencies and configure the environment variables.

[0069] Through the above solution, this embodiment provides a flexible and extensible cross-architecture compilation and packaging environment, which can automatically select a suitable template according to project requirements and complete the construction, testing, and deployment processes. Finally, this embodiment also uses the real-time feedback system of Weihai Gemini to verify the built installation environment. In the process of verifying the installation environment, the software development platform will provide feedback immediately, clearly display the installation progress, and predict possible error messages, and then automatically generate an environment setup document to record the tools, versions, and configuration steps used for subsequent software maintenance.

[0070] Embodiment 2

[0071] This embodiment provides a computer device, including a memory, a processor, and a computer program stored on the memory. In this embodiment, the processor can be a general-purpose processor, such as a central processing unit or a network processor, or can also be a digital signal processor, an application-specific integrated circuit, a field programmable gate array, etc. The memory can be a random access memory or a non-volatile memory. In this embodiment, when the user operates the computer device, the processor executes the computer program stored on the memory, thereby completing the method steps described in Embodiment 1.

[0072] Embodiment 3

[0073] This embodiment provides a computer-readable storage medium, on which a computer program / instructions are stored. In this embodiment, when the computer-readable storage medium is used, the computer program / instructions therein will be executed by the processor, thereby implementing the method steps described in Embodiment 1.

[0074] The above embodiments are only the preferred embodiments of the present invention and should not be used to limit the protection scope of the present invention. Any meaningless changes or polish made in the main design concept and spirit of the present invention, as long as the technical problems solved are still the same as those of the present invention, should be included in the protection scope of the present invention.

Claims

1. A method for building a software development environment, characterized in that: The following steps are involved: S1, based on the software development platform, collects the project's technology stack information through user input or file parsing, and configures the project engineering XML file and event response class based on the SDK package; S2 uses Jenkins open source software combined with Docker open source software to compile and package predefined environment templates that are suitable for X86 architecture and ARM architecture. Users can select environment templates based on project types. S3, based on the project's technology stack information and the selected environment template, uses the input parameter template to automatically generate the environment template's configuration file Makefile and performs advanced debugging to obtain the URL of the configuration file Makefile; the Makefile is placed in the directory where the project engineering XML file is located; S4, using the Makefile configuration file to generate an installation script that includes dependency download, dependency verification, and installation steps, wherein dependency verification is used to convert hidden environmental problems into clear error prompts; S5, through the run configuration and debug configuration startup configuration dialog boxes defined by the software development platform, users can view and modify the startup configuration properties of each environment, and then automatically execute the installation script to install the necessary tools and dependencies and complete the configuration of environment variables; S6 verifies the constructed installation environment and automatically generates environment construction documents, recording the tools, versions, and configuration steps used.

2. A method for building a software development environment according to claim 1, characterized in that: The software development platform adopts Eclipse or VSCode.

3. A method for building a software development environment according to claim 2, characterized in that: In step S1, configuring the project engineering XML file includes the following steps: S11, filter out the SDK package with the correct content based on the project’s technology stack information; S12, installing the selected SDK package on the software development platform; S13, refer to the XML sample project configuration file in the SDK package to build a project XML file; S14, lists the command line attributes of all event response classes; S15. Use the SDK package to generate a new project XML file.

4. A method for building a software development environment according to claim 3, characterized in that: In step S2, the environment template pre-defined generation process is as follows: S21, build Dockerfile templates for X86 and ARM architectures respectively; S22, using Docker's Buildx tool to support building multi-architecture images; S23, select a base image that is compatible with multiple architectures, so that the image can run smoothly on X86 and ARM platforms; S24, customize Jenkinsfile templates for different project categories so that users can choose appropriate templates according to specific project requirements; S25, in the Jenkins pipeline, dynamically load the corresponding Dockerfile and environment configuration according to the architecture selected by the user to generate a predefined environment template.

5. A method for building a software development environment according to claim 4, characterized in that: In step S22, during the multi-architecture image building process, the image management and distribution process of Docker is as follows: Push the built Docker image to Docker Hub or a private image repository and mark it as an image of different architectures; Create a multi-architecture image list through Docker Manifest, so that users can pull the image that matches their architecture with just one image tag; Optimize image building speed with the help of Docker's layer caching mechanism and reduce the time required for repeated building.

6. A method for building a software development environment according to claim 5, characterized in that: In step S24, the user is allowed to select the project type and target architecture through the Jenkins interface; and customize the compilation options and dependency versions through Jenkins environment variable configuration, and store the Dockerfile and Jenkinsfile templates in the Git repository to clone and customize the templates.

7. A method for building a software development environment according to claim 6, characterized in that: In step S3, the parameter template is the information of the environment template input by the software development platform.

8. A method for building a software development environment according to claim 7, characterized in that: In step S3, advanced debugging includes template debugging and adding parallel stages in Jenkinsfile; in the process of adding parallel stages in Jenkinsfile, a strategy of allocating an independent working directory to each architecture task and pulling base images in batches in advance is adopted to avoid conflicts that may be caused by shared resources.

9. A computer device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor is configured to execute a computer program to implement the steps of the method according to any one of claims 1 to 8.

10. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.