sbsv2/raptor/python/plugins/filter_whatcomp.py
author timothy.murphy@nokia.com
Fri, 18 Dec 2009 18:19:11 +0000
branchwip
changeset 115 5869e06bf2ac
parent 114 35ed82e9d574
child 132 2022a4abb126
permissions -rw-r--r--
Cause whatcomp output to use the incoming epocroot value. i.e. if epocroot is relative then so is the what output. e.g. if EPOCROOT=\ then the output will be of the form "\epoc32\release\armv5\...." If it's "..\myepocroot" then the output will be "..\myepocroot\epoc32\release\armv5". If it's absolute then the what output will also be absolute.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
93
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
     1
#
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
     2
# Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
     3
# All rights reserved.
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
     4
# This component and the accompanying materials are made available
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
     5
# under the terms of the License "Eclipse Public License v1.0"
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
     6
# which accompanies this distribution, and is available
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
     8
#
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
     9
# Initial Contributors:
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    10
# Nokia Corporation - initial contribution.
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    11
#
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    12
# Contributors:
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    13
#
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    14
# Description: 
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    15
# Filter class for doing --what and --check operations
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    16
#
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    17
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    18
import os
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    19
import sys
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    20
import re
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    21
import filter_interface
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    22
import filter_what
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    23
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    24
class FilterWhatComp(filter_what.FilterWhat):
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    25
114
35ed82e9d574 Strip epocroot off whatcomp filter output.
timothy.murphy@nokia.com
parents: 93
diff changeset
    26
        def __init__(self): 
115
5869e06bf2ac Cause whatcomp output to use the incoming epocroot value. i.e. if epocroot is relative then so is the what output.
timothy.murphy@nokia.com
parents: 114
diff changeset
    27
		super(filter_what.FilterWhat, self).__init__()
114
35ed82e9d574 Strip epocroot off whatcomp filter output.
timothy.murphy@nokia.com
parents: 93
diff changeset
    28
93
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    29
	def write(self, text):
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    30
		"process some log text"
114
35ed82e9d574 Strip epocroot off whatcomp filter output.
timothy.murphy@nokia.com
parents: 93
diff changeset
    31
		ok = True
93
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    32
		
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    33
		for line in text.splitlines():
114
35ed82e9d574 Strip epocroot off whatcomp filter output.
timothy.murphy@nokia.com
parents: 93
diff changeset
    34
			ok = filter_what.FilterWhat.write(self, line)
93
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    35
			if not ok:
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    36
				break
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    37
				
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    38
		self.ok = ok
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    39
		return self.ok
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    40
	
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    41
	def start_bldinf(self,bldinf):
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    42
		if "win" in self.buildparameters.platform:
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    43
			dir = os.path.dirname(bldinf.replace("/","\\"))
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    44
		else:
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    45
			dir = os.path.dirname(bldinf)
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    46
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    47
		self.outfile.write("-- abld -w \nChdir %s \n" % dir)
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    48
		
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    49
	def end_bldinf(self):
572b3909c72f RELEASE NOTE: Added new launchers for the sbs_filter program so that there is no longer a need to manually set the HOSTPLATFORM variable
timothy.murphy@nokia.com
parents:
diff changeset
    50
		self.outfile.write("++ Finished\n")
115
5869e06bf2ac Cause whatcomp output to use the incoming epocroot value. i.e. if epocroot is relative then so is the what output.
timothy.murphy@nokia.com
parents: 114
diff changeset
    51
5869e06bf2ac Cause whatcomp output to use the incoming epocroot value. i.e. if epocroot is relative then so is the what output.
timothy.murphy@nokia.com
parents: 114
diff changeset
    52
        def open(self, build_parameters):
5869e06bf2ac Cause whatcomp output to use the incoming epocroot value. i.e. if epocroot is relative then so is the what output.
timothy.murphy@nokia.com
parents: 114
diff changeset
    53
		t = filter_what.FilterWhat.open(self, build_parameters)
5869e06bf2ac Cause whatcomp output to use the incoming epocroot value. i.e. if epocroot is relative then so is the what output.
timothy.murphy@nokia.com
parents: 114
diff changeset
    54
		self.path_prefix_to_strip = os.path.abspath(build_parameters.epocroot)
5869e06bf2ac Cause whatcomp output to use the incoming epocroot value. i.e. if epocroot is relative then so is the what output.
timothy.murphy@nokia.com
parents: 114
diff changeset
    55
		self.path_prefix_to_add_on = build_parameters.incoming_epocroot
5869e06bf2ac Cause whatcomp output to use the incoming epocroot value. i.e. if epocroot is relative then so is the what output.
timothy.murphy@nokia.com
parents: 114
diff changeset
    56
		return t