Beispiel #1
0
def collect_env(args):
    PROJ_DIR = look_for_proj_dir(os.path.abspath(__file__), 'pubspec.yaml')
    RUST_PROJ_DIR = os.path.join(PROJ_DIR, 'rust')
    RUST_ASSETS_DIR = os.path.join(RUST_PROJ_DIR, 'assets')
    TOML_FILE = os.path.join(RUST_PROJ_DIR, 'Cargo.toml')
    META = toml.loads(open(TOML_FILE).read())
    NAME = META['package']['name']
    VERSION = META['package']['version']
    DESCRIPTION = META['package']['description']

    DEBUG = not args.release
    RELEASE = args.release

    WORKSPACE = get_workspace_dir(RUST_PROJ_DIR)
    if WORKSPACE is not None:
        # cargo put outputs in workspace target directory
        TARGET_DIR = os.path.join(WORKSPACE, 'target')
    else:
        TARGET_DIR = os.path.join(RUST_PROJ_DIR, 'target')
    OUTPUT_DIR = os.path.join(TARGET_DIR, 'debug' if DEBUG else 'release')
    FLUTTER_CONFIG = META['package']['metadata']['flutter']
    IDENTIFIER = FLUTTER_CONFIG[
        'identifier'] if 'identifier' in FLUTTER_CONFIG else 'one.juju.flutter-app'
    FLUTTER_LIB_VER = META['package']['metadata']['flutter']['version']
    FLUTTER_ASSETS = os.path.join(os.path.dirname(RUST_PROJ_DIR), 'build',
                                  'flutter_assets')
    return locals()
Beispiel #2
0
def collect_env(args):
    PROJ_DIR = look_for_proj_dir(os.path.abspath(__file__), 'pubspec.yaml')
    RUST_PROJ_DIR = os.path.join(PROJ_DIR, 'rust')
    RUST_ASSETS_DIR = os.path.join(RUST_PROJ_DIR, 'assets')
    TOML_FILE = os.path.join(RUST_PROJ_DIR, 'Cargo.toml')
    META = toml.loads(open(TOML_FILE).read())
    CONFIG = toml.loads(open(os.path.join(RUST_PROJ_DIR, 'build.toml')).read())
    NAME = META['package']['name']
    VERSION = META['package']['version']
    DESCRIPTION = META['package']['description']

    DEBUG = not args.release
    RELEASE = args.release

    TARGET_DIR = os.path.join(RUST_PROJ_DIR, 'target')
    WORKSPACE = get_workspace_dir(RUST_PROJ_DIR)
    WORKSPACE_TARGET_DIR = os.path.join(WORKSPACE,
                                        'target') if WORKSPACE else None
    OUTPUT_DIR = os.path.join(TARGET_DIR, 'debug' if DEBUG else 'release')
    FLUTTER_LIB_VER = get_flutter_version()
    FLUTTER_ASSETS = os.path.join(os.path.dirname(RUST_PROJ_DIR), 'build',
                                  'flutter_assets')
    return locals()