From the very beginning of Android, HTC has made it a habit to release the source code to each of their smart phones. Today finds the handset maker releasing the source code for the G2, MyTouch 4G and Droid Incredible in their Developer Center. The developing community will probably be very happy with those, making a good and stable root possibly much easier. Please note: The source of the G2 is not meant for the Desire Z. The G2 is running stock Froyo, while the Desire Z is creamed with HTC Sense.
Source: HTC Developer Center