# HG changeset patch # User stechong # Date 1242844568 18000 # Node ID f70af3d98d078a3aabf0c1bb6e92be7f707db76a # Parent 619ca8fc1260c1d2b1f16c78ab6e374b986a52e5# Parent ab726debd0c1717c24987053d5c824b9da0fdd92 Merge commit diff -r 619ca8fc1260 -r f70af3d98d07 builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/EpocEngineHelper.java --- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/EpocEngineHelper.java Wed May 20 13:34:23 2009 -0500 +++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/EpocEngineHelper.java Wed May 20 13:36:08 2009 -0500 @@ -1884,6 +1884,27 @@ } /** + * Tell if given MMP has the FEATUREVARIANT keyword + * + * @param projectInfo the current Carbide project + * @param relativeMMPPath -project relative path to the MMP file we need to inspect + * + */ + public static boolean hasFeatureVariantKeyword(ICarbideProjectInfo projectInfo, final IPath relativeMMPPath) { + Boolean result = (Boolean) EpocEnginePlugin.runWithMMPData( + relativeMMPPath, + new DefaultMMPViewConfiguration( + projectInfo, + new AllNodesViewFilter()), + new MMPDataRunnableAdapter() { + public Object run(IMMPData data) { + return data.getFlags().contains(EMMPStatement.FEATUREVARIANT); + } + }); + return result != null ? result.booleanValue() : false; + } + + /** * A particular MMP file is considered to be a Symbian Binary Variation iff the MMP file * has the keyword "FEATUREVARIANT" flag defined and the build configuration has a valid * build variant target in it's configuration name. @@ -1891,7 +1912,7 @@ * @param project - The project we need to get the build configuration name from * @return true if a variant executable will be built for this mmp */ - public static boolean isFeatureVariantMMP(IMMPData mmpData, IProject project){ + private static boolean isFeatureVariantMMP(IMMPData mmpData, IProject project){ boolean isFeatureVariant = false; ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager().getProjectInfo(project); @@ -2035,6 +2056,11 @@ String mmpRootName = mmpFile.lastSegment(); String plat = config.getPlatformString(); String basePlat = config.getBasePlatformForVariation(); + String variantPlat = config.getBuildVariationName(); + + if (variantPlat.length() == 0){ + plat = plat + "." + ISymbianBuildContext.DEFAULT_VARIANT; + } String makefilePath = makefileDir.toOSString() + File.separator + mmpRootName + File.separator + basePlat + File.separator; String variantMakeFileName = mmpRootName + "." + plat; @@ -2084,7 +2110,7 @@ } - return MD5Str; + return MD5Str.trim(); } /** diff -r 619ca8fc1260 -r f70af3d98d07 builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideSBSv1Builder.java --- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideSBSv1Builder.java Wed May 20 13:34:23 2009 -0500 +++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideSBSv1Builder.java Wed May 20 13:36:08 2009 -0500 @@ -155,7 +155,14 @@ } String componentName = componentPath.removeFileExtension().lastSegment(); - + String buildPlatform = ""; + if ( buildConfig.getPlatformString().startsWith(ISymbianBuildContext.ARMV5_PLATFORM) && + EpocEngineHelper.hasFeatureVariantKeyword(buildConfig.getCarbideProject(), componentPath)){ + buildPlatform = buildConfig.getPlatformString().toLowerCase(); + } else { + buildPlatform = buildConfig.getBasePlatformForVariation().toLowerCase(); + } + // need to run individual build steps when managing makefiles or doing concurrent builds if (areWeManagingTheMakeFiles || buildConfig.getCarbideProject().isConcurrentBuildingEnabled()) { @@ -202,7 +209,7 @@ args.add(TEST_CMD); } args.add(LIBRARY_CMD); - args.add(buildConfig.getPlatformString().toLowerCase()); + args.add(buildPlatform); args.add(componentName); for (String arg : buildConfig.getBuildArgumentsInfo().getAbldLibraryArgs().split(" ")) { @@ -225,7 +232,7 @@ args.add(TEST_CMD); } args.add(RESOURCE_CMD); - args.add(buildConfig.getPlatformString().toLowerCase()); + args.add(buildPlatform); args.add(buildConfig.getTargetString().toLowerCase()); args.add(componentName); @@ -249,7 +256,7 @@ args.add(TEST_CMD); } args.add(TARGET_CMD); - args.add(buildConfig.getPlatformString().toLowerCase()); + args.add(buildPlatform); args.add(buildConfig.getTargetString().toLowerCase()); args.add(componentName); @@ -272,7 +279,7 @@ args.add(TEST_CMD); } args.add(FINAL_CMD); - args.add(buildConfig.getPlatformString().toLowerCase()); + args.add(buildPlatform); args.add(buildConfig.getTargetString().toLowerCase()); args.add(componentName); @@ -298,7 +305,7 @@ argsList.add(TEST_CMD); } argsList.add(BUILD_CMD); - argsList.add(buildConfig.getPlatformString().toLowerCase()); + argsList.add(buildPlatform); argsList.add(buildConfig.getTargetString().toLowerCase()); argsList.add(componentName); @@ -330,6 +337,13 @@ } String componentName = componentPath.removeFileExtension().lastSegment(); + String buildPlatform = ""; + if ( buildConfig.getPlatformString().startsWith(ISymbianBuildContext.ARMV5_PLATFORM) && + EpocEngineHelper.hasFeatureVariantKeyword(buildConfig.getCarbideProject(), componentPath)){ + buildPlatform = buildConfig.getPlatformString().toLowerCase(); + } else { + buildPlatform = buildConfig.getBasePlatformForVariation().toLowerCase(); + } SubMonitor progress = SubMonitor.convert(monitor, 2); progress.setTaskName("Cleaning " + componentName); @@ -355,7 +369,7 @@ argsList.add(TEST_CMD); } argsList.add(abldCleanCmd); - argsList.add(buildConfig.getPlatformString().toLowerCase()); + argsList.add(buildPlatform); argsList.add(buildConfig.getTargetString().toLowerCase()); argsList.add(componentName); @@ -386,6 +400,13 @@ } String componentName = componentPath.removeFileExtension().lastSegment(); + String buildPlatform = ""; + if ( buildConfig.getPlatformString().startsWith(ISymbianBuildContext.ARMV5_PLATFORM) && + EpocEngineHelper.hasFeatureVariantKeyword(buildConfig.getCarbideProject(), componentPath)){ + buildPlatform = buildConfig.getPlatformString().toLowerCase(); + } else { + buildPlatform = buildConfig.getBasePlatformForVariation().toLowerCase(); + } // run abld makefile platform for each component to be built if needed if (!generateAbldMakefileIfNecessary(buildConfig, launcher, componentPath, isTest, monitor)) { @@ -402,7 +423,7 @@ argsList.add(TEST_CMD); } argsList.add(FREEZE_CMD); - argsList.add(buildConfig.getPlatformString().toLowerCase()); + argsList.add(buildPlatform); argsList.add(componentName); for (String arg : buildConfig.getBuildArgumentsInfo().getAbldFreezeArgs().split(" ")) { @@ -532,8 +553,10 @@ modelProvider.releaseSharedModel(model); IPath objectDir = null; - if (buildConfig.isSymbianBinaryVariation()){ + if ( buildConfig.getPlatformString().startsWith(ISymbianBuildContext.ARMV5_PLATFORM) && + EpocEngineHelper.hasFeatureVariantKeyword(cpi, fullMMPPath)){ // if symbian binary variation, then the object file dir will be in sub-directory with /udeb/ + // The platform can only be a variant if the MMP file has FEATUREVARIANT keyword && The platform is ARMV5-based. String MD5Name = EpocEngineHelper.getMD5HashForBinaryVariant(buildConfig, fullMMPPath); if (MD5Name != null && MD5Name.length() > 0){ objectDir = new Path(epocBldMacros[0].getValue().toString()).append(MD5Name).append(buildConfig.getTargetString()); @@ -1268,15 +1291,26 @@ if (progress.isCanceled()) { return false; } - + // build the normal components if there are any. do each abld step for all components. if (normalMakMakePaths.size() > 0) { // run abld library platform for each component for (IPath path : normalMakMakePaths) { + + String buildPlatform = ""; + if ( buildConfig.getPlatformString().startsWith(ISymbianBuildContext.ARMV5_PLATFORM) && + EpocEngineHelper.hasFeatureVariantKeyword(buildConfig.getCarbideProject(), path)) { + + buildPlatform = buildConfig.getPlatformString().toLowerCase(); + + } else { + buildPlatform = buildConfig.getBasePlatformForVariation().toLowerCase(); + } + argsList.clear(); argsList.add(LIBRARY_CMD); - argsList.add(buildConfig.getPlatformString().toLowerCase()); + argsList.add(buildPlatform); argsList.add(path.removeFileExtension().lastSegment()); for (String arg : buildConfig.getBuildArgumentsInfo().getAbldLibraryArgs().split(" ")) { @@ -1295,9 +1329,20 @@ // run abld resource platform target for each component for (IPath path : normalMakMakePaths) { + + String buildPlatform = ""; + if ( buildConfig.getPlatformString().startsWith(ISymbianBuildContext.ARMV5_PLATFORM) && + EpocEngineHelper.hasFeatureVariantKeyword(buildConfig.getCarbideProject(), path)) { + + buildPlatform = buildConfig.getPlatformString().toLowerCase(); + + } else { + buildPlatform = buildConfig.getBasePlatformForVariation().toLowerCase(); + } + argsList.clear(); argsList.add(RESOURCE_CMD); - argsList.add(buildConfig.getPlatformString().toLowerCase()); + argsList.add(buildPlatform); argsList.add(buildConfig.getTargetString().toLowerCase()); argsList.add(path.removeFileExtension().lastSegment()); @@ -1317,9 +1362,20 @@ // run abld target platform target for each component for (IPath path : normalMakMakePaths) { + + String buildPlatform = ""; + if ( buildConfig.getPlatformString().startsWith(ISymbianBuildContext.ARMV5_PLATFORM) && + EpocEngineHelper.hasFeatureVariantKeyword(buildConfig.getCarbideProject(), path)) { + + buildPlatform = buildConfig.getPlatformString().toLowerCase(); + + } else { + buildPlatform = buildConfig.getBasePlatformForVariation().toLowerCase(); + } + argsList.clear(); argsList.add(TARGET_CMD); - argsList.add(buildConfig.getPlatformString().toLowerCase()); + argsList.add(buildPlatform); argsList.add(buildConfig.getTargetString().toLowerCase()); argsList.add(path.removeFileExtension().lastSegment()); @@ -1338,9 +1394,19 @@ // run abld final platform target for each component for (IPath path : normalMakMakePaths) { + String buildPlatform = ""; + if ( buildConfig.getPlatformString().startsWith(ISymbianBuildContext.ARMV5_PLATFORM) && + EpocEngineHelper.hasFeatureVariantKeyword(buildConfig.getCarbideProject(), path)) { + + buildPlatform = buildConfig.getPlatformString().toLowerCase(); + + } else { + buildPlatform = buildConfig.getBasePlatformForVariation().toLowerCase(); + } + argsList.clear(); argsList.add(FINAL_CMD); - argsList.add(buildConfig.getPlatformString().toLowerCase()); + argsList.add(buildPlatform); argsList.add(buildConfig.getTargetString().toLowerCase()); argsList.add(path.removeFileExtension().lastSegment()); @@ -1381,10 +1447,21 @@ // run abld library platform for each component for (IPath path : testMakMakePaths) { + + String buildPlatform = ""; + if ( buildConfig.getPlatformString().startsWith(ISymbianBuildContext.ARMV5_PLATFORM) && + EpocEngineHelper.hasFeatureVariantKeyword(buildConfig.getCarbideProject(), path)) { + + buildPlatform = buildConfig.getPlatformString().toLowerCase(); + + } else { + buildPlatform = buildConfig.getBasePlatformForVariation().toLowerCase(); + } + argsList.clear(); argsList.add(TEST_CMD); argsList.add(LIBRARY_CMD); - argsList.add(buildConfig.getPlatformString().toLowerCase()); + argsList.add(buildPlatform); argsList.add(path.removeFileExtension().lastSegment()); for (String arg : buildConfig.getBuildArgumentsInfo().getAbldLibraryArgs().split(" ")) { @@ -1403,10 +1480,21 @@ // run abld resource platform target for each component for (IPath path : testMakMakePaths) { + + String buildPlatform = ""; + if ( buildConfig.getPlatformString().startsWith(ISymbianBuildContext.ARMV5_PLATFORM) && + EpocEngineHelper.hasFeatureVariantKeyword(buildConfig.getCarbideProject(), path)) { + + buildPlatform = buildConfig.getPlatformString().toLowerCase(); + + } else { + buildPlatform = buildConfig.getBasePlatformForVariation().toLowerCase(); + } + argsList.clear(); argsList.add(TEST_CMD); argsList.add(RESOURCE_CMD); - argsList.add(buildConfig.getPlatformString().toLowerCase()); + argsList.add(buildPlatform); argsList.add(buildConfig.getTargetString().toLowerCase()); argsList.add(path.removeFileExtension().lastSegment()); @@ -1426,10 +1514,21 @@ // run abld target platform target for each component for (IPath path : testMakMakePaths) { + + String buildPlatform = ""; + if ( buildConfig.getPlatformString().startsWith(ISymbianBuildContext.ARMV5_PLATFORM) && + EpocEngineHelper.hasFeatureVariantKeyword(buildConfig.getCarbideProject(), path)) { + + buildPlatform = buildConfig.getPlatformString().toLowerCase(); + + } else { + buildPlatform = buildConfig.getBasePlatformForVariation().toLowerCase(); + } + argsList.clear(); argsList.add(TEST_CMD); argsList.add(TARGET_CMD); - argsList.add(buildConfig.getPlatformString().toLowerCase()); + argsList.add(buildPlatform); argsList.add(buildConfig.getTargetString().toLowerCase()); argsList.add(path.removeFileExtension().lastSegment()); @@ -1448,10 +1547,21 @@ // run abld final platform target for each component for (IPath path : testMakMakePaths) { + + String buildPlatform = ""; + if ( buildConfig.getPlatformString().startsWith(ISymbianBuildContext.ARMV5_PLATFORM) && + EpocEngineHelper.hasFeatureVariantKeyword(buildConfig.getCarbideProject(), path)) { + + buildPlatform = buildConfig.getPlatformString().toLowerCase(); + + } else { + buildPlatform = buildConfig.getBasePlatformForVariation().toLowerCase(); + } + argsList.clear(); argsList.add(TEST_CMD); argsList.add(FINAL_CMD); - argsList.add(buildConfig.getPlatformString().toLowerCase()); + argsList.add(buildPlatform); argsList.add(buildConfig.getTargetString().toLowerCase()); argsList.add(path.removeFileExtension().lastSegment()); @@ -1502,10 +1612,10 @@ if (0 == cleanLevel) { abldCleanCmd = CLEAN_CMD; } - + // clean the normal components if there are any if (normalMakMakePaths.size() > 0) { - + List argsList = new ArrayList(); argsList.add(abldCleanCmd); argsList.add(buildConfig.getPlatformString().toLowerCase()); @@ -2439,7 +2549,13 @@ makefilePath = makefilePath.append(mmpName); // each platform has its own directory - String platformName = config.getPlatformString().toUpperCase(); + String platformName = ""; + if (EpocEngineHelper.hasFeatureVariantKeyword(config.getCarbideProject(), componentPath)){ + platformName = config.getPlatformString().toUpperCase(); + } else { + platformName = config.getBasePlatformForVariation(); + } + makefilePath = makefilePath.append(config.getBasePlatformForVariation().toUpperCase()); // and the makefile has the form MMPNAME.PLATFORM diff -r 619ca8fc1260 -r f70af3d98d07 connectivity/com.nokia.carbide.remoteConnections.tests/plugin.xml --- a/connectivity/com.nokia.carbide.remoteConnections.tests/plugin.xml Wed May 20 13:34:23 2009 -0500 +++ b/connectivity/com.nokia.carbide.remoteConnections.tests/plugin.xml Wed May 20 13:36:08 2009 -0500 @@ -57,5 +57,11 @@ class="com.nokia.carbide.remoteconnections.tests.extensions.ConnectedServiceFactory"> + + + + diff -r 619ca8fc1260 -r f70af3d98d07 connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/AllTests.java --- a/connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/AllTests.java Wed May 20 13:34:23 2009 -0500 +++ b/connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/AllTests.java Wed May 20 13:36:08 2009 -0500 @@ -29,6 +29,7 @@ suite.addTestSuite(SerializationTest.class); suite.addTestSuite(ServiceTest.class); suite.addTestSuite(FilterTest.class); + suite.addTestSuite(TCPIPConnectionTypeTests.class); //$JUnit-END$ return suite; } diff -r 619ca8fc1260 -r f70af3d98d07 connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/TCPIPConnectionTypeTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/TCPIPConnectionTypeTests.java Wed May 20 13:36:08 2009 -0500 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.carbide.remoteconnections.tests; + +import com.nokia.carbide.remoteconnections.RemoteConnectionsActivator; +import com.nokia.carbide.remoteconnections.interfaces.*; +import com.nokia.carbide.remoteconnections.tests.extensions.DefaultProvidingTCPIPService; +import com.nokia.carbide.remoteconnections.tests.extensions.TestFilter; +import com.nokia.carbide.trk.support.connection.TCPIPConnectionType; + +import java.util.Map; + +import junit.framework.TestCase; + +@SuppressWarnings("restriction") +public class TCPIPConnectionTypeTests extends TestCase { + + private static IConnectionType connectionType; + + protected void setUp() throws Exception { + TestFilter.isTest = true; + IConnectionTypeProvider connectionTypeProvider = RemoteConnectionsActivator.getConnectionTypeProvider(); + if (connectionType == null) + connectionType = connectionTypeProvider.getConnectionType(TCPIPConnectionType.ID); + } + + protected void tearDown() throws Exception { + } + + public void testTCPIPDefaultMappings() throws Exception { + Map settings = connectionType.getConnectionFactory().getSettingsFromUI(); + IConnection connection = connectionType.getConnectionFactory().createConnection(settings); + RemoteConnectionsActivator.getConnectionsManager().addConnection(connection); + settings = connection.getSettings(); + String defaultPort = settings.get(DefaultProvidingTCPIPService.ID); + assertEquals(DefaultProvidingTCPIPService.DEFAULT_PORT, defaultPort); + } +} diff -r 619ca8fc1260 -r f70af3d98d07 connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/extensions/ConnectedServiceFactory.java --- a/connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/extensions/ConnectedServiceFactory.java Wed May 20 13:34:23 2009 -0500 +++ b/connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/extensions/ConnectedServiceFactory.java Wed May 20 13:36:08 2009 -0500 @@ -18,10 +18,12 @@ package com.nokia.carbide.remoteconnections.tests.extensions; import com.nokia.carbide.remoteconnections.interfaces.*; +import com.nokia.carbide.trk.support.connection.TCPIPConnectionType; import java.util.*; +@SuppressWarnings("restriction") public class ConnectedServiceFactory implements IConnectedServiceFactory { public IConnectedService createConnectedService(IService service, IConnection connection) { @@ -30,16 +32,28 @@ else if (service instanceof UnknownStatusService) { return ((UnknownStatusService) service).createInstance(connection); } + else if (service instanceof DefaultProvidingTCPIPService) { + return ((DefaultProvidingTCPIPService) service).createInstance(connection); + } return null; } public Collection getCompatibleConnectionTypeIds(IService service) { - if (service instanceof RandomCycleService) - return Collections.singleton(IntervalConnectionType.class.getName()); + if (service instanceof RandomCycleService) { + return Arrays.asList( + new String[] + {IntervalConnectionType.class.getName(), + TCPIPConnectionType.ID}); + } else if (service instanceof UnknownStatusService) { - String[] ids = {IntervalConnectionType.class.getName(), - NoSettingsConnectionType.class.getName()}; - return Arrays.asList(ids); + return Arrays.asList( + new String[] + {IntervalConnectionType.class.getName(), + NoSettingsConnectionType.class.getName(), + TCPIPConnectionType.ID}); + } + else if (service instanceof DefaultProvidingTCPIPService) { + return Collections.singleton(TCPIPConnectionType.ID); } return Collections.EMPTY_LIST; } diff -r 619ca8fc1260 -r f70af3d98d07 connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/extensions/DefaultProvidingTCPIPService.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/extensions/DefaultProvidingTCPIPService.java Wed May 20 13:36:08 2009 -0500 @@ -0,0 +1,125 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.carbide.remoteconnections.tests.extensions; + +import com.nokia.carbide.remoteconnections.interfaces.*; +import com.nokia.carbide.trk.support.connection.TCPIPConnectionFactory; + +import org.osgi.framework.Version; + +import java.util.Collections; +import java.util.Map; + +@SuppressWarnings("restriction") +public class DefaultProvidingTCPIPService implements IService2 { + + public static final String DEFAULT_PORT = "4144"; + public static String ID = DefaultProvidingTCPIPService.class.getName(); + + public DefaultProvidingTCPIPService() { + } + + public String getAdditionalServiceInfo() { + return "No testing available for this service"; + } + + public String getDisplayName() { + return "Default Providing Service"; + } + + public String getIdentifier() { + return ID; + } + + public IRemoteAgentInstallerProvider getInstallerProvider() { + return null; + } + + public boolean isTestable() { + return false; + } + + public Map getDefaults() { + return Collections.singletonMap(TCPIPConnectionFactory.IP_PORT, DEFAULT_PORT); + } + + public IConnectedService createInstance(IConnection connection) { + final IConnectedService[] connectedService = { null }; + IConnectedService cs = new IConnectedService() { + private boolean enabled; + + public void addStatusChangedListener(IStatusChangedListener listener) { + } + + public void dispose() { + } + + public IService getService() { + return DefaultProvidingTCPIPService.this; + } + + public IStatus getStatus() { + return new IStatus() { + public IConnectedService getConnectedService() { + return connectedService[0]; + } + + public EStatus getEStatus() { + return EStatus.UNKNOWN; + } + + public String getLongDescription() { + return "This is for testing only"; + } + + public String getShortDescription() { + return "Unknown status"; + } + }; + } + + public boolean isEnabled() { + return enabled; + } + + public void removeStatusChangedListener(IStatusChangedListener listener) { + } + + public void setDeviceOS(String familyName, Version version) { + } + + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } + + public void testStatus() { + } + }; + + connectedService[0] = cs; + return cs; + } + + public boolean wantsDeviceOS() { + return false; + } + + public Object getAdapter(Class adapter) { + return null; + } +} diff -r 619ca8fc1260 -r f70af3d98d07 connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/extensions/RandomCycleConnectedService.java --- a/connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/extensions/RandomCycleConnectedService.java Wed May 20 13:34:23 2009 -0500 +++ b/connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/extensions/RandomCycleConnectedService.java Wed May 20 13:36:08 2009 -0500 @@ -87,8 +87,8 @@ } public void run() { - IntervalConnection testConnection = service.getConnection(); - int msInterval = testConnection.getInterval(); + IConnection testConnection = service.getConnection(); + int msInterval = testConnection instanceof IntervalConnection ? ((IntervalConnection) testConnection).getInterval() : 1000; try { Thread.sleep(msInterval); } catch (InterruptedException e) { @@ -177,7 +177,7 @@ } private ListenerList listeners; - private IntervalConnection connection; + private IConnection connection; private EStatus status; private RandomCycleScheduler downageScheduler; private final IService service; @@ -185,8 +185,7 @@ private static Random rand; public RandomCycleConnectedService(IService service, IConnection connection) { - Check.checkContract(connection instanceof IntervalConnection); - this.connection = (IntervalConnection) connection; + this.connection = connection; this.service = service; status = EStatus.DOWN; if (downageScheduler == null) { @@ -240,7 +239,7 @@ t.start(); } - public IntervalConnection getConnection() { + public IConnection getConnection() { return connection; } diff -r 619ca8fc1260 -r f70af3d98d07 connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/extensions/TestFilter.java --- a/connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/extensions/TestFilter.java Wed May 20 13:34:23 2009 -0500 +++ b/connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/extensions/TestFilter.java Wed May 20 13:36:08 2009 -0500 @@ -33,8 +33,8 @@ private static List serviceIds = new ArrayList(); private static List> connectedServiceIdPairs = new ArrayList>(); - public static boolean isTest; - + public static boolean isTest = Boolean.parseBoolean(System.getenv("remoteconnections.tests")); + public static void reset() { connectionTypeIds.clear(); serviceIds.clear(); diff -r 619ca8fc1260 -r f70af3d98d07 connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/extensions/TestInstallerProvider.java --- a/connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/extensions/TestInstallerProvider.java Wed May 20 13:34:23 2009 -0500 +++ b/connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/extensions/TestInstallerProvider.java Wed May 20 13:36:08 2009 -0500 @@ -128,11 +128,12 @@ public List getSDKFamilyNames(IRunnableContext runnableContext) { if (!initialized) { try { - runnableContext.run(false, false, new IRunnableWithProgress() { - public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { - getMockData(monitor); - } - }); + if (runnableContext != null) + runnableContext.run(false, false, new IRunnableWithProgress() { + public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { + getMockData(monitor); + } + }); } catch (Exception e) { e.printStackTrace(); } diff -r 619ca8fc1260 -r f70af3d98d07 connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/extensions/UnknownStatusService.java --- a/connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/extensions/UnknownStatusService.java Wed May 20 13:34:23 2009 -0500 +++ b/connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/extensions/UnknownStatusService.java Wed May 20 13:36:08 2009 -0500 @@ -19,6 +19,7 @@ package com.nokia.carbide.remoteconnections.tests.extensions; import com.nokia.carbide.remoteconnections.interfaces.*; +import com.nokia.carbide.trk.support.connection.TCPIPConnectionFactory; import org.eclipse.jface.operation.IRunnableContext; import org.eclipse.swt.graphics.Image; @@ -28,7 +29,8 @@ import java.io.InputStream; import java.util.*; -public class UnknownStatusService implements IService { +@SuppressWarnings("restriction") +public class UnknownStatusService implements IService2 { private static final String _5_0 = "5.0"; private static final String S60 = "S60"; @@ -173,4 +175,16 @@ return false; } + public Map getDefaults() { + return Collections.singletonMap(TCPIPConnectionFactory.IP_PORT, "10000"); + } + + public boolean wantsDeviceOS() { + return false; + } + + public Object getAdapter(Class adapter) { + return null; + } + } diff -r 619ca8fc1260 -r f70af3d98d07 connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IService.java --- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IService.java Wed May 20 13:34:23 2009 -0500 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IService.java Wed May 20 13:36:08 2009 -0500 @@ -18,7 +18,6 @@ package com.nokia.carbide.remoteconnections.interfaces; -import java.util.Collection; /** * The interface for remote service extension diff -r 619ca8fc1260 -r f70af3d98d07 connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IService2.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IService2.java Wed May 20 13:36:08 2009 -0500 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.carbide.remoteconnections.interfaces; + +import org.eclipse.core.runtime.IAdaptable; + +import java.util.Map; + +/** + * An extended interface for remote connections services + */ +public interface IService2 extends IService, IAdaptable { + + /** + * Return whether this service uses the Device OS setting in the connection edit page + * @return boolean + */ + boolean wantsDeviceOS(); + + /** + * Return a map of service specific default settings + * @return Map + */ + Map getDefaults(); + +} diff -r 619ca8fc1260 -r f70af3d98d07 connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/messages.properties --- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/messages.properties Wed May 20 13:34:23 2009 -0500 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/messages.properties Wed May 20 13:36:08 2009 -0500 @@ -10,7 +10,7 @@ ConnectionSettingsPage.AgentTestTabLabel=Set Connection Settings ConnectionSettingsPage.ConnectionSettingsGroupLabel=Connection Settings ConnectionSettingsPage.DeviceOSComboToolTip=Used to determine which installer version to compare against the version reported by the remote agent -ConnectionSettingsPage.DeviceOSLabel=Device OS: +ConnectionSettingsPage.DeviceOSLabel=Device OS (used for service test results): ConnectionSettingsPage.GettingDataMessage=Getting data from server... ConnectionSettingsPage.InstallButtonLabel=Install ConnectionSettingsPage.InstallButtonToolTip=Run installer file @@ -31,6 +31,7 @@ ConnectionSettingsPage.StatusLabel=Status ConnectionSettingsPage.UnlabeledPackageLabel=Unlabeled package ConnectionsView.DeleteActionLabel=Delete Connection +ConnectionsView.DescriptionColumnHeader=Description ConnectionsView.EditActionLabel=Edit Connection Settings ConnectionsView.HelpActionLabel=Connection Documentation ConnectionsView.NameColumnHeader=Connection/Services diff -r 619ca8fc1260 -r f70af3d98d07 connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/settings/ui/ConnectionSettingsPage.java --- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/settings/ui/ConnectionSettingsPage.java Wed May 20 13:34:23 2009 -0500 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/settings/ui/ConnectionSettingsPage.java Wed May 20 13:36:08 2009 -0500 @@ -220,6 +220,7 @@ IService curService = (IService) selection.getFirstElement(); if (!curService.equals(service)) { service = curService; + serviceTestButton.setEnabled(service.isTestable()); resetServiceTesting(true); } } @@ -593,10 +594,11 @@ }); } }); - if (connectedService instanceof AbstractConnectedService) + if (connectedService instanceof AbstractConnectedService) { ((AbstractConnectedService) connectedService).setRunnableContext(getContainer()); - tester = new Tester(); - tester.start(); + tester = new Tester(); + tester.start(); + } isTesting = true; } } @@ -797,6 +799,10 @@ statusText.setText(STATUS_NOT_TESTED); serviceTestInfo.setText(service.getAdditionalServiceInfo()); agentTestTabComposite.layout(true, true); + boolean wantsDeviceOS = service.getInstallerProvider() != null; + if (service instanceof IService2) + wantsDeviceOS &= ((IService2) service).wantsDeviceOS(); + deviceOSComboViewer.getCombo().setEnabled(wantsDeviceOS); } disposeConnectedService(); if (!serviceTestButton.isDisposed()) { diff -r 619ca8fc1260 -r f70af3d98d07 connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/settings/ui/SettingsWizard.java --- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/settings/ui/SettingsWizard.java Wed May 20 13:34:23 2009 -0500 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/settings/ui/SettingsWizard.java Wed May 20 13:36:08 2009 -0500 @@ -112,6 +112,7 @@ } enableConnectedServices(true); + RemoteConnectionsActivator.getConnectionsManager().storeConnections(); return true; } diff -r 619ca8fc1260 -r f70af3d98d07 connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/view/ConnectionsView.java --- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/view/ConnectionsView.java Wed May 20 13:34:23 2009 -0500 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/view/ConnectionsView.java Wed May 20 13:36:08 2009 -0500 @@ -169,6 +169,7 @@ connection.setDisplayName(value.toString()); viewer.refresh(true); packColumns(); + RemoteConnectionsActivator.getConnectionsManager().storeConnections(); } } @@ -282,7 +283,7 @@ if (!status.getEStatus().equals(EStatus.IN_USE)) { // if in-use, we show it in the connection row String longDescription = status.getLongDescription(); if (longDescription != null) - longDescription = TextUtils.canonicalizeNewlines(longDescription, " "); + longDescription = TextUtils.canonicalizeNewlines(longDescription, " "); //$NON-NLS-1$ return longDescription; } } @@ -380,7 +381,7 @@ TreeViewerColumn descriptionColumn = new TreeViewerColumn(viewer, SWT.LEFT); descriptionColumn.setLabelProvider(new DescriptionLabelProvider()); - descriptionColumn.getColumn().setText("Description"); + descriptionColumn.getColumn().setText(Messages.getString("ConnectionsView.DescriptionColumnHeader")); //$NON-NLS-1$ viewer.setContentProvider(new TreeNodeContentProvider()); viewer.setInput(loadConnections()); diff -r 619ca8fc1260 -r f70af3d98d07 core/com.nokia.carbide.cpp.doc.user/html/cheatsheets/install_remote_agent.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/com.nokia.carbide.cpp.doc.user/html/cheatsheets/install_remote_agent.xml Wed May 20 13:36:08 2009 -0500 @@ -0,0 +1,39 @@ + + + + + A remote agent is required on a device in order to communicate with Carbide while debugging. Follow the steps below to learn how to download and install the latest remote agent for your target device. + + + + + In the Remote Connections view select the connection setting used to communicate with the remote device. + + + + + + + + + Choose the remote agent that matches the OS on the target device. + + + + + + + + + diff -r 619ca8fc1260 -r f70af3d98d07 core/com.nokia.carbide.cpp.doc.user/html/cheatsheets/new_remote_conn.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/com.nokia.carbide.cpp.doc.user/html/cheatsheets/new_remote_conn.xml Wed May 20 13:36:08 2009 -0500 @@ -0,0 +1,78 @@ + + + + + Use the New Connections window to create, edit, and manage remote connection settings to enable on-device debugging and the installation of remote agents. + + + + + Use the New Connections window to create, edit, and manage remote connection settings to enable on-device debugging and the installation of remote agents. + + + + + + Use the Edit connection name and type page to define basic remote connection settings. + + + + + + + + + + + + In the Connection settings page specify the connection settings, the device OS, and verify the presence of a remote agent. + + + + + + + + + Select service to test and click Initiate service testing + + + + + + + + + + + + + Verify and monitor connections using the Remote Connections view. + + + + diff -r 619ca8fc1260 -r f70af3d98d07 core/com.nokia.carbide.cpp.doc.user/html/tasks/ImportingProjects.html --- a/core/com.nokia.carbide.cpp.doc.user/html/tasks/ImportingProjects.html Wed May 20 13:34:23 2009 -0500 +++ b/core/com.nokia.carbide.cpp.doc.user/html/tasks/ImportingProjects.html Wed May 20 13:36:08 2009 -0500 @@ -1,127 +1,128 @@ - -Importing Projects from a Bld.Inf File in Tasks - - - -

Importing Projects from a Bld.Inf File

-
- -

- The command-line Symbian OS toolchain requires that projects are - defined with these formats:

-
    -
  • Symbian OS-specific project file formats (bld.inf)
  • -
  • Symbian OS executable files (.exe)
  • -
-

The primary purpose of bld.inf files is to - group together closely associated projects, such as a GUI application and a - engine DLL used by that application.

-

- The Symbian OS plug-ins allow you to import projects defined with these - formats into the workbench. This is useful if:

- -
    -
  • -

    - You have existing projects defined using these formats and now wish - to move to development in Carbide.c++.

    -
  • -
  • -

    You need to keep the ability to build from the command line, for - example in order to do automated builds, and so maintain the command line - project files, but want to use Carbide.c++ for editing code and debugging.

    -
  • -
- -

Projects for Symbian OS 9.3+

-

The latest versions of Symbian OS 9.3+ devkits include extensive use of PRJ_EXTENSIONS and PRJ_TESTEXTENSIONS. These top-level entries are extension makefile templates whose names are later filled in with target names, sources, and options. The intent is to make source editing easier and dependency checking possible during a build.

-

Currently if you import a bld.inf file but are not importing all of the components and one of these extensions are found:

-
    -
  • a warning appears at the top of the wizard page
  • -
  • a warning is shown in the Carbide Project Settings property page
  • -
  • if not building from the bld.inf, messages appear in the Console and Problems views
  • -
-

The reason being that individual extensions cannot be built from within Carbide, only the complete bld.inf.

-
-

- To import from a bld.inf file

- -
    -
  1. - Click File > Import... to get a list of available import wizards
  2. -
  3. Select Symbian OS Bld.inf file and click Next to go to the Import Bld.inf page -
    - -

    -
    -
  4. -
  5. - Type the location of the bld.inf file to import, or browse to the file using the Browse button.
  6. - -

    file import

    -

    NOTE There will be two builders available in Carbide, one for SBSv1 (current version of Symbian Build System) and one for SBSv2 (newer version). The Builder option will only be displayed when a SBSv2 installation is detected.

    -

    SBSv2 only works with recent versions of Symbian OS9.5. Both SBSv1 and SBSv2 are GNU make based build systems.  SBSv1 uses Perl to generate make files, while SBSv2 uses Python. Select the appropriate builder for your project.

    - When building for SBSv2, the builder will set EPOCROOT to the absolute path (including drive letter) to the kit for the active build configuration.  It will also add the path to the sbs bin directory to the start of the PATH variable.  This is derived from the SBS_HOME environment variable.

    For SBSv2, all build configurations (platform/target), including the built-in platforms (WISNCW, ARMV5), are declared in xml files in the \sbs\lib\config directory. The Build Configurations selection page will display only those kits known to support SBSv2.

    -
  7. Click Next to select the recognized SDKs and Build Configurations to be created for this project -

    The SDKs and Build Configurations shows a tree of - the SDKs that are available to be used, and for each SDK, the type of build configurations - that are available. You can select a single SDK if you are developing the program - for just one version of a platform, or multiple SDKs if your - program is to be built against multiple platforms or operating system - versions.

    -

    NOTE The platforms listed are dependent upon the filter settings in the Platform Filtering Preferences.

    -

    -
    -

    -
    -
  8. -
  9. Click Next to select the mmp and extension make files -
    -

    -
    -
  10. -
  11. Click Next to enter the Project name and root directory
  12. -

    When creating a project, project files are created in the root directory. Carbide.c++ creates additional files for each project. They consist of:

    -
      -
    • .project - an xml file that provides a project description
    • -
    • .cproject - an xml file that provides additional project information
    • -
    • .settings folder - contains files that provide build configuration and preference settings
    • -
    -

    The root directory is a path to the root of your project. All necessary tool components, developer libraries, and information about the SDK are stored in subdirectories under this root. The whole path leading to the SDK root directory must be declared to the Windows system via the Environment Variables settings. The variable name is EPOCROOT and the variable value is the full path where a Symbian OS SDK is installed in the Windows system.

    -

    The root directory should contain all project related files that you want to work with in Carbide. The default directory is calculated by parsing the bld.inf file and mmp file(s).

    -

    - -
  13. Click Finish to import the project -

    - The - wizard creates the project in the C/C++ Projects view, where it can be built and edited as normal. If the wizard is unable to read the project files, then the page - describes the error that occurred. If an error occurs, you must fix the project file, and then - re-import the bld.inf.

    -
  14. -
- -
-
Related concepts
- - -
Related tasks
- -
Related references
- - - - - + +Importing Projects from a Bld.Inf File in Tasks + + + +

Importing Projects from a Bld.Inf File

+
+ +

+ The command-line Symbian OS toolchain requires that projects are + defined with these formats:

+
    +
  • Symbian OS-specific project file formats (bld.inf)
  • +
  • Symbian OS executable files (.exe)
  • +
+

The primary purpose of bld.inf files is to + group together closely associated projects, such as a GUI application and a + engine DLL used by that application.

+

+ The Symbian OS plug-ins allow you to import projects defined with these + formats into the workbench. This is useful if:

+ +
    +
  • +

    + You have existing projects defined using these formats and now wish + to move to development in Carbide.c++.

    +
  • +
  • +

    You need to keep the ability to build from the command line, for + example in order to do automated builds, and so maintain the command line + project files, but want to use Carbide.c++ for editing code and debugging.

    +
  • +
+ +

Projects for Symbian OS 9.3+

+

The latest versions of Symbian OS 9.3+ devkits include extensive use of PRJ_EXTENSIONS and PRJ_TESTEXTENSIONS. These top-level entries are extension makefile templates whose names are later filled in with target names, sources, and options. The intent is to make source editing easier and dependency checking possible during a build.

+

Currently if you import a bld.inf file but are not importing all of the components and one of these extensions are found:

+
    +
  • a warning appears at the top of the wizard page
  • +
  • a warning is shown in the Carbide Project Settings property page
  • +
  • if not building from the bld.inf, messages appear in the Console and Problems views
  • +
+

The reason being that individual extensions cannot be built from within Carbide, only the complete bld.inf.

+
+

+ To import from a bld.inf file

+ +
    +
  1. + Click File > Import... to get a list of available import wizards
  2. +
  3. Select Symbian OS Bld.inf file and click Next to go to the Import Bld.inf page +
    + +

    +
    +
  4. +
  5. + Type the location of the bld.inf file to import, or browse to the file using the Browse button.
  6. + +

    file import

    +

    NOTE There will be two builders available in Carbide, one for SBSv1 (current version of Symbian Build System) and one for SBSv2 (newer version). The Builder option will only be displayed when a SBSv2 installation is detected.

    +

    SBSv2 only works with recent versions of Symbian OS9.5. Both SBSv1 and SBSv2 are GNU make based build systems.  SBSv1 uses Perl to generate make files, while SBSv2 uses Python. Select the appropriate builder for your project.

    + When building for SBSv2, the builder will set EPOCROOT to the absolute path (including drive letter) to the kit for the active build configuration.  It will also add the path to the sbs bin directory to the start of the PATH variable.  This is derived from the SBS_HOME environment variable.

    For SBSv2, all build configurations (platform/target), including the built-in platforms (WISNCW, ARMV5), are declared in xml files in the \sbs\lib\config directory. The Build Configurations selection page will display only those kits known to support SBSv2.

    +
  7. Click Next to select the recognized SDKs and Build Configurations to be created for this project +

    The SDKs and Build Configurations shows a tree of + the SDKs that are available to be used, and for each SDK, the type of build configurations + that are available. You can select a single SDK if you are developing the program + for just one version of a platform, or multiple SDKs if your + program is to be built against multiple platforms or operating system + versions.

    +

    NOTE The platforms listed are dependent upon the filter settings in the Platform Filtering Preferences.

    +

    +
    +

    +
    +
  8. +
  9. Click Next to select the mmp and extension make files +
    +

    One MMP file must be selected in order to continue. If the bld.inf file contains more than three MMP files, just select the MMP files you need to import. If there are three or less MMP files, then all are selected for importing.

    +

    +
    +
  10. +
  11. Click Next to enter the Project name and root directory
  12. +

    When creating a project, project files are created in the root directory. Carbide.c++ creates additional files for each project. They consist of:

    +
      +
    • .project - an xml file that provides a project description
    • +
    • .cproject - an xml file that provides additional project information
    • +
    • .settings folder - contains files that provide build configuration and preference settings
    • +
    +

    The root directory is a path to the root of your project. All necessary tool components, developer libraries, and information about the SDK are stored in subdirectories under this root. The whole path leading to the SDK root directory must be declared to the Windows system via the Environment Variables settings. The variable name is EPOCROOT and the variable value is the full path where a Symbian OS SDK is installed in the Windows system.

    +

    The root directory should contain all project related files that you want to work with in Carbide. The default directory is calculated by parsing the bld.inf file and mmp file(s).

    +

    + +
  13. Click Finish to import the project +

    + The + wizard creates the project in the C/C++ Projects view, where it can be built and edited as normal. If the wizard is unable to read the project files, then the page + describes the error that occurred. If an error occurs, you must fix the project file, and then + re-import the bld.inf.

    +
  14. +
+ +
+
Related concepts
+ + +
Related tasks
+ +
Related references
+ + + + + \ No newline at end of file diff -r 619ca8fc1260 -r f70af3d98d07 core/com.nokia.carbide.cpp.doc.user/plugin.xml --- a/core/com.nokia.carbide.cpp.doc.user/plugin.xml Wed May 20 13:34:23 2009 -0500 +++ b/core/com.nokia.carbide.cpp.doc.user/plugin.xml Wed May 20 13:36:08 2009 -0500 @@ -25,6 +25,7 @@ + + + + + + + - diff -r 619ca8fc1260 -r f70af3d98d07 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISymbianBuildContext.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISymbianBuildContext.java Wed May 20 13:34:23 2009 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/sdk/core/ISymbianBuildContext.java Wed May 20 13:36:08 2009 -0500 @@ -42,6 +42,12 @@ public static final String ARMV6_ABIV2_PLATFORM = "ARMV6_ABIV2"; /** + * DEFAULT suffix to use for components that are specified as variant, but don't buid as variants. For example, plain ARMV5, when specified as + * as a FEATUREVARIANT, will build as ARMV5.DEFAULT + */ + public static final String DEFAULT_VARIANT = "DEFAULT"; + + /** * Target constants */ @@ -64,6 +70,7 @@ /** * For Symbian Bianry Variation, platforms will be names . * So in some cases you need to know only the platforms that the variant is based on. + * For example, a build platform name of "armv5.myvariant" will return "armv5". * @return The base platform string. * @see isSymbianBinaryVariation() */ diff -r 619ca8fc1260 -r f70af3d98d07 debuggercdi/com.nokia.carbide.trk.support/plugin.xml --- a/debuggercdi/com.nokia.carbide.trk.support/plugin.xml Wed May 20 13:34:23 2009 -0500 +++ b/debuggercdi/com.nokia.carbide.trk.support/plugin.xml Wed May 20 13:36:08 2009 -0500 @@ -38,5 +38,11 @@ class="com.nokia.carbide.trk.support.service.ConnectedServiceFactory"> + + + + diff -r 619ca8fc1260 -r f70af3d98d07 debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/connection/TCPIPConnectionType.java --- a/debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/connection/TCPIPConnectionType.java Wed May 20 13:34:23 2009 -0500 +++ b/debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/connection/TCPIPConnectionType.java Wed May 20 13:36:08 2009 -0500 @@ -27,10 +27,10 @@ */ public class TCPIPConnectionType implements IConnectionType { - public static final String ID = TCPIPConnectionType.class.getName(); + public static final String ID = "com.nokia.carbide.connection.TCPIPConnectionType"; //$NON-NLS-1$ public IConnectionFactory getConnectionFactory() { - return new TCPIPConnectionFactory(this); + return new TCPIPPortMappingConnectionFactory(this); } public String getDescription() { diff -r 619ca8fc1260 -r f70af3d98d07 debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/connection/TCPIPPortMappingConnection.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/connection/TCPIPPortMappingConnection.java Wed May 20 13:36:08 2009 -0500 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.carbide.trk.support.connection; + +import com.nokia.carbide.remoteconnections.interfaces.IConnectionType; + +import java.util.Map; + +public class TCPIPPortMappingConnection extends TCPIPConnection { + + public TCPIPPortMappingConnection(IConnectionType connectionType, Map settings) { + super(connectionType, settings); + } + + +} diff -r 619ca8fc1260 -r f70af3d98d07 debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/connection/TCPIPPortMappingConnectionFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/connection/TCPIPPortMappingConnectionFactory.java Wed May 20 13:36:08 2009 -0500 @@ -0,0 +1,231 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.carbide.trk.support.connection; + +import com.nokia.carbide.remoteconnections.RemoteConnectionsActivator; +import com.nokia.carbide.remoteconnections.interfaces.*; +import com.nokia.carbide.trk.support.Messages; + +import org.eclipse.jface.layout.GridDataFactory; +import org.eclipse.jface.viewers.*; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.*; + +import java.util.*; +import java.util.List; + +public class TCPIPPortMappingConnectionFactory extends TCPIPConnectionFactory { + + private final class PortColumnEditingSupport extends EditingSupport { + private TextCellEditor editor; + + private PortColumnEditingSupport(ColumnViewer viewer) { + super(viewer); + editor = new TextCellEditor((Composite) viewer.getControl(), SWT.NONE); + } + + @Override + protected boolean canEdit(Object element) { + return true; + } + + @Override + protected CellEditor getCellEditor(Object element) { + return editor; + } + + @Override + protected Object getValue(Object element) { + return serviceIdToPortMappings.get(element.toString()).toString(); + } + + @Override + protected void setValue(Object element, Object value) { + Integer integer = getValidValue((String) value); + if (integer != null) { + serviceIdToPortMappings.put(element.toString(), integer); + viewer.refresh(true); + packColumns(); + } + } + + } + + private final class TableLabelProvider implements ITableLabelProvider { + public Image getColumnImage(Object element, int columnIndex) { + return null; + } + + public String getColumnText(Object element, int columnIndex) { + String serviceId = element.toString(); + if (columnIndex == SERVICE_COLUMN) { + IService service = + RemoteConnectionsActivator.getConnectionTypeProvider().findServiceByID(serviceId); + return service.getDisplayName(); + } + else if (columnIndex == PORT_COLUMN) { + return String.valueOf(serviceIdToPortMappings.get(serviceId).intValue()); + } + return null; + } + + public void addListener(ILabelProviderListener listener) { + } + + public void dispose() { + } + + public boolean isLabelProperty(Object element, String property) { + return false; + } + + public void removeListener(ILabelProviderListener listener) { + } + } + + private static final int MIN_DYN_PORT_NUM = 49152; + private static final int MAX_DYN_PORT_NUM = 65535; + private static final int SERVICE_COLUMN = 0; + private static final int PORT_COLUMN = 1; + private Map serviceIdToPortMappings; + private TableViewer viewer; + + public TCPIPPortMappingConnectionFactory(IConnectionType connectionType) { + super(connectionType); + serviceIdToPortMappings = new HashMap(); + initializePortMappings(); + } + + private void initializePortMappings() { + Collection services = RemoteConnectionsActivator.getConnectionTypeProvider().getCompatibleServices(connectionType); + for (IService service : services) { + IService2 service2 = service instanceof IService2 ? (IService2) service : null; + Integer defaultPort = null; + if (service2 != null) { + try { + String defaultPortString = service2.getDefaults().get(IP_PORT); + defaultPort = Integer.valueOf(defaultPortString); + } catch (NumberFormatException e) { + // if it doesn't parse as an int, we ignore it and provide a dynamic default + } + } + if (defaultPort != null) + serviceIdToPortMappings.put(service.getIdentifier(), defaultPort); + } + for (IService service : services) { + String identifier = service.getIdentifier(); + if (!serviceIdToPortMappings.containsKey(identifier)) + serviceIdToPortMappings.put(identifier, getUnusedDynamicDefault()); + } + + } + + private Integer getUnusedDynamicDefault() { + for (Integer val = MIN_DYN_PORT_NUM; val < MAX_DYN_PORT_NUM; val++) { + if (!serviceIdToPortMappings.containsValue(val)) + return val; + } + return -1; // should never get here!!! + } + + @Override + public IConnection createConnection(Map settings) { + if (settings == null) + settings = getSettingsFromUI(); + return new TCPIPPortMappingConnection(connectionType, settings); + } + + @Override + public void createEditingUI(Composite parent, IValidationErrorReporter errorReporter, Map initialSettings) { + super.createEditingUI(parent, errorReporter, initialSettings); + updatePortMappings(initialSettings); + Label label = new Label(composite, SWT.NONE); + GridDataFactory.defaultsFor(label).span(2, 1).applyTo(label); + label.setText(Messages.getString("TCPIPPortMappingConnectionFactory.ViewerLabel")); //$NON-NLS-1$ + + viewer = new TableViewer(composite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION); + viewer.setContentProvider(new ArrayContentProvider()); + + TableViewerColumn serviceColumn = new TableViewerColumn(viewer, SWT.LEFT); + serviceColumn.getColumn().setText(Messages.getString("TCPIPPortMappingConnectionFactory.ServiceHeader")); //$NON-NLS-1$ + + TableViewerColumn portColumn = new TableViewerColumn(viewer, SWT.RIGHT); + portColumn.getColumn().setText(Messages.getString("TCPIPPortMappingConnectionFactory.PortHeader")); //$NON-NLS-1$ + portColumn.setEditingSupport(new PortColumnEditingSupport(viewer)); + + viewer.setLabelProvider(new TableLabelProvider()); + viewer.setInput(serviceIdToPortMappings.keySet()); + + Table table = viewer.getTable(); + table.setHeaderVisible(true); + GridDataFactory.defaultsFor(table).span(2, 1).hint(SWT.DEFAULT, 60).grab(true, false).applyTo(table); + table.setToolTipText(Messages.getString("TCPIPPortMappingConnectionFactory.ViewerTooltip")); //$NON-NLS-1$ + table.setData(UID, "TCPIPPortMappingConnectionFactory.table"); //$NON-NLS-1$ + table.setData("viewer", viewer); //$NON-NLS-1$ + packColumns(); + } + + private Integer getValidValue(String value) { + try { + int intVal = Integer.parseInt(value); + if (intVal < 0) + return new Integer(0); + else if (intVal > MAX_DYN_PORT_NUM) + return new Integer(MAX_DYN_PORT_NUM); + else + return new Integer(intVal); + } catch (Exception e) { + } + return null; + } + + private void updatePortMappings(Map initialSettings) { + if (initialSettings != null) { + List serviceIds = new ArrayList(serviceIdToPortMappings.keySet()); + for (String serviceId : serviceIds) { + String value = initialSettings.get(serviceId); + Integer validValue = getValidValue(value); + if (validValue != null) + serviceIdToPortMappings.put(serviceId, validValue); + } + } + + } + + @Override + public Map getSettingsFromUI() { + Map settings = super.getSettingsFromUI(); + addMappings(settings); + return settings; + } + + private void addMappings(Map settings) { + for (String serviceId : serviceIdToPortMappings.keySet()) { + settings.put(serviceId, String.valueOf(serviceIdToPortMappings.get(serviceId).intValue())); + } + settings.remove(IP_PORT); + } + + private void packColumns() { + TableColumn[] columns = viewer.getTable().getColumns(); + for (TableColumn tableColumn : columns) { + tableColumn.pack(); + } + } +} diff -r 619ca8fc1260 -r f70af3d98d07 debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/messages.properties --- a/debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/messages.properties Wed May 20 13:34:23 2009 -0500 +++ b/debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/messages.properties Wed May 20 13:36:08 2009 -0500 @@ -29,6 +29,10 @@ TCPIPConnectionFactory.NoAddressError=Please provide a valid IP address TCPIPConnectionType.Desc=TCP/IP settings TCPIPConnectionType.Label=TCP/IP +TCPIPPortMappingConnectionFactory.PortHeader=Port +TCPIPPortMappingConnectionFactory.ServiceHeader=Service +TCPIPPortMappingConnectionFactory.ViewerLabel=Service to port mappings +TCPIPPortMappingConnectionFactory.ViewerTooltip=Service to port mappings for this connection. Port settings are user editable TracingConnectedService.BadVersionResponseError=Response from TraceCore was corrupted TracingConnectedService.DownLabel=Not accessible TracingConnectedService.ErrorStatus=Error: diff -r 619ca8fc1260 -r f70af3d98d07 debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/service/TRKConnectedService.java --- a/debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/service/TRKConnectedService.java Wed May 20 13:34:23 2009 -0500 +++ b/debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/service/TRKConnectedService.java Wed May 20 13:36:08 2009 -0500 @@ -116,7 +116,7 @@ private Version getTRKVersionFromOSTUSB(String port) throws ConnectionFailException { ITCConnection conn = TCFClassFactory.createITCVirtualSerialConnection(port); - conn.setDecodeFormat("ost"); + conn.setDecodeFormat("ost"); //$NON-NLS-1$ return getTRKVersionUsingTCF(conn, (byte)0x90, (byte)0x90); } diff -r 619ca8fc1260 -r f70af3d98d07 debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/service/TracingConnectedService.java --- a/debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/service/TracingConnectedService.java Wed May 20 13:34:23 2009 -0500 +++ b/debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/service/TracingConnectedService.java Wed May 20 13:36:08 2009 -0500 @@ -76,7 +76,7 @@ private boolean getTraceCoreResponseFromOSTUSB(String port) throws ConnectionFailException { ITCConnection conn = TCFClassFactory.createITCVirtualSerialConnection(port); - conn.setDecodeFormat("ost"); + conn.setDecodeFormat("ost"); //$NON-NLS-1$ return getTraceCoreResponseUsingTCF(conn, true, (byte)0x0, (byte)0x0, TC_REQ_OST, new IMessageValidator() { public boolean isValidMessage(byte[] message) {