#!/bin/sh

# Removing unreachable statements which cause compilation errors, and then putting the generated classes in the source tree.
# We do this only once: this does not have to happen during the test phase.
if [ -e $PWD/target/generated-sources/annotations/com/baselet/element/facet/customdrawings/gen/CustomDrawingParser.java ]; then
    for F in facet/customdrawings/gen/CustomDrawingParser.java sequence_aio/facet/specific/gen/SequenceAllInOneParser.java; do
        sed -i '/Missing return statement in function/d' $PWD/target/generated-sources/annotations/com/baselet/element/$F;
    done
    
    cp -a $PWD/target/generated-sources/annotations/com/baselet/element/sequence_aio/facet/specific $PWD/src/main/java/com/baselet/element/sequence_aio/facet/
    cp -a $PWD/target/generated-sources/annotations/com/baselet/element/facet/customdrawings/gen $PWD/src/main/java/com/baselet/element/facet/customdrawings/
fi
