scala tags file building function