Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: e1e254dd79ffda20bb3f9da59f9856fec04d010e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
/*******************************************************************************
 * Copyright (c) 2015 QNX Software Systems and others.
 * 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
 *******************************************************************************/
package org.eclipse.cdt.core.build;

import java.util.Collection;
import java.util.List;
import java.util.Map;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.ISafeRunnable;

/**
 * The global toolchain manager. Accessed as an OSGi service.
 *
 * @noimplement This interface is not intended to be implemented by clients.
 * @since 6.0
 */
public interface IToolChainManager {

	/**
	 * Return the provider with the given id
	 * 
	 * @param providerId
	 *            id
	 * @return provider
	 * @throws CoreException
	 */
	IToolChainProvider getProvider(String providerId) throws CoreException;

	/**
	 * Return the UI label for the toolchain type.
	 * 
	 * @param id
	 *            type toolchain type id
	 * @return name of the type
	 * @since 6.4
	 */
	String getToolChainTypeName(String typeId);

	/**
	 * Return the toolchain from the given provider with the given id and version.
	 * 
	 * @param providerId
	 *            id of provider
	 * @param id
	 *            id of toolchain
	 * @param version
	 *            version of toolchain
	 * @return the toolchain
	 * @throws CoreException
	 * @deprecated version is now irrelevant. id's are unique.
	 */
	@Deprecated
	default IToolChain getToolChain(String providerId, String id, String version) throws CoreException {
		return getToolChain(providerId, id);
	}

	/**
	 * Return the toolChain with the given type and id.
	 * 
	 * @param typeId
	 *            id of toolchain type
	 * @param id
	 *            id of toolchain
	 * @return the toolchain
	 * @throws CoreException
	 * @since 6.4
	 */
	IToolChain getToolChain(String typeId, String id) throws CoreException;
	
	/**
	 * Return the toolchains provided by the given provider
	 * 
	 * @param providerId
	 *            id of provider
	 * @return toolchains the provider provides
	 * @throws CoreException
	 * @deprecated we no longer organize toolchains by provider id.
	 */
	@Deprecated
	default Collection<IToolChain> getToolChains(String providerId) throws CoreException {
		return null;
	}

	/**
	 * Return all versions of toolchains with the given id provided by the given
	 * provider.
	 * 
	 * @param providerId
	 *            id of provider
	 * @param id
	 *            id of toolchains
	 * @return toolchains with the given id provided by the provider
	 * @throws CoreException
	 * @deprecated toolchains no longer have multiple versions per id
	 */
	@Deprecated
	default Collection<IToolChain> getToolChains(String providerId, String id) throws CoreException {
		return null;
	}

	/**
	 * Returns the list of toolchains that have the given properties.
	 * 
	 * @param properties
	 *            properties of the toolchains
	 * @return the qualified toolchains
	 */
	Collection<IToolChain> getToolChainsMatching(Map<String, String> properties) throws CoreException;

	/**
	 * Return all of the toolchains.
	 * 
	 * @since 6.4
	 */
	Collection<IToolChain> getAllToolChains() throws CoreException;

	/**
	 * Set the preference order of the toolchains. This controls the order
	 * toolchains are returned in the other methods in this interface. Often, the
	 * first toolchain in a list is the default toolchain to use in a build
	 * configuration.
	 * 
	 * @param orderedToolchains
	 * @throws CoreException
	 * @since 6.4
	 */
	void setToolChainOrder(List<IToolChain> orderedToolchains) throws CoreException;

	/**
	 * Add a toolchain.
	 * 
	 * @param toolChain
	 *            the toolchain
	 */
	void addToolChain(IToolChain toolChain);
	
	/**
	 * Remove a toolchain
	 * 
	 * @param toolChain
	 *            the toolchain
	 */
	void removeToolChain(IToolChain toolChain);

	/**
	 * Add a listener for toolchains added or removed. The listener is a simple
	 * runnable that is called when an event occurs.
	 * 
	 * @param listener
	 *            runnable that is called when a toolchain is added or removed
	 * @since 6.4
	 */
	void addToolChainListener(ISafeRunnable listener);

	/**
	 * Remove a listener.
	 * 
	 * @param listener
	 *            the listener to remove
	 * @since 6.4
	 */
	void removeToolChainListener(ISafeRunnable listener);

}

Back to the top