1#!/bin/bash 2 3# Creates stubs for the checker framework annotations. 4 5ANNOTATIONS=( 6 kotlin.annotations.jvm.UnderMigration 7 org.checkerframework.checker.initialization.qual.UnknownInitialization 8 org.checkerframework.checker.nullness.compatqual.NullableType 9 org.checkerframework.checker.nullness.qual.EnsuresNonNull 10 org.checkerframework.checker.nullness.qual.EnsuresNonNullIf 11 org.checkerframework.checker.nullness.qual.MonotonicNonNull 12 org.checkerframework.checker.nullness.qual.Nullable 13 org.checkerframework.checker.nullness.qual.PolyNull 14 org.checkerframework.checker.nullness.qual.RequiresNonNull 15) 16 17ENUMS=( 18 kotlin.annotations.jvm.MigrationStatus 19) 20 21rm -r $(dirname $0)/src/* 22 23for a in ${ANNOTATIONS[@]}; do 24 package=${a%.*} 25 class=${a##*.} 26 dir=$(dirname $0)/src/${package//.//} 27 value_type="String[]" 28 file=${class}.java 29 mkdir -p ${dir} 30 sed -e"s/__PACKAGE__/${package}/"\ 31 -e"s/__CLASS__/${class}/"\ 32 -e"s/__VALUE_TYPE__/${value_type}/"\ 33 annotation_template.java > ${dir}/${file} 34done 35 36for a in ${ENUMS[@]}; do 37 package=${a%.*} 38 class=${a##*.} 39 dir=$(dirname $0)/src/${package//.//} 40 file=${class}.java 41 mkdir -p ${dir} 42 sed -e"s/__PACKAGE__/${package}/" -e"s/__CLASS__/${class}/" enum_template.java > ${dir}/${file} 43done 44