From b1e3108361a1b0afaf99faf382d01c0b105c32cb Mon Sep 17 00:00:00 2001 From: "gune.kim" Date: Fri, 10 Feb 2012 18:04:34 +0900 Subject: [Title] rename project folder (com.samsung.tizen -> org.tizen). [Type] [Module] [Priority] [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] Change-Id: I34e30222c45db02c2d355c3974f41228869bf67f --- com.samsung.tizen.codecoverage.feature/.project | 17 -- .../build.properties | 2 - .../feature.properties | 52 ------ com.samsung.tizen.codecoverage.feature/feature.xml | 169 ------------------- com.samsung.tizen.codecoverage.update/.project | 17 -- com.samsung.tizen.codecoverage/.classpath | 7 - com.samsung.tizen.codecoverage/.project | 28 ---- .../.settings/org.eclipse.jdt.core.prefs | 72 -------- .../META-INF/MANIFEST.MF | 21 --- com.samsung.tizen.codecoverage/NOTICE | 2 - com.samsung.tizen.codecoverage/build.properties | 6 - .../icons/toolbar_icon.gif | Bin 610 -> 0 bytes com.samsung.tizen.codecoverage/plugin.xml | 31 ---- .../src/org/tizen/codecoverage/Activator.java | 70 -------- .../org/tizen/codecoverage/actions/GcovAction.java | 114 ------------- .../org/tizen/codecoverage/helper/GcovHelper.java | 181 --------------------- org.tizen.codecoverage.feature/.project | 17 ++ org.tizen.codecoverage.feature/build.properties | 2 + org.tizen.codecoverage.feature/feature.properties | 52 ++++++ org.tizen.codecoverage.feature/feature.xml | 169 +++++++++++++++++++ org.tizen.codecoverage.update/.project | 17 ++ org.tizen.codecoverage/.classpath | 7 + org.tizen.codecoverage/.project | 28 ++++ .../.settings/org.eclipse.jdt.core.prefs | 72 ++++++++ org.tizen.codecoverage/META-INF/MANIFEST.MF | 21 +++ org.tizen.codecoverage/NOTICE | 2 + org.tizen.codecoverage/build.properties | 6 + org.tizen.codecoverage/icons/toolbar_icon.gif | Bin 0 -> 610 bytes org.tizen.codecoverage/plugin.xml | 31 ++++ .../src/org/tizen/codecoverage/Activator.java | 70 ++++++++ .../org/tizen/codecoverage/actions/GcovAction.java | 114 +++++++++++++ .../org/tizen/codecoverage/helper/GcovHelper.java | 181 +++++++++++++++++++++ 32 files changed, 789 insertions(+), 789 deletions(-) delete mode 100644 com.samsung.tizen.codecoverage.feature/.project delete mode 100644 com.samsung.tizen.codecoverage.feature/build.properties delete mode 100644 com.samsung.tizen.codecoverage.feature/feature.properties delete mode 100644 com.samsung.tizen.codecoverage.feature/feature.xml delete mode 100644 com.samsung.tizen.codecoverage.update/.project delete mode 100644 com.samsung.tizen.codecoverage/.classpath delete mode 100644 com.samsung.tizen.codecoverage/.project delete mode 100644 com.samsung.tizen.codecoverage/.settings/org.eclipse.jdt.core.prefs delete mode 100644 com.samsung.tizen.codecoverage/META-INF/MANIFEST.MF delete mode 100644 com.samsung.tizen.codecoverage/NOTICE delete mode 100644 com.samsung.tizen.codecoverage/build.properties delete mode 100644 com.samsung.tizen.codecoverage/icons/toolbar_icon.gif delete mode 100644 com.samsung.tizen.codecoverage/plugin.xml delete mode 100644 com.samsung.tizen.codecoverage/src/org/tizen/codecoverage/Activator.java delete mode 100644 com.samsung.tizen.codecoverage/src/org/tizen/codecoverage/actions/GcovAction.java delete mode 100644 com.samsung.tizen.codecoverage/src/org/tizen/codecoverage/helper/GcovHelper.java create mode 100644 org.tizen.codecoverage.feature/.project create mode 100644 org.tizen.codecoverage.feature/build.properties create mode 100644 org.tizen.codecoverage.feature/feature.properties create mode 100644 org.tizen.codecoverage.feature/feature.xml create mode 100644 org.tizen.codecoverage.update/.project create mode 100644 org.tizen.codecoverage/.classpath create mode 100644 org.tizen.codecoverage/.project create mode 100644 org.tizen.codecoverage/.settings/org.eclipse.jdt.core.prefs create mode 100644 org.tizen.codecoverage/META-INF/MANIFEST.MF create mode 100644 org.tizen.codecoverage/NOTICE create mode 100644 org.tizen.codecoverage/build.properties create mode 100644 org.tizen.codecoverage/icons/toolbar_icon.gif create mode 100644 org.tizen.codecoverage/plugin.xml create mode 100644 org.tizen.codecoverage/src/org/tizen/codecoverage/Activator.java create mode 100644 org.tizen.codecoverage/src/org/tizen/codecoverage/actions/GcovAction.java create mode 100644 org.tizen.codecoverage/src/org/tizen/codecoverage/helper/GcovHelper.java diff --git a/com.samsung.tizen.codecoverage.feature/.project b/com.samsung.tizen.codecoverage.feature/.project deleted file mode 100644 index 750ec27..0000000 --- a/com.samsung.tizen.codecoverage.feature/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - org.tizen.codecoverage.feature - - - - - - org.eclipse.pde.FeatureBuilder - - - - - - org.eclipse.pde.FeatureNature - - diff --git a/com.samsung.tizen.codecoverage.feature/build.properties b/com.samsung.tizen.codecoverage.feature/build.properties deleted file mode 100644 index b3a611b..0000000 --- a/com.samsung.tizen.codecoverage.feature/build.properties +++ /dev/null @@ -1,2 +0,0 @@ -bin.includes = feature.xml,\ - feature.properties diff --git a/com.samsung.tizen.codecoverage.feature/feature.properties b/com.samsung.tizen.codecoverage.feature/feature.properties deleted file mode 100644 index 5c79346..0000000 --- a/com.samsung.tizen.codecoverage.feature/feature.properties +++ /dev/null @@ -1,52 +0,0 @@ -############################################################################### -# Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# S-Core Co., Ltd -############################################################################### -# feature.properties -# contains externalized strings for feature.xml -# "%foo" in feature.xml corresponds to the key "foo" in this file -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# This file should be translated. - -# "featureName" property - name of the feature -featureName=Tizen Code Coverage - -# "providerName" property - name of the company that provides the feature -providerName=Samsung - -# "updateSiteName" property - label for the update site -updateSiteName=Tizen Code Coverage Updates - -# "description" property - description of the feature -description=Tizen Code Coverage for Native Applications. - -# "copyright" property -copyrightURL=https://developer.tizen.org -copyright=Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd.\n\ -All rights reserved.\n - -# "licenseURL" property - URL of the "Feature License" -# do not translate value - just change to point to a locale-specific HTML page -licenseURL=license.html - -# "license" property - text of the "Feature Update License" -# should be plain text version of license agreement pointed to be "licenseURL" -license=\ -Tizen SDK\n\ -\n\ -Tizen SDK contains software portions licensed under various open source licenses as well as proprietary components. All open source software portions ("Open Source Software") are licensed under the open source licenses that accompany such Open Source Software.\n\ - \n\ -The licenses governing the Open Source Software are available at: http://developer.tizen.org/download/tizen_sdk_opensource_license.html\n\ - \n\ -Except for the Open Source Software contained in Tizen SDK, all other software portions contained in Tizen SDK are governed by the terms and conditions of the Tizen Software Development Kit License Agreement, available at: http://developer.tizen.org/download/samsung_sdk_license.html\n\ - \n\ -You may access and download Tizen SDK Open Source Software at: http://developer.tizen.org/download/tizenopensdk.tar.gz\n\ - \n\ -BY CLICKING THE "I AGREE" BUTTON OR BY USING ANY PART OF TIZEN SDK, YOU AGREE (ON BEHALF OF YOURSELF AND/OR YOUR COMPANY) TO THE OPEN SOURCE SOFTWARE LICENSE TERMS AND THE TIZEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT. IF YOU DO NOT AGREE WITH THE OPEN SOURCE SOFTWARE LICENSE TERMS OR THE TIZEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT, YOU MAY NOT DOWNLOAD OR USE TIZEN SDK.\n -########### end of license property ########################################## diff --git a/com.samsung.tizen.codecoverage.feature/feature.xml b/com.samsung.tizen.codecoverage.feature/feature.xml deleted file mode 100644 index 4013d66..0000000 --- a/com.samsung.tizen.codecoverage.feature/feature.xml +++ /dev/null @@ -1,169 +0,0 @@ - - - - - %description - - - - %copyright - - - - %license - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/com.samsung.tizen.codecoverage.update/.project b/com.samsung.tizen.codecoverage.update/.project deleted file mode 100644 index e071335..0000000 --- a/com.samsung.tizen.codecoverage.update/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - org.tizen.codecoverage.update - - - - - - org.eclipse.pde.UpdateSiteBuilder - - - - - - org.eclipse.pde.UpdateSiteNature - - diff --git a/com.samsung.tizen.codecoverage/.classpath b/com.samsung.tizen.codecoverage/.classpath deleted file mode 100644 index ad32c83..0000000 --- a/com.samsung.tizen.codecoverage/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/com.samsung.tizen.codecoverage/.project b/com.samsung.tizen.codecoverage/.project deleted file mode 100644 index ee5a68f..0000000 --- a/com.samsung.tizen.codecoverage/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.tizen.codecoverage - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/com.samsung.tizen.codecoverage/.settings/org.eclipse.jdt.core.prefs b/com.samsung.tizen.codecoverage/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 8e500c1..0000000 --- a/com.samsung.tizen.codecoverage/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,72 +0,0 @@ -#Fri Dec 02 17:57:57 KST 2011 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore -org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore -org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore -org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore -org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore -org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning diff --git a/com.samsung.tizen.codecoverage/META-INF/MANIFEST.MF b/com.samsung.tizen.codecoverage/META-INF/MANIFEST.MF deleted file mode 100644 index c212f64..0000000 --- a/com.samsung.tizen.codecoverage/META-INF/MANIFEST.MF +++ /dev/null @@ -1,21 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Tizen Gcov -Bundle-SymbolicName: org.tizen.codecoverage;singleton:=true -Bundle-Version: 1.0.0.qualifier -Bundle-Activator: org.tizen.codecoverage.Activator -Bundle-Vendor: Samsung -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.core.resources, - org.eclipse.cdt.core, - org.eclipse.cdt.debug.core, - org.eclipse.debug.core, - org.eclipse.linuxtools.gcov, - org.tizen.common -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 -Bundle-ActivationPolicy: lazy -Import-Package: org.tizen.common.connection, - org.tizen.nativeapp.editors.manifest, - org.eclipse.cdt.managedbuilder.core -Export-Package: org.tizen.codecoverage.helper diff --git a/com.samsung.tizen.codecoverage/NOTICE b/com.samsung.tizen.codecoverage/NOTICE deleted file mode 100644 index 87d9729..0000000 --- a/com.samsung.tizen.codecoverage/NOTICE +++ /dev/null @@ -1,2 +0,0 @@ -Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - diff --git a/com.samsung.tizen.codecoverage/build.properties b/com.samsung.tizen.codecoverage/build.properties deleted file mode 100644 index 6c480f3..0000000 --- a/com.samsung.tizen.codecoverage/build.properties +++ /dev/null @@ -1,6 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml,\ - icons/ diff --git a/com.samsung.tizen.codecoverage/icons/toolbar_icon.gif b/com.samsung.tizen.codecoverage/icons/toolbar_icon.gif deleted file mode 100644 index 62a7d86..0000000 Binary files a/com.samsung.tizen.codecoverage/icons/toolbar_icon.gif and /dev/null differ diff --git a/com.samsung.tizen.codecoverage/plugin.xml b/com.samsung.tizen.codecoverage/plugin.xml deleted file mode 100644 index 475aa6d..0000000 --- a/com.samsung.tizen.codecoverage/plugin.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/com.samsung.tizen.codecoverage/src/org/tizen/codecoverage/Activator.java b/com.samsung.tizen.codecoverage/src/org/tizen/codecoverage/Activator.java deleted file mode 100644 index d0eb6c8..0000000 --- a/com.samsung.tizen.codecoverage/src/org/tizen/codecoverage/Activator.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Code Coverage - * - * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * JeongHwan kim - * JuYoung Kim - * - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * - S-Core Co., Ltd - * - */ - - -package org.tizen.codecoverage; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "com.score.gcov"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/com.samsung.tizen.codecoverage/src/org/tizen/codecoverage/actions/GcovAction.java b/com.samsung.tizen.codecoverage/src/org/tizen/codecoverage/actions/GcovAction.java deleted file mode 100644 index 8e9d02e..0000000 --- a/com.samsung.tizen.codecoverage/src/org/tizen/codecoverage/actions/GcovAction.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Code Coverage - * - * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * JeongHwan kim - * JuYoung Kim - * - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * - S-Core Co., Ltd - * - */ - - -package org.tizen.codecoverage.actions; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.TreeSelection; -import org.eclipse.linuxtools.gcov.view.CovView; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.IWorkbenchWindowActionDelegate; -import org.eclipse.ui.PlatformUI; -import org.tizen.codecoverage.helper.GcovHelper; - - -/** - * Our sample action implements workbench action delegate. The action proxy will - * be created by the workbench and shown in the UI. When the user tries to use - * the action, this delegate will be created and execution will be delegated to - * it. - * - * @see IWorkbenchWindowActionDelegate - */ -public class GcovAction implements IWorkbenchWindowActionDelegate { - // private IWorkbenchWindow window; - - private IProject project; - /** - * The constructor. - */ - public GcovAction() { - project = null; - } - - /** - * The action has been activated. The argument of the method represents the - * 'real' action sitting in the workbench UI. - * - * @see IWorkbenchWindowActionDelegate#run - */ - public void run(IAction action) { - GcovHelper.run(project); - } - - /** - * Selection in the workbench has been changed. We can change the state of - * the 'real' action here if we want, but this can only happen after the - * delegate has been created. - * - * @see IWorkbenchWindowActionDelegate#selectionChanged - */ - public void selectionChanged(IAction action, ISelection selection) { - Object obj = null; - - if (selection instanceof TreeSelection) { - TreeSelection _selection = (TreeSelection) selection; - - if (_selection != null) { - obj = _selection.getFirstElement(); - } - } - - if (obj != null) { - if (obj instanceof IResource) { - project = ((IResource) obj).getProject(); - } else if (obj instanceof ICElement) { - IResource resource = ((ICElement) obj).getResource(); - project = ((IResource) resource).getProject(); - } else { -// System.out.println(obj.getClass()); - } - } - } - - /** - * We can use this method to dispose of any system resources we previously - * allocated. - * - * @see IWorkbenchWindowActionDelegate#dispose - */ - public void dispose() { - } - - /** - * We will cache window object in order to be able to provide parent shell - * for the message dialog. - * - * @see IWorkbenchWindowActionDelegate#init - */ - public void init(IWorkbenchWindow window) { - } -} diff --git a/com.samsung.tizen.codecoverage/src/org/tizen/codecoverage/helper/GcovHelper.java b/com.samsung.tizen.codecoverage/src/org/tizen/codecoverage/helper/GcovHelper.java deleted file mode 100644 index 14c2f80..0000000 --- a/com.samsung.tizen.codecoverage/src/org/tizen/codecoverage/helper/GcovHelper.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Code Coverage - * - * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * JeongHwan kim - * JuYoung Kim - * - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * - S-Core Co., Ltd - * - */ - - -package org.tizen.codecoverage.helper; - -import java.util.List; - -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.model.IBinary; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.linuxtools.gcov.parser.CovManager; -import org.eclipse.linuxtools.gcov.view.CovView; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.PlatformUI; - -import org.tizen.common.connection.ConnectionPlugin; -import org.tizen.nativeapp.editors.manifest.PackageModel; -import org.tizen.sdblib.IDevice; -import org.tizen.sdblib.SyncService; -import org.tizen.sdblib.SyncService.SyncResult; - -public class GcovHelper { - final static String DATA_DIR = "/data/"; - - static public void run(IProject project) { - // null check project - if (project == null || !project.exists()) { - final String message = "Please select a project."; - Shell s = PlatformUI.getWorkbench().getDisplay().getActiveShell(); - MessageDialog.openInformation(s, "Project not found", message); - return; - } - - IDevice currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); - if (currentDevice == null) { -// final String message = "Target device is not running"; -// Shell s = PlatformUI.getWorkbench().getDisplay().getActiveShell(); -// MessageDialog.openError(s, "Gcov Error", message); - return; - } - - String binary = GcovHelper.getBinary(project); - if (binary == null) { - final String message = "Gcov failed. Binary file not found.\n" - + "Please check Build Settings"; - Shell s = PlatformUI.getWorkbench().getDisplay().getActiveShell(); - MessageDialog.openError(s, "Gcov Error", message); - return; - } - - try { - GcovHelper.downloadGcdaFile(binary); - } catch (Exception e) { - final String message = "Gcov failed. Coverage data file not found."; - Shell s = PlatformUI.getWorkbench().getDisplay().getActiveShell(); - MessageDialog.openError(s, "Gcov Error", message); - return; - } - CovView.displayCovResults(binary); - } - - // FIXME searching a selected binary is not complete - // This part is affected IDE launch part - // TODO Fix this method - public static String getBinary(IProject project) { - String binary = null; - ICProject cproject = CoreModel.getDefault().create(project); - if (cproject == null) { - return binary; - } - IBinary[] bins = null; - try { - bins = cproject.getBinaryContainer().getBinaries(); - } catch (CModelException e) { - e.printStackTrace(); - } - - IDevice currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); - if (currentDevice.isEmulator()) { - System.out.println("Emulator"); - for (int i = 0; i < bins.length; i++) { - IResource r = bins[i].getResource(); - if (bins[i].getPath().toOSString().contains("Emulator") && - bins[i].getPath().lastSegment().equals(r.getProject().getName())) { - binary = r.getLocation().toOSString(); - return binary; - } - } - } else { - System.out.println("Real Device"); - for (int i = 0; i < bins.length; i++) { - IResource r = bins[i].getResource(); - if (bins[i].getPath().toOSString().contains("Device") && - bins[i].getPath().lastSegment().equals(r.getProject().getName())) { - binary = r.getLocation().toOSString(); - return binary; - } - } - } - return binary; - } - - static IProject getProject(IPath file) { - IFile c = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(file); - return c.getProject(); - } - - public static void downloadGcdaFile(String binaryPath) throws Exception { - CovManager cvrgeMnger = null; - List gcdaPaths = null; - cvrgeMnger = new CovManager(binaryPath); - try { - gcdaPaths = cvrgeMnger.getGCDALocations(); - } catch (Exception e) { - final String message = "Gcov failed. Binary not found."; - Shell s = PlatformUI.getWorkbench().getDisplay().getActiveShell(); - MessageDialog.openError(s, "Gcov Error", message); - return; - } - // download gcda file - IPath file = new Path(binaryPath); - IProject project = getProject(file); - String targetPath = getGcdaPath(project); - - @SuppressWarnings("restriction") - IDevice currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); - @SuppressWarnings("restriction") - SyncService syncService = currentDevice.getSyncService(); - - for (String gcdaPath: gcdaPaths) { - int start = gcdaPath.lastIndexOf('/') + 1; - int end = gcdaPath.length(); - String gcdaFile = gcdaPath.substring(start, end); - String srcFile = targetPath + gcdaFile; - String dstFile = gcdaPath; - @SuppressWarnings("restriction") - SyncResult syncSuccess = syncService.pullFile(srcFile, dstFile, SyncService.getNullProgressMonitor()); - if (syncSuccess.getCode() != SyncService.RESULT_OK) { - Exception e = new Exception(); - throw e; - } - } - } - - static public String getGcdaPath(IProject project) { - String installPath = getPackageInstallPath(project); - String gcdaPath = installPath + DATA_DIR; - return gcdaPath; - } - - static String getPackageInstallPath(IProject project) { - PackageModel packageModel = PackageModel.newInstance(project); - String installPath = packageModel.getAppInstallPath(); - return installPath; - } -} diff --git a/org.tizen.codecoverage.feature/.project b/org.tizen.codecoverage.feature/.project new file mode 100644 index 0000000..750ec27 --- /dev/null +++ b/org.tizen.codecoverage.feature/.project @@ -0,0 +1,17 @@ + + + org.tizen.codecoverage.feature + + + + + + org.eclipse.pde.FeatureBuilder + + + + + + org.eclipse.pde.FeatureNature + + diff --git a/org.tizen.codecoverage.feature/build.properties b/org.tizen.codecoverage.feature/build.properties new file mode 100644 index 0000000..b3a611b --- /dev/null +++ b/org.tizen.codecoverage.feature/build.properties @@ -0,0 +1,2 @@ +bin.includes = feature.xml,\ + feature.properties diff --git a/org.tizen.codecoverage.feature/feature.properties b/org.tizen.codecoverage.feature/feature.properties new file mode 100644 index 0000000..5c79346 --- /dev/null +++ b/org.tizen.codecoverage.feature/feature.properties @@ -0,0 +1,52 @@ +############################################################################### +# Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# S-Core Co., Ltd +############################################################################### +# feature.properties +# contains externalized strings for feature.xml +# "%foo" in feature.xml corresponds to the key "foo" in this file +# java.io.Properties file (ISO 8859-1 with "\" escapes) +# This file should be translated. + +# "featureName" property - name of the feature +featureName=Tizen Code Coverage + +# "providerName" property - name of the company that provides the feature +providerName=Samsung + +# "updateSiteName" property - label for the update site +updateSiteName=Tizen Code Coverage Updates + +# "description" property - description of the feature +description=Tizen Code Coverage for Native Applications. + +# "copyright" property +copyrightURL=https://developer.tizen.org +copyright=Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd.\n\ +All rights reserved.\n + +# "licenseURL" property - URL of the "Feature License" +# do not translate value - just change to point to a locale-specific HTML page +licenseURL=license.html + +# "license" property - text of the "Feature Update License" +# should be plain text version of license agreement pointed to be "licenseURL" +license=\ +Tizen SDK\n\ +\n\ +Tizen SDK contains software portions licensed under various open source licenses as well as proprietary components. All open source software portions ("Open Source Software") are licensed under the open source licenses that accompany such Open Source Software.\n\ + \n\ +The licenses governing the Open Source Software are available at: http://developer.tizen.org/download/tizen_sdk_opensource_license.html\n\ + \n\ +Except for the Open Source Software contained in Tizen SDK, all other software portions contained in Tizen SDK are governed by the terms and conditions of the Tizen Software Development Kit License Agreement, available at: http://developer.tizen.org/download/samsung_sdk_license.html\n\ + \n\ +You may access and download Tizen SDK Open Source Software at: http://developer.tizen.org/download/tizenopensdk.tar.gz\n\ + \n\ +BY CLICKING THE "I AGREE" BUTTON OR BY USING ANY PART OF TIZEN SDK, YOU AGREE (ON BEHALF OF YOURSELF AND/OR YOUR COMPANY) TO THE OPEN SOURCE SOFTWARE LICENSE TERMS AND THE TIZEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT. IF YOU DO NOT AGREE WITH THE OPEN SOURCE SOFTWARE LICENSE TERMS OR THE TIZEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT, YOU MAY NOT DOWNLOAD OR USE TIZEN SDK.\n +########### end of license property ########################################## diff --git a/org.tizen.codecoverage.feature/feature.xml b/org.tizen.codecoverage.feature/feature.xml new file mode 100644 index 0000000..4013d66 --- /dev/null +++ b/org.tizen.codecoverage.feature/feature.xml @@ -0,0 +1,169 @@ + + + + + %description + + + + %copyright + + + + %license + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.tizen.codecoverage.update/.project b/org.tizen.codecoverage.update/.project new file mode 100644 index 0000000..e071335 --- /dev/null +++ b/org.tizen.codecoverage.update/.project @@ -0,0 +1,17 @@ + + + org.tizen.codecoverage.update + + + + + + org.eclipse.pde.UpdateSiteBuilder + + + + + + org.eclipse.pde.UpdateSiteNature + + diff --git a/org.tizen.codecoverage/.classpath b/org.tizen.codecoverage/.classpath new file mode 100644 index 0000000..ad32c83 --- /dev/null +++ b/org.tizen.codecoverage/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.tizen.codecoverage/.project b/org.tizen.codecoverage/.project new file mode 100644 index 0000000..ee5a68f --- /dev/null +++ b/org.tizen.codecoverage/.project @@ -0,0 +1,28 @@ + + + org.tizen.codecoverage + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/org.tizen.codecoverage/.settings/org.eclipse.jdt.core.prefs b/org.tizen.codecoverage/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..8e500c1 --- /dev/null +++ b/org.tizen.codecoverage/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,72 @@ +#Fri Dec 02 17:57:57 KST 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning diff --git a/org.tizen.codecoverage/META-INF/MANIFEST.MF b/org.tizen.codecoverage/META-INF/MANIFEST.MF new file mode 100644 index 0000000..c212f64 --- /dev/null +++ b/org.tizen.codecoverage/META-INF/MANIFEST.MF @@ -0,0 +1,21 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Tizen Gcov +Bundle-SymbolicName: org.tizen.codecoverage;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Activator: org.tizen.codecoverage.Activator +Bundle-Vendor: Samsung +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.core.resources, + org.eclipse.cdt.core, + org.eclipse.cdt.debug.core, + org.eclipse.debug.core, + org.eclipse.linuxtools.gcov, + org.tizen.common +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Bundle-ActivationPolicy: lazy +Import-Package: org.tizen.common.connection, + org.tizen.nativeapp.editors.manifest, + org.eclipse.cdt.managedbuilder.core +Export-Package: org.tizen.codecoverage.helper diff --git a/org.tizen.codecoverage/NOTICE b/org.tizen.codecoverage/NOTICE new file mode 100644 index 0000000..87d9729 --- /dev/null +++ b/org.tizen.codecoverage/NOTICE @@ -0,0 +1,2 @@ +Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + diff --git a/org.tizen.codecoverage/build.properties b/org.tizen.codecoverage/build.properties new file mode 100644 index 0000000..6c480f3 --- /dev/null +++ b/org.tizen.codecoverage/build.properties @@ -0,0 +1,6 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + icons/ diff --git a/org.tizen.codecoverage/icons/toolbar_icon.gif b/org.tizen.codecoverage/icons/toolbar_icon.gif new file mode 100644 index 0000000..62a7d86 Binary files /dev/null and b/org.tizen.codecoverage/icons/toolbar_icon.gif differ diff --git a/org.tizen.codecoverage/plugin.xml b/org.tizen.codecoverage/plugin.xml new file mode 100644 index 0000000..475aa6d --- /dev/null +++ b/org.tizen.codecoverage/plugin.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + diff --git a/org.tizen.codecoverage/src/org/tizen/codecoverage/Activator.java b/org.tizen.codecoverage/src/org/tizen/codecoverage/Activator.java new file mode 100644 index 0000000..d0eb6c8 --- /dev/null +++ b/org.tizen.codecoverage/src/org/tizen/codecoverage/Activator.java @@ -0,0 +1,70 @@ +/* + * Code Coverage + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * JeongHwan kim + * JuYoung Kim + * + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * - S-Core Co., Ltd + * + */ + + +package org.tizen.codecoverage; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "com.score.gcov"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/org.tizen.codecoverage/src/org/tizen/codecoverage/actions/GcovAction.java b/org.tizen.codecoverage/src/org/tizen/codecoverage/actions/GcovAction.java new file mode 100644 index 0000000..8e9d02e --- /dev/null +++ b/org.tizen.codecoverage/src/org/tizen/codecoverage/actions/GcovAction.java @@ -0,0 +1,114 @@ +/* + * Code Coverage + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * JeongHwan kim + * JuYoung Kim + * + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * - S-Core Co., Ltd + * + */ + + +package org.tizen.codecoverage.actions; + +import org.eclipse.cdt.core.model.ICElement; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.TreeSelection; +import org.eclipse.linuxtools.gcov.view.CovView; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.IWorkbenchWindowActionDelegate; +import org.eclipse.ui.PlatformUI; +import org.tizen.codecoverage.helper.GcovHelper; + + +/** + * Our sample action implements workbench action delegate. The action proxy will + * be created by the workbench and shown in the UI. When the user tries to use + * the action, this delegate will be created and execution will be delegated to + * it. + * + * @see IWorkbenchWindowActionDelegate + */ +public class GcovAction implements IWorkbenchWindowActionDelegate { + // private IWorkbenchWindow window; + + private IProject project; + /** + * The constructor. + */ + public GcovAction() { + project = null; + } + + /** + * The action has been activated. The argument of the method represents the + * 'real' action sitting in the workbench UI. + * + * @see IWorkbenchWindowActionDelegate#run + */ + public void run(IAction action) { + GcovHelper.run(project); + } + + /** + * Selection in the workbench has been changed. We can change the state of + * the 'real' action here if we want, but this can only happen after the + * delegate has been created. + * + * @see IWorkbenchWindowActionDelegate#selectionChanged + */ + public void selectionChanged(IAction action, ISelection selection) { + Object obj = null; + + if (selection instanceof TreeSelection) { + TreeSelection _selection = (TreeSelection) selection; + + if (_selection != null) { + obj = _selection.getFirstElement(); + } + } + + if (obj != null) { + if (obj instanceof IResource) { + project = ((IResource) obj).getProject(); + } else if (obj instanceof ICElement) { + IResource resource = ((ICElement) obj).getResource(); + project = ((IResource) resource).getProject(); + } else { +// System.out.println(obj.getClass()); + } + } + } + + /** + * We can use this method to dispose of any system resources we previously + * allocated. + * + * @see IWorkbenchWindowActionDelegate#dispose + */ + public void dispose() { + } + + /** + * We will cache window object in order to be able to provide parent shell + * for the message dialog. + * + * @see IWorkbenchWindowActionDelegate#init + */ + public void init(IWorkbenchWindow window) { + } +} diff --git a/org.tizen.codecoverage/src/org/tizen/codecoverage/helper/GcovHelper.java b/org.tizen.codecoverage/src/org/tizen/codecoverage/helper/GcovHelper.java new file mode 100644 index 0000000..14c2f80 --- /dev/null +++ b/org.tizen.codecoverage/src/org/tizen/codecoverage/helper/GcovHelper.java @@ -0,0 +1,181 @@ +/* + * Code Coverage + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * JeongHwan kim + * JuYoung Kim + * + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * - S-Core Co., Ltd + * + */ + + +package org.tizen.codecoverage.helper; + +import java.util.List; + +import org.eclipse.cdt.core.model.CModelException; +import org.eclipse.cdt.core.model.CoreModel; +import org.eclipse.cdt.core.model.IBinary; +import org.eclipse.cdt.core.model.ICProject; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.linuxtools.gcov.parser.CovManager; +import org.eclipse.linuxtools.gcov.view.CovView; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.PlatformUI; + +import org.tizen.common.connection.ConnectionPlugin; +import org.tizen.nativeapp.editors.manifest.PackageModel; +import org.tizen.sdblib.IDevice; +import org.tizen.sdblib.SyncService; +import org.tizen.sdblib.SyncService.SyncResult; + +public class GcovHelper { + final static String DATA_DIR = "/data/"; + + static public void run(IProject project) { + // null check project + if (project == null || !project.exists()) { + final String message = "Please select a project."; + Shell s = PlatformUI.getWorkbench().getDisplay().getActiveShell(); + MessageDialog.openInformation(s, "Project not found", message); + return; + } + + IDevice currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); + if (currentDevice == null) { +// final String message = "Target device is not running"; +// Shell s = PlatformUI.getWorkbench().getDisplay().getActiveShell(); +// MessageDialog.openError(s, "Gcov Error", message); + return; + } + + String binary = GcovHelper.getBinary(project); + if (binary == null) { + final String message = "Gcov failed. Binary file not found.\n" + + "Please check Build Settings"; + Shell s = PlatformUI.getWorkbench().getDisplay().getActiveShell(); + MessageDialog.openError(s, "Gcov Error", message); + return; + } + + try { + GcovHelper.downloadGcdaFile(binary); + } catch (Exception e) { + final String message = "Gcov failed. Coverage data file not found."; + Shell s = PlatformUI.getWorkbench().getDisplay().getActiveShell(); + MessageDialog.openError(s, "Gcov Error", message); + return; + } + CovView.displayCovResults(binary); + } + + // FIXME searching a selected binary is not complete + // This part is affected IDE launch part + // TODO Fix this method + public static String getBinary(IProject project) { + String binary = null; + ICProject cproject = CoreModel.getDefault().create(project); + if (cproject == null) { + return binary; + } + IBinary[] bins = null; + try { + bins = cproject.getBinaryContainer().getBinaries(); + } catch (CModelException e) { + e.printStackTrace(); + } + + IDevice currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); + if (currentDevice.isEmulator()) { + System.out.println("Emulator"); + for (int i = 0; i < bins.length; i++) { + IResource r = bins[i].getResource(); + if (bins[i].getPath().toOSString().contains("Emulator") && + bins[i].getPath().lastSegment().equals(r.getProject().getName())) { + binary = r.getLocation().toOSString(); + return binary; + } + } + } else { + System.out.println("Real Device"); + for (int i = 0; i < bins.length; i++) { + IResource r = bins[i].getResource(); + if (bins[i].getPath().toOSString().contains("Device") && + bins[i].getPath().lastSegment().equals(r.getProject().getName())) { + binary = r.getLocation().toOSString(); + return binary; + } + } + } + return binary; + } + + static IProject getProject(IPath file) { + IFile c = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(file); + return c.getProject(); + } + + public static void downloadGcdaFile(String binaryPath) throws Exception { + CovManager cvrgeMnger = null; + List gcdaPaths = null; + cvrgeMnger = new CovManager(binaryPath); + try { + gcdaPaths = cvrgeMnger.getGCDALocations(); + } catch (Exception e) { + final String message = "Gcov failed. Binary not found."; + Shell s = PlatformUI.getWorkbench().getDisplay().getActiveShell(); + MessageDialog.openError(s, "Gcov Error", message); + return; + } + // download gcda file + IPath file = new Path(binaryPath); + IProject project = getProject(file); + String targetPath = getGcdaPath(project); + + @SuppressWarnings("restriction") + IDevice currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); + @SuppressWarnings("restriction") + SyncService syncService = currentDevice.getSyncService(); + + for (String gcdaPath: gcdaPaths) { + int start = gcdaPath.lastIndexOf('/') + 1; + int end = gcdaPath.length(); + String gcdaFile = gcdaPath.substring(start, end); + String srcFile = targetPath + gcdaFile; + String dstFile = gcdaPath; + @SuppressWarnings("restriction") + SyncResult syncSuccess = syncService.pullFile(srcFile, dstFile, SyncService.getNullProgressMonitor()); + if (syncSuccess.getCode() != SyncService.RESULT_OK) { + Exception e = new Exception(); + throw e; + } + } + } + + static public String getGcdaPath(IProject project) { + String installPath = getPackageInstallPath(project); + String gcdaPath = installPath + DATA_DIR; + return gcdaPath; + } + + static String getPackageInstallPath(IProject project) { + PackageModel packageModel = PackageModel.newInstance(project); + String installPath = packageModel.getAppInstallPath(); + return installPath; + } +} -- cgit v1.2.3