Search in sources :

Example 1 with OrderedProperties

use of com.bladecoder.engineeditor.common.OrderedProperties in project bladecoder-adventure-engine by bladecoder.

the class Project method getGradleProperties.

public Properties getGradleProperties() throws FileNotFoundException, IOException {
    Properties prop = new OrderedProperties();
    prop.load(new FileReader(Ctx.project.getProjectDir().getAbsolutePath() + "/gradle.properties"));
    return prop;
}
Also used : OrderedProperties(com.bladecoder.engineeditor.common.OrderedProperties) FileReader(java.io.FileReader) Properties(java.util.Properties) OrderedProperties(com.bladecoder.engineeditor.common.OrderedProperties)

Example 2 with OrderedProperties

use of com.bladecoder.engineeditor.common.OrderedProperties in project bladecoder-adventure-engine by bladecoder.

the class PackageDialog method setCurrentVersion.

/**
 * Saves the selected version
 */
private void setCurrentVersion(String version) {
    try {
        OrderedProperties prop = Ctx.project.getGradleProperties(Ctx.project.getProjectDir());
        prop.setProperty("version", version);
        Ctx.project.saveGradleProperties(prop, Ctx.project.getProjectDir());
    } catch (IOException e) {
        Message.showMsg(getStage(), "Error reading file 'gradle.properties' from the game.", 3);
    }
}
Also used : OrderedProperties(com.bladecoder.engineeditor.common.OrderedProperties) IOException(java.io.IOException)

Example 3 with OrderedProperties

use of com.bladecoder.engineeditor.common.OrderedProperties in project bladecoder-adventure-engine by bladecoder.

the class I18NHandler method loadI18N.

private OrderedProperties loadI18N(String modelFilename) {
    String i18nFilename = getI18NFilename(modelFilename);
    // To save in alphabetical order we use the OrderedProperties
    OrderedProperties i18n = new OrderedPropertiesBuilder().withSuppressDateInComment(true).withOrdering().build();
    try {
        i18n.load(new InputStreamReader(new FileInputStream(i18nFilename), I18N.ENCODING));
    } catch (IOException e) {
        EditorLogger.error("ERROR LOADING BUNDLE: " + i18nFilename);
    }
    return i18n;
}
Also used : InputStreamReader(java.io.InputStreamReader) OrderedPropertiesBuilder(com.bladecoder.engineeditor.common.OrderedProperties.OrderedPropertiesBuilder) OrderedProperties(com.bladecoder.engineeditor.common.OrderedProperties) IOException(java.io.IOException) FileInputStream(java.io.FileInputStream)

Example 4 with OrderedProperties

use of com.bladecoder.engineeditor.common.OrderedProperties in project bladecoder-adventure-engine by bladecoder.

the class Project method updateEngineVersion.

public void updateEngineVersion(File projectPath) throws FileNotFoundException, IOException {
    OrderedProperties prop = getGradleProperties(projectPath);
    prop.setProperty(Config.BLADE_ENGINE_VERSION_PROP, Versions.getVersion());
    prop.setProperty("gdxVersion", Versions.getLibgdxVersion());
    prop.setProperty("roboVMVersion", Versions.getRoboVMVersion());
    prop.setProperty("roboVMGradlePluginVersion", Versions.getROBOVMGradlePluginVersion());
    prop.setProperty("androidGradlePluginVersion", Versions.getAndroidGradlePluginVersion());
    prop.setProperty("bladeInkVersion", Versions.getBladeInkVersion());
    saveGradleProperties(prop, projectPath);
}
Also used : OrderedProperties(com.bladecoder.engineeditor.common.OrderedProperties)

Aggregations

OrderedProperties (com.bladecoder.engineeditor.common.OrderedProperties)4 IOException (java.io.IOException)2 OrderedPropertiesBuilder (com.bladecoder.engineeditor.common.OrderedProperties.OrderedPropertiesBuilder)1 FileInputStream (java.io.FileInputStream)1 FileReader (java.io.FileReader)1 InputStreamReader (java.io.InputStreamReader)1 Properties (java.util.Properties)1