private void addBlockMetadata(Block block, BlockKind kind) {
    AnnotationNode blockAnn = new AnnotationNode(nodeCache.BlockMetadata);
    blockAnn.setMember(BlockMetadata.KIND, new PropertyExpression(
        new ClassExpression(nodeCache.BlockKind), kind.name()));
    ListExpression textExprs = new ListExpression();
    for (String text : block.getDescriptions()) {
      textExprs.addExpression(new ConstantExpression(text));
    }
    blockAnn.setMember(BlockMetadata.TEXTS, textExprs);
    int index = blockAnnElems.getExpressions().size();
    Assert.that(index == block.getBlockMetaDataIndex(),
        () -> kind + " block mismatch of index: " + index + ", block.getBlockMetaDataIndex(): " + block.getBlockMetaDataIndex());
    blockAnnElems.addExpression(new AnnotationConstantExpression(blockAnn));
  }
Puts all spec information required at runtime into annotations
attached to class members.

@author Peter Niederwieser
spock-core/src/main/java/org/spockframework/compiler/SpecAnnotator.java