// Path: src/com/github/nukc/plugin/model/Options.java
// public class Options {
//     public List<String> channels = new ArrayList<>(0);
//     public String keyStorePath;
//     public String keyStorePassword;
//     public String keyAlias;
//     public String keyPassword;
//     public String zipalignPath;
//     public String buildType;
//     public String signer;
// }


import com.github.nukc.plugin.model.Options;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.text.StringUtil;
import java.io.*;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
package com.github.nukc.plugin.helper;



/**
 * Created by Nukc.
 */
public class OptionsHelper {

    private static final Logger log = Logger.getInstance(OptionsHelper.class);
    private static final String CHANNELS_PROPERTIES = "channels.properties";
    private static final String KEY_STORE_PATH = "key.store.path";
    private static final String KEY_STORE_PASSWORD = "key.store.password";
    private static final String KEY_ALIAS = "key.alias";
    private static final String KEY_PASSWORD = "key.password";
    private static final String ZIPALIGN_PATH = "zipalign.path";
    private static final String BUILD_TYPE = "build.type";
    private static final String SIGNER_PATH = "signer.path";

    public static final String BUILD_TYPE_UPDATE = "update AndroidManifest.xml";
    public static final String BUILD_TYPE_ADD = "add channel file to META-INF";
    public static final String BUILD_TYPE_ZIP_COMMENT = "write zip comment";

    private static String getPathName(Project project) {
        return project.getBasePath() + File.separator + CHANNELS_PROPERTIES;
    }

    public static Options load(Project project) {
        String pathname = getPathName(project);
        File file = new File(pathname);
        if (!file.exists()) {
            log.warn(pathname + " is not exists");
            return null;
        }

// Path: src/com/github/nukc/plugin/model/Options.java
// public class Options {
//     public List<String> channels = new ArrayList<>(0);
//     public String keyStorePath;
//     public String keyStorePassword;
//     public String keyAlias;
//     public String keyPassword;
//     public String zipalignPath;
//     public String buildType;
//     public String signer;
// }


// Path: src/com/github/nukc/plugin/helper/OptionsHelper.java
import com.github.nukc.plugin.model.Options;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.text.StringUtil;
import java.io.*;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;

package com.github.nukc.plugin.helper;



/**
 * Created by Nukc.
 */
public class OptionsHelper {

    private static final Logger log = Logger.getInstance(OptionsHelper.class);
    private static final String CHANNELS_PROPERTIES = "channels.properties";
    private static final String KEY_STORE_PATH = "key.store.path";
    private static final String KEY_STORE_PASSWORD = "key.store.password";
    private static final String KEY_ALIAS = "key.alias";
    private static final String KEY_PASSWORD = "key.password";
    private static final String ZIPALIGN_PATH = "zipalign.path";
    private static final String BUILD_TYPE = "build.type";
    private static final String SIGNER_PATH = "signer.path";

    public static final String BUILD_TYPE_UPDATE = "update AndroidManifest.xml";
    public static final String BUILD_TYPE_ADD = "add channel file to META-INF";
    public static final String BUILD_TYPE_ZIP_COMMENT = "write zip comment";

    private static String getPathName(Project project) {
        return project.getBasePath() + File.separator + CHANNELS_PROPERTIES;
    }

    public static Options load(Project project) {
        String pathname = getPathName(project);
        File file = new File(pathname);
        if (!file.exists()) {
            log.warn(pathname + " is not exists");
            return null;
        }

        Options options = new Options();