Exemple #1
0
    //[MenuItem("Hugula/project  StandaloneWindows ", false, 16)]
    static void BuildForWindows()
    {
        string path = "../../release/pc/";

        ExportResources.DirectoryDelete(path);
        ExportResources.CheckDirectory(path);
        WriteAppVerion();
        path = path + "hugula.exe";
        BuildPipeline.BuildPlayer(GetBuildScenes(), path, BuildTarget.StandaloneWindows, BuildOptions.None);
    }
Exemple #2
0
    //	[MenuItem("Hugula/IOS Publish  ", false, 16)]
    static void BuildForIOS()
    {
        CUtils.DebugCastTime("Time BuildForIOS Begin");
        string path = "../../release/ios";

        path = Path.GetFullPath(path);
        ExportResources.DirectoryDelete(path);
        ExportResources.CheckDirectory(path);
        BuildPipeline.BuildPlayer(GetBuildScenes(), path, BuildTarget.iOS, BuildOptions.None);
        CUtils.DebugCastTime("Time BuildForIOS End");
    }
Exemple #3
0
    public static void exportPublish()
    {
        ExportResources.DirectoryDelete(Path.Combine(Application.streamingAssetsPath, ExportAssetBundles.GetTarget().ToString()));

        BuildScript.BuildAssetBundles(); //导出资源

        exportLua();

        exportConfig();

        exportLanguage();

        autoVerAdd();
    }
Exemple #4
0
    // [MenuItem("Hugula/IOS Publish  ", false, 16)]
    static void BuildForIOS()
    {
        CUtils.DebugCastTime("Time BuildForIOS Begin");

        string path = "../../release/ios";

        path = Path.GetFullPath(path);
        IOSSettings();
        ExportResources.DirectoryDelete(path);
        ExportResources.CheckDirectory(path);
        if (setting.ToLower().Contains("development"))
        {
            GenericBuild(GetBuildScenes(), path, BuildTarget.iOS, BuildOptions.Development);
        }
        else
        {
            GenericBuild(GetBuildScenes(), path, BuildTarget.iOS, BuildOptions.None);
        }
        CUtils.DebugCastTime("Time BuildForIOS End");
    }
Exemple #5
0
    // [MenuItem("Hugula/Android Project publish ", false, 16)]
    static void BuildForAndroidProject()
    {
        string path = "../../release/android";

        path = Path.GetFullPath(path);
        exportingAndroidProject = true;
        AndroidSettings("mono");
        ExportResources.DirectoryDelete(path);
        ExportResources.CheckDirectory(path);
        if (setting.ToLower().Contains("development"))
        {
            GenericBuild(GetBuildScenes(), path, BuildTarget.Android, BuildOptions.Development | BuildOptions.AcceptExternalModificationsToPlayer);
        }
        else
        {
            GenericBuild(GetBuildScenes(), path, BuildTarget.Android, BuildOptions.AcceptExternalModificationsToPlayer);
        }

        CUtils.DebugCastTime("Time BuildForAndroidProject End");
    }
Exemple #6
0
    // [MenuItem("Hugula/Android IL2CPP Project publish ", false, 16)]
    static void BuildForAndroidProjectIL2CPP()
    {
        string path = "../../release/android_il2cpp";

        path = Path.GetFullPath(path);
        exportingAndroidProject = true;
        AndroidSettings();
        ExportResources.DirectoryDelete(path);
        ExportResources.CheckDirectory(path);
        PlayerSettings.SetPropertyInt("ScriptingBackend", (int)ScriptingImplementation.IL2CPP, BuildTargetGroup.Android);
        if (setting.ToLower().Contains("development"))
        {
            GenericBuild(GetBuildScenes(), path, BuildTarget.Android, BuildOptions.Development | BuildOptions.AcceptExternalModificationsToPlayer);
        }
        else
        {
            GenericBuild(GetBuildScenes(), path, BuildTarget.Android, BuildOptions.AcceptExternalModificationsToPlayer);
        }
        PlayerSettings.SetPropertyInt("ScriptingBackend", (int)ScriptingImplementation.Mono2x, BuildTargetGroup.Android);
        CUtils.DebugCastTime("Time BuildForAndroidProjectIL2CPP End");
    }
Exemple #7
0
    static void WriteShell()
    {
        string path = Path.GetFullPath("shell");

        ExportResources.DirectoryDelete(path);
        ExportResources.CheckDirectory(path);
        string        shellPath   = Path.Combine(path, "ftp_release_shell.sh");
        StringBuilder ftpTampleta = new StringBuilder();

        ftpTampleta.Append("function foo()\n{\nlocal r\nlocal a\nr=\"$@\"\nwhile [[ \"$r\" != \"$a\" ]] ; do\na=${r%%/*}\necho \"mkdir $a\"\necho \"cd $a\"\nr=${r#*/}\ndone\n}");
        ftpTampleta.Append("\nfunction upload_ftp()\n{\necho \"current folder \"$1\necho \"upload to \"$FTP_ROOT$2\nftp -niv <<- EOF\nopen $FTP_IP\nuser $FTP_USER $FTP_PWD\nlcd $1\n$(foo \"$FTP_ROOT$2\")\ncd $FTP_ROOT$2\nbin\nhash\npwd\nprompt off\nmput *.*\nclose\nbye\nEOF\n}");
        var codeVersion = "";

        if (Hugula.HugulaSetting.instance.appendCrcToFile)
        {
            codeVersion = Hugula.CodeVersion.CODE_VERSION.ToString();
        }
        else
        {
            codeVersion = Hugula.CodeVersion.APP_NUMBER.ToString();         //文件crc 不变路径需要改变
        }
        string        firstPackagePath = SplitPackage.UpdateOutVersionPath; // release/android/v9000
        string        ftpToPath        = CUtils.platform + "/v" + codeVersion;
        StringBuilder content1         = new StringBuilder();

        content1.AppendFormat("\nupload_ftp {0} {1}", firstPackagePath, ftpToPath);                                                                   //eg release/android/v9000 to android/v9001
        content1.AppendFormat("\nupload_ftp {0} {1}", firstPackagePath, string.Format("{0}/v{1}", CUtils.platform, Hugula.CodeVersion.CODE_VERSION)); //eg release/android/v9000 to android/v9000
        content1.AppendFormat("\nupload_ftp {0} {1}", Path.Combine(firstPackagePath, "res"), Path.Combine(ftpToPath, "res"));                         //eg release/android/v9000/res to android/v9001/res
        content1.AppendFormat("\nupload_ftp {0} {1}", Path.Combine(firstPackagePath, "res/battle"), Path.Combine(ftpToPath, "res/battle"));           //eg release/android/v9000/res to android/v9001/res

        using (StreamWriter sw = new StreamWriter(shellPath, false, new UTF8Encoding(false)))
        {
            sw.Write(ftpTampleta.ToString());
            sw.Write(content1.ToString());
        }
        Debug.Log("Create shell success " + shellPath);

        string ftpVerPath = Path.Combine(path, "ftp_dev_shell.sh");

        firstPackagePath = SplitPackage.UpdateOutVersionDevelopPath;
        content1         = new StringBuilder();
        content1.AppendFormat("\nupload_ftp {0} {1}", firstPackagePath, ftpToPath);                                                                   //eg dev/android/v9000 to android/v9001
        content1.AppendFormat("\nupload_ftp {0} {1}", firstPackagePath, string.Format("{0}/v{1}", CUtils.platform, Hugula.CodeVersion.CODE_VERSION)); //eg dev/android/v9000 to android/v9000

        using (StreamWriter sw = new StreamWriter(ftpVerPath, false, new UTF8Encoding(false)))
        {
            sw.Write(ftpTampleta.ToString());
            sw.Write(content1.ToString());
        }
        Debug.Log("Create shell success " + ftpVerPath);

        //environment_shell.sh
        string environmentPath = Path.Combine(path, "environment_shell.sh");

        using (StreamWriter sw = new StreamWriter(environmentPath, false, new UTF8Encoding(false)))
        {
            sw.Write(environmentVariable.ToString());
        }

        environmentVariable = new StringBuilder();
        Debug.Log("Create shell success " + environmentPath);
    }
Exemple #8
0
 public static void DeleteStreamingOutPath()
 {
     ExportResources.DirectoryDelete(Path.Combine(Application.streamingAssetsPath, CUtils.GetAssetPath("")));
 }