diff options
author | Iikka Eklund <iikka.eklund@digia.com> | 2012-08-06 11:21:31 +0300 |
---|---|---|
committer | Simo Fält <simo.falt@nokia.com> | 2012-08-07 07:33:00 +0200 |
commit | 9d1db67cfe3e76675137d7cd249f3a4bba015f14 (patch) | |
tree | ad73c2a9422b002dc43ecb4ea6f7247cc8abee0a | |
parent | e4a53730d80170d88194adaa892c7699392574ec (diff) |
Enable custom configurations directory when creating installer
Added possibility to add custom configurations directory when
calling create_installer.py, extra argument is:
configurations_dir=my_custom_configurations_dir
This way it's easier to maintain different installer projects.
Change-Id: Ic02cd493bb93ab24094323f12b8fb16876e7cb8e
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Simo Fält <simo.falt@nokia.com>
-rw-r--r-- | release-tools/bld_ifw_tools.py | 11 | ||||
-rw-r--r-- | release-tools/bld_ifw_tools_impl.py | 8 | ||||
-rw-r--r-- | release-tools/create_installer.py | 11 |
3 files changed, 22 insertions, 8 deletions
diff --git a/release-tools/bld_ifw_tools.py b/release-tools/bld_ifw_tools.py index 913d139..5661ac9 100644 --- a/release-tools/bld_ifw_tools.py +++ b/release-tools/bld_ifw_tools.py @@ -43,11 +43,18 @@ import bld_ifw_tools_impl if len(sys.argv) < 2: - print '*** platform identifier is needed as parameter: linux/mac/windows' + print '*** platform identifier is needed as parameter 1: linux/mac/windows' sys.exit(-1) platformIdentifier = sys.argv[1] -bld_ifw_tools_impl.build_ifw('release', platformIdentifier) +# default configurations directory +configurations_dir = 'configurations' +# check for custom configurations directory +arg_count = len(sys.argv) +if arg_count > 2: + configurations_dir = sys.argv[2] +# build ifw tools +bld_ifw_tools_impl.build_ifw('release', configurations_dir, platformIdentifier) diff --git a/release-tools/bld_ifw_tools_impl.py b/release-tools/bld_ifw_tools_impl.py index 692ce67..9c34894 100644 --- a/release-tools/bld_ifw_tools_impl.py +++ b/release-tools/bld_ifw_tools_impl.py @@ -60,7 +60,7 @@ INSTALLERBASE_ARCHIVE_NAME = '' ############################### # function ############################### -def init_config(): +def init_config(configurations_dir): global CONFIG_IFW global MAKE_CMD global QT_QMAKE_BIN @@ -78,7 +78,7 @@ def init_config(): global INSTALLER_FRAMEWORK_ARCHIVE_NAME global INSTALLERBASE_ARCHIVE_NAME - conf_path = SCRIPT_ROOT_DIR + os.sep + 'configurations' + os.sep + PLATFORM_IDENTIFIER + os.sep + 'installer-framework' + conf_path = SCRIPT_ROOT_DIR + os.sep + configurations_dir + os.sep + PLATFORM_IDENTIFIER + os.sep + 'installer-framework' CONFIG_IFW = ConfigParser.ConfigParser() CONFIG_IFW.readfp(open(conf_path)) @@ -392,7 +392,7 @@ def archive_qt(): ############################### # main ############################### -def build_ifw(build_mode, platform): +def build_ifw(build_mode, configurations_dir, platform): global DEVELOPMENT_MODE global PLATFORM_IDENTIFIER @@ -402,7 +402,7 @@ def build_ifw(build_mode, platform): # init bldinstallercommon.init_common_module(SCRIPT_ROOT_DIR) - init_config() + init_config(configurations_dir) #clean environment first clean_build_environment() #checkout sources diff --git a/release-tools/create_installer.py b/release-tools/create_installer.py index dd9bd06..ccb418a 100644 --- a/release-tools/create_installer.py +++ b/release-tools/create_installer.py @@ -185,9 +185,9 @@ def parse_cmd_line(): global INSTALLER_NAMING_SCHEME_COMPILER global INSTALLER_NAMING_SCHEME_TARGET_ARCH global LICENSE_TYPE + global CONFIGURATIONS_DIR MAIN_CONFIG_NAME = sys.argv[1] - check_configuration_file(MAIN_CONFIG_NAME) if(arg_count > 2): counter = 2 while(counter < arg_count): @@ -212,10 +212,17 @@ def parse_cmd_line(): values = argument.split('=') if values[1] != '': LICENSE_TYPE = values[1] + elif argument.find('configurations_dir') >= 0: + values = argument.split('=') + if values[1] != '': + CONFIGURATIONS_DIR = values[1] else: print '*** Unsupported argument given: ' + argument sys.exit(-1) counter = counter + 1 + + # check that given configuration exits + check_configuration_file(MAIN_CONFIG_NAME) return True @@ -766,7 +773,7 @@ def install_ifw_tools(): # if "devmode" mode used, then build IFW from sources if DEVELOPMENT_MODE: - tools_dir_temp = bld_ifw_tools_impl.build_ifw('devmode', PLATFORM_IDENTIFIER) + tools_dir_temp = bld_ifw_tools_impl.build_ifw('devmode', CONFIGURATIONS_DIR, PLATFORM_IDENTIFIER) tools_bin_path = SCRIPT_ROOT_DIR + os.sep + tools_dir_temp else: tools_dir_name = bldinstallercommon.config_section_map(CONFIG_PARSER_TARGET,'InstallerFrameworkTools')['name'] |