├── .gitignore ├── README.md ├── SublimeLogger-Source ├── .gitignore ├── LoggerImpl.cs ├── Properties │ └── AssemblyInfo.cs ├── README ├── SublimeLogger.csproj ├── SublimeLogger.pidb └── SublimeLogger.sln ├── SublimeLogger.dll ├── SublimeLogger.pdb ├── Unity.sublime-build └── UnityBuild.sublime-project /.gitignore: -------------------------------------------------------------------------------- 1 | /*.sublime-workspace -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | UnityBuild 2 | ======== 3 | 4 | This is an extension of Sublime Text 2 to support Unity 3d builds. 5 | 6 | Use Unity as build system and enjoy ! 7 | 8 | Windows 9 | ======== 10 | 11 | If it does not work at the first time, check the xbuild path in UnityBuild.sublime-build (it uses the default location of Unity) 12 | (C:\\Program Files (x86)\\Unity\\Editor\\Data\\Mono\\bin\\) 13 | 14 | OSX 15 | ======== 16 | 17 | Make sure you have MonoDevelop 2.10.2 installed on your OSX in the default location. 18 | If get it here : http://download.mono-project.com/archive/2.10.2/macos-10-x86/5.4/MonoFramework-MRE-2.10.2_5.4.macos10.novell.x86.dmg 19 | 20 | If it does not work at the first time, check the xbuild path in UnityBuild.sublime-build (it uses the default location of Unity) 21 | (/Applications/Unity/MonoDevelop.app/Contents/Frameworks/Mono.framework/Commands/xbuild) 22 | 23 | 24 | NB : The logger used is based on Jacob Pennock's logger -------------------------------------------------------------------------------- /SublimeLogger-Source/.gitignore: -------------------------------------------------------------------------------- 1 | *.csproj.user 2 | *.resharper.user 3 | *.resharper 4 | *.suo 5 | *.cache 6 | *.usertasks 7 | *.userprefs 8 | *.licx 9 | *.bak 10 | *.log 11 | *.user 12 | *.vspscc 13 | *.vssscc~$* 14 | deploy/* 15 | _ReSharper.* 16 | [Oo]bj 17 | [Bb]in 18 | deploy 19 | StyleCop.Cache 20 | aspnet_client 21 | Thumbs.db 22 | TestResults 23 | *.generated.cs 24 | /*.sublime-* -------------------------------------------------------------------------------- /SublimeLogger-Source/LoggerImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.IO; 4 | using Microsoft.Build.Framework; 5 | using Microsoft.Build.Utilities; 6 | 7 | namespace SublimeLogger 8 | { 9 | public class LoggerImpl : Logger 10 | { 11 | private int ErrorCount; 12 | private int WarningCount; 13 | private string ProjectDirectory; 14 | 15 | 16 | public override void Initialize(IEventSource eventSource) 17 | { 18 | eventSource.ProjectStarted += ProjectStarted; 19 | eventSource.BuildStarted += BuildStarted; 20 | eventSource.BuildFinished += BuildFinished; 21 | eventSource.ErrorRaised += ErrorRaised; 22 | eventSource.WarningRaised += WarningRaised; 23 | ErrorCount = 0; 24 | WarningCount = 0; 25 | } 26 | 27 | void ProjectStarted(object sender, ProjectStartedEventArgs e) 28 | { 29 | ProjectDirectory = Path.GetDirectoryName(e.ProjectFile); 30 | } 31 | 32 | void BuildFinished(object sender, BuildFinishedEventArgs e) 33 | { 34 | Console.ForegroundColor = ConsoleColor.White; 35 | if (e.Succeeded) 36 | { 37 | Console.ForegroundColor = ConsoleColor.DarkGreen; 38 | Console.WriteLine("Compilation SUCCEEDED! Errors:{0} Warnings:{1}",ErrorCount,WarningCount); 39 | } 40 | else 41 | { 42 | Console.ForegroundColor = ConsoleColor.DarkRed; 43 | Console.WriteLine("Compilation FAILED! Errors:{0} Warnings:{1}",ErrorCount,WarningCount); 44 | } 45 | Console.BackgroundColor = ConsoleColor.Black; 46 | } 47 | 48 | void BuildStarted(object sender, BuildStartedEventArgs e) 49 | { 50 | Console.WriteLine("Sublime Text 2 output logger by Jacob Pennock, Updated by Frédéric Vauchelles"); 51 | } 52 | 53 | void ErrorRaised(object sender, BuildErrorEventArgs e) 54 | { 55 | string fullPath = ProjectDirectory != null ? Path.Combine(ProjectDirectory, e.File) : e.File; 56 | Console.ForegroundColor = ConsoleColor.DarkRed; 57 | Console.WriteLine("{0}({1},{2}) error:{3} {4}", fullPath, e.LineNumber, e.ColumnNumber, e.Code, e.Message); 58 | ErrorCount++; 59 | Console.ForegroundColor = ConsoleColor.White; 60 | } 61 | 62 | void WarningRaised(object sender, BuildWarningEventArgs e) 63 | { 64 | string fullPath = ProjectDirectory != null ? Path.Combine(ProjectDirectory, e.File) : e.File; 65 | Console.ForegroundColor = ConsoleColor.DarkYellow; 66 | if (e.Code != null) 67 | { 68 | Console.WriteLine("{0}({1},{2}) warning:{3} {4}", fullPath, e.LineNumber, e.ColumnNumber, e.Code, e.Message); 69 | WarningCount++; 70 | } 71 | Console.ForegroundColor = ConsoleColor.White; 72 | } 73 | 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /SublimeLogger-Source/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("SublimeLogger")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("SublimeLogger")] 12 | [assembly: AssemblyCopyright("")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("3d1846d7-4550-41df-826a-541ca8b74f06")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /SublimeLogger-Source/README: -------------------------------------------------------------------------------- 1 | This is a custom xbuild logger by Jacob Pennock in order to facilitate the Sublime Build System RegEx parsing for use with Unity 3d game engine. 2 | 3 | Use of this system to test complie your unity C# scripts is very untested and unreailable at best. I would recomend against using 4 | it on a production project. 5 | 6 | Rename the file MyUnityProject.sublime-project to the name of your project (this all might break if your project has spaces in its name) Then move it outside the SublimeUnity folder and into the root of your project (the folder containing assets and all the .sln files). Open one of you scripts in sublime and hit ctr+B to build and hope it works. 7 | 8 | Now you can by pressing F7 build the solution, and if the compilation fails you could use F4 and Shift+F4 to loop between the files with compilation errors. 9 | 10 | Good luck but be warned, there be dragons here. 11 | 12 | -------------------------------------------------------------------------------- /SublimeLogger-Source/SublimeLogger.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {286CC341-0BCA-4A7F-AAA2-A6AC6ACFEFBA} 9 | Library 10 | Properties 11 | SublimeLogger 12 | SublimeLogger 13 | v2.0 14 | 512 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | ..\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 52 | -------------------------------------------------------------------------------- /SublimeLogger-Source/SublimeLogger.pidb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredericvauchelles/UnityBuild/2e72bc7cd3108c801e64655ec8a0863d78237067/SublimeLogger-Source/SublimeLogger.pidb -------------------------------------------------------------------------------- /SublimeLogger-Source/SublimeLogger.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SublimeLogger", "SublimeLogger.csproj", "{286CC341-0BCA-4A7F-AAA2-A6AC6ACFEFBA}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {286CC341-0BCA-4A7F-AAA2-A6AC6ACFEFBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {286CC341-0BCA-4A7F-AAA2-A6AC6ACFEFBA}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {286CC341-0BCA-4A7F-AAA2-A6AC6ACFEFBA}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {286CC341-0BCA-4A7F-AAA2-A6AC6ACFEFBA}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /SublimeLogger.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredericvauchelles/UnityBuild/2e72bc7cd3108c801e64655ec8a0863d78237067/SublimeLogger.dll -------------------------------------------------------------------------------- /SublimeLogger.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fredericvauchelles/UnityBuild/2e72bc7cd3108c801e64655ec8a0863d78237067/SublimeLogger.pdb -------------------------------------------------------------------------------- /Unity.sublime-build: -------------------------------------------------------------------------------- 1 | { 2 | "windows": { 3 | "cmd": [ 4 | "C:\\Program Files (x86)\\Unity\\Editor\\Data\\Mono\\bin\\xbuild.bat", 5 | "${project_path}\\\\${project_base_name}-csharp.sln", 6 | "/noconsolelogger", 7 | "/logger:${packages}\\Unity3D Build System\\SublimeLogger.dll" 8 | ], 9 | "file_regex": "^([\\d\\w:\\\\\\.-]*)\\((\\d+),(\\d+)\\)\\s*(.*)$" 10 | }, 11 | "osx": { 12 | "cmd": [ 13 | "/Applications/Unity/MonoDevelop.app/Contents/Frameworks/Mono.framework/Commands/xbuild", 14 | "${project_path}/${project_base_name}-csharp.sln", 15 | "/noconsolelogger", 16 | "/logger:${packages}/Unity3D Build System/SublimeLogger.dll" 17 | ], 18 | "file_regex": "^([\\d\\w:/\\.-]*)\\((\\d+),(\\d+)\\)\\s*(.*)$" 19 | }, 20 | "variants": [ 21 | { 22 | "name": "Clean", 23 | "windows": { 24 | "cmd": [ 25 | "C:\\Program Files (x86)\\Unity\\Editor\\Data\\Mono\\bin\\xbuild.bat", 26 | "${project_path}\\\\${project_base_name}-csharp.sln", 27 | "/target:Clean", 28 | "/noconsolelogger", 29 | "/logger:${packages}\\Unity3D Build System\\SublimeLogger.dll" 30 | ] 31 | }, 32 | "osx": { 33 | "cmd": [ 34 | "/Applications/Unity/MonoDevelop.app/Contents/Frameworks/Mono.framework/Commands/xbuild", 35 | "${project_path}/${project_base_name}-csharp.sln", 36 | "/target:Clean", 37 | "/noconsolelogger", 38 | "/logger:${packages}/Unity3D Build System/SublimeLogger.dll" 39 | ] 40 | } 41 | } 42 | ] 43 | } 44 | -------------------------------------------------------------------------------- /UnityBuild.sublime-project: -------------------------------------------------------------------------------- 1 | { 2 | "folders": 3 | [ 4 | { 5 | "path": "/C/Users/workstation1-user/AppData/Roaming/Sublime Text 2/Packages/UnityBuild" 6 | } 7 | ] 8 | } 9 | --------------------------------------------------------------------------------