|
19 | 19 |
|
20 | 20 |
|
21 | 21 | @cli.cmd()
|
22 |
| -def build(add_python_path=True): |
| 22 | +def full_build(add_python_path=True): |
23 | 23 | root_i = paths.project.root
|
24 | 24 | root_o = '{dist}/{version}'.format(
|
25 | 25 | dist=paths.project.dist,
|
@@ -77,6 +77,67 @@ def build(add_python_path=True):
|
77 | 77 | print(':t', 'see result at', fs.relpath(root_o))
|
78 | 78 |
|
79 | 79 |
|
| 80 | +@cli.cmd() |
| 81 | +def min_build(add_python_packages=False): |
| 82 | + # TODO: optimize merging wiht `full_build`. |
| 83 | + root_i = paths.project.root |
| 84 | + root_o = '{dist}/{version}'.format( |
| 85 | + dist=paths.project.dist, |
| 86 | + version=f'depsland-{__version__}' |
| 87 | + ) |
| 88 | + assert not exists(root_o) |
| 89 | + os.mkdir(root_o) |
| 90 | + |
| 91 | + # make empty dirs |
| 92 | + os.mkdir(f'{root_o}/apps') |
| 93 | + os.mkdir(f'{root_o}/apps_launcher') |
| 94 | + os.mkdir(f'{root_o}/build') |
| 95 | + os.mkdir(f'{root_o}/build/exe') |
| 96 | + os.mkdir(f'{root_o}/conf') |
| 97 | + # os.mkdir(f'{root_o}/depsland') |
| 98 | + os.mkdir(f'{root_o}/docs') |
| 99 | + os.mkdir(f'{root_o}/pypi') |
| 100 | + os.mkdir(f'{root_o}/pypi/cache') |
| 101 | + os.mkdir(f'{root_o}/pypi/downloads') |
| 102 | + os.mkdir(f'{root_o}/pypi/index') |
| 103 | + os.mkdir(f'{root_o}/pypi/installed') |
| 104 | + os.mkdir(f'{root_o}/python') |
| 105 | + # os.mkdir(f'{root_o}/sidework') |
| 106 | + os.mkdir(f'{root_o}/temp') |
| 107 | + os.mkdir(f'{root_o}/temp/.fake_oss_storage') |
| 108 | + os.mkdir(f'{root_o}/temp/.unittests') |
| 109 | + |
| 110 | + # copy files |
| 111 | + fs.copy_file(f'{root_i}/build/exe/depsland.exe', |
| 112 | + f'{root_o}/build/exe/depsland.exe') |
| 113 | + fs.copy_file(f'{root_i}/build/exe/desktop.exe', |
| 114 | + f'{root_o}/build/exe/desktop.exe') |
| 115 | + fs.copy_file(f'{root_i}/build/exe/setup_patch.exe', |
| 116 | + f'{root_o}/setup.exe') |
| 117 | + fs.copy_file(f'{root_i}/build/depsland_setup.py', |
| 118 | + f'{root_o}/build/depsland_setup.py') |
| 119 | + fs.copy_file(f'{root_i}/conf/depsland.yaml', |
| 120 | + f'{root_o}/conf/depsland.yaml') |
| 121 | + fs.copy_file(f'{root_i}/conf/oss_client.yaml', |
| 122 | + f'{root_o}/conf/oss_client.yaml') |
| 123 | + fs.copy_tree(f'{root_i}/depsland', |
| 124 | + f'{root_o}/depsland') |
| 125 | + fs.copy_tree(f'{root_i}/sidework', |
| 126 | + f'{root_o}/sidework') |
| 127 | + if add_python_packages: |
| 128 | + os.mkdir(f'{root_o}/python/Lib') |
| 129 | + fs.make_link(f'{root_i}/python/Lib/site-packages', |
| 130 | + f'{root_o}/python/Lib/site-packages') |
| 131 | + |
| 132 | + # init files |
| 133 | + dumps(defaultdict(list), f'{root_o}/pypi/index/dependencies.pkl') |
| 134 | + dumps(defaultdict(list), f'{root_o}/pypi/index/name_2_versions.pkl') |
| 135 | + dumps({}, f'{root_o}/pypi/index/name_id_2_paths.pkl') |
| 136 | + dumps({}, f'{root_o}/pypi/index/updates.pkl') |
| 137 | + |
| 138 | + print(':t', 'see result at', fs.relpath(root_o)) |
| 139 | + |
| 140 | + |
80 | 141 | @cli.cmd()
|
81 | 142 | def compress_to_zip():
|
82 | 143 | dir_i = '{}/{}'.format(paths.project.dist, f'depsland-{__version__}')
|
|
0 commit comments