Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build tools need to handle build modes #4

Open
dcporter opened this issue May 29, 2013 · 4 comments
Open

Build tools need to handle build modes #4

dcporter opened this issue May 29, 2013 · 4 comments

Comments

@dcporter
Copy link
Member

In abbot, if you wrap code in:

//@if(debug)
...
//@endif

then it will be removed if not in debug mode.

It would be nice to build this as part of a more comprehensive build mode system, with possible developer access. Having a "qa" build mode would be nice, and not having to hard-code all the build modes would also be nice. =)

@mauritslamers
Copy link
Member

While implementing the //@if(debug) parser, I was thinking of the same. Currently the //@if(debug) is hardcoded (see https://github.com/sproutcore/build-tools/blob/master/lib/file_types/script.js#L88), but it is pretty easy to make this dynamic. I suspect however that things might become complex in case of simultaneous modes. Thoughts?

@dcporter
Copy link
Member Author

I would be in favor of not exposing support for simultaneous modes. I believe currently mode can be controlled by a command-line flag, but you can only specify one mode.

Having ad hoc support for //@if(any_mode) would be great (although it'll inevitably get misused...).

@mauritslamers
Copy link
Member

Reason I mention multiple modes is that instead of the entire multi-lang support with complicated folder structures, we could do the multilang support with

//@if(en)
//@endif(en)

After some thinking, I don't think it is very complicated. The model for parsing this would be similar to the

@theme(some-theme){ 
/* css */
}

as it is done for the css files.

@dcporter
Copy link
Member Author

I don't think localization is an appropriate use case for modes. Localization folders include css and images along with strings; it makes a lot of sense to keep everything together in that folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants