Posts

Showing posts from 2017

Emulating line-buffering mode (Gradle example)

C printf() function doesn't flush buffers by default, and a lot of code using it may miss this, therefore creating interactivity problems to the end user. It's not specific to C though - it's about the standard I/O streams, and the problem may appear anywhere. The post is based on StackExchange discussion, so you can dig deeper if you want: Turn off buffering in pipe.

Xcode build settings

Image
Xcode build locations may mislead developers hoping to fully control the output of the IDE. While we can use CONFIGURATION_BUILD_DIR for the xcodebuild tool during continuous integration, IDE generates files in different locations, and sometimes we want to control it too.

Thunderbird Grammar Checker 0.7 has been released

Link: https://addons.mozilla.org/en-US/thunderbird/addon/grammar-checker/

This is a maintenance release that has fixed the compatibility issues with the LanguageTool API v2 (the current one) and the new Thunderbird API. No functionality has been added, but now the add-on actually works.

Development of the add-on have been moved to Github: https://github.com/nuald/thb-gramchecker

Unfortunately, I can't actively maintain the add-on, but all pull requests are welcomed.

Gradle task for launching Android simulator

Android build toolchain, albeit being powerful, sometimes lacks some essential functionality required for the modern software development. In particular, running instrumented unit-tests in the CI environment: those tests require a device or a simulator running, however developers need some scripting to make it work.

To simplify the task, I've created a Gradle task that verifies if any Android device or simulator is connected. If not, the task launches a simulator with the first AVD in the list (or fails if no AVDs are found). It's up to you to make the dependencies for the connectedCheck task. The sample output:

> ./gradlew connect --info

...

:AndroidSampleApp:connect (Thread[main,5,main]) started.
:AndroidSampleApp:connect
Executing task ':AndroidSampleApp:connect' (up-to-date check took 0.001 secs) due to:
  Task has not declared any outputs.
Detecting devices...
Launching emulator for Nexus_5_API_25 ...
:AndroidSampleApp:connect (Thread[main,5,main]) completed. Took 14.18…