diff --git a/doc/dev_infrastructure/images/image10.png b/doc/dev_infrastructure/images/image10.png index 708ec0fea7fa5d871c7975a4343aa06b0b27799d..73abf8f55fc59f6fd5f61cf236d05a99950dcdb3 100644 Binary files a/doc/dev_infrastructure/images/image10.png and b/doc/dev_infrastructure/images/image10.png differ diff --git a/doc/dev_infrastructure/images/image11.png b/doc/dev_infrastructure/images/image11.png index 393bc7b659753dc9762e0a0ff91ed016679f936d..9ca75935087f2b36870b28802f3034255fa78baa 100644 Binary files a/doc/dev_infrastructure/images/image11.png and b/doc/dev_infrastructure/images/image11.png differ diff --git a/doc/dev_infrastructure/images/image3.png b/doc/dev_infrastructure/images/image3.png index 702c735c455770523e6e816fe6df4dd351a0308e..8fc588dff9a9da0eb5bfd137d5ce361c3a2b89b7 100644 Binary files a/doc/dev_infrastructure/images/image3.png and b/doc/dev_infrastructure/images/image3.png differ diff --git a/doc/dev_infrastructure/images/image4.png b/doc/dev_infrastructure/images/image4.png index f62aa2daee4a2a600f527c0f935501bca3801838..5ee30836fc99339b617e29102bdf4186dfd05a39 100644 Binary files a/doc/dev_infrastructure/images/image4.png and b/doc/dev_infrastructure/images/image4.png differ diff --git a/doc/dev_infrastructure/images/image6.png b/doc/dev_infrastructure/images/image6.png index 360eb4ac2d99f9abb51b8d696e182c90b9eda0d7..4d7b1daef90f83477ae1b963cb46c719deba9206 100644 Binary files a/doc/dev_infrastructure/images/image6.png and b/doc/dev_infrastructure/images/image6.png differ diff --git a/doc/dev_infrastructure/ttool_development_infrastructure.tex b/doc/dev_infrastructure/ttool_development_infrastructure.tex index fa83d5184ffbc7cec0abae59192d69d2faba06d5..5bfae62128067251700475584573d7b5bbd5a5a3 100644 --- a/doc/dev_infrastructure/ttool_development_infrastructure.tex +++ b/doc/dev_infrastructure/ttool_development_infrastructure.tex @@ -138,13 +138,15 @@ the development of TTool. It describes sources configuration management, the development process with basic editor and command lines, with the Eclipse IDE, as well as the testing, building and installation procedures. +\newpage + \section{Source Configuration Management} \label{sec:scm} \subsection{Gitlab Server} -TTool sources are hosted on the Gitlab server of Telecom ParisTech under the -group \textit{mbe}\textit{-tools} and project \textit{TTool}. The Gitlab project +TTool sources are hosted on the Gitlab server of \textbf{Telecom ParisTech} under the +group \textbf{\textit{mbe}\textit{-tools}} and project \textbf{\textit{TTool}}. The Gitlab project can be accessed via \url{https://gitlab.telecom-paristech.fr/users/sign_in}. Login must be performed using Shibboleth as shown in figure~\ref{fig:image1}, using the credentials from your institution if it is a @@ -226,28 +228,28 @@ In particular, compiling the sources of all subprojects can be done with the 42sh$ make all \end{verbatim} +\newpage \section{Development with Eclipse} -Eclipse is a well-known Integrated Development Environment (IDE) providing many advanced functionalities to support developers and improve code quality by the application of built-in on the fly code analyses. One advantage of Eclipse is that it is a multi-platform application so it can be used on Linux, Windows and Mac. The procedures described in this section are valid for all platforms although some elements such as C++ projects need to be different due to different platform-specific compilation tool chains to be used. More information on this is provided on the concerned subsections. \\ +Eclipse is a well-known Integrated Development Environment (IDE) providing many advanced functionalities to support developers and improve code quality by the application of built-in on the fly code analyses. One advantage of Eclipse is that it is a \textbf{multi-platform application} so it can be used on Linux, Windows and macOS. The procedures described in this section are valid for all platforms although some elements such as C++ projects need to be different due to different platform-specific compilation tool chains to be used. More information on this is provided on the concerned subsections. \subsection{Installing and Configuring Eclipse} Download Eclipse IDE for Java developers here: \\ \url{http://www.eclipse.org/downloads/packages/release/photon/r/eclipse-ide-java-developers} -\\ Unzip the package and launch the eclipse executable. For developing C++ applications such as the DIPLODOCUS simulator, add the C Development Tools -(CDT). For this, select menu ``Help >> Install New Software''. -From the dialog box that opens, select the ``Neon'' update site, unfold the -``Programming Languages'' category and check the elements as shown in +(CDT). For this, select menu ``\textbf{Help >> Install New Software}''. +From the dialog box that opens, select the ``\textbf{Photon}'' update site, unfold the +``\textbf{Programming Languages}'' category and check the elements as shown in figure~\ref{fig:image2}. Follow the wizard instructions to complete the installation. \begin{figure}[H] \begin{center} -\includegraphics[width=\textwidth]{images/image3.png} +\includegraphics[width=0.9\textwidth, height=0.5\textheight]{images/image3.png} \caption{} \label{fig:image2} \end{center} @@ -255,7 +257,7 @@ installation. \subsection{Online Help} -The first place to look for help is in via menu ``Help>>Help Content'' from +The first place to look for help is in via menu ``\textbf{Help >> Help Content}'' from Eclipse. A dialog box will show a tree with branches for each integrated plugin or application. Help is provided for the 3 plugins that are used to develop TTool; EGit, Java Development Tools and C/C++ Development Tools. @@ -268,7 +270,7 @@ configuration management using Git. \subsubsection{Cloning the TTool Repository} First, switch to the Git perspective by clicking menu -``Window>>Perspective>>Open Perspective>>Other''. Then select the Git +``\textbf{Window >> Perspective >> Open Perspective >> Other}''. Then select the Git perspective as illustrated in figure~\ref{fig:image3}. \begin{figure}[H] @@ -280,7 +282,7 @@ perspective as illustrated in figure~\ref{fig:image3}. \end{figure} Then clone the TTool Git repository by clicking the appropriate button as shown -in figure~\ref{fig:image4}. Specify the TTool Git repository URI +in figure~\ref{fig:image4}. Specify the \textbf{TTool Git repository URI} (git@gitlab.enst.fr:mbe-tools/TTool.git) and follow the wizard by also setting the local Git repository path. @@ -293,7 +295,7 @@ the local Git repository path. \end{figure} The content of the cloned repository can be seen from the Git Repository view by -unfolding the ``Working Tree'' folder (figure~\ref{fig:image5}). +unfolding the ``\textbf{Working Tree}'' folder (figure~\ref{fig:image5}). \begin{figure}[H] \begin{center} @@ -308,32 +310,32 @@ unfolding the ``Working Tree'' folder (figure~\ref{fig:image5}). Two Eclipse Java projects are needed to develop TTool: the \textit{bin} project that contains the required libraries (jars) and the \textit{src} project that -contains the source code. Install these 2 projects in the workspace by -right-clicking the ``Working Tree'' it in the Git repository view and -selecting ``Import Projects\ldots'' as shown in figure~\ref{fig:image5}. +contains the source code. Install these two projects in the workspace by +right-clicking the ``\textbf{Working Tree}'' it in the Git repository view and +selecting ``\textbf{Import Projects}\ldots'' as shown in figure~\ref{fig:image5}. -Then select ``Import existing Eclipse projects'' as shown in +Then select ``\textbf{Import existing Eclipse projects}'' as shown in figure~\ref{fig:image6} and follow the steps of the wizard. -\begin{figure}[H] -\begin{center} -\includegraphics[width=0.7\textwidth]{images/image7.png} -\end{center} -\caption{} -\label{fig:image6} -\end{figure} - \subsubsection{Committing, Pulling and Pushing Changes} Committing the changes of a file or a directory or a project is performed by selecting this element in the project navigator view then selecting -``Team>>Commit''. This will open the Git Staging view for where the changed +``\textbf{Team >> Commit}''. This will open the Git Staging view for where the changed files are listed. Double clicking a file in the unstaged changes view will open an editor allowing visualizing the changes (figure~\ref{fig:image7}). Right click and select -``Add to Index'', then enter a commit message and click the ``Commit'' button to +``\textbf{Add to Index}'', then enter a commit message and click the ''\textbf{Commit}'' button to commit the changes. Pushing and pulling can be performed by selecting the repository from the Git repository view or the elements from the project view. +\begin{figure}[H] +\begin{center} +\includegraphics[width=0.6\textwidth]{images/image7.png} +\end{center} +\caption{} +\label{fig:image6} +\end{figure} + \begin{figure}[H] \begin{center} \includegraphics[width=\textwidth]{images/image8.png} @@ -347,11 +349,11 @@ the Git repository view or the elements from the project view. \subsubsection{Coding and Compiling} Switch to the Java perspective to develop TTool with JDT (select menu -``Windows>>Perspective\ldots'' or select the appropriate perspective button from +``\textbf{Windows >> Perspective}\ldots'' or select the appropriate perspective button from the upper right corner of Eclipse). By default Eclipse will automatically compile all files in the project. However the provided projects have already been configured so that only the required classes are compiled and also to use -the required library files from the \textit{bin} project. +the required library files from the \textbf{\textit{bin}} project. JDT provides several advanced functionalities such as automatically navigating from a variable to its declaration, finding its use throughout all the classes, @@ -360,9 +362,9 @@ including refactoring capabilities, syntactic coloration, code completion, etc. \subsubsection{Launching TTool} \label{sec:launch} -A default launch configuration is provided with the TTool \textit{src} project. +A default launch configuration is provided with the TTool \textbf{\textit{src}} project. It allows for launching TTool from the compiled code. This configuration can be -edited by opening the \textit{Run Configurations} dialog box as show in figure~\ref{fig:image8}. +edited by opening the \textbf{\textit{Run Configurations}} dialog box as show in figure~\ref{fig:image8}. \begin{figure}[H] \begin{center} @@ -375,7 +377,7 @@ edited by opening the \textit{Run Configurations} dialog box as show in figure~\ The TTool launch configuration is displayed in figure~\ref{fig:image9}. It specifies the main class to execute as well as the program arguments, working directory and optionally additional environment variables to be added to the default system -environment. Click \textit{Run} to launch TTool. The output from TTool will be +environment. Click \textbf{\textit{Run}} to launch TTool. The output from TTool will be displayed in the console view. Once TTool has been launched once, simply clicking the button to open the launch dialog box will directly launch TTool so that it is not necessary to open the launch dialog box every time. @@ -393,7 +395,7 @@ that it is not necessary to open the launch dialog box every time. In addition, JDT provides an enhanced debugger allowing executing the program step by step with sophisticated breakpoints to control the execution and to examine variable contents etc. However to use the debugger, the proper launch -configurations must be used by clicking the \textit{debug} +configurations must be used by clicking the \textbf{\textit{debug}} button just left of the launch configuration button of figure~\ref{fig:image8}. \subsection{C++ Development} @@ -420,42 +422,42 @@ must first be imported into the workspace as explained in section~\ref{sec:import}. Note that for CDT, the projects are platform dependent due to the different compilation toolchains (Cygwin is used for Windows) so there is one project per platform. For instance, for developing the DIPLODOCUS simulator on Linux, import -the \textit{c++}\textit{2} project. For windows, import the -\textit{c++}\textit{2 $ \_ $ windows} project (TODO to be provided later). CDT +the \textbf{\textit{c++2} project}. For windows, import the +\textbf{\textit{c++2 $ \_ $ windows} project} (TODO to be provided later). CDT provides the ability to define several build configurations. For the -\textit{c++}\textit{2} project, two configurations are provided as shown in +\textbf{\textit{c++2} project}, two configurations are provided as shown in figure~\ref{fig:image11}. \begin{figure}[H] \begin{center} -\includegraphics[width=\textwidth]{images/image12.png} +\includegraphics[width=0.9\textwidth, height=0.38\textheight]{images/image12.png} \end{center} \caption{} \label{fig:image11} \end{figure} -The \textit{TTool} configuration will compile the code using the provided make -file as if the simulator were compiled from TTool. The \textit{Debug} -configuration allows for compiling TTool such that it can be executed in debug +The \textbf{\textit{TTool} configuration} will compile the code using the provided make +file as if the simulator were compiled from TTool. The \textbf{\textit{Debug} +configuration} allows for compiling TTool such that it can be executed in debug mode. The selected button in figure~\ref{fig:image11} allows changing the configuration being used. The hammer button on the right hand side of it allows compiling and linking the code. The settings for these build configurations can be edited by selecting the \textit{c++2} project in the project navigator and clicking -``Properties''. For the \textit{Debug} configuration, the CDT internal builder +``\textbf{Properties}''. For the \textbf{\textit{Debug} configuration}, the CDT internal builder is used. This means that the compilation and linking options can be changed via the form editor shown in figure~\ref{fig:image12}. \begin{figure}[H] \begin{center} -\includegraphics[width=\textwidth]{images/image13.png} +\includegraphics[width=0.9\textwidth]{images/image13.png} \end{center} \caption{} \label{fig:image12} \end{figure} -Note that the code provided by default in the \textit{c++2} project +Note that the code provided by default in the \textbf{\textit{c++2} project} from the Git repository does not compile by itself. TTool must first be executed to generate the classes specific to the system being simulated. Once this is done, the simulator can be compiled and executed from CDT for the desired build @@ -466,16 +468,18 @@ configuration. Like for JDT, the launch of C++ applications can be specified using the launch configurations dialog as introduced in section~\ref{sec:launch}. One launch configuration is provided for each build configuration and named -\textit{c++2 TTool} and \textit{c++2 Debug}. +\textbf{\textit{c++2 TTool}} and \textbf{\textit{c++2 Debug}}. \subsubsection{Using the Debugger} The CDT debugger is very similar to the JDT debugger. However to be able to use -it only the \textit{c++2 Debug} launch configuration should be used and -triggered from the \textit{Debug As} button. By default, the program execution +it only the \textbf{\textit{c++2 Debug} launch configuration} should be used and +triggered from the \textbf{\textit{Debug As} button}. By default, the program execution will automatically stop at the first instruction of the program. This behavior can be changed by editing the debug launch configuration. +\newpage + \section{Development with IntelliJ} IntelliJ IDEA is another Integrated Development Environment popular especially @@ -594,6 +598,8 @@ and select \emph{Reformat code}. Note that there is a vim plugin available in IntelliJ that supports some of vim commands. +\newpage + \section{Coding Information} Here are gathered all tricks on how TTool source codes are organized, and what function is coded where, and also how to extend TTool, e.g. adding a new diagram.