The deal will see German planes fly from a Scottish RAF base and lead to closer collaboration on developing new military equipment.