@@ -80,7 +80,7 @@ def run(self):
80
80
81
81
def prepare_build_dir (self ):
82
82
83
- if argv_contains ('--private' ):
83
+ if argv_contains ('--private' ) and not argv_contains ( '--launcher' ) :
84
84
print ('WARNING: Received --private argument when this would '
85
85
'normally be generated automatically.' )
86
86
print (' This is probably bad unless you meant to do '
@@ -101,27 +101,30 @@ def prepare_build_dir(self):
101
101
filens .extend (glob (pattern ))
102
102
103
103
main_py_dirs = []
104
- for filen in filens :
105
- new_dir = join (bdist_dir , dirname (filen ))
106
- if not exists (new_dir ):
107
- makedirs (new_dir )
108
- print ('Including {}' .format (filen ))
109
- copyfile (filen , join (bdist_dir , filen ))
110
- if basename (filen ) in ('main.py' , 'main.pyo' ):
111
- main_py_dirs .append (filen )
104
+ if not argv_contains ('--launcher' ):
105
+ for filen in filens :
106
+ new_dir = join (bdist_dir , dirname (filen ))
107
+ if not exists (new_dir ):
108
+ makedirs (new_dir )
109
+ print ('Including {}' .format (filen ))
110
+ copyfile (filen , join (bdist_dir , filen ))
111
+ if basename (filen ) in ('main.py' , 'main.pyo' ):
112
+ main_py_dirs .append (filen )
112
113
113
114
# This feels ridiculous, but how else to define the main.py dir?
114
115
# Maybe should just fail?
115
- if len ( main_py_dirs ) == 0 :
116
+ if not main_py_dirs and not argv_contains ( '--launcher' ) :
116
117
print ('ERROR: Could not find main.py, so no app build dir defined' )
117
118
print ('You should name your app entry point main.py' )
118
119
exit (1 )
119
120
if len (main_py_dirs ) > 1 :
120
121
print ('WARNING: Multiple main.py dirs found, using the shortest path' )
121
122
main_py_dirs = sorted (main_py_dirs , key = lambda j : len (split (j )))
122
123
123
- sys .argv .append ('--private={}' .format (join (realpath (curdir ), bdist_dir ,
124
- dirname (main_py_dirs [0 ]))))
124
+ if not argv_contains ('--launcher' ):
125
+ sys .argv .append ('--private={}' .format (
126
+ join (realpath (curdir ), bdist_dir , dirname (main_py_dirs [0 ])))
127
+ )
125
128
126
129
127
130
def _set_user_options ():
@@ -138,4 +141,4 @@ def _set_user_options():
138
141
139
142
BdistAPK .user_options = user_options
140
143
141
- _set_user_options ()
144
+ _set_user_options ()
0 commit comments