Skip to content

Commit da2d163

Browse files
committed
Add partial self build
1 parent 1b4a515 commit da2d163

File tree

3 files changed

+66
-2
lines changed

3 files changed

+66
-2
lines changed

build/build.py

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020

2121
@cli.cmd()
22-
def build(add_python_path=True):
22+
def full_build(add_python_path=True):
2323
root_i = paths.project.root
2424
root_o = '{dist}/{version}'.format(
2525
dist=paths.project.dist,
@@ -77,6 +77,67 @@ def build(add_python_path=True):
7777
print(':t', 'see result at', fs.relpath(root_o))
7878

7979

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+
80141
@cli.cmd()
81142
def compress_to_zip():
82143
dir_i = '{}/{}'.format(paths.project.dist, f'depsland-{__version__}')

build/exe/setup.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
@echo off
2-
cd %~dp0
2+
cd /d %~dp0
33
.\python\python.exe -B build/depsland_setup.py

build/exe/setup_patch.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
cd /d %~dp0
3+
$DEPSLAND$\python\python.exe -B build/depsland_setup.py

0 commit comments

Comments
 (0)