var path = require("path");

var moduleObj = {
        //compiler: process.cwd() + "/lib/compiler-1.6.jar",
        outJsName: "main.js",
        outZipJsName: "main.min.js",
        //cordova-js-src文件夹好像没用到，暂时留着，TODO，将这些cordova打包成一个文件呢？
        cordovaFiles: ["cordova-js-src", "plugins", "cordova_plugins.js", "cordova.js", "httpd.js", "MyCordova.js", "http_get.js", "index.html", "index1.html"],
        publishRoot: path.join(process.cwd(), "publish"),
        sourceFolders: ["src", "res"],
        //用本机的模板，github上有点问题
        useLocalTemplate: true,
        localTemplatePath: "/Users/long/Documents/www/nodejs/cordova/cordovaTemplate/platforms",
        //模板splash，每次发布都自动覆盖过去
        splashesPath: "/Users/long/Documents/www/nodejs/cordova/cordovaTemplate/splashes/etdogs",
        //github下载地址
        zipUrl: "https://codeload.github.com/longyangxi/cordovaTemplate/zip/master",
        resUrl: "https://lottery.etdogs.com/wechat/physicBall3",//资源地址, 对微信必须，其他不必
        wechatMain: "game.js",//微信主文件
        fbsdk: "https://connect.facebook.net/en_US/fbinstant.6.2.js",//facebook的sdk路径
        flaxConfig: {},
        platformConfig: {},
        outputShell: false,//输出ios或android的时候，是否同时输出壳子工程，目前苹果好像审核不过，先略掉
        isCocos: false,//是否cocos工程
        //编译选项
        compileOptions: {
            platform: "ios",//ios/android/web/wechat/fb
            isNative: true,
            singleFile: false,
            zipFile: false,
            obscure: false,
            forceClean: false,
            gameId: "com.domain.gameId",
            pureGameId: "gameId",
            gameName:"",
            gameName_en:"",
            entryMaster: "http://longames.com:8721",//获取游戏url的master服务接口
            defaultEntry: "http://etdogs.com/cordova/$",//如果master连接出现问题，备用地址，默认是将$替换为包名的最后一个单词，比如com.enhao.physicBall中的physicBall
            host: "120.24.180.89",//用于上传ios_web或ios_android的web服务器ip地址
            hostPath: "cordova/$"//路径
        }
}

//源码路径
moduleObj.sourceFolder = function() {
    if(moduleObj.isCocos) return process.cwd();
   return path.join(process.cwd(), "www")
}

moduleObj.publishFolderRoot = function(platform) {
    return moduleObj.publishRoot + "/" + platform;
}

moduleObj.publishFolder = function(platform) {
    var folder = moduleObj.publishFolderRoot(platform);
    if(platform.indexOf("ios") == 0) folder += "/www";
    else if(platform.indexOf("android") == 0) folder += "/app/src/main/assets/www";
    return folder;
}

module.exports = moduleObj;