File tree 6 files changed +58
-1
lines changed
6 files changed +58
-1
lines changed Original file line number Diff line number Diff line change 11
11
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
+
15
+ from .internal import ci_command
Original file line number Diff line number Diff line change 16
16
import os
17
17
18
18
from . import gradle
19
- from .internal import ci_command
19
+ from . import ci_command
20
20
21
21
22
22
@click .argument ('task' , required = True , nargs = - 1 )
Original file line number Diff line number Diff line change 22
22
ADB_INSTALL_TIMEOUT = '5'
23
23
24
24
25
+ def P (name , value ):
26
+ """Returns name and value in the format of gradle's project property cli argument."""
27
+ return '-P{}={}' .format (name , value )
28
+
29
+
25
30
def run (* args , gradle_opts = '' , workdir = None ):
26
31
"""Invokes gradle with specified args and gradle_opts."""
27
32
new_env = dict (os .environ )
Original file line number Diff line number Diff line change 15
15
import logging
16
16
17
17
from . import commands
18
+ from . import plugins
18
19
from .internal import main
19
20
20
21
logging .basicConfig (
21
22
format = '%(name)s: [%(levelname)s] %(message)s' ,
22
23
level = logging .DEBUG ,
23
24
)
24
25
26
+ plugins .discover ()
27
+
25
28
cli = main
Original file line number Diff line number Diff line change
1
+ # Copyright 2018 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ import importlib
16
+ import pkgutil
17
+ import fireciplugins
18
+
19
+
20
+ def discover ():
21
+ """Discovers fireci plugins available on PYTHONPATH under firebaseplugins subpackages.
22
+
23
+ Discovery works by importing all direct subpackages of firebaseplugins and importing them,
24
+ plugins are supposed to register ci_command's with fireci in their __init__.py files directly
25
+ or by importing from their own subpackages.
26
+
27
+ Note: plugins *must* define the `firebaseplugins` package as a namespace package.
28
+ See: https://packaging.python.org/guides/packaging-namespace-packages/
29
+ """
30
+ modules = pkgutil .iter_modules (fireciplugins .__path__ ,
31
+ fireciplugins .__name__ + "." )
32
+ for module in modules :
33
+ importlib .import_module (module .name )
Original file line number Diff line number Diff line change
1
+ # Copyright 2018 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ __path__ = __import__ ('pkgutil' ).extend_path (__path__ , __name__ )
You can’t perform that action at this time.
0 commit comments