batchmode에서 안됨

    public static void SetCloudProjectId(string id, string name, string company)
    {
        var type = Type.GetType("UnityEditor.Connect.UnityConnect, UnityEditor, Version = 0.0.0.0, Culture = neutral, PublicKeyToken = null");
        PropertyInfo instanceInfo = type.GetProperty("instance");
        object settingsInstance = instanceInfo.GetValue(null, null);

        MethodInfo unbind = type.GetMethod("UnbindProject");
        MethodInfo bind = type.GetMethod("BindProject");

        Debug.Log("Unbinding current cloud project");
        unbind.Invoke(settingsInstance, new System.Object[] { });

        Debug.LogFormat("Binding cloud project to {0}: {1} ({2})", name, id, company);
        bind.Invoke(settingsInstance, new System.Object[] { id, name, company });

        Debug.LogFormat("Binded cloud project to {0}: {1} ({2})", name, id, company);
    }

실행후에 유니티 재시작필요.

Jenkins에서 호출하는경우 빌드전에 따로 실행

유니티 Bind를 사용하는 경우 batch mode에서 제대로 안되서 파일 직접변경이 필요.

    public static void SetCloudProjectIdFile(string name, string id, string company)
    {
        const string filepath = "ProjectSettings/ProjectSettings.asset";
        string[] lines = File.ReadAllLines(filepath);
        var new_lines = new List<string>();
        id = " " + id;
        name = " " + name;
        company = " " + company;

        foreach (string line in lines)
        {
            string[] command = line.Split(':');
            if (command.Length < 2)
            {
                new_lines.Add(line);
                continue;
            }

            switch (command[0])
            {
                case "  cloudProjectId":
                    if (command[1] != id)
                    {
                        Debug.Log($"Replace {command[0]}");
                        new_lines.Add(string.Join(":", command[0], id));
                    }
                    break;

                case "  projectName":
                    if (command[1] != name)
                    {
                        Debug.Log($"Replace {command[0]}");
                        new_lines.Add(string.Join(":", command[0], name));
                    }
                    break;

                case "  organizationId":
                    if (command[1] != company)
                    {
                        Debug.Log($"Replace {command[0]}");
                        new_lines.Add(string.Join(":", command[0], company));
                    }
                    break;

                default:
                    new_lines.Add(line);
                    break;
            }
        }

        File.WriteAllLines(filepath, new_lines.ToArray());
        AssetDatabase.Refresh();
    }

rm -f play.prop
touch play.prop

echo GIT_COMMIT_SHORT=$(git rev-parse --short ${GIT_COMMIT}) > play.prop
echo GIT_REVISION=$(git rev-list --count ${GIT_COMMIT}) >> play.prop

vi lib/redmine/scm/adapters/subversion_adapter.rb 

str << " --no-auth-cache --non-interactive --config-dir /tmp/subversion_config"


svn ls --config-option config:auth:store-auth-creds=yes --config-dir /tmp/subversion_config https://192.168.0.230/svn/project/trunk


ruby bin/rails runner "Repository.fetch_changesets" -e production


http://www.redmine.org/issues/1273

http://viralpatel.net/blogs/batch-insert-in-java-jdbc/

http://visualstudiogallery.msdn.microsoft.com/8e2103b6-87cf-4fef-9410-a580c434b602

+ Recent posts