void AssetReferenceListener.OnVCSReferenceObtained(VersionControlSystemRef vcsRef) { obtainedInterface = obtainedInterface ?? CreateLocalizedAUInterface(); if (obtainedInterface != null) { obtainedInterface.modifier.SetContent( new AssetContentSettingParam <VersionControlSystemRef> { content = vcsRef, contentPath = "", doOverwrite = true }, new StubAssetInResultListener <VersionControlSystemRef>() ); } ConsumeTasks(); }
void AssetReferer.ReferAsset(AssetUnitInfo assetUnitInfo, AssetReferenceListener listener) { var strings = assetUnitInfo.reference.Split(' '); if (strings[0].EndsWith(".git")) { var vcsRef = new VersionControlSystemRef { repository = strings[0], systemName = "git" }; if (strings.Length > 1) { vcsRef.targetPath = strings[1]; } listener.OnBeginRefering(); listener.OnVCSReferenceObtained(vcsRef); listener.OnFinish(); } }
void AssetReferenceListener.OnVCSReferenceObtained(VersionControlSystemRef vcsRef) { EnsureLocalAssetDirectory(); try { if (vcsRef.systemName == "git") { System.Diagnostics.Process myProcess = new System.Diagnostics.Process(); myProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal; myProcess.StartInfo.CreateNoWindow = false; myProcess.StartInfo.UseShellExecute = true; myProcess.StartInfo.FileName = "C:\\Windows\\system32\\cmd.exe"; string gitCommand = ""; if (Utilities.IsStringEmpty(vcsRef.targetPath)) { //gitCommand = "git clone --shallow-submodules --depth 1 " + vcsRef.repository + " " + assetRootPath; gitCommand = "git clone --depth 1 " + vcsRef.repository + " " + assetRootPath; myProcess.StartInfo.Arguments = "/K \"\"C:\\Program Files\\Git\\bin\\sh.exe\" --login -i -c \"" + gitCommand + "\"\""; Debug.Log(myProcess.StartInfo.Arguments); myProcess.EnableRaisingEvents = true; myProcess.Start(); myProcess.WaitForExit(); int ExitCode = myProcess.ExitCode; //if (ExitCode >= 0) { parent.localizedAssetInfoColl.Take(localAUInfo); //} Debug.Log(ExitCode); } else { gitCommand = "git archive --format=tar --remote=" + vcsRef.repository + " HEAD:" + vcsRef.targetPath + " > " + assetRootPath + "/Temp.tar.gz | tar xf " + assetRootPath + "/Temp.tar.gz"; } } } catch (Exception e) { Debug.Log(e); } RefreshAssets(); }
void AssetReferenceListener.OnVCSReferenceObtained(VersionControlSystemRef reason) { clientListener.OnVCSReferenceObtained(reason); }
void AssetReferenceListener.OnVCSReferenceObtained(VersionControlSystemRef vcsRef) { clientListener.OnVCSReferenceObtained(vcsRef); }