I take it as "in order to deliver this cantrip to the target, you do a normal weapon attack". So you cast the spell first and it grants the attack, but I claim that the delivery method is by weapon attack, not that the spell delivers the attack.
In short, the spell grants the attack, but does...