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

always compile project not focused asset #170

Closed
tablatronix opened this issue Sep 16, 2017 · 23 comments
Closed

always compile project not focused asset #170

tablatronix opened this issue Sep 16, 2017 · 23 comments

Comments

@tablatronix
Copy link

Is there a way to have a "project", so that when you compile it compiles a specific file, not the current focused file ?

Is there say anyway I could have all assets open, be editing a included library, and when i compile it compiles the primary assert via some flag, or ini setting ?

@tablatronix
Copy link
Author

Or even easier to implement, optionally open a dialog select to pick which open file to compile, and remember the last one autoselected

@gepd
Copy link
Owner

gepd commented Sep 16, 2017

PlatformIO is project based, you can open any file inside of the source folder and compile it.

There was an issue when I launched v2.0 but it was fixed, have you tried to compile with other file?

@tablatronix
Copy link
Author

I guess i need to look into the pio way of doing this, these are not in the same source folder or even project, I am working on dependancies external to the project but need to compile an arduino sketch for example to test it, or some external unit tests, so I have to go back to that file ( the includee) and compile there, was looking for a way to hit compile anywhere and it could always compile that file instead.

@gepd
Copy link
Owner

gepd commented Sep 16, 2017

What is your O.S?

@tablatronix
Copy link
Author

I use pc and mac

@gepd
Copy link
Owner

gepd commented Sep 16, 2017

In mac you can use symplink to the external files

But could be easier and cross-platform to have all your external sources in the same folder, (like libraries) and then use the lib_dir flag.

In deviot you can assign a folder from Deviot Menu > Library Options > Extra Library Folder, this option will add the lib_dir flag on each environment when the project is compiled, but you can also edit the platformio.ini file (Devito Menu > Open Build Config File) and add

[common]
lib_dir =
pathtoexternalsource1
pathtoexternalsource2
...

That way it will add the external source on each environment

@tablatronix
Copy link
Author

tablatronix commented Sep 16, 2017

Yeah that is how i use libraries, but how does that address making compile global so it does not compile the cpp or h file but the main cpp or ino.

lets say i have a project a bunch of open files etc.

Example

myproject.ino
#include dostufflibrary

This library is in development, or has a bug, or i am optimizing it.
editing dostufflibrary.cpp make change

tab back to myproject.ino <-- how to avoid this step
compile

go back to editing dostufflibrary.cpp

@tablatronix
Copy link
Author

Added example of what I am specifically talking about, in case it is still not clear.

@gepd
Copy link
Owner

gepd commented Sep 17, 2017

I see, what do you think of an option to "freeze" deviot on a specific project? so it wouldn't matter what file you are working on, it will always compile the same project.

The steps could be this:

  1. Open/Select the file to "Freese"
  2. Select the option to freeze

@tablatronix
Copy link
Author

tablatronix commented Sep 17, 2017

Would this affect multiple instances of sublime text , that would be bad.

I think that would be acceptable, i mean you would only turn it on and off when you needed something like that, say you are working on (compiling/uploading) a library example file, and debugging the cpp file for a bug in the actual library, this would help with the back and forth, or focused window, also i cant tell you how many times I "compile" the serial terminal, or a .h file on accident.

I am surprised sublime has no concept of starring or flagging a file in a sublime project, as a main file or something.

Other option a popup dialog with last compiled file in it selected, optional toggle

@gepd
Copy link
Owner

gepd commented Sep 17, 2017

The popup dialog is also possible, it should list only the files previously compiled or all projects currently open? This should be enable/disable from an option too

what do you think?

@tablatronix
Copy link
Author

Maybe previous compiled and currently open in current session/instance only

@tablatronix
Copy link
Author

And yes optional in configmor menu you dont want this always on

@tablatronix
Copy link
Author

Oh and why does deviot not have a standard package ini file like most plugins?

@gepd
Copy link
Owner

gepd commented Sep 17, 2017

Oh and why does deviot not have a standard package ini file like most plugins?

Which one do you mean?

@tablatronix
Copy link
Author

The package control settings config files that other plugins use to control more advanced preferences

@gepd
Copy link
Owner

gepd commented Sep 18, 2017

Mainly because Deviot use a own menu, most of the plugins uses the config file because there is not other way to access to the options, but in this case you can edit each parameter of the plugin from the menu. Most the options are updated automatically.

Which option would you include in the configuration file?

@tablatronix
Copy link
Author

Most plugins use the prefs menu to allow advanced configs, and their key binding files. Users know how to back these up and transfer them. I don't think you need to put every option in the menu as this gets more advanced and users get picky, would be a good place to allow users to modify baud rate lists, verbose modes, and other things users want hacked in etc.

@gepd gepd added this to the v2.2 milestone Sep 20, 2017
@gepd
Copy link
Owner

gepd commented Sep 20, 2017

At this moment Deviot haven't the menu option to edit the key bindings file, but you can always edit them from Packages/Deviot (Arduino IDE)/Shortcuts.

In the case of the config file, I've to create the template with all the available options, but technically you can edit the file in Packages/User/deviot.sublime-settings as you want. I haven't done it because time reason. I've given priority to GUI options because Deviot born as an alternative to the Arduino IDE, and the idea is to keep it easy.

I've pushed a new commit with the freeze feature. (Deviot 2.2.0-dev.3)
It works as I wrote before.

  1. Select the tab with the sketch to "freeze"
  2. Go to Deviot Menu > Freeze Sketch
  3. Now Deviot will compile the same sketch from any tab.

Note: You can unfreeze the sketch from any tab

@tablatronix
Copy link
Author

Ok i was curious maybe throw it on a milestone or a roadmap ?

@gepd
Copy link
Owner

gepd commented Sep 21, 2017

Definitelly, I'll first finish to write the documentation in the wiki and I'll start to solve this kind of issues.

Let me know if the new feature is working well

@tablatronix
Copy link
Author

Yeah works pretty great!

@gepd
Copy link
Owner

gepd commented Sep 21, 2017

So I'll close this issue, re-open it if you find any problem

@gepd gepd closed this as completed Sep 21, 2017
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