code: @Nonnull
    public static File scriptFileToJavaFile(@Nullable final File targetDir, @Nullable final String classPackage, @Nonnull final File scriptFile) {
      final String rawFileName = FilenameUtils.getBaseName(scriptFile.getName());
      final String className = CommonUtils.extractClassName(rawFileName);
      final String packageName = classPackage == null ? CommonUtils.extractPackageName(rawFileName) : classPackage;
  
      String fullClassName = packageName.isEmpty() ? className : packageName + '.' + className;
      fullClassName = fullClassName.replace('.', File.separatorChar) + ".java";
  
      return new File(targetDir, fullClassName);
    }
docs: Convert script file into path to Java class file.
  
  @param targetDir    the target dir for generated sources, it can be null
  @param classPackage class package to override extracted one from script name, it can be null
  @param scriptFile   the script file, must not be null
  @return java source file for the script file