use of org.androidannotations.internal.exception.VersionNotFoundException in project androidannotations by androidannotations.
the class AndroidAnnotationsPlugin method getVersionFromPropertyFile.
private String getVersionFromPropertyFile(String name) throws FileNotFoundException, VersionNotFoundException {
String filename = name + ".properties";
Properties properties;
try {
URL url = getClass().getClassLoader().getResource(filename);
properties = new Properties();
properties.load(url.openStream());
} catch (Exception e) {
logger.error("Property file {} couldn't be parsed", filename);
throw new FileNotFoundException("Property file " + filename + " couldn't be parsed.");
}
String version = properties.getProperty("version");
if (version == null) {
logger.error("{} plugin is missing 'version' property!", getName());
throw new VersionNotFoundException(this);
}
return version;
}
Aggregations