You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apply modern table presentation to Versions (#3737)
* Apply modern table presentation to Versions
* Improve annotation readability
* Fix grammar of 'conversion-rule'
* Add semicolon after 'version'
* Rewrite bad sentence for version-annotation as two sentences
* Change PACKAGE-VERSION-STRING -> PACKAGE-VERSION
Co-authored-by: Hans Olsson <[email protected]>
A top-level package or model can specify the version of top-level classes it uses, its own version number, and if possible how to convert from previous versions.
1847
+
The annotations listed below allow a top-level package or model to specify the versions of top-level classes it uses, its own version number, and if possible, how to convert from previous versions.
1848
1848
This can be used by a tool to guarantee that consistent versions are used, and if possible to upgrade usage from an earlier version to a current one.
In a top-level class, the version number and the dependency to earlier versions of this class are defined using one or more of the following annotations:
1880
-
% TODO: Syntax below is a mess: neither Modelica, pseudo-code record, nor grammar.
Defines that user models using the \lstinline!VERSION-NUMBER! can be upgraded to the \lstinline!CURRENT-VERSION-NUMBER! of the current class without any changes.
where \emph{Versions} is \lstinline!VERSION-NUMBER! \textbar{} \lstinline!{VERSION-NUMBER, VERSION-NUMBER, $\ldots$}! and \lstinline!Convert! is \lstinline!script="$\ldots$"! \textbar{} \lstinline!change={conversionRule(), $\ldots$, conversionRule()}!\\*[.5ex]
1892
-
Defines that user models using the \lstinline!VERSION-NUMBER! or any of the given \lstinline!VERSION-NUMBER! can be upgraded to the given \lstinline!VERSION-NUMBER! (if the to-tag is missing this is the \lstinline!CURRENT-VERSION-NUMBER!) of the current class by applying the given conversion rules.
1893
-
The script consists of an unordered sequence of \lstinline!conversionRule();! (and optionally Modelica comments).
1894
-
The \lstinline!conversionRule! functions are defined in \cref{conversion-rules}.
1895
-
1896
-
\begin{nonnormative}
1897
-
The to-tag is added for clarity and optionally allows a tool to convert in multiple steps.
Defines that classes within this top-level class use version \lstinline!VERSION-NUMBER! of classes within the top-level class \lstinline!IDENT!.
1902
-
\end{itemize}
1896
+
In a top-level class, the version number and the dependency to earlier versions of this class are defined using one or more of the annotations described in this section.
1897
+
1898
+
\begin{annotationdefinition}[version]
1899
+
\begin{synopsis}\begin{lstlisting}
1900
+
/*literal*/ constant String version;
1901
+
\end{lstlisting}\end{synopsis}
1902
+
\begin{semantics}
1903
+
\lstinline!version = $\mathit{currentVersion}$! defines the version number of the model or package.
1904
+
The $\mathit{currentVersion}$ shall be a \lstinline[language=grammar]!PACKAGE-VERSION!.
1905
+
All classes within this top-level class have this version number.
\lstinline!conversion(noneFromVersion = $\mathit{fromVersion}$)! defines that models and packages using the $\mathit{fromVersion}$ can be upgraded to the $\mathit{currentVersion}$ of the current class without any changes.
1936
+
1937
+
\lstinline!conversion(from(version = $\mathit{fromVersions}$, to = $\mathit{toVersion}$, $\mathit{conversionRules}$))! defines that models and packages using any of the $\mathit{fromVersions}$ can be upgraded to the $\mathit{toVersion}$ (if the $\mathit{toVersion}$ is omitted, this is the $\mathit{currentVersion}$) of the current class by applying the $\mathit{conversionRules}$.
1938
+
When $\mathit{conversionRules}$ is given as \lstinline!script = $\mathit{conversionScript}$!, the $\mathit{conversionScript}$ is the name of a file consisting of an unordered sequence of \lstinline[language=grammar]!conversion-rule ";"! and Modelica comments, where any comments should be ignored by tools.
1939
+
A \lstinline[language=grammar]!conversion-rule! has the form of a function call, where the functions are defined in \cref{conversion-rules}.
1940
+
1941
+
\begin{nonnormative}
1942
+
The \lstinline!to! version is added for clarity and optionally allows a tool to convert in multiple steps.
\lstinline!uses($\mathit{otherPackage}$(version = $\mathit{otherPackageVersion}$))! defines that classes within this top-level class use the $\mathit{otherPackageVersion}$ of classes within the top-level class $\mathit{otherPackage}$.
1960
+
1961
+
See \cref{version-date-and-build-information} regarding the use of \lstinline!versionBuild! and \lstinline!dateModified!.
In this example the model \lstinline!A! uses an older version of the Modelica library and can be upgraded using the given script, and model \lstinline!B! uses an older version of the Modelica library but no changes are required when upgrading.
If the parameter had no impact on the model it can be removed using \lstinline!convertModifiers!, see \cref{convertmodifiers}.
2153
2216
\end{nonnormative}
2154
2217
2218
+
2155
2219
\subsection{Versions in the File System}\label{mapping-of-versions-to-file-system}\label{versions-in-the-File-System}
2156
2220
2157
2221
The top-level class $\mathit{packageName}$ with version $\mathit{packageVersion}$ (matching \lstinline[language=grammar]!PACKAGE-VERSION! defined in \cref{version-numbering}) can be stored in one of the following ways in a directory given in the \lstinline!MODELICAPATH! (\cref{the-modelica-library-path-modelicapath}):
@@ -2172,24 +2236,72 @@ \subsection{Versions in the File System}\label{mapping-of-versions-to-file-syste
2172
2236
2173
2237
This allows a tool to access multiple versions of the same package.
2174
2238
2239
+
2175
2240
\subsection{Version Date and Build Information}\label{version-date-and-build-information}
2176
2241
2177
-
Besides version information, a top-level class can have additionally the following top-level annotations to specify associated information to the version number:%
2178
-
\begin{lstlisting}[language=modelica]
2242
+
This section describes annotations that a top-level class can have to specify information associated to the version number.
2243
+
2244
+
The \lstinline!versionBuild! and \lstinline!dateModified! annotations can also be specified in the \lstinline!uses! annotation (together with the version number).
2245
+
2246
+
\begin{nonnormative}
2247
+
It is recommended that tools do not automatically store \lstinline!versionBuild! and \lstinline!dateModified! in the \lstinline!uses! annotation.
2248
+
\end{nonnormative}
2249
+
2250
+
\begin{annotationdefinition}[versionDate]
2251
+
\begin{synopsis}\begin{lstlisting}
2179
2252
/*literal*/ constant String versionDate
2180
-
"UTC date of first version build (in format: YYYY-MM-DD)";
2253
+
\end{lstlisting}\end{synopsis}
2254
+
\begin{semantics}
2255
+
\lstinline!versionDate! is the date when the library was released.
2256
+
This string is updated by the library author to correspond with the version number.
2257
+
2258
+
The date shall be given as UTC according to ISO 8601: YYYY-MM-DD
2259
+
\end{semantics}
2260
+
\end{annotationdefinition}
2261
+
2262
+
\begin{annotationdefinition}[versionBuild]
2263
+
\begin{synopsis}\begin{lstlisting}
2181
2264
/*literal*/ constant Integer versionBuild
2182
-
"Larger number is a more recent maintenance update";
2265
+
\end{lstlisting}\end{synopsis}
2266
+
\begin{semantics}
2267
+
\lstinline!versionBuild! is the optional build number of the library.
2268
+
When a new version is released \lstinline!versionBuild! should be omitted or \lstinline!versionBuild = 1!.
2269
+
There might be bug fixes to the library that do not justify a new library version.
2270
+
Such maintenance changes are called a \emph{build} release of the library.
2271
+
For every new maintenance change, the \lstinline!versionBuild! number is increased.
2272
+
A \lstinline!versionBuild! number $A$ that is higher than \lstinline!versionBuild! number $B$, is a newer release of the library.
2273
+
There are no conversions between the same versions with different build numbers.
2274
+
2275
+
Two releases of a library with the same \lstinline!version! but different \lstinline!versionBuild! are in general assumed to be compatible.
2276
+
In special cases, the \lstinline!uses!-clause of a model may specify \lstinline!versionBuild! and/or \lstinline!dateModified!.
2277
+
In such a case the tool is expected to give a warning if there is a mismatch between library and model.
2278
+
\end{semantics}
2279
+
\end{annotationdefinition}
2280
+
2281
+
\begin{annotationdefinition}[dateModified]
2282
+
\begin{synopsis}\begin{lstlisting}
2183
2283
/*literal*/ constant String dateModified
2184
-
"UTC date and time of the latest change to the package
2185
-
in the following format (with one space between date
2186
-
and time): YYYY-MM-DD hh:mm:ssZ";
2284
+
\end{lstlisting}\end{synopsis}
2285
+
\begin{semantics}
2286
+
\lstinline!dateModified! is the date and time of the last modification of the package.
2287
+
2288
+
The date and time shall given as UTC according to ISO 8601 (with one space between date and time): YYYY-MM-DD hh:mm:ssZ
2289
+
2290
+
\begin{nonnormative}
2291
+
The intention is that a Modelica tool updates this annotation whenever the package or part of it was modified and is saved on persistent storage (like file or database system).
2292
+
\end{nonnormative}
2293
+
\end{semantics}
2294
+
\end{annotationdefinition}
2295
+
2296
+
\begin{annotationdefinition}[revisionId]
2297
+
\begin{synopsis}\begin{lstlisting}
2187
2298
/*literal*/ constant String revisionId
2188
-
"Revision identifier of the version management system used
2189
-
to manage this library. It marks the latest submitted
\lstinline!version! is the version number of the released library, see \cref{version-handling}.
2222
-
\item
2223
-
\lstinline!versionDate! is the date in UTC format (according to ISO 8601) when the library was released.
2224
-
This string is updated by the library author to correspond with the version number.
2225
-
\item
2226
-
\lstinline!versionBuild! is the optional build number of the library.
2227
-
When a new version is released \lstinline!versionBuild! should be omitted or \lstinline!versionBuild = 1!.
2228
-
There might be bug fixes to the library that do not justify a new library version.
2229
-
Such maintenance changes are called a \emph{build} release of the library.
2230
-
For every new maintenance change, the \lstinline!versionBuild! number is increased.
2231
-
A \lstinline!versionBuild! number $A$ that is higher than \lstinline!versionBuild! number $B$, is a newer release of the library.
2232
-
There are no conversions between the same versions with different build numbers.
2233
-
2234
-
Two releases of a library with the same \lstinline!version! but different \lstinline!versionBuild! are in general assumed to be compatible.
2235
-
In special cases, the \lstinline!uses!-clause of a model may specify \lstinline!versionBuild! and/or \lstinline!dateModified!.
2236
-
In such a case the tool is expected to give a warning if there is a mismatch between library and model.
2237
-
\item
2238
-
\lstinline!dateModified! is the UTC date and time (according to ISO 8601) of the last modification of the package.
2239
-
2240
-
\begin{nonnormative}
2241
-
The intention is that a Modelica tool updates this annotation whenever the package or part of it was modified and is saved on persistent storage (like file or database system).
2242
-
\end{nonnormative}
2243
-
\item
2244
-
\lstinline!revisionId! is a tool specific revision identifier possibly generated by a source code management system (e.g., Subversion or CVS).
2245
-
This information exactly identifies the library source code in the source code management system.
2246
-
\end{itemize}
2247
-
2248
-
The \lstinline!versionBuild! and \lstinline!dateModified! annotations can also be specified in the \lstinline!uses! annotation (together with the version number).
2249
-
2250
-
\begin{nonnormative}
2251
-
It is recommended that tools do not automatically store \lstinline!versionBuild! and \lstinline!dateModified! in the \lstinline!uses! annotation.
2252
-
\end{nonnormative}
2253
-
2254
2333
2255
2334
\section{Access Control to Protect Intellectual Property}\label{annotations-for-access-control-to-protect-intellectual-property}\label{access-control-to-protect-intellectual-property}
0 commit comments