imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/IIMakerWrapper.java
author dpodwall
Tue, 12 Jan 2010 13:17:53 -0600
changeset 0 61163b28edca
child 1 7ff23301fe22
permissions -rw-r--r--
initial EPL conversion
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     1
/*
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     3
* All rights reserved.
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     4
* This component and the accompanying materials are made available
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     6
* which accompanies this distribution, and is available
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     8
*
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     9
* Initial Contributors:
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    11
*
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    12
* Contributors:
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    13
*
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    14
* Description:
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    15
*
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    16
*/
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    17
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    18
package com.nokia.s60tools.imaker;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    19
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    20
import java.io.File;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    21
import java.io.OutputStream;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    22
import java.util.List;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    23
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    24
import org.eclipse.core.runtime.IProgressMonitor;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    25
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    26
import com.nokia.s60tools.imaker.exceptions.IMakerCoreAlreadyRunningException;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    27
import com.nokia.s60tools.imaker.exceptions.IMakerCoreExecutionException;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    28
import com.nokia.s60tools.imaker.exceptions.IMakerCoreNotFoundException;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    29
/**
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    30
 * General image generation interface
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    31
 *
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    32
 */
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    33
public interface IIMakerWrapper {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    34
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    35
	/**
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    36
	 * Function to get iMaker version information
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    37
	 * @return
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    38
	 * @throws IMakerCoreNotFoundException
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    39
	 * @throws IMakerCoreExecutionException
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    40
	 */
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    41
	public abstract String getIMakerCoreVersion() throws IMakerCoreNotFoundException,
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    42
	IMakerCoreExecutionException;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    43
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    44
	/**
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    45
	 * Method is for querying configurations from the iMaker.
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    46
	 * 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    47
	 * 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    48
	 * @return A list containing the data as UIConfiguration objects.
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    49
	 *         Return is null in case of an error
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    50
	 * @throws IMakerCoreExecutionException 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    51
	 * @throws IMakerCoreNotFoundException 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    52
	 * @throws InterruptedException 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    53
	 */
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    54
	public abstract List<UIConfiguration> getConfigurations(IProgressMonitor monitor) throws IMakerCoreNotFoundException,
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    55
	IMakerCoreExecutionException;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    56
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    57
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    58
	/**
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    59
	 * Method is for the settings of a specific makefile.
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    60
	 * 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    61
	 * 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    62
	 * @return A list containing the data as UIConfiguration objects.
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    63
	 *         Return is null in case of an error
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    64
	 * @throws IMakerCoreExecutionException 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    65
	 * @throws IMakerCoreNotFoundException 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    66
	 */
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    67
	public abstract UIConfiguration getConfiguration(List<String> params, IProgressMonitor monitor) 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    68
	throws IMakerCoreExecutionException, 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    69
	IMakerCoreNotFoundException;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    70
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    71
	/**
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    72
	 * Flashes an image. Currently does nothing
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    73
	 * 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    74
	 * @param cmdParams Command line parameters for iMaker.
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    75
	 * @return true if flashing succeeded, otherwise false.
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    76
	 */
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    77
	public abstract boolean flashImage(List<String> cmdParams);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    78
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    79
	/**
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    80
	 * Runs iMaker with the specified command line parameters. 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    81
	 * @param cmdParams command line parameters to iMaker. Contains product make
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    82
	 * @return if build was successful, otherwise
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    83
	 * 	                 false
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    84
	 * @throws IMakerCoreNotFoundException
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    85
	 * @throws IMakerCoreExecutionException
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    86
	 * @throws IMakerCoreAlreadyRunningException 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    87
	 */
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    88
	public abstract boolean buildImage(List<String> cmdParams, OutputStream out) throws IMakerCoreNotFoundException,
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    89
	IMakerCoreExecutionException, IMakerCoreAlreadyRunningException;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    90
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    91
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    92
	/**
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    93
	 * Runs iMaker core with the specified imp file. 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    94
	 * @param impFile absolute file URI to impFile
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    95
	 * @return if build was successful, otherwise
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    96
	 * 	                 false
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    97
	 * @throws IMakerCoreNotFoundException
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    98
	 * @throws IMakerCoreExecutionException
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    99
	 * @throws IMakerCoreAlreadyRunningException 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   100
	 */
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   101
	public abstract boolean buildImage(File impFile, OutputStream out) throws IMakerCoreNotFoundException,
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   102
	IMakerCoreExecutionException, IMakerCoreAlreadyRunningException;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   103
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   104
	/**
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   105
	 * Determine whether iMaker is running or not
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   106
	 * @return
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   107
	 */
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   108
	public abstract boolean isRunning();
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   109
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   110
	/**
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   111
	 * Construct the full iMaker command that will be executed and return it as a String for convenience
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   112
	 * @param params, command line parameters for iMaker
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   113
	 * @return
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   114
	 */
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   115
	public abstract String getBuildCommand(List<String> params);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   116
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   117
	/**
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   118
	 * Get full path to iMaker tool that will be run
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   119
	 * @return
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   120
	 */
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   121
	public abstract List<String> getTool();
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   122
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   123
	/**
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   124
	 * Get iMaker steps for specific target
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   125
	 * @param target, iMaker target
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   126
	 * @param makefile, iMaker product makefile
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   127
	 * @param monitor, monitor object
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   128
	 * @return
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   129
	 */
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   130
	public abstract String getTargetSteps(String target,String makefile, IProgressMonitor monitor);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   131
}