Страница в РАЗРАБОТКЕ! Если вы видите, что можно добавить или изменить, добавляйте без сомнения!
Эта заметка написана на основе Application Note 279: "Using Git for Project Management with uVision". (Можно считать ее вольным переводом «близко к тексту»)
Все, о чем пойдет речь, проверялось на Keil RealView Microcontroller Development Kit v4.72a
В настоящее время, командная работа стала основной в области разработок для микроконтроллеров. Часто команды, работающие над проектом, являются распределенными географически и в разных часовых поясах. Синхронизация процесса разработки является основной задачей руководителей проектов. Т.к. эта задача не может эффективно решаться с использованием, например, пересылки рабочих файлов по электронной почте, в таких случаях используются Системы Контроля Версий - Software Version Control Systems (SVCS). Раньше были популярны централизованные системы Concurrent Versions System (CVS) and Subversion (SVN) использующие инфраструктуру с центральным выделенным сервером. В настоящее время, все большую популярность набирают распределенные системы контроля версий. Одна из них называется Git.
В этой заметке описано как интегрировать Git в µVision и как организовать процесс разработки ПО с помощью этой VCS.
Revision control is being used for a couple of years now in software development.
In the past, centralized server infrastructures have been used to track the changes in the source code of a microcontroller development project. With the release of Git, decentralized VCS have become more and more popular.
Git, which is free software distributed under the terms of the GNU General Public License, was developed for maintaining the Linux kernel. It became more and more popular and is now the de-facto standard in source control management (SCM), another term for VCS.
This application note assumes that you have installed Git on your PC (refer to Appendix A: Software) and do know how to use the Windows command shell (cmd.exe).
Using Git, you can make use of various workflows when maintaining a software project:
This application note explains how to use µVision in a centralized workflow environment. Other workflows can be realized as well using a mix of Git commands from within µVision and using the command line/GUI. For more information on workflows, see Appendix B: Links.
In a centralized work environment, there is usually a single collaboration model: the centralized workflow. A central repository accepts code changes, and every developer synchronizes his work to it. This is just like using SVN for example. However, using Git has a few advantages over the traditional SVN workflow.
First, it gives every developer an own local copy of the entire project. In this local environment, each developer can work independently of all other colleagues. The local repository is used for commits and they can completely forget about the original one until it's convenient for them.
Second, all developers can use Git’s robust branching and merging model. Git branches are designed to be failsafe when adding code and sharing changes between repositories.
The centralized workflow uses a central repository serving as the entry point for all project changes. The default development branch is called ‘master’ and all changes are committed into this branch. No other branches are required by this workflow:
Before setting up the workflow, the project manager should be absolutely clear about the files that need to be version controlled. Of course all source code files need to be versioned, but there are a couple of files that are special to µVision that need to be monitored as well.
Before using Git for SCM, you need to configure µVision’s software version control menu. µVision 5.15 is providing a SVCS template file for Git. It resides in the installation directory (for example C:\Keil_v5\UV4) and is called GIT.SVCS. For versions previous to 5.15, please use the file as it is provided in this application note’s ZIP file and copy it to the µVision installation directory. Или скачать его у нас: git.svcs.rar
When working with the SVCS menu, you can usually access files that are highlighted in the Project window of
µVision. For example, if you are clicking on the File Blinky.c in the Project window and you then go to the
SVCS menu, you will see the SVCS options for the Blinky.c file:
To catch µVision’s project related files (uvmpw, uvprojx, uvoptx), click on the following (or equivalent):
To be able to use Git on a Windows PC and from within µVision, you need to install the following software:
Please copy the file to the µVision installation directory, for example C:\Keil_v5\UV4