The overall energy required to digitize a given physical source can be comparable to the energy required for communication of the produced information bits, especially in cyber-physical sensing systems where radio links are short. When energy is at a premium, this fact calls for energy management solutions that are able to properly allocate the available energy over time between source and channel coding tasks. Energy management is particularly challenging for devices that operate via energy-harvesting, since the controller has to operate without full knowledge of the energy availability in the future. This work addresses the problem of energy allocation over source digitization and communication for a single energy-harvesting sensor. First, optimal policies that minimize the average distortion under constraints on the stability of the data queue connecting source and channel encoders are derived. It is shown that such policies perform independent resource optimizations for the source and channel encoders. The drawback of these policies is that they require an arbitrarily large battery to counteract the variability of the harvesting process and an infinite data queue to mitigate temporal variations in source and channel qualities. Suboptimal policies that do not have such drawbacks are then investigated as well, along with the optimal trade-off distortion vs. delay, which is addressed via dynamic programming tools.