AG Barr has recorded an increase in full-year profits driven by an increase in brand investment.