(root, android_jar)
| 128 | |
| 129 | |
| 130 | def 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 | |
| 153 | def package_aar(args, root): |
no test coverage detected