How to configure Sublime Text 2 ANT build script in Windows? - windows

I typically use Sublime Text on a Mac at work and it's fine. But I'm trying to set up Sublime Text with my Windows PC at home and keep getting errors when trying to run my build script.
Here's my project file:
{
"folders":
[
{
"path": "my-folder"
}
],
"build_systems":
[
{
"name": "Ant",
"cmd": ["ant"],
"working_dir": "${project_path}"
}
]
}
And here's the error I get:
[Error 2] The system cannot find the file specified
[cmd: [u'ant']]
[dir: D:\Users\****\Projects]
[path: C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\]
[Finished]
Seems that it can't find ANT? But isn't that bundled with Sublime Text?

Type 'ant' in your commandline. If it throws an error, then ant is not in your PATH. You'll need to install it (http://ant.apache.org/manual/install.html) and then add it to your PATH environment variable.
I use Sublime, but I don't know if it packages Ant by default. If it does, just add the location of the binary to your system PATH.

Related

How to compile Sass to CSS in Sublime Text 3 automatically?

For example, there is package for less LessToCss. As for Sass(or SCSS) I don't know what i should do. Ruby and sublime package Sass are installed.
You have to alter the PATH variable at the end of PATH string in the Environment Variables: Desktop - Properties - Environment Variables. It for win vista/7 users. Detail for 2000/XP here Sass compiler not working in sublime text 3
One way is to download a SASS build compiler from here: SASS Compiler
This is automatic Sublime package that simply builds your file at the place.
However since they released the new version, there seem to be multiple settings on this package - you could try to mess with that a bit and see what it can do nowdays.
Second way is to write your own Build command in Sublime. You do this by going to "Tools>Build System>New Build System..."
{
"cmd": ["sass", "--update", "$file:${project_path}/Project/Web/css/${file_base_name}.css", "--stop-on-error", "--style", "compressed", "--no-cache", "--sourcemap=none"],
"selector": "source.sass, source.scss",
"line_regex": "Line ([0-9]+):",
"osx":
{
"path": "/usr/local/bin:$PATH"
},
"windows":
{
"shell": "true"
}
}
Explanation: I use a folder structure as the following: Project/Web/CSS - If you have the Sublime Project FILE at the same level as Project FOLDER, then this will automatically build your Sass file (placed ANYWHERE in the project file) in your Web/CSS folder. Of course you can change this as you see fitting.
here is 100% solution, as i also using. Actually i am using in mac so, i am not sure about windows because i wouldn't try yet in windows but i think it will works in window's too.
so here is the build;
copy this from starting brackets and paste it into build and then save with any name like (Build to CSS),"
{
"cmd": ["sass", "--update", "$file:${file_path}/../css/${file_base_name}.css", "--stop-on-error", "--no-cache"],
"osx":
{
"path": "/user/local/bin:$PATH"
},
"windows":
{
"shell": true
}
}
If it's working then please comment.
Thanks

Could someone help me configure MinGW in SublimeText 3? (Newbie)

I downloaded MinGW following the first link here https://isocpp.org/get-started and now I need to configure it in SubimeText 3. I know I should go to Tools > Build System > New Build System... But what should I specify there?
I use Win7x64. And MinGW is in C:\MinGW
The complete reference for build systems is here. The first thing you need to do is make sure that the C:\MinGW\bin directory is in your PATH, then restart Sublime so the change gets picked up.
Once you've done that, create a new build system with the following contents:
{
"cmd": ["gcc", "${file}", "-o", "${file_base_name}.exe"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"shell": true,
"variants":
[
{
"name": "Run",
"cmd": ["start", "cmd", "/k", "${file_path}/${file_base_name}.exe"],
"shell": true
}
]
}
and save it as Packages/User/C.sublime-build where the Packages folder is the one opened by selecting Preferences -> Browse Packages....
You can now choose this build system by selecting Tools -> Build System -> C. Once you are ready to compile, save your source file, then hit CtrlB to build. To run the program, hit CtrlShiftB and a cmd window will open up to run the resulting .exe file, then stay open until you close it (so you can see any output produced by the program).
You can try to use the C++ build system that comes with Sublime, but some users have run into issues with it in the past, especially on Windows, so this custom one may suit your needs better.
Good luck!

Sublime Text projects on both Mac and Windows

I'm not sure if this is possible or been done before but...
I jump between a Windows and Mac Sublime Text 2 IDE. My active projects are stored in a Dropbox folder that is synced between my Windows machines. Tonight I opened up Sublime on my OSX Maverick machine hoping to pound out some code. Of course the project file wasn't able to find my Windows path and open the folders needed. I opened the project file and see my windows path being specified.
"folders":
[
{
"path": "/C/Users/me/Documents/Dropbox/Development/Projects/Active/folder"
}
]
Is it possible to specify the mac folder in the same project file? Am I missing something very simple?
Thank you!
There were multiple threads started on ST forums, I will post a few of them where you may find suggestions that may help, but there are no ways to do this but keeping the path relative to the .sublime-project file. You may keep it in the directory where your project resides and point to it with "path": ".".
https://www.sublimetext.com/forum/viewtopic.php?f=2&t=14601
http://www.sublimetext.com/forum/viewtopic.php?f=2&p=57728
https://www.sublimetext.com/forum/viewtopic.php?f=2&t=15278
As ST devs are very quiet right now I doubt it will be changed before the ST3 release.
I am using sublime text 3.
Creating a folder structure with sublime in Windows it looks like this:
{
"folders":
[
{
"path": "C:\Dropbox\workspace\01_snippets\os"
},
]
}
The only way to get it running on a mac and win is
* using relative paths
* to change from \ to /

Setting up sublime build file for sass/scss

I am trying to set-up automatic build of .scss files in Sublime Text 2. I keep getting the error [Error 2] The system cannot find the file specified. I've tried several configurations, but I'm just not getting it.
On my current project, the structure is like:
- 2014
- sites
- all
- themes
- 2014sub_theme
- sass
- css
I have set-up a project and within my .sublime-project file I have (complete file contents):
{
"folders":
[
{
"path": "sites/2014"
}
],
"build_systems":
[
{
"name": "SASS-Custom",
"cmd": [
"sass",
"--watch",
"sass:css"
],
"working_dir": "$project_path/sites/2014/sites/all/themes/2014sub_theme"
}
]
}
When I save, I get the following error:
[Error 2] The system cannot find the file specified
[cmd: [u'sass', u'--watch', u'sass:css']]
[dir: C:\wamp\www\sites\2014\sites\all\themes\2014sub_theme]
[path: __path stuff removed__]
[Finished]
Without a doubt, the sass folder is at C:\wamp\www\sites\2014\sites\all\themes\2014sub_theme\sass and css is at C:\wamp\www\sites\2014\sites\all\themes\2014sub_theme\css.
From cmd.exe, I do this:
cd C:\wamp\www\sites\2014\sites\all\themes\2014sub_theme
sass --watch sass:css
It works just fine, any changes to sass/global.scss are immediately compiled to css/global.css
I am using SublimeOnSaveBuild.
I ran into this same issue and spent quite a while messing with it. I know this is very late, probably too late to help you, but I'm going to answer anyway for anyone else who might stumble upon this question.
For some reason, just using "sass" fails from the ST3 build system. Change it to "sass.bat" (also a file in the same directory) and it worked for me.

Sublime Text 2 gives PATH error when trying to run a Grunt build system

I've created this build system for Sublime Text 2 to run my Grunt project:
{
"cmd": ["grunt"] ,
"selector": ["source.js", "source.less", "source.json"] ,
"working_dir": "${project_path}/MyProject" ,
"path": "/Users/me/.nvm/v0.10.0/bin",
"shell": true
}
Everytime I try to build, I get this error:
Warning: You need to have Ruby and Sass installed and in your PATH for
this task to work. More info:
Despite the fact that I've installed both Ruby and Sass, and both are available in the terminal. Also, I've tried "echo $PATH" and it looks ok...
/Library/Frameworks/Python.framework/Versions/2.7/bin:/Users/me/.venvburrito/bin:/Users/me/.nvm/v0.8.22/bin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Users/me/.rvm/gems/ruby-2.0.0-p0/bin:/Users/me/.rvm/gems/ruby-2.0.0-p0#global/bin:/Users/me/.rvm/rubies/ruby-2.0.0-p0/bin:/Users/me/.rvm/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin
Why can't sublime seem to access my environmental variables?
The "path" property will overwrite the existing path. You'll need to either remove the property or manually add in the path to the Sass binary. You can find it using which sass.
Example:
"path": "/usr/local/bin/:/Users/me/.nvm/v0.10.0/bin"
Got it working. I had to add this to the "path" property:
"/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/me/.rvm/rubies/ruby-2.0.0-p0/bin/ruby:/Users/me/.rvm/gems/ruby-2.0.0-p0/bin/sass:/Users/me/.nvm/v0.10.0/bin"
Obviously you'll have to replace "me" with your own name. Thanks to Sindre Sorhus for pointing me in the right direction.

Resources