Flutter Engine
The Flutter Engine
Functions | Variables
gen_android_buildconfig Namespace Reference

Functions

def main ()
 

Variables

string BUILD_CONFIG_TEMPLATE
 

Function Documentation

◆ main()

def gen_android_buildconfig.main ( )

Definition at line 32 of file gen_android_buildconfig.py.

32def main():
33 parser = argparse.ArgumentParser(description='Generate BuildConfig.java for Android')
34 parser.add_argument('--runtime-mode', type=str, required=True)
35 parser.add_argument('--out', type=str, required=True)
36
37 args = parser.parse_args()
38
39 jit_release = 'jit_release' in args.runtime_mode.lower()
40 release = not jit_release and 'release' in args.runtime_mode.lower()
41 profile = 'profile' in args.runtime_mode.lower()
42 debug = 'debug' in args.runtime_mode.lower()
43 assert debug or profile or release or jit_release
44
45 with open(os.path.abspath(args.out), 'w+') as output_file:
46 output_file.write(
47 BUILD_CONFIG_TEMPLATE.format(
48 str(debug).lower(),
49 str(profile).lower(),
50 str(release).lower(),
51 str(jit_release).lower()
52 )
53 )
54
55

Variable Documentation

◆ BUILD_CONFIG_TEMPLATE

string gen_android_buildconfig.BUILD_CONFIG_TEMPLATE
Initial value:
1= """
2// Copyright 2013 The Flutter Authors. All rights reserved.
3// Use of this source code is governed by a BSD-style license that can be
4// found in the LICENSE file.
5
6
7// THIS FILE IS AUTO_GENERATED
8// DO NOT EDIT THE VALUES HERE - SEE $flutter_root/tools/gen_android_buildconfig.py
9package io.flutter;
10
11public final class BuildConfig {{
12 private BuildConfig() {{}}
13
14 public final static boolean DEBUG = {0};
15 public final static boolean PROFILE = {1};
16 public final static boolean RELEASE = {2};
17 public final static boolean JIT_RELEASE = {3};
18}}
19"""

Definition at line 11 of file gen_android_buildconfig.py.