use of org.eclipse.tycho.p2.resolver.TargetDefinitionFile in project tycho by eclipse.
the class TargetDefinitionUtil method makeURLsAbsolute.
/**
* Resolves relative URLs in the given target definition file, with the specified resource as
* base URL.
*
* @param targetDefinitionFile
* The target definition file in which relative URLs shall be replaced.
* @param base
* @throws IOException
*/
public static void makeURLsAbsolute(File targetDefinitionFile, File relocationBasedir) throws IOException {
TargetDefinitionFile platform = TargetDefinitionFile.read(targetDefinitionFile, null);
List<? extends TargetDefinition.Location> locations = platform.getLocations();
for (TargetDefinition.Location location : locations) {
List<Repository> repositories = ((IULocation) location).getRepositoryImpls();
for (Repository repository : repositories) {
makeRepositoryElementAbsolute(repository, relocationBasedir);
}
}
TargetDefinitionFile.write(platform, targetDefinitionFile);
}
use of org.eclipse.tycho.p2.resolver.TargetDefinitionFile in project tycho by eclipse.
the class TargetDefinitionUtil method setRepositoryURLs.
/**
* Overwrites all repository URLs in the target file.
*/
public static void setRepositoryURLs(File targetDefinitionFile, String url) throws IOException {
TargetDefinitionFile platform = TargetDefinitionFile.read(targetDefinitionFile, null);
for (TargetDefinition.Location location : platform.getLocations()) {
for (Repository repository : ((IULocation) location).getRepositoryImpls()) {
repository.setLocation(url);
}
}
TargetDefinitionFile.write(platform, targetDefinitionFile);
}
Aggregations