build_file_alias Perf Improvement: Move class declaration out of method target_macro
build_file_alias Perf Improvement: Move class declaration out of method target_macro

`target_macro` is called once for each macro for each BUILD file. If you have a lot of build files and a lot of macros, it can become expensive to declare large numbers of classes. This moves the declaration out of the method, so it will only be defined once.

Testing Done:
Ran unit tests locally, ci in progress.

Bugs closed: 2822

closes #2822

Reviewed at https://rbcommons.com/s/twitter/r/3361/

pantsbuild/pants,lahosken/pants,manasapte/pants,pantsbuild/pants,landism/pants,mateor/pants,gmalmquist/pants,dbentley/pants,ity/pants,UnrememberMe/pants,twitter/pants,UnrememberMe/pants,gmalmquist/pants,gmalmquist/pants,mateor/pants,15Dkatz/pants,landism/pants,benjyw/pants,fkorotkov/pants,baroquebobcat/pants,landism/pants,mateor/pants,foursquare/pants,15Dkatz/pants,foursquare/pants,landism/pants,ericzundel/pants,UnrememberMe/pants,pantsbuild/pants,benjyw/pants,benjyw/pants,lahosken/pants,foursquare/pants,UnrememberMe/pants,manasapte/pants,tdyas/pants,kwlzn/pants,ity/pants,pombredanne/pants,landism/pants,UnrememberMe/pants,kwlzn/pants,lahosken/pants,fkorotkov/pants,pantsbuild/pants,dturner-tw/pants,peiyuwang/pants,fkorotkov/pants,tdyas/pants,ericzundel/pants,pombredanne/pants,cevaris/pants,dbentley/pants,gmalmquist/pants,baroquebobcat/pants,ity/pants,dturner-tw/pants,benjyw/pants,peiyuwang/pants,UnrememberMe/pants,mateor/pants,kwlzn/pants,tdyas/pants,twitter/pants,pombredanne/pants,benjyw/pants,peiyuwang/pants,foursquare/pants,peiyuwang/pants,fkorotkov/pants,gmalmquist/pants,wisechengyi/pants,baroquebobcat/pants,dturner-tw/pants,twitter/pants,peiyuwang/pants,mateor/pants,ericzundel/pants,peiyuwang/pants,15Dkatz/pants,foursquare/pants,landism/pants,tdyas/pants,peiyuwang/pants,manasapte/pants,manasapte/pants,ity/pants,twitter/pants,wisechengyi/pants,fkorotkov/pants,manasapte/pants,gmalmquist/pants,peiyuwang/pants,cevaris/pants,UnrememberMe/pants,kwlzn/pants,cevaris/pants,landism/pants,15Dkatz/pants,ericzundel/pants,tdyas/pants,kwlzn/pants,kwlzn/pants,dturner-tw/pants,pantsbuild/pants,baroquebobcat/pants,wisechengyi/pants,15Dkatz/pants,dturner-tw/pants,jsirois/pants,foursquare/pants,pantsbuild/pants,dbentley/pants,foursquare/pants,fkorotkov/pants,twitter/pants,15Dkatz/pants,benjyw/pants,twitter/pants,tdyas/pants,twitter/pants,cevaris/pants,manasapte/pants,pombredanne/pants,wisechengyi/pants,pombredanne/pants,ericzundel/pants,cevaris/pants,dbentley/pants,baroquebobcat/pants,mateor/pants,lahosken/pants,tdyas/pants,jsirois/pants,pombredanne/pants,lahosken/pants,baroquebobcat/pants,lahosken/pants,ity/pants,pombredanne/pants,ity/pants,gmalmquist/pants,benjyw/pants,manasapte/pants,foursquare/pants,cevaris/pants,lahosken/pants,tdyas/pants,ericzundel/pants,wisechengyi/pants,fkorotkov/pants,wisechengyi/pants,landism/pants,UnrememberMe/pants,baroquebobcat/pants,15Dkatz/pants,ity/pants,dturner-tw/pants,fkorotkov/pants,jsirois/pants,wisechengyi/pants,mateor/pants,UnrememberMe/pants,wisechengyi/pants,wisechengyi/pants,dturner-tw/pants,tdyas/pants,ericzundel/pants,dbentley/pants,twitter/pants,baroquebobcat/pants,dbentley/pants,dbentley/pants,mateor/pants,kwlzn/pants,lahosken/pants,foursquare/pants,twitter/pants,cevaris/pants,baroquebobcat/pants,pantsbuild/pants,15Dkatz/pants,ericzundel/pants