|
Lines 55-61
Link Here
|
| 55 |
import org.eclipse.pde.internal.core.util.PatternConstructor; |
55 |
import org.eclipse.pde.internal.core.util.PatternConstructor; |
| 56 |
import org.osgi.framework.Constants; |
56 |
import org.osgi.framework.Constants; |
| 57 |
|
57 |
|
| 58 |
public class BuildErrorReporter extends ErrorReporter implements IBuildPropertiesConstants{ |
58 |
public class BuildErrorReporter extends ErrorReporter implements IBuildPropertiesConstants { |
| 59 |
|
59 |
|
| 60 |
private static final String DEF_SOURCE_ENTRY = PROPERTY_SOURCE_PREFIX + '.'; |
60 |
private static final String DEF_SOURCE_ENTRY = PROPERTY_SOURCE_PREFIX + '.'; |
| 61 |
|
61 |
|
|
Lines 209-215
Link Here
|
| 209 |
// make sure we have a manifest entry |
209 |
// make sure we have a manifest entry |
| 210 |
if(fProject.exists(ICoreConstants.MANIFEST_PATH)) { |
210 |
if(fProject.exists(ICoreConstants.MANIFEST_PATH)) { |
| 211 |
String key = "META-INF/"; //$NON-NLS-1$ |
211 |
String key = "META-INF/"; //$NON-NLS-1$ |
| 212 |
validateBinIncludes(binIncludes, key); |
212 |
validateBinIncludes(binIncludes, key); |
| 213 |
} |
213 |
} |
| 214 |
|
214 |
|
| 215 |
// make sure if we're a fragment, we have a fragment.xml entry |
215 |
// make sure if we're a fragment, we have a fragment.xml entry |
|
Lines 223-228
Link Here
|
| 223 |
String key = "plugin.xml"; //$NON-NLS-1$ |
223 |
String key = "plugin.xml"; //$NON-NLS-1$ |
| 224 |
validateBinIncludes(binIncludes, key); |
224 |
validateBinIncludes(binIncludes, key); |
| 225 |
} |
225 |
} |
|
|
226 |
|
| 227 |
// validate for bundle localization |
| 228 |
IPluginModelBase model = PluginRegistry.findModel(fProject); |
| 229 |
if (model == null) |
| 230 |
return; |
| 231 |
if (model instanceof IBundlePluginModelBase && !(model instanceof IBundleFragmentModel)) { |
| 232 |
IBundleModel bm = ((IBundlePluginModelBase)model).getBundleModel(); |
| 233 |
IManifestHeader mh = bm.getBundle().getManifestHeader(Constants.BUNDLE_LOCALIZATION); |
| 234 |
if ((mh == null || mh.getValue() == null)) { // check for default location |
| 235 |
Path path = new Path(Constants.BUNDLE_LOCALIZATION_DEFAULT_BASENAME); |
| 236 |
if(fProject.exists(path)) |
| 237 |
validateBinIncludes(binIncludes, Constants.BUNDLE_LOCALIZATION_DEFAULT_BASENAME); |
| 238 |
} else { // check for the real location |
| 239 |
String localization = mh.getValue(); |
| 240 |
int index = localization.lastIndexOf('/'); |
| 241 |
if(index != -1) { // if we're a folder |
| 242 |
String folder = localization.substring(0, index + 1); |
| 243 |
Path path = new Path(folder); |
| 244 |
if(fProject.exists(path)) |
| 245 |
validateBinIncludes(binIncludes, folder); |
| 246 |
} else { // if we're just a file location |
| 247 |
String location = mh.getValue().concat(".properties"); //$NON-NLS-1$ |
| 248 |
Path path = new Path(location); |
| 249 |
if(fProject.exists(path)) |
| 250 |
validateBinIncludes(binIncludes, location); |
| 251 |
} |
| 252 |
} |
| 253 |
} |
| 254 |
|
| 226 |
} |
255 |
} |
| 227 |
|
256 |
|
| 228 |
private void validateBinIncludes(IBuildEntry binIncludes, String key) { |
257 |
private void validateBinIncludes(IBuildEntry binIncludes, String key) { |
|
Lines 241-248
Link Here
|
| 241 |
if(project != null && tokens[i] != null) { |
270 |
if(project != null && tokens[i] != null) { |
| 242 |
File file = project.toFile(); |
271 |
File file = project.toFile(); |
| 243 |
File[] files = file.listFiles(new WildcardFilenameFilter(tokens[i])); |
272 |
File[] files = file.listFiles(new WildcardFilenameFilter(tokens[i])); |
| 244 |
if(files.length > 0) |
273 |
for(int j = 0; j < files.length; j++) { |
| 245 |
exists = true; |
274 |
if(files[j].toString().endsWith(key)) { |
|
|
275 |
exists = true; |
| 276 |
break; |
| 277 |
} |
| 278 |
} |
| 246 |
} |
279 |
} |
| 247 |
} |
280 |
} |