You might be thinking of the Rocket Hideout, which is a dungeon you explore in Pokémon FireRed (LeafGreen's counterpart). In FireRed, you do have to defeat Team Rocket members and their leader, Giovanni, within the Rocket Hideout.
If you're looking for something similar in LeafGreen, it's a bit different. Here's a breakdown of how Team Rocket works in LeafGreen:
1. Initial Encounters: You'll encounter Team Rocket members in various locations, like the Pokémon Center and Celadon City.
2. S.S. Anne: You'll have a major encounter with Team Rocket aboard the S.S. Anne.
3. Silph Co. Headquarters: The main confrontation with Team Rocket takes place in the Silph Co. Headquarters, where you ultimately face off against Giovanni.
While there isn't a specific "Rocket Building" task, the game certainly involves a lot of combat against Team Rocket members in these locations.