Created
May 8, 2013 03:20
-
-
Save zettoone/5537955 to your computer and use it in GitHub Desktop.
Running Premake from Visual Studio (http://industriousone.com/topic/running-premake-visual-studio)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' Open the Macro Explorer (Tools/Macros/Macro Explorer), create a new Module, and add the following subroutine: | |
Sub RunPremake() | |
If Not DTE.Solution Is Nothing And Not String.IsNullOrEmpty(DTE.Solution.FullName) Then | |
Dim solutionPath, solutionDir, premakeTarget, premakeFlags, premakeExePath, premakeScriptDir As String | |
solutionPath = DTE.Solution.FullName | |
solutionDir = solutionPath.Substring(0, solutionPath.LastIndexOf("\")) | |
premakeTarget = solutionDir.Substring(solutionDir.LastIndexOf("\") + 1) | |
' You might need to adjust these | |
premakeFlags = "" | |
premakeExePath = "C:\premake\premake4.exe" ' need to be changed | |
premakeScriptDir = solutionDir + "\..\.." ' need to be changed | |
DTE.ExecuteCommand("File.CloseSolution") | |
ChDir(premakeScriptDir) | |
Dim command As String | |
command = premakeExePath + " " + premakeFlags + " " + premakeTarget | |
Shell(command, AppWinStyle.NormalFocus, True) | |
DTE.Solution.Open(solutionPath) | |
Else | |
MsgBox("No solution!") | |
End If | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment