Home Download Buy Blog Forum Support

Build system question

Build system question

Postby ttvd on Sun Apr 17, 2011 1:06 am

Hello!

I have a question regarding build system (.build-system) json format. Currently, cmd specifies an array of values, first value is command to execute, and rest are parameters passed to the first value.

How do I specify multiple commands? Basically what I want to achieve is to run a build system and then run a post-build script.

Thank you very much.
tt
ttvd
 
Posts: 8
Joined: Sun Apr 17, 2011 12:57 am

Re: Build system question

Postby jbrooksuk on Mon Apr 18, 2011 9:12 am

ttvd wrote:How do I specify multiple commands? Basically what I want to achieve is to run a build system and then run a post-build script.

I believe the only way to do this is to set the main command as a .bat file or whatever the equivalent is for your OS, then make that run your post-build script :)
jbrooksuk
 
Posts: 781
Joined: Sun Apr 11, 2010 10:37 am
Location: England

Re: Build system question

Postby gingerbeardman on Mon Apr 18, 2011 11:53 am

Any idea what PATH Sublime Text uses?

I've added locations to my system PATH but it still doesn't find the cmd.
gingerbeardman
 
Posts: 10
Joined: Fri Apr 15, 2011 11:33 am

Re: Build system question

Postby guillermooo on Mon Apr 18, 2011 12:37 pm

Has your new PATH properly propagated to the system? You might need to log off and log back on from your account. If it works in a command processor window (DOS box), it should work in Sublime too.
guillermooo
 
Posts: 729
Joined: Thu Jul 23, 2009 9:06 am

Re: Build system question

Postby gingerbeardman on Mon Apr 18, 2011 2:21 pm

I have restarted since, and it works from the command line.

Can I print any details of the command environment from Sublime?

I am on Mac OS X btw.
gingerbeardman
 
Posts: 10
Joined: Fri Apr 15, 2011 11:33 am

Re: Build system question

Postby guillermooo on Mon Apr 18, 2011 2:41 pm

Python console (ctrl+`) > os.environ['PATH'] if you want to doublecheck the env vars.
guillermooo
 
Posts: 729
Joined: Thu Jul 23, 2009 9:06 am

Re: Build system question

Postby gingerbeardman on Tue Apr 19, 2011 3:19 pm

Thanks, that python call did not work but I will do some reading...

>>> os.environ['PATH']
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'os' is not defined


Also, in answer to the original poster, you can pass multiple parameters as follows:
Code: Select all
{
   "cmd": ["app", "-param1", "-param2", "\"$file\""],
   "working_dir": "${project_path:${folder:${file_path}}}",
   "selector": "source.language"
}

HTH,
matt
gingerbeardman
 
Posts: 10
Joined: Fri Apr 15, 2011 11:33 am

Re: Build system question

Postby ttvd on Wed Apr 20, 2011 6:39 am

jbrooksuk wrote:
ttvd wrote:How do I specify multiple commands? Basically what I want to achieve is to run a build system and then run a post-build script.

I believe the only way to do this is to set the main command as a .bat file or whatever the equivalent is for your OS, then make that run your post-build script :)


Ha, great suggestion, I should have thought of that, thanks.
ttvd
 
Posts: 8
Joined: Sun Apr 17, 2011 12:57 am

Re: Build system question

Postby gingerbeardman on Wed Apr 20, 2011 10:20 am

See my example above for a built-in way of sending multiple parameters: just list them individually between the command and the file.
gingerbeardman
 
Posts: 10
Joined: Fri Apr 15, 2011 11:33 am

Re: Build system question

Postby jashatton on Thu Feb 23, 2012 6:54 pm

I am trying out Sublime and so far it is impressive. I did notice pretty quickly I wanted a way to pass dynamic arguments to the build command. For build systems like Ant, Gradle, and Maven that have a lot of tasks and switches having to enter a new build command into the build-systems configuration file wouldn't be practical long term. What I am looking for is a way to execute a build through the command palette and enter what ever parameters I want there. It appears this isn't supported at least through the documentation or what I have found so far on the Internet. Are there plans to support this? Is there a way to override the current implementation easily (less than a couple days) and implement it through a plugin?

Thanks,
Jas

I have put a request out on the UserEcho site. I missed the sticky topic before submitting :).
jashatton
 
Posts: 1
Joined: Thu Feb 23, 2012 6:33 pm


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 15 guests