1#************************************************************************* 2# 3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4# 5# Copyright 2000, 2010 Oracle and/or its affiliates. 6# 7# OpenOffice.org - a multi-platform office productivity suite 8# 9# This file is part of OpenOffice.org. 10# 11# OpenOffice.org is free software: you can redistribute it and/or modify 12# it under the terms of the GNU Lesser General Public License version 3 13# only, as published by the Free Software Foundation. 14# 15# OpenOffice.org is distributed in the hope that it will be useful, 16# but WITHOUT ANY WARRANTY; without even the implied warranty of 17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18# GNU Lesser General Public License version 3 for more details 19# (a copy is included in the LICENSE file that accompanied this code). 20# 21# You should have received a copy of the GNU Lesser General Public License 22# version 3 along with OpenOffice.org. If not, see 23# <http://www.openoffice.org/license.html> 24# for a copy of the LGPLv3 License. 25# 26# ************************************************************************/ 27 28Adapting version after a release of an office 29============================================= 30After a release the entries in cli_ure/version/version.txt must be changed to reflect the versions 31of the assemblies at the time of the release. Please refer to the document at 32http://udk.openoffice.org/common/man/spec/assemblyversioning.html 33for more information about versioning of assemblies. 34 35 36Step 1: Remove old office installations. 37 38To do this, deinstall all offices, 39and make sure that there are no assemblies installed in the Global Assembly Cache (GAC). The GAC 40is contained in C:\Windows\assembly. Change C:\Windows according to your windows installation. 41Use the Windows Explorer to view the contents of the GAC. Are there any of the following assemblies 42installed: 43 44cli_uretypes.dll 45cli_basetypes.dll 46cli_cppuhelper.dll 47cli_ure.dll 48cli_oootypes.dll (build in unoil) 49 50policy.x.y.cli_uretypes.dll 51policy.x.y.cli_basetypes.dll 52policy.x.y.cli_ure.dll 53policy.x.y.cli_cppuhelper.dll 54policy.x.y.cli_oootypes.dll (build in unoil) 55 56The "x" and "y" in the names of the policy assemblies are to be replaces by version numbers. At the 57time of writing the real names are: 58 59policy.1.0.cli_uretypes.dll 60policy.1.0.cli_basetypes.dll 61policy.1.0.cli_ure.dll 62policy.1.0.cli_cppuhelper.dll 63policy.1.0.cli_ootypes.dll (build in unoil) 64 65After deinstalling the offices, there should none of them remain in the GAC. If there are some, then 66try to remove them by clicking on them an choose uninstall from the context menu of the mouse. 67 68Step 2: Install the office of the last release (respin when using staroffice) 69 70Step 3: Determine the versions of the assemblies 71 72Use the Windows Explorer to view the contents of the Windows\assembly directory. Locate the assemblies 73and policy assemblies. See step 1 for the names of those assemblies. Take down the version number as 74can be found in the version column, which is usually right next to the name column. 75 76Step 4: Changing the versions in the cli_ure module. 77 78Open the file cli_ure\version\version.txt. 79The file contains name/value pairs, such as:CLI_URETYPES_NEW_VERSION=1.0.3.0. 80The first part of the names represent the assemly which they are referring to. So obviously 81entries starting with CLI_URETYPES refer to the cli_uretypes.dll. Entries which contain the part "POLICY" refer 82to the policy assembly. For example: 83CLI_URETYPES_POLICY_VERSION refers to the policy assembly for cli_uretypes which is named 84policy.1.0.cli_uretypes.dll 85 86The versions may already have been incremented because someone has changed code after the 87last release. So if a version from version.txt is greater then the one of the respective 88assembly in the GAC then leave it at that. 89 90The values have to be adjusted as follows: 91 92XYZ_NEW_VERSION : increse the value of the version 93GAC. "XYZ_" would be "CLI_URETYPES", "CLI_URE", etc. 94XYZ_OLD_VERSION : must be changes so that the right version part is one less than 95XYZ_NEW_VERSION. For example 96 97CLI_URETYPES_NEW_VERSION=1.0.[3].0 98CLI_URETYPES_OLD_VERSION=1.0.0.0-1.0.[2].0 99 100The affected part is marked by the brackets. 101 102XYZ_POLICY_VERSION: change the version according to the version of the policy assembly from the 103GAC. 104 105XYZ_POLICY_ASSEMBLY: remain unchanged. 106 107Commit the changes and rebuild the project. 108 109Step 5: Changing the versions in the unoil module 110 111The unoil module builds the cli_oootypes.dll which contains the office types (offapi). Change the contents 112of unoil/climaker/version.txt similar to the versions.txt in this module. Then rebuild the module 113 114//====== 115The automatic test in cli_ure/qa/versioning should be extended. See the readme.txt in that directory 116for more information. 117//===== 118 119 120 121 122 123 124How does the version mechanism works 125==================================== 126 127The assemblies which are build in this project have a strong name and hence a version. The version should 128be increased whenever something was fixed or the code has changed in any way. For further information 129have a look at 130http://udk.openoffice.org/common/man/spec/assemblyversioning.html 131 132The versions of all assemblies are contained in cli_ure/version/version.txt. This is the place where 133the versions are changed. This will happen under two circumstances. First, the versions are 134adjusted AFTER an office was released. The version.txt must then contain the versions at the 135time of the release. Second, when something was fixed. Then a version should be changed unless 136this has already be done for the next release. Please look at the document mentioned further 137above. 138 139If new published UNO types have been added since the last release (product update) then the 140minor version of cli_uretypes.dll should be incremented. When building the version directory, a script 141is run that recognizes this and writes a cliureversion.mk file in the bin directory. 142cliureversion.mk contains all the entries of version.txt. The versions have been incremented 143by the script. The script obtains the information of new types from unotype_statistics.txt 144which is build in offapi. 145 146The contents of cliureversion.mk is used when building the assemblies in this project. It 147is also delivered so that instset_native (or instsetoo_native) can use it when building 148the installation sets. 149 150 151The contents of version.txt 152=========================== 153The entries in version.txt are needed for building the assemblies and for building the 154installation set (msi database). 155 156For every assembly exist four 157entries. For example: 158 159CLI_URETYPES_NEW_VERSION=1.0.3.0 160CLI_URETYPES_OLD_VERSION=1.0.0.0-1.0.2.0 161CLI_URETYPES_POLICY_VERSION=3.0.0.0 162CLI_URETYPES_POLICY_ASSEMBLY=policy.1.0.cli_uretypes 163 164The meaning of these entries is the following: 165 166CLI_URETYPES_NEW_VERSION represents the current version of the assembly. 167 168CLI_URETYPES_OLD_VERSION represents a range of former versions (which were compatible). 169It has to be placed in the 170cli_uretypes.config XML file which is part of the policy assembly. This is done automatically. 171The XYZ_OLD_VERSION and XYZ_NEW_VERSION values are used for the binding redirection of 172the policy file. 173 174CLI_URETYPES_POLICY_VERSION represents the version of the policy file. 175 176CLI_URETYPES_POLICY_ASSEMBLY represents the name of the policy file. 177 178Please refer to the document at 179http://udk.openoffice.org/common/man/spec/assemblyversioning.html 180about how the versions have to look like. 181 182When the minor version is changed, which is the third number from the left, the 183"old version" and the policy version must be changed as well. Using the former example, 184an incremented version would look like this: 185CLI_URETYPES_NEW_VERSION=1.0.4.0 186CLI_URETYPES_OLD_VERSION=1.0.0.0-1.0.3.0 187CLI_URETYPES_POLICY_VERSION=4.0.0.0 188CLI_URETYPES_POLICY_ASSEMBLY=policy.1.0.cli_uretypes 189 190If the major version changed we would have these values: 191CLI_URETYPES_NEW_VERSION=2.0.0.0 192CLI_URETYPES_OLD_VERSION=2.0.0.0-2.0.0.0 193CLI_URETYPES_POLICY_VERSION=1.0.0.0 194CLI_URETYPES_POLICY_ASSEMBLY=policy.2.0.cli_uretypes 195 196Because a change of a major is only done if the code has changed incompatibly, we must not 197redirect old client code to the new assembly. Actually we would not need a policy file here. 198The name of the policy file has changed as well so as to refer to the new version. Since 199the name is new and refers to the version 2 auf cli_uretypes, we can start with the policy version 200from 1. 201 202The next compatible change would require to change the version to these: 203CLI_URETYPES_NEW_VERSION=2.0.1.0 204CLI_URETYPES_OLD_VERSION=2.0.0.0-2.0.1.0 205CLI_URETYPES_POLICY_VERSION=2.0.0.0 206CLI_URETYPES_POLICY_ASSEMBLY=policy.2.0.cli_uretypes 207 208 209Automatic incrementation of the version 210======================================= 211Currently switched off! See cli_ure/version/makefile.mk 212The automatic incrementation of the version this is done when new published types have been 213introduce between two releases.In cli_ure/version/makefile.mk the script 214cli_ure/source/scripts/increment_version.pl 215is run which creates the cliureversion.mk with the new versions. This automatism only changes 216the version parts which have the meaning of a compatible change. Which versions are to be 217incremented is contained in cli_ure/version/incversions.txt. It contains, for example these entries: 218 219CLI_URETYPES_NEW_VERSION 220CLI_URETYPES_OLD_VERSION 221CLI_URETYPES_POLICY_VERSION 222 223The names are exactly the same as in version.txt. The script knows how to increase the version 224of the different types: 225 226Entries ending on _NEW_VERSION: The third number from the left is incremented. 227Entries ending on _OLD_VERSION: The third number from the left of the second version is incremented. 228Entries ending on _POLICY_VERSION: The first number from the left is incremented. 229 230For example, the versions in version.txt are: 231CLI_URETYPES_NEW_VERSION=1.0.4.0 232CLI_URETYPES_OLD_VERSION=1.0.0.0-1.0.3.0 233CLI_URETYPES_POLICY_VERSION=4.0.0.0 234 235If new types have been added the script would create these entries in cliureversion.mk 236CLI_URETYPES_NEW_VERSION=1.0.5.0 237CLI_URETYPES_OLD_VERSION=1.0.0.0-1.0.4.0 238CLI_URETYPES_POLICY_VERSION=5.0.0.0 239 240As one can see from the incversions.txt, the versions of the cli_ure.dll and cli_cppuhelper.dll 241are also changed. This is because these are dependent on cli_uretypes.dll. 242 243 244Further notes on increasing the assembly versions 245================================ 246Changing a version for one assembly means changing 247at least the XYZ_NEW_VERSION, XYZ_OLD_VERSION and XYZ_POLICY_VERSION. In case of an incompatible 248change, that is one of the first two numbers of the version has been changed, the XYZ_POLICY_ASSEMBLY 249must also be changed. 250 251When changing a version of an assembly then the versions of the assemblies which depend on it should 252be changed as well. For example, when changing the version of cli_uretypes.dll, then the versions of 253cli_ure.dll and cli_cppuhelper.dll should be changed as well. One can use idlasm.exe to see which 254assemblies are referenced by an assembly. The information is contained in the assemblie's manifest. 255 256If one would not change the versions of the dependent dlls then one would risk that an assembly 257has the same old version but references a different assembly. For example, say we have a 258cli_uretypes.dll with version 1 and a cli_ure.dll with version 1. cli_ure.dll references version 1 of 259cli_uretypes.dll. Now the version of cli_uretypes.dll changes to version 2 and its policy assembly is 260adapted so that all code that uses version 1 now uses version 2. This would also allow cli_ure.dll 261o run with the new cli_uretypes.dll. If now cli_ure.dll is build, then it would reference 262cli_uretypes.dll version 2, because our build environment does not keep the older assembly. The old 263cli_uretypes.dll version 1 was replaced by version 2. cli_ure.dll now references cli_uretypes.dll version 2 264but still has the old version. 265 266 267 268rebasing of assemblies 269======================================================= 270Neither assemblies nor policy assemblies may be rebased. This would 271make the signature invalid. Therefore all assemblies must be contained 272in postprocess/rebase/no_rebase.txt 273