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