Skip to content

Commit

Permalink
Merge branch 'master' into RefactorDependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian-O authored Sep 10, 2023
2 parents 8e2e2d2 + 8490791 commit 43e2c2a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 89 deletions.
13 changes: 0 additions & 13 deletions .ci/osx_ci.sh

This file was deleted.

22 changes: 3 additions & 19 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,29 @@ name: iOS
jobs:
Integration:
name: "Integration (${{ matrix.runs_on }}, ${{ matrix.python }})"
runs-on: ${{ matrix.runs_on || 'macos-latest' }}
runs-on: ${{ matrix.runs_on }}
strategy:
matrix:
include:
- runs_on: macos-latest
python: '3.9'
- runs_on: apple-silicon-m1
python: '3.9.7'
runs_on: [macos-latest, apple-silicon-m1]
steps:
- name: Setup python
# Needs to be skipped on our self-hosted runners tagged as 'apple-silicon-m1'
if: ${{ matrix.runs_on != 'apple-silicon-m1' }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
python-version: '3.x'
- uses: actions/checkout@v4
- name: Setup environment
run: |
source .ci/osx_ci.sh
arm64_set_path_and_python_version ${{ matrix.python }}
pip install .[ios]
- name: Check buildozer installation
run: |
source .ci/osx_ci.sh
arm64_set_path_and_python_version ${{ matrix.python }}
buildozer --help
- name: Initialize buildozer in project folder
run: |
source .ci/osx_ci.sh
arm64_set_path_and_python_version ${{ matrix.python }}
buildozer init
- name: Install dependencies
run: |
source .ci/osx_ci.sh
arm64_set_path_and_python_version ${{ matrix.python }}
brew install autoconf automake libtool pkg-config
- name: buildozer ios debug
run: |
source .ci/osx_ci.sh
arm64_set_path_and_python_version ${{ matrix.python }}
touch main.py
buildozer ios debug
3 changes: 0 additions & 3 deletions buildozer/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class Target:
def __init__(self, buildozer):
self.buildozer = buildozer
self.build_mode = 'debug'
self.artifact_format = 'apk'
self.platform_update = False
self.logger = Logger()

Expand Down Expand Up @@ -106,7 +105,6 @@ def cmd_update(self, *args):
def cmd_debug(self, *args):
self.buildozer.prepare_for_build()
self.build_mode = 'debug'
self.artifact_format = self.buildozer.config.getdefault('app', 'android.debug_artifact', 'apk')
self.buildozer.build()

def cmd_release(self, *args):
Expand Down Expand Up @@ -143,7 +141,6 @@ def cmd_release(self, *args):
exit(1)

self.build_mode = 'release'
self.artifact_format = self.buildozer.config.getdefault('app', 'android.release_artifact', 'aab')
self.buildozer.build()

def cmd_deploy(self, *args):
Expand Down
11 changes: 11 additions & 0 deletions buildozer/targets/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ class TargetAndroid(Target):

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

self.artifact_format = 'apk'

if self.buildozer.config.has_option(
"app", "android.arch"
) and not self.buildozer.config.has_option("app", "android.archs"):
Expand Down Expand Up @@ -989,6 +992,14 @@ def check_p4a_sign_env(self, error=False):
check = False
return check

def cmd_debug(self, *args):
self.artifact_format = self.buildozer.config.getdefault('app', 'android.debug_artifact', 'apk')
super().cmd_debug(*args)

def cmd_release(self, *args):
self.artifact_format = self.buildozer.config.getdefault('app', 'android.release_artifact', 'aab')
super().cmd_release(*args)

def cmd_run(self, *args):
entrypoint = self.buildozer.config.getdefault(
'app', 'android.entrypoint')
Expand Down
54 changes: 0 additions & 54 deletions buildozer/targets/osx.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,6 @@ def check_requirements(self):
self.ensure_sdk()
self.ensure_kivyapp()

def check_configuration_tokens(self, errors=None):
if errors:
self.logger.info('Check target configuration tokens')
self.logger.error(
'{0} error(s) found in the buildozer.spec'.format(
len(errors)))
for error in errors:
print(error)
sys.exit(1)
# check

def build_package(self):
self.logger.info('Building package')

Expand Down Expand Up @@ -147,9 +136,6 @@ def build_package(self):
binpath)
self.logger.info('All Done!')

def compile_platform(self):
pass

def install_platform(self):
# ultimate configuration check.
# some of our configuration cannot be checked without platform.
Expand All @@ -159,16 +145,6 @@ def install_platform(self):
'PACKAGES_PATH': self.buildozer.global_packages_dir,
})

def get_custom_commands(self):
result = []
for x in dir(self):
if not x.startswith('cmd_'):
continue
if x[4:] in self.buildozer.standard_cmds:
continue
result.append((x[4:], getattr(self, x).__doc__))
return result

def get_available_packages(self):
return ['kivy', 'python3']

Expand Down Expand Up @@ -212,36 +188,6 @@ def run_commands(self, args):

func(args)

def check_build_prepared(self):
self._build_prepared = False

def cmd_clean(self, *args):
self.buildozer.clean_platform()

def cmd_update(self, *args):
self.platform_update = True
self.buildozer.prepare_for_build()

def cmd_debug(self, *args):
self.buildozer.prepare_for_build()
self.build_mode = 'debug'
self.check_build_prepared()
self.buildozer.build()

def cmd_release(self, *args):
self.buildozer.prepare_for_build()
self.build_mode = 'release'
self.buildozer.build()

def cmd_deploy(self, *args):
self.buildozer.prepare_for_build()

def cmd_run(self, *args):
self.buildozer.prepare_for_build()

def cmd_serve(self, *args):
self.buildozer.cmd_serve()


def get_target(buildozer):
return TargetOSX(buildozer)

0 comments on commit 43e2c2a

Please sign in to comment.