def jar(ctx, jython_version='2.7.2', pyyaml_version='5.1', jar_name=None, remove_dist=False): """Create JAR distribution. Downloads Jython JAR and PyYAML if needed. Args: jython_version: Jython version to use as a base. Must match version in `jython-standalone-<version>.jar` found from Maven central. pyyaml_version: Version of PyYAML that will be included in the standalone jar. The version must be available from PyPI. remove_dist: Control is 'dist' directory initially removed or not. """ clean(ctx, remove_dist, create_dirs=True) jython_jar = get_jython_jar(jython_version) print(f"Using '{jython_jar}'.") compile_java_files(ctx, jython_jar) unzip_jar(jython_jar) remove_tests() copy_robot_files() pyaml_archive = get_pyyaml(pyyaml_version) extract_and_copy_pyyaml_files(pyyaml_version, pyaml_archive) compile_python_files(ctx, jython_jar) version = Version(path=VERSION_PATH, pattern=VERSION_PATTERN) create_robot_jar(ctx, str(version), jar_name)
def jar(ctx, jython_version='2.7.0', pyyaml_version='3.11', remove_dist=False): """Create JAR distribution. Downloads Jython JAR and PyYAML if needed. Args: jython_version: Jython version to use as a base. Must match version in `jython-standalone-<version>.jar` found from Maven central. pyyaml_version: Version of PyYAML that will be included in the standalone jar. The version must be available from PyPI. remove_dist: Control is 'dist' directory initially removed or not. """ clean(ctx, remove_dist, create_dirs=True) jython_jar = get_jython_jar(jython_version) print(f"Using '{jython_jar}'.") compile_java_files(ctx, jython_jar) unzip_jar(jython_jar) copy_robot_files() pyaml_archive = get_pyyaml(pyyaml_version) extract_and_copy_pyyaml_files(pyyaml_version, pyaml_archive) compile_python_files(ctx, jython_jar) version = Version(path=VERSION_PATH, pattern=VERSION_PATTERN) create_robot_jar(ctx, str(version))