The build/deploy using the CLI (and, for me, VS Code) seems to work well: https://makecode.com/cli
As described, I used the server to import the project, so it was placed in the projects director. I then switched to VS code and command-line builds.
pxt deploy --local builds both CODAL and DAL via Docker (or local yotta if an environment variable is set). Maybe there’s some way to specify just DAL or CODAL, but I haven’t looked yet. I’m doing an extension, which includes a .ts file to test it. It’ll deploy to whatever type of mico:bit is connected. (build can be used for just builds)
Build time with docker (the default) still a little slower than I’d like, but far better than the cloud. Error messages are also visible.
All the source for the platforms are included in subdirectories of built. There are separate subtrees for DAL (dockeryt) and CODAL (dockercodal).
Building locally with yotta (rather than docker+yotta) was a lot faster. I’ll be using this approach. I also noticed some warnings and errors that I didn’t with docker (Maybe I just overlooked them before).
Setup for me (macOS) required installing Yotta: https://docs.yottabuild.org/ . I followed the “Installation On OSX / Manual Installation” section. I already had homebrew installed. I had to modify instructions a bit: I had to do pip3 rather than pip, and for some reason ninja didn’t install - maybe I missed an error message, so I just did a separate brew install ninja. The build system also needs srecord, so brew install srecord.
I had to modify / export some shell variables. Yotta was installed in my user folder. I had to do something like this: export PATH=$PATH:~/Library/Python/3.7/bin (yt was in that bin). And to make pxt use local yotta rather than docker: export PXT_NODOCKER=1
It looks like local yotta’s build places sources in built/yt/ (DAL) and built/codal (CODAL).
I think VS Code’s intellisense is working a bit better with local yotta, which is helpful.
I’m using conditional compilation in .cpp files for CODAL/DAL differences (based on examples in other packages). (#if MICROBIT_CODAL ... #else ... #endif)
The --serial or --console options to pxt don’t seem to work. (I’m directed to install native support, which doesn’t appear to have an impact). Instead I’m using the Web-based console I made for other things: https://bsiever.github.io/microbit-webusb/ . It works reasonably well.
I still wouldn’t mind some tips on more effective use of VS code. I’m still using command line (separate window, not even a VS Code shell) to both run pxt and to push back to github. I’m sure there are better ways. That being said, both of these are minor compared to the slow build process and not seeing compilation errors.