the present invention relates to heterocyclic compounds of the general formula their pharmaceutically acceptable salts , pharmaceutically acceptable solvates , enantiomers , diastereomers , and polymorphs . the invention also relates to processes for the preparation of the compounds of invention , pharmaceutical compositions containing the compounds and their use as selective bruton &# 39 ; s tyrosine kinase inhibitors .