Share code using the Eclipse platform

xiaoxiao2021-03-06  37

[Repost] Use the Eclipse platform shared code published: 2004-4-20 11:09 AM

Reply

Eclipse How to Use Source Code Control Level: Intermediate Pawel Leszek (Pawel.leszek@ipgate.pl) Independent Consultant August 2003 This article outlines how the Eclipse platform supports the source code version control in the software project. First, we will briefly discuss the idea of ​​team code development, then study how Eclipse uses the CVS code repository. We will also study some source management software tools to extend these tools through the Eclipse plugin extension. Most applications that have been shared by the Source Code in Team Projects are developed by multiplayers. Even if only a small project of several developers, changes to the source code are needed to strictly control. This is the task of the source code management software. Source code version control software must support two core functions: provide a method to coordinate changes to source code, and integrated history of these change teams to submit a history of work When team members complete new work, Submit to the resource library to share their work. Similarly, when they want to get the latest available work results, they can update their local workspace according to the changes in the repository. This means that the project repository often changes due to team members to submit new work results. In other words, the repository should represent the current state of the project. At any time, team members must be able to update their work space based on the resource library and confident that they are the latest. Maintaining history is also important, so you can compare the current work with previous versions, if necessary, you can reply to the previous version. Coordinating teamwork so that there is only a unique current project status definition, as well as including team integrated work, which is also necessary for managing version controls. This coordination is likely to be the most difficult achievement. The most ideal model is: Any member of the team can make changes to any resource you have access to you. Because the two team members can submit changes to the same resource, there is a possible conflict, and this conflict must be solved. This model assumes that the conflict has uniqueness. But unfortunately, no source code is isolated in isolation; usually it contains implicit or explicit correlation with other resources. The source code references the components described in other source code resources. But the work of the source code management software is here, because it does not replace project management. Project managers must fulfill their responsibilities: coordinate the work of other members and responsible for progress, project phases, and release. In addition, source code management cannot replace communication between developers. The Eclipse platform supports the code management Eclipse platform to provide the ability to share code and work as a team in software projects. Eclipse has widely supporting a variety of code management solutions, which is due to its plugin architecture (however, it has been introduced to CVS support). The focus of the Eclipse platform architecture is the work space. Workspace maintenance and testing everything you need to test software projects. It contains objects (source code and resources). It also saves configuration settings for projects, IDE, and plugins. Workspace is maintained locally on the machine's machine, and the team collaborates through external resource libraries, and different developers' code collection in the resource library. The repository can be accessed via the Internet via the "Client-Server" architecture. The Eclipse platform provides support for team development operations directly from workspace. This support allows developers to interact with several independent repositorys and different versions of code or projects. Resources in Workspace Allow Team Support Components Processing Version and Configuration Management Problems. Of course, a single working space can access different types of repository at the same time. The Eclipse platform does not provide its own code management solution; it always relies on the external system. The Eclipse platform provides built-in support only for one (but also the most popular) source code management system: concurrent version control system (CVS).

Support for supporting other repositorys using third-party plugins in support of third-party code management applications. What is CVS? CVS was born in 1986, which appeared as a group of Shell scripts, but it has now developed into the most popular source code management solution for software developers. CVS is a client / server solution for open source management for code versions, which can be used in various platforms, including Linux and Windows NT / 2000 / XP. Please refer to the reference information at the end of this article, where there is a download link for the CVS client, server and source code. Typically, the main function of CVS is to record the history of the source file. When a group of developers are engaged in the same project, CVS will leave each other. Each developer works independently in his own directory, then merges the results of the workload using the CVS repository (from time to time). The Eclipse has a built-in CVS client that is closely integrated with the Eclipse platform IDE, which is implemented as a separate perspective (CVS Repository Exploring perspective) for interaction with CVS. General Eclipse Settings for CVS is located under Window -> Preferences WINDOW -> Team. After switching to the CVS Repository Exploring perspective, you can use all CVS (turn to Window -> Open Perspective -> Other -> CVS Repository Exploring menu - see Figure 1 and Figure 2). Figure 1. Switch to the CVS Repository Exploring perspective first set the location of the repository, which will define the connection parameters used to select the CVS server / repository. Be sure to use the SSH tunnel (EXTSSH). Figure 2. Browsing the source code workflow of the CVS repository Eclipse / CVS in the CVS Repository Exploring perspective, in the CVS team collaboration model, team members complement all their work on their respective works. Finally, they want to share their work. They achieve this through the CVS resource library. CVS uses a branch model to support multiple workflows that are independent and highly dependent on each other. These branches are places where the development team is used to share and integrate in progress. It can be considered that the branch is a shared workbench that updates this workbench when the team member changes the source code. This model allows each developer engaged in CVS team projects to share their work with other members when making changes, as well as accessing other members during project progression. A special branch called HEAD is used to represent the main workflow in the repository (HEAD is often referred to as the main trunk). When team members submit resource to this branch, they will affect these relevance. Make sure the integrity of correlation is important because the branch represents the status of the current project. Of course, the team members can use the content of the branch as the foundation of the new job. Those rules are not only suitable for CVS: No matter which version control software used, there are some common steps for source code management. Below is a sample workflow for CVS support using Eclipse: 1. Starting new team projects Each new empty Eclipse project can be shared by CVS (or supported any other source management system). Developers can also share it by migrating its existing code to resource library.

To share, click the project master folder, use the Team -> Share Project option in the context menu displayed, as shown in Figure 3. Figure 3. Sharing the local project using the CVS Resource Library Another option is to create a new workstore project by importing code from the selected CVS repository branch. As long as you choose the appropriate branch (or HEAD), select the "Checkout as Project" option from the context menu in the CVS Repository Exploring perspective, as shown in Figure 4. Figure 4. Creating a new project from the existing CVS repository 2. Using the code and change the developer's local use code through the Eclipse workbencture, including the job creates a new resource, modify the existing resource, write comments, and in them These content are saved locally after use. 3. Synchronize local changes and CVS repository If a project developer is ready to submit him / her work, then first perform an update operation. This will target the resource library for the introduced changes and add these changes to the developer's local workbench. This ensures that developers know that these changes may affect the integrity of his / she will submit. Use the Compare with ... option in the project context menu to compare the local version to the code stored in the repository (see Figure 5). Figure 5. Compare the version of the local version and the repository Next is to resolve any conflict that the last occurrence and try to compile the code again. If everything is normal, use the Team -> Commit ... option from the project context menu, as shown in Figure 6. This will make all changes into the repository. Figure 6. Submit changes to Remote Resource Library 4. Managing repository CVS allows developers to change to some independent paths developed, called branches. This change does not appear on the trunk or other branch when a developer changes files on a branch. Those branches are named subset or code fork. Later, the consolidation operation will change from one branch to another branch (or trunk). Then submit these amendments. This effectively copies the change to another branch. Use the Team -> Branch ... option of the project context menu, Eclipse makes the migration between the development branch easily. Of course, when the development team maintains large repository, there is a need to control the submission and merge operations within the project. Eclipse / CVS integration provides a special view: CVS Repository History (see Figure 7). It gives a quick preview of the changes that the team members perform in the resource library. Figure 7. Viewing the revision history of the comment in the CVS Resource History window Eclipse platform provides several utilities supporting code management. The most useful is patch function. It will compare from two sources (such as local table and repository), and then create a network-like patch file containing code differences (see Figure 8). This file can be sent to the developer to upgrade the source code to the latest version. Figure 8. Creating a patch for source code distribution 5. Disconnect the project and CVS connection When project development is over, the team wants to freeze the source code, you can delete the final version of the project from the HEAD repository. Disabled Projects and CVS will disable resource library operations on the project and its resources, and delete CVS information associated with the item (this is optional). Disconnect operations can be performed through the Team -> Disconnect option in the project context menu. By selecting this option, the Confirm Disconnect From CVS dialog opens. After disconnecting the project with the resource library, the team must determine how to handle CVS information.

The first option is "delete the cvs meta information"; it will disable the CVS team menu operation and remove the CVS folder and its content from the file system. The second option is "Do Not Delete the CVS Meta Information"; it will disable the CVS team menu operation, but keep CVS meta information. There are several important restrictions on support CVS for third-party code management applications: it cannot determine a single file or change in the entire fileset, which cannot detect logic conflicts between files. Its conflict concept is purely in text, and the conflict occurs when the two change time of the same basic document is very close, so that the merge commands are disturbed. CVS also does not provide any interactive collaboration tool similar to messaging. Fortunately, CVS is not the unique source code management software supported by the Eclipse platform. Developers can extend the functionality of the Eclipse platform through plugins, and now (until March 4, 2003) has 16 plugins that can be used for team development software. All plugins are created by the Eclipse community or commercial software vendor. Most of these plugins have added support for third-party, commercial source code management systems. The most valuable plugin is a plugin that supports popular business code management systems such as Merang PVCS and Rational Clearcase. For example, the CVS-SSH2 plug-in allows you to access CVS via SSH2 session, while Microsoft Visual SourceSafe (VSS) team provides program plugins to add support for MS VSS products (you can also be used on non-Windows platforms such as Linux). However, the plugin I prefer is KOI (see Resources to get link). Although it is not strictly used in source control, this innovative tool has injected many new vitality to collaboration. Its current version supports the workbench to the table's message delivery, sharing tag, conflict change notification, sharing calendar, and event notification. KOI uses XML-RPC as a communication model in its client-server architecture. The client is a single Eclipse platform instance that communicates with the Cooperative Server, and the collaborative server is also an Eclipse plugin. KOI uses a relationship database accessible in JDBC as a data store. The link to complete, classified Eclipse plug-in registry can be found in the reference material. Refer to the Eclipse platform community on Eclipse.org. The Eclipse platform source code follows Common public license. Eclipse.org also has an Eclipse project terms and description vocabulary, as well as technical articles and newsgroups. The Eclipse platform white paper (available in Eclipse.org Homepage) describes the main components and features of Eclipse. Download the KOI plugin from Eclipse.org. Check the full and classified registry of the Eclipse plugin. Download CVS clients, servers, and source code from CVS home or Loria Sites. See the developerWorks article "Working The Eclipse Platform" for background knowledge about the Eclipse platform. Please refer to the developerWorks article "Getting Started With The Eclipse Platform", this article describes the Eclipse platform and editing, compiling, and debugging applications using Eclipse plugin. Please refer to the developerWorks article "Developing Eclipse Plugins", this article describes how to develop an Eclipse plugin.

转载请注明原文地址:https://www.9cbs.com/read-66976.html

New Post(0)