org.tizen.nativecpp_2.0.0.201310232125

16:50:23.721 INFO  jd.cli.Main - Decompiling org.tizen.nativecpp_2.0.0.201310232125.jar
package org.tizen.nativecpp;

import freemarker.template.Configuration;
import freemarker.template.DefaultObjectWrapper;
import java.io.File;
import java.net.URL;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.tizen.nativecommon.build.ProjectTypeManager;
import org.tizen.nativecpp.build.NativeProjectDependentBuilder;
import org.tizen.nativecpp.build.NativeProjectDependentPackager;

public class Activator
  extends AbstractUIPlugin
{
  public static final String PLUGIN_ID = "org.tizen.nativecpp";
  public static final String CDT_PLUGIN_ID = "org.eclipse.cdt.ui";
  public static final String TEMPLATE_PLUGIN_ID = "org.tizen.nativecpp.template";
  private static Activator plugin;
  public static final String IMG_FORM_BG = "formBg";
  public static final String IMG_HORIZONTAL = "horizontal";
  public static final String IMG_LARGE = "large";
  public static final String IMG_RUN = "run";
  public static final String IMG_DEBUG = "debug";
  public static final String IMG_HELP = "help";
  public static final String IMG_REFRESH = "refresh";
  public static final String IMG_ICON_APP = "icon_app";
  public static final String PREFIXREPLACER_EDITOR_ID = "org.tizen.nativecpp.contentassist.SLPCEditor";
  public static Configuration templateCfg;
  
  public Activator()
  {
    plugin = this;
  }
  
  public void start(BundleContext context)
    throws Exception
  {
    super.start(context);
    
    plugin = this;
    activateFileListener();
    
    registerProjectType("org.tizen.nativecpp.buildArtefactType.app");
    registerProjectType("org.tizen.nativecpp.buildArtefactType.sharedLib");
    registerProjectType("org.tizen.nativecpp.buildArtefactType.staticLib");
    
    templateCfg = new Configuration();
    URL templateURL = FileLocator.toFileURL(Platform.getBundle("org.tizen.nativecpp").getEntry("templates"));
    templateCfg.setDirectoryForTemplateLoading(new File(templateURL.toURI()));
    templateCfg.setObjectWrapper(new DefaultObjectWrapper());
  }
  
  public void stop(BundleContext context)
    throws Exception
  {
    plugin = null;
    
    super.stop(context);
  }
  
  public static Activator getDefault()
  {
    return plugin;
  }
  
  protected void initializeImageRegistry(ImageRegistry registry)
  {
    registerImage(registry, "horizontal", "th_horizontal.gif");
    registerImage(registry, "formBg", "form_banner.gif");
    registerImage(registry, "large", "large_image.gif");
    registerImage(registry, "run", "./editors/run.gif");
    registerImage(registry, "debug", "./editors/debug.gif");
    registerImage(registry, "help", "./editors/help.gif");
    registerImage(registry, "refresh", "./editors/refresh.gif");
    registerImage(registry, "icon_app", "icon_application.png");
  }
  
  private void registerImage(ImageRegistry registry, String key, String fileName)
  {
    try
    {
      IPath path = new Path("icons/" + fileName);
      URL url = FileLocator.find(Platform.getBundle("org.tizen.nativecpp"), path, null);
      if (url != null)
      {
        ImageDescriptor desc = ImageDescriptor.createFromURL(url);
        registry.put(key, desc);
      }
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
  }
  
  public Image getImage(String key)
  {
    return getImageRegistry().get(key);
  }
  
  public ImageDescriptor getImageDescriptor(String key)
  {
    return getImageRegistry().getDescriptor(key);
  }
  
  public static String getID()
  {
    return "org.tizen.nativecpp";
  }
  
  public static ImageDescriptor getImageDescriptorFromPlugin(String path)
  {
    return imageDescriptorFromPlugin("org.tizen.nativecpp", path);
  }
  
  public void activateAutoRefereshProvider(IResource resource) {}
  
  public void activateFileListener() {}
  
  private void registerProjectType(String projectType)
  {
    ProjectTypeManager.registerProjectArtifactType(projectType, 
      NativeProjectDependentBuilder.getInstance(), NativeProjectDependentPackager.getInstance(), true);
  }
  
  protected void initializeDefaultPreferences(IPreferenceStore store)
  {
    store.setDefault("updateCheckWhenStartup", true);
  }
  
  public IPreferenceStore getPrefStore()
  {
    return getPreferenceStore();
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.Activator
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp;

import org.eclipse.core.runtime.CoreException;
import org.tizen.nativecommon.launch.LaunchInfo;
import org.tizen.nativecommon.launch.LaunchListener;
import org.tizen.nativecpp.build.NativeProjectDependentPackager;

class StartUp$1
  implements LaunchListener
{
  StartUp$1(StartUp paramStartUp) {}
  
  public void preLaunched(LaunchInfo info)
    throws CoreException
  {
    NativeProjectDependentPackager.validateSettingFile(info.getProject());
  }
  
  public void postLaunched(LaunchInfo info)
    throws CoreException
  {}
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.StartUp.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.ui.IStartup;
import org.tizen.nativecommon.launch.AbstractTizenCLaunchDelegate;
import org.tizen.nativecommon.launch.LaunchInfo;
import org.tizen.nativecommon.launch.LaunchListener;
import org.tizen.nativecpp.build.NativeProjectDependentPackager;

public class StartUp
  implements IStartup
{
  public void earlyStartup()
  {
    AbstractTizenCLaunchDelegate.addListener(new LaunchListener()
    {
      public void preLaunched(LaunchInfo info)
        throws CoreException
      {
        NativeProjectDependentPackager.validateSettingFile(info.getProject());
      }
      
      public void postLaunched(LaunchInfo info)
        throws CoreException
      {}
    });
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.StartUp
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp;

import org.tizen.common.TizenPlatformConstants;

public class TizenOSPConstants
{
  public static final String DEBUG_DEFINE_OPTION = "_DEBUG";
  public static final String OSP_LINK_OPTION = "-lpthread ";
  public static final String OSP_APP_LINK_OPTION = "-pie -lpthread ";
  public static final String OSP_SHARED_LIB_LINK_OPTION = "-lpthread ";
  public static final String OSP_COMPILE_OPTION = " -fPIE";
  public static final String OSP_LIB_COMPILE_OPTION = " -fPIC";
  public static final String OSP_FRAMEWORK = "osp";
  public static final String PACKAGE_TYPE = "tpk";
  public static final String EXECUTABLE_EXT = ".exe";
  public static final String OSP_INSTALLER_CMD = "/usr/etc/package-manager/backend/oap -i %s";
  @Deprecated
  public static final String RPM_UNINSTALLER_CMD = "/bin/rpm -f -e %s";
  public static final String LAUNCH_CMD = TizenPlatformConstants.LAUNCH_CMD;
  
  public static String getOSPName(String packageName, String exeName)
  {
    return packageName + "." + exeName;
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.TizenOSPConstants
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.build;

import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Collections;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.tizen.common.TizenPlatformConstants;
import org.tizen.common.core.command.CommandCancelException;
import org.tizen.nativecommon.build.CommonBuildMessages;
import org.tizen.nativecommon.build.CommonConfigurationManager;
import org.tizen.nativecommon.build.CommonProjectDependentPackager;
import org.tizen.nativecommon.build.PlatformChangingManager;
import org.tizen.nativecommon.build.ProjectTypeManager;
import org.tizen.nativecommon.build.exception.SBIException;

class BuildPackageObjectAction$1
  implements IRunnableWithProgress
{
  BuildPackageObjectAction$1(BuildPackageObjectAction paramBuildPackageObjectAction) {}
  
  public void run(IProgressMonitor monitor)
    throws InvocationTargetException, InterruptedException
  {
    BuildPackageObjectAction.access$0(this$0, null);
    
    CommonProjectDependentPackager packager = 
      ProjectTypeManager.getProjectPackagerInstance(this$0.project);
    NativeCheckCancelJob cancelJob = new NativeCheckCancelJob(monitor, this$0.project, 
      packager.getSbi());
    try
    {
      ArrayList<IProject> refPrjs = new ArrayList();
      
      BuildPackageObjectAction.access$1(this$0, refPrjs, this$0.project);
      
      int refPrjsCount = refPrjs.size();
      int totalWorkCount = refPrjsCount + 2;
      monitor.beginTask(CommonBuildMessages.PACKAGING_APPLICATION, totalWorkCount);
      
      int count = 1;
      Collections.reverse(refPrjs);
      for (IProject refPrj : refPrjs)
      {
        if (!CommonConfigurationManager.equalsArch(this$0.project, refPrj)) {
          PlatformChangingManager.changeOnlyArch(this$0.project, refPrj);
        }
        monitor.subTask(String.format("Building referenced project [%s]...", new Object[] {
          refPrj.getName() }));
        refPrj.build(10, null);
        monitor.worked(count);
        count++;
      }
      monitor.subTask(String.format("Building project [%s]...", new Object[] { this$0.project.getName() }));
      this$0.project.build(10, null);
      monitor.worked(count++);
      
      monitor.subTask(String.format("Packaging project [%s]...", new Object[] {
        this$0.project.getName() }));
      if ((packager instanceof NativeProjectDependentPackager)) {
        ((NativeProjectDependentPackager)packager).doMultiAppPreProcess(monitor);
      }
      Thread checkCancelThread = new Thread(cancelJob);
      checkCancelThread.start();
      
      packager.buildPackage(BuildPackageObjectAction.access$2(this$0), 
        TizenPlatformConstants.SIGNING_BUILD_PACKAGE, false);
      monitor.worked(count);
    }
    catch (SBIException e)
    {
      e.printStackTrace();
      BuildPackageObjectAction.access$0(this$0, new Status(4, "org.tizen.nativecpp", 
        CommonBuildMessages.FAIL_TO_BUILD_PACKAGE));
      cancelJob.setFinishFlag(true);
      monitor.done();
      return;
    }
    catch (CoreException e)
    {
      if (e.getStatus().getSeverity() == 8) {
        BuildPackageObjectAction.access$0(this$0, e.getStatus());
      } else {
        BuildPackageObjectAction.access$0(this$0, new Status(4, "org.tizen.nativecpp", e.getMessage()));
      }
      cancelJob.setFinishFlag(true);
      monitor.done();
      return;
    }
    catch (OperationCanceledException localOperationCanceledException)
    {
      cancelJob.setFinishFlag(true);
      return;
    }
    catch (CommandCancelException localCommandCancelException)
    {
      cancelJob.setFinishFlag(true);
      return;
    }
    if (packager.checkPackageFile(BuildPackageObjectAction.access$2(this$0))) {
      BuildPackageObjectAction.access$0(this$0, new Status(0, "org.tizen.nativecpp", 
        CommonBuildMessages.SUCCESS_TO_BUILD_PACKAGE));
    } else {
      BuildPackageObjectAction.access$0(this$0, new Status(4, "org.tizen.nativecpp", 
        CommonBuildMessages.FAIL_TO_BUILD_PACKAGE));
    }
    cancelJob.setFinishFlag(true);
    monitor.done();
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.build.BuildPackageObjectAction.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.build;

import java.io.File;
import java.io.FilenameFilter;

public class BuildPackageObjectAction$ExtFilter
  implements FilenameFilter
{
  protected String ext;
  
  public BuildPackageObjectAction$ExtFilter(BuildPackageObjectAction paramBuildPackageObjectAction, String ext)
  {
    this.ext = ext;
  }
  
  public boolean accept(File dir, String name)
  {
    return name.endsWith(ext);
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.build.BuildPackageObjectAction.ExtFilter
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.build;

import java.io.File;
import java.io.FilenameFilter;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Collections;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.ui.IObjectActionDelegate;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
import org.eclipse.ui.PlatformUI;
import org.tizen.common.TizenPlatformConstants;
import org.tizen.common.core.command.CommandCancelException;
import org.tizen.nativecommon.build.CommonBuildMessages;
import org.tizen.nativecommon.build.CommonBuildPackageFile;
import org.tizen.nativecommon.build.CommonConfigurationManager;
import org.tizen.nativecommon.build.CommonProjectDependentPackager;
import org.tizen.nativecommon.build.PlatformChangingManager;
import org.tizen.nativecommon.build.ProjectTypeManager;
import org.tizen.nativecommon.build.exception.SBIException;

public class BuildPackageObjectAction
  implements IWorkbenchWindowActionDelegate, IObjectActionDelegate
{
  protected IProject project;
  protected IWorkbenchWindow window;
  private IStatus status = null;
  private String pkgType;
  
  public BuildPackageObjectAction() {}
  
  public BuildPackageObjectAction(IProject project)
  {
    this.project = project;
  }
  
  private void getReferencedPrjs(ArrayList<IProject> refPrjs, IProject project)
  {
    try
    {
      IProject[] arrayOfIProject;
      int j = (arrayOfIProject = project.getReferencedProjects()).length;
      for (int i = 0; i < j; i++)
      {
        IProject p = arrayOfIProject[i];
        if (refPrjs.contains(p)) {
          refPrjs.remove(p);
        }
        refPrjs.add(p);
        getReferencedPrjs(refPrjs, p);
      }
    }
    catch (CoreException e)
    {
      e.printStackTrace();
    }
  }
  
  public void run(IAction action)
  {
    pkgType = action.getText();
    CommonBuildPackageFile.setPackageType(project, pkgType);
    window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    ProgressMonitorDialog dialog = new ProgressMonitorDialog(window.getShell());
    try
    {
      dialog.run(true, true, new IRunnableWithProgress()
      {
        public void run(IProgressMonitor monitor)
          throws InvocationTargetException, InterruptedException
        {
          status = null;
          
          CommonProjectDependentPackager packager = 
            ProjectTypeManager.getProjectPackagerInstance(project);
          NativeCheckCancelJob cancelJob = new NativeCheckCancelJob(monitor, project, 
            packager.getSbi());
          try
          {
            ArrayList<IProject> refPrjs = new ArrayList();
            
            BuildPackageObjectAction.this.getReferencedPrjs(refPrjs, project);
            
            int refPrjsCount = refPrjs.size();
            int totalWorkCount = refPrjsCount + 2;
            monitor.beginTask(CommonBuildMessages.PACKAGING_APPLICATION, totalWorkCount);
            
            int count = 1;
            Collections.reverse(refPrjs);
            for (IProject refPrj : refPrjs)
            {
              if (!CommonConfigurationManager.equalsArch(project, refPrj)) {
                PlatformChangingManager.changeOnlyArch(project, refPrj);
              }
              monitor.subTask(String.format("Building referenced project [%s]...", new Object[] {
                refPrj.getName() }));
              refPrj.build(10, null);
              monitor.worked(count);
              count++;
            }
            monitor.subTask(String.format("Building project [%s]...", new Object[] { project.getName() }));
            project.build(10, null);
            monitor.worked(count++);
            
            monitor.subTask(String.format("Packaging project [%s]...", new Object[] {
              project.getName() }));
            if ((packager instanceof NativeProjectDependentPackager)) {
              ((NativeProjectDependentPackager)packager).doMultiAppPreProcess(monitor);
            }
            Thread checkCancelThread = new Thread(cancelJob);
            checkCancelThread.start();
            
            packager.buildPackage(pkgType, 
              TizenPlatformConstants.SIGNING_BUILD_PACKAGE, false);
            monitor.worked(count);
          }
          catch (SBIException e)
          {
            e.printStackTrace();
            status = new Status(4, "org.tizen.nativecpp", 
              CommonBuildMessages.FAIL_TO_BUILD_PACKAGE);
            cancelJob.setFinishFlag(true);
            monitor.done();
            return;
          }
          catch (CoreException e)
          {
            if (e.getStatus().getSeverity() == 8) {
              status = e.getStatus();
            } else {
              status = new Status(4, "org.tizen.nativecpp", e.getMessage());
            }
            cancelJob.setFinishFlag(true);
            monitor.done();
            return;
          }
          catch (OperationCanceledException localOperationCanceledException)
          {
            cancelJob.setFinishFlag(true);
            return;
          }
          catch (CommandCancelException localCommandCancelException)
          {
            cancelJob.setFinishFlag(true);
            return;
          }
          if (packager.checkPackageFile(pkgType)) {
            status = new Status(0, "org.tizen.nativecpp", 
              CommonBuildMessages.SUCCESS_TO_BUILD_PACKAGE);
          } else {
            status = new Status(4, "org.tizen.nativecpp", 
              CommonBuildMessages.FAIL_TO_BUILD_PACKAGE);
          }
          cancelJob.setFinishFlag(true);
          monitor.done();
        }
      });
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
    if (status != null) {
      if (status.isOK()) {
        MessageDialog.openInformation(window.getShell(), CommonBuildMessages.BUILD_RESULT, 
          status.getMessage());
      } else if (status.getSeverity() != 8) {
        MessageDialog.openError(window.getShell(), CommonBuildMessages.BUILD_RESULT, 
          status.getMessage());
      }
    }
    try
    {
      project.refreshLocal(2, null);
    }
    catch (CoreException e)
    {
      e.printStackTrace();
    }
  }
  
  protected File findFirstFilebyExtension(File searchPath, String ext)
  {
    File[] allFiles = searchPath.listFiles(new ExtFilter(ext));
    if ((allFiles == null) || (allFiles.length == 0)) {
      return null;
    }
    return allFiles[0];
  }
  
  protected class ExtFilter
    implements FilenameFilter
  {
    protected String ext;
    
    public ExtFilter(String ext)
    {
      this.ext = ext;
    }
    
    public boolean accept(File dir, String name)
    {
      return name.endsWith(ext);
    }
  }
  
  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) && 
      ((obj instanceof IProject))) {
      project = ((IProject)obj);
    }
  }
  
  public void setActivePart(IAction action, IWorkbenchPart targetPart) {}
  
  public void dispose() {}
  
  public void init(IWorkbenchWindow window) {}
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.build.BuildPackageObjectAction
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.build;

import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.tizen.nativecommon.build.SmartBuildInterface;
import org.tizen.nativecommon.build.exception.SBIException;
import org.tizen.nativecommon.build.model.Rootstrap;
import org.tizen.nativecommon.build.model.SBIModel;
import org.tizen.nativecommon.build.model.Target;
import org.tizen.nativecpp.build.model.DevPackage;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

public class DevPackageManager
{
  private static final String ATTR_BASEID = "base_id";
  private static final String ATTR_PATH = "path";
  private static final String ATTR_NAME = "name";
  private static final String ATTR_ISFRAMEWORK = "is_framework";
  private static final String ATTR_ISVIRTUAL = "is_virtual";
  private static final String ELEMENT_DEVPKG = "DevPackage";
  private static final String ELEMENT_INCPATH = "include_path";
  private static final String ELEMENT_INCFILE = "include_file";
  private static final String ELEMENT_LIB = "library";
  private static final String ELEMENT_LIB_PATH = "library_path";
  private static final String ELEMENT_RESOURCE = "resource";
  private static final String ELEMENT_DEP = "dependency";
  private static final String ELEMENT_INCPKG = "include_package";
  private static final String ELEMENT_DESC = "description";
  private static final String ELEMENT_CFLAG = "other_cflag";
  private static final String ELEMENT_LFLAG = "other_lflag";
  private static HashMap<String, List<DevPackage>> devListMap = new HashMap();
  
  public static List<DevPackage> generateDevPackageList(String path)
  {
    Document doc = readDoc(path);
    if (doc != null) {
      return generateDevPackageList(doc);
    }
    return null;
  }
  
  private static Document readDoc(String path)
  {
    Document doc = null;
    try
    {
      if ((System.getProperty("os.name").startsWith("Windows")) && 
        (path.charAt(0) == '/') && (path.charAt(2) == '/'))
      {
        char drive = path.charAt(1);
        if (((drive >= 'a') && (drive <= 'z')) || ((drive >= 'A') && (drive <= 'Z')))
        {
          String _path = drive + ":";
          _path = _path.concat(path.substring(2));
          path = _path;
        }
      }
      File file = new File(path);
      if (!file.exists()) {
        return null;
      }
      doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(file);
    }
    catch (ParserConfigurationException e)
    {
      System.out.println("ParserConfigurationException : \n" + e);
    }
    catch (SAXException e)
    {
      System.out.println("SAXException : \n" + e);
    }
    catch (IOException e)
    {
      e.printStackTrace();
    }
    return doc;
  }
  
  private static void addExtDevPackageList(List<DevPackage> list, String baseId, String platformVerPath)
  {
    String extDevPackageDir = platformVerPath + File.separatorChar + "info";
    File dir = new File(extDevPackageDir);
    if (!dir.isDirectory()) {
      return;
    }
    String[] extList = dir.list();
    for (int i = 0; i < extList.length; i++) {
      if (extList[i].endsWith(".xml"))
      {
        Document doc = readDoc(extDevPackageDir + "/" + extList[i]);
        if ((doc != null) && (doc.getDocumentElement().getAttribute("base_id").equals(baseId)))
        {
          String path = doc.getDocumentElement().getAttribute("path");
          NodeList pList = doc.getElementsByTagName("DevPackage");
          for (int j = 0; j < pList.getLength(); j++) {
            list.add(generateExtDevPackage(pList.item(j), path));
          }
        }
      }
    }
  }
  
  private static DevPackage generateExtDevPackage(Node node, String path)
  {
    NamedNodeMap attributeMap = node.getAttributes();
    
    String name = attributeMap.getNamedItem("name").getNodeValue();
    boolean isFramework = attributeMap.getNamedItem("is_framework").getNodeValue()
      .equals("true");
    boolean isVirtual = attributeMap.getNamedItem("is_virtual").getNodeValue().equals("true");
    
    DevPackage newPackage = new DevPackage(name, isFramework, isVirtual);
    for (Node subNode = node.getFirstChild(); subNode != null; subNode = subNode
          .getNextSibling())
    {
      String value = null;
      if (subNode.getFirstChild() != null)
      {
        value = subNode.getFirstChild().getNodeValue();
        if (subNode.getNodeName().equals("include_path"))
        {
          if (value.startsWith("/")) {
            newPackage.addIncludePath("/../" + path + value);
          } else {
            newPackage.addIncludePath("/../" + value);
          }
        }
        else if (subNode.getNodeName().equals("include_file"))
        {
          if (value.startsWith("/")) {
            newPackage.addIncludeFile("/../" + path + value);
          } else {
            newPackage.addIncludeFile("/../" + value);
          }
        }
        else if (subNode.getNodeName().equals("library_path"))
        {
          if (value.startsWith("/")) {
            newPackage.addLibraryPath("/../" + path + value);
          } else {
            newPackage.addLibraryPath("/../" + value);
          }
        }
        else if (subNode.getNodeName().equals("library"))
        {
          if (value.indexOf('/') == -1)
          {
            newPackage.addLibrary(value);
          }
          else
          {
            int sep = value.lastIndexOf('/');
            String dirName = value.substring(0, sep);
            String baseName = value.substring(sep + 1);
            String libFile;
            String libFile;
            if (value.startsWith("/"))
            {
              newPackage.addLibraryPath("/../" + path + dirName);
              libFile = "/../" + path + value;
            }
            else
            {
              newPackage.addLibraryPath("/../" + dirName);
              libFile = "/../" + value;
            }
            if ((libFile.endsWith(".so")) || (libFile.endsWith(".a"))) {
              newPackage.addLibrary(baseName);
            }
            if ((libFile.endsWith(".so")) || (libFile.indexOf(".so.") != -1)) {
              newPackage.addExtendedSharedLibraryFile(libFile);
            }
          }
        }
        else if (subNode.getNodeName().equals("resource"))
        {
          if (value.startsWith("/")) {
            newPackage.addResourceFile("/../" + path + value);
          } else {
            newPackage.addResourceFile("/../" + value);
          }
        }
        else if (subNode.getNodeName().equals("dependency")) {
          newPackage.addDepenencyr(value);
        } else if (subNode.getNodeName().equals("include_package")) {
          newPackage.addIncludePackage(value);
        } else if (subNode.getNodeName().equals("description")) {
          newPackage.addDescription(value);
        } else if (subNode.getNodeName().equals("other_cflag")) {
          newPackage.addOtherCFlag(value);
        } else if (subNode.getNodeName().equals("other_lflag")) {
          newPackage.addOtherLFlag(value);
        }
      }
    }
    return newPackage;
  }
  
  private static List<DevPackage> generateDevPackageList(Document doc)
  {
    List<DevPackage> result = new ArrayList();
    
    NodeList list = doc.getElementsByTagName("DevPackage");
    for (int i = 0; i < list.getLength(); i++) {
      result.add(generateDevPackage(list.item(i)));
    }
    return result;
  }
  
  private static DevPackage generateDevPackage(Node node)
  {
    NamedNodeMap attributeMap = node.getAttributes();
    
    String name = attributeMap.getNamedItem("name").getNodeValue();
    boolean isFramework = attributeMap.getNamedItem("is_framework").getNodeValue()
      .equals("true");
    boolean isVirtual = attributeMap.getNamedItem("is_virtual").getNodeValue().equals("true");
    
    DevPackage newPackage = new DevPackage(name, isFramework, isVirtual);
    for (Node subNode = node.getFirstChild(); subNode != null; subNode = subNode
          .getNextSibling())
    {
      String value = null;
      if (subNode.getFirstChild() != null)
      {
        value = subNode.getFirstChild().getNodeValue();
        if (subNode.getNodeName().equals("include_path")) {
          newPackage.addIncludePath(value);
        } else if (subNode.getNodeName().equals("include_file")) {
          newPackage.addIncludeFile(value);
        } else if (subNode.getNodeName().equals("library_path")) {
          newPackage.addLibraryPath(value);
        } else if (subNode.getNodeName().equals("library")) {
          newPackage.addLibrary(value);
        } else if (subNode.getNodeName().equals("dependency")) {
          newPackage.addDepenencyr(value);
        } else if (subNode.getNodeName().equals("include_package")) {
          newPackage.addIncludePackage(value);
        } else if (subNode.getNodeName().equals("description")) {
          newPackage.addDescription(value);
        } else if (subNode.getNodeName().equals("other_cflag")) {
          newPackage.addOtherCFlag(value);
        } else if (subNode.getNodeName().equals("other_lflag")) {
          newPackage.addOtherLFlag(value);
        }
      }
    }
    return newPackage;
  }
  
  public static List<DevPackage> getAllDevPkgs(String targetID)
  {
    SmartBuildInterface sbi = SmartBuildInterface.getInstance();
    List<DevPackage> packageList = null;
    String rootstrapID = sbi.getRootstrapIDFromTargetID(targetID);
    if (devListMap.containsKey(rootstrapID))
    {
      packageList = (List)devListMap.get(rootstrapID);
    }
    else
    {
      packageList = getAllDevPkgsInternal(targetID);
      if (packageList != null) {
        devListMap.put(rootstrapID, packageList);
      }
    }
    if (packageList == null) {
      return new ArrayList();
    }
    return packageList;
  }
  
  public static List<String> getAllDevPkgName(String targetID)
  {
    List<String> pkgNameList = new ArrayList();
    List<DevPackage> pkgList = getAllDevPkgs(targetID);
    for (DevPackage pkg : pkgList) {
      pkgNameList.add(pkg.getName());
    }
    return pkgNameList;
  }
  
  private static List<DevPackage> getAllDevPkgsInternal(String targetID)
  {
    SmartBuildInterface sbi = SmartBuildInterface.getInstance();
    List<DevPackage> pkgList = null;
    try
    {
      if (sbi.checkTargetID(targetID))
      {
        Target t = SBIModel.getTargetById(targetID);
        Rootstrap r = t.getRootstrap();
        String path = r.getPropertyValue("DEV_PACKAGE_CONFIG_PATH");
        pkgList = generateDevPackageList(path);
        String rootstrapId = r.getId();
        String platformVerPath = getPlatformVerPath(r);
        if ((platformVerPath == null) || (platformVerPath.isEmpty())) {
          return pkgList;
        }
        addExtDevPackageList(pkgList, rootstrapId, platformVerPath);
      }
    }
    catch (SBIException e)
    {
      e.printStackTrace();
      e.showErrorDialog();
    }
    return pkgList;
  }
  
  private static String getPlatformVerPath(Rootstrap rootstrap)
  {
    SmartBuildInterface sbi = SmartBuildInterface.getInstance();
    IPath platformBasePath = new Path(sbi.getPlatformBasePath());
    IPath rootstrapPath = rootstrap.getPath();
    String platformVerPath = "";
    
    int matchingIndex = rootstrapPath.matchingFirstSegments(platformBasePath);
    IPath versionPath = rootstrapPath.removeFirstSegments(matchingIndex);
    if ((versionPath != null) && (!versionPath.isEmpty()))
    {
      String platformVer = versionPath.segment(0);
      platformVerPath = platformBasePath.append(platformVer).append("rootstraps")
        .toOSString();
    }
    return platformVerPath;
  }
  
  public static List<String> getIncludePathList(String targetID, String pkgName)
  {
    DevPackage pkg = findPackage(targetID, pkgName);
    if (pkg != null) {
      return pkg.getIncludePathList();
    }
    return new ArrayList();
  }
  
  public static List<String> getLibraryPathList(String targetID, String pkgName)
  {
    DevPackage pkg = findPackage(targetID, pkgName);
    if (pkg != null) {
      return pkg.getLibraryPathList();
    }
    return new ArrayList();
  }
  
  public static List<String> getLibraryList(String targetID, String pkgName)
  {
    DevPackage pkg = findPackage(targetID, pkgName);
    if (pkg != null) {
      return pkg.getLibraryList();
    }
    return new ArrayList();
  }
  
  public static List<String> getOtherCFlagList(String targetID, String pkgName)
  {
    DevPackage pkg = findPackage(targetID, pkgName);
    if (pkg != null) {
      return (ArrayList)pkg.getOtherCFlagList().clone();
    }
    return new ArrayList();
  }
  
  public static List<String> getOtherLFlagList(String targetID, String pkgName)
  {
    DevPackage pkg = findPackage(targetID, pkgName);
    if (pkg != null) {
      return (ArrayList)pkg.getOtherLFlagList().clone();
    }
    return new ArrayList();
  }
  
  public static List<String> getExtendedSharedLibraryFileList(String targetID, String pkgName)
  {
    DevPackage pkg = findPackage(targetID, pkgName);
    if (pkg != null) {
      return pkg.getExtendedSharedLibraryFileList();
    }
    return new ArrayList();
  }
  
  public static List<String> getResourceFileList(String targetID, String pkgName)
  {
    DevPackage pkg = findPackage(targetID, pkgName);
    if (pkg != null) {
      return pkg.getResourceFileList();
    }
    return new ArrayList();
  }
  
  private static DevPackage findPackage(String targetID, String pkgName)
  {
    List<DevPackage> pkgList = getAllDevPkgs(targetID);
    if (pkgList != null) {
      for (DevPackage pkg : pkgList) {
        if (pkg.getName().equals(pkgName)) {
          return pkg;
        }
      }
    }
    return null;
  }
  
  public static boolean isValidDevPackageName(String targetID, String pkgName)
  {
    if (findPackage(targetID, pkgName) != null) {
      return true;
    }
    return false;
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.build.DevPackageManager
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.build;

import org.eclipse.osgi.util.NLS;

public class Messages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.tizen.nativecpp.build.messages";
  public static String NativeIDEMultiPackager_LoadClassError;
  public static String NativeProjectDependentPackager_LoadingRefPrjError;
  public static String NativeProjectDependentPackager_BuildError;
  public static String NativeProjectDependentPackager_ValidatingIconError;
  public static String NativeProjectDependentPackager_ValidatingExecutableError;
  public static String NativeProjectDependentPackager_ValidatingSettingFileError;
  public static String NativeProjectDependentPackager_MultipackError;
  public static String NativeProjectDependentPackager_CopyFileError;
  public static String NativeProjectDependentPackager_GetRootstrapError;
  public static String NativeProjectDependentPackager_GetTransformedXMLError;
  public static String NativeProjectDependentPackager_GenXMLError;
  public static String NativeConfigurationManager_GetBuildOptionError;
  public static String NativeResourceManager_AcceptProjectError;
  public static String NativeFrameworkManagedOptionValueHandler_ExceptionNotFound;
  public static String NativeFrameworkManagedOptionValueHandler_ExceptionGetUserObject;
  public static String ERROR_COPY_SIGNATURE_FILE;
  
  static
  {
    NLS.initializeMessages("org.tizen.nativecpp.build.messages", Messages.class);
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.build.Messages
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.build;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IProgressMonitor;
import org.tizen.nativecommon.build.SmartBuildInterface;

public class NativeCheckCancelJob
  implements Runnable
{
  private IProgressMonitor monitor;
  private SmartBuildInterface target_sbi;
  private boolean isFinished;
  private Process proc;
  
  public NativeCheckCancelJob(IProgressMonitor _monitor, IProject proj, SmartBuildInterface target_sbi)
  {
    this.target_sbi = target_sbi;
    monitor = _monitor;
    proc = null;
  }
  
  public void run()
  {
    isFinished = false;
    try
    {
      while (!isFinished)
      {
        Thread.sleep(100L);
        if (monitor.isCanceled())
        {
          proc = target_sbi.getProcess();
          proc.destroy();
          setFinishFlag(true);
        }
      }
    }
    catch (InterruptedException e1)
    {
      e1.printStackTrace();
    }
  }
  
  public void setFinishFlag(boolean value)
  {
    isFinished = value;
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.build.NativeCheckCancelJob
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.build;

import java.util.ArrayList;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.envvar.IBuildEnvironmentVariable;
import org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSupplier;
import org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider;
import org.eclipse.cdt.managedbuilder.internal.envvar.BuildEnvVar;
import org.tizen.common.core.application.InstallPathConfig;
import org.tizen.common.util.OSChecker;
import org.tizen.nativecommon.build.SmartBuildInterface;
import org.tizen.nativecommon.build.exception.SBIException;
import org.tizen.nativecommon.launch.LaunchUtils;

public class NativeConfigurationEnvVarSupplier
  implements IConfigurationEnvironmentVariableSupplier
{
  public final String ENV_PATH_DELIMITER_WINDOWS = ";";
  public final String ENV_PATH_DELIMITER_LINUX = ":";
  
  public IBuildEnvironmentVariable getVariable(String variableName, IConfiguration configuration, IEnvironmentVariableProvider provider)
  {
    String sysrootPath = getEnvSysrootPath(configuration);
    String compilerPath = getEnvComplierPath(configuration);
    String sdkToolPath = getEnvSdkToolPath();
    String sdkInstallPath = getEnvSdkInstallPath();
    String path = getEnvPath();
    String sdkArch = getArch(configuration);
    
    String mingwBinPath = getEnvMingwBinPath();
    String msysBinPath = getEnvMsysBinPath();
    String binutilsPath = getEnvBinutilsPath(configuration);
    if (variableName.equals("SBI_SYSROOT")) {
      return new BuildEnvVar("SBI_SYSROOT", sysrootPath, 
        1, null);
    }
    if (variableName.equals("SBI_COMPILER_PATH")) {
      return new BuildEnvVar("SBI_COMPILER_PATH", compilerPath, 
        1, null);
    }
    if (variableName.equals("PATH")) {
      return new BuildEnvVar("PATH", path, 1, null);
    }
    if (variableName.equals("SDK_TOOLPATH")) {
      return new BuildEnvVar("SDK_TOOLPA
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd