public static void SVNUpdate(RuntimePlatform platform) { string platformAssets = HS_PlatformRes.Directory[platform]; SVNSetiingWindows.Update(); string streamingAssetsPath = Application.streamingAssetsPath; HS_Directory.CreateDirectory(streamingAssetsPath); s_CopyFolder.Clear(); foreach (string p in SVNSetiingWindows.UpdatePaths) { string folderName = HS_Path.GetCurrentFolder(p); string fullFolderName = streamingAssetsPath + @"/" + folderName; try { HS_Base.SystemDeleteFolder(fullFolderName); } catch (System.Exception _e) { D.LogForce("Ignore: " + _e.ToString()); } } AssetDatabase.Refresh(); foreach (string p in SVNSetiingWindows.UpdatePaths) { string dstPath = streamingAssetsPath + @"/"; if (p.Contains("Assets")) { if (!p.Contains(platformAssets)) { continue; } dstPath += platformAssets; } else { dstPath += HS_Path.GetCurrentFolder(p); } s_CopyFolder.Add(dstPath); HS_Base.SystemCopyDirectory(p, dstPath, new string[] { ".svn", ".bat", ".dll" }); } AssetDatabase.Refresh(); HS_GenerateMD5.GenerateMD5(streamingAssetsPath, ""); }
static public void BuildForAndroid(HS_EditDefine.HS_ChannelDefine channelDefine) { LoadConfig(); string androidPath = Application.dataPath + "/Plugins/Android"; HS_Directory.CreateDirectory(androidPath); try { HS_Base.SystemDeleteFolder(androidPath); } catch (System.Exception _e) { D.LogForce("Ignore: " + _e.ToString()); } string rootPath = S_RootPath; ChannelConfig channelConfig = S_AllChannelConfig[channelDefine.ToString()]; string channel = channelConfig.channel; string packerName = channelConfig.packerName; HS_Base.SystemCopyDirectory(rootPath + @"/Channel/" + channel + "/Android/", androidPath); string lastDefineSymbols = PlayerSettings.GetScriptingDefineSymbolsForGroup(BuildTargetGroup.Android); if (!string.IsNullOrEmpty(channelConfig.defineSymbols)) { PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.Android, channelConfig.defineSymbols); } else { PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.Android, ""); } PlayerSettings.bundleIdentifier = packerName; PlayerSettings.defaultInterfaceOrientation = UIOrientation.LandscapeLeft; string path = rootPath + "/Client/Android"; HS_Directory.CreateDirectory(path); path += "/" + packerName + ".apk"; //FilterEditorDLL(FilterEditorDLLModel.Assets2Backups); //更新SVN并且拷贝到streamingAssets SVNUpdate(RuntimePlatform.Android); BuildPipeline.BuildPlayer(GetBuildScenes(), path, BuildTarget.Android, BuildOptions.None); //FilterEditorDLL(FilterEditorDLLModel.Backups2Assets); if (!string.IsNullOrEmpty(lastDefineSymbols)) { PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.Android, lastDefineSymbols); } RemoveSVNResources(); AssetDatabase.Refresh(); System.Diagnostics.Process.Start(HS_Path.GetDirectoryName(path)); try { HS_Base.SystemDeleteFolder(androidPath); } catch (System.Exception _e) { D.LogForce("Ignore: " + _e.ToString()); } }