Changeset 9f0f35e for buildhelpers/configure
- Timestamp:
- May 19, 2020, 8:59:28 PM (7 years ago)
- Branches:
- debian/bullseye, master
- Children:
- 24617e1
- Parents:
- d5199c9
- File:
-
- 1 edited
-
buildhelpers/configure (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
buildhelpers/configure
rd5199c9 r9f0f35e 11 11 CURRENT_DIR = Path(os.path.dirname(__file__)) 12 12 SRC = CURRENT_DIR.joinpath('../src/gnuboat') 13 SRC_GEN = CURRENT_DIR.joinpath('../src /gnuboat/')13 SRC_GEN = CURRENT_DIR.joinpath('../src') 14 14 APIS_DIR = CURRENT_DIR.joinpath('../apis') 15 15 version_file = open(CURRENT_DIR.joinpath('../VERSION').resolve(), 'r') … … 51 51 Package('mapservice', 'python-flask', CURRENT_DIR.joinpath('codegen/templates'), None), 52 52 Package('deviceservice', 'python-flask', CURRENT_DIR.joinpath('codegen/templates'), None), 53 Package('mapservice', 'python', None, 'mapservice_client'), 53 Package('mapservice', 'python', None, 'gnuboat/mapservice_client'), 54 Package('mapservice', 'typescript-angular', None, 'mapservice-webclient/src-gen/gnuboat-mapservice'), 54 55 ] 55 56 56 def generate_stub(package, generator, template_folder, target ):57 def generate_stub(package, generator, template_folder, target_dir): 57 58 target_tmp = SRC_GEN.joinpath('{}_tmp'.format(package)) 58 59 service_specification_file = APIS_DIR.joinpath('{}.yaml'.format(package)).resolve() 59 60 server_port = 8080 60 61 62 target = target_dir.stem 61 63 package_name_gen = 'gnuboat.{}'.format(target) 62 64 target_tmp = SRC_GEN.joinpath('{}_tmp'.format(package)) 63 target_dir = SRC_GEN.joinpath(target )65 target_dir = SRC_GEN.joinpath(target_dir) 64 66 service_specification_file = APIS_DIR.joinpath('{}.yaml'.format(package)).resolve() 65 67 server_port = 8080 … … 104 106 return 105 107 106 shutil.move(target_tmp.joinpath('gnuboat/{}'.format(target)).resolve(), target_dir.resolve()) 107 shutil.rmtree(target_tmp.resolve()) 108 if 'python' in generator: 109 shutil.move(target_tmp.joinpath('gnuboat/{}'.format(target)).resolve(), target_dir.resolve()) 110 shutil.rmtree(target_tmp.resolve()) 111 # running yapf 112 print(' Formatting the generated code accoring to style file') 113 subprocess.run(['yapf', '--style', 'python-style.yapf', '-r', '-i', 114 target_dir.resolve()]) 115 if 'python-flask' == generator: 116 # copy conftest in place 117 shutil.copy(target_dir.joinpath( 118 '../{}_impl/tests/conftest.py'.format(package)).resolve(), 119 target_dir.joinpath('test').resolve() 120 ) 121 else: 122 shutil.move(target_tmp, target_dir.resolve()) 108 123 109 # running yapf110 print(' Formatting the generated code accoring to style file')111 subprocess.run(['yapf', '--style', 'python-style.yapf', '-r', '-i',112 target_dir.resolve()])113 124 114 125 print('Generating the {} services:'.format(len(PACKAGES))) 115 126 for package in PACKAGES: 116 127 print(' {}'.format(package.package)) 117 118 128 for package in PACKAGES: 119 129 package_name_gen = 'gnuboat.{}'.format(package) 120 130 if package.target is None: 121 package.target = package.package 131 package.target = Path('gnuboat').joinpath(package.package) 132 else: 133 package.target = Path(package.target) 122 134 generate_stub(package.package, package.generator, package.template_folder, package.target) 123 135
Note:
See TracChangeset
for help on using the changeset viewer.
