use of com.google.gwt.core.ext.ConfigurationProperty in project libgdx by libgdx.
the class PreloaderBundleGenerator method getAssetOutputPath.
private String getAssetOutputPath(GeneratorContext context) {
ConfigurationProperty assetPathProperty = null;
try {
assetPathProperty = context.getPropertyOracle().getConfigurationProperty("gdx.assetoutputpath");
} catch (BadPropertyValueException e) {
return null;
}
if (assetPathProperty.getValues().size() == 0) {
return null;
}
String paths = assetPathProperty.getValues().get(0);
if (paths == null) {
return null;
} else {
ArrayList<String> existingPaths = new ArrayList<String>();
String[] tokens = paths.split(",");
String path = null;
for (String token : tokens) {
if (new FileWrapper(token).exists() || new FileWrapper(token).mkdirs()) {
path = token;
}
}
if (path != null && !path.endsWith("/")) {
path += "/";
}
return path;
}
}
use of com.google.gwt.core.ext.ConfigurationProperty in project libgdx by libgdx.
the class PreloaderBundleGenerator method getAssetFilter.
private AssetFilter getAssetFilter(GeneratorContext context) {
ConfigurationProperty assetFilterClassProperty = null;
try {
assetFilterClassProperty = context.getPropertyOracle().getConfigurationProperty("gdx.assetfilterclass");
} catch (BadPropertyValueException e) {
return new DefaultAssetFilter();
}
if (assetFilterClassProperty.getValues().size() == 0) {
return new DefaultAssetFilter();
}
String assetFilterClass = assetFilterClassProperty.getValues().get(0);
if (assetFilterClass == null)
return new DefaultAssetFilter();
try {
return (AssetFilter) Class.forName(assetFilterClass).newInstance();
} catch (Exception e) {
throw new RuntimeException("Couldn't instantiate custom AssetFilter '" + assetFilterClass + "', make sure the class is public and has a public default constructor", e);
}
}
Aggregations