MCPcopy Create free account
hub / github.com/brainflow-dev/brainflow / build_simpleble_bridge

Function build_simpleble_bridge

tools/build_android_aar.py:130–150  ·  view source on GitHub ↗
(root, android_jar)

Source from the content-addressed store, hash-verified

128
129
130def build_simpleble_bridge(root, android_jar):
131 source_root = root / 'third_party' / 'SimpleBLE' / 'simpledroidbridge' / 'src' / 'main' / 'java'
132 source_files = sorted(source_root.rglob('*.java'))
133 if not source_files:
134 raise RuntimeError('No SimpleBLE Android bridge Java sources found under %s' % source_root)
135
136 classes_dir = root / 'tools' / 'simpleble-bridge-classes'
137 sources_file = root / 'tools' / 'simpleble-bridge-sources.txt'
138 bridge_jar = root / 'tools' / 'simpleble-bridge.jar'
139
140 if classes_dir.exists():
141 shutil.rmtree(classes_dir)
142 classes_dir.mkdir(parents=True)
143 sources_file.write_text(
144 '\n'.join(str(path) for path in source_files) + '\n', encoding='utf-8')
145
146 run_command([
147 resolve_executable('javac'), '-source', '8', '-target', '8', '-classpath', android_jar,
148 '-d', classes_dir, '@%s' % sources_file
149 ], root)
150 run_command([resolve_executable('jar'), 'cf', bridge_jar, '-C', classes_dir, '.'], root)
151
152
153def package_aar(args, root):

Callers 1

mainFunction · 0.85

Calls 2

resolve_executableFunction · 0.85
run_commandFunction · 0.70

Tested by

no test coverage detected