SDL
SDL copied to clipboard
Uppercase first char on the Activity-class name | androidbuild.sh
I noticed the androidbuild.sh
script does not make the first character uppercase in the Android Activity-class name, which is a Java-convention. I see the class name is generated by the script args, and with BASH 5.1 the @u
can uppercase it along with the corresponding Java source file:
# Uppercase the first char in the activity class name because it's Java
ACTIVITY="${folder@u}Activity"
sed -i -e "s|\"SDLActivity\"|\"$ACTIVITY\"|g" $BUILDPATH/app/src/main/AndroidManifest.xml
# Fill in a default Activity
cat >"$ACTIVITY.java" <<__EOF__
package $APP;
import org.libsdl.app.SDLActivity;
public class $ACTIVITY extends SDLActivity
{
}
__EOF__