Commit 41876a36 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Started generic prepare.py

parent 275ac054
Makefile
Makefile.android
Makefile.ios
android
iOS
Xamarin/Xamarin/Xamarin/LinphoneWrapper.cs
......@@ -7,6 +9,8 @@ Xamarin/Xamarin/Xamarin.Droid/Libs/armeabi-v7a
Xamarin/Xamarin/Xamarin.Droid/Libs/x86
Xamarin/Xamarin/Xamarin.Droid/Libs/liblinphone.jar
*.pyc
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
......
......@@ -174,8 +174,8 @@ class AndroidPreparator(prepare.Preparator):
def clean(self):
prepare.Preparator.clean(self)
if os.path.isfile('Makefile'):
os.remove('Makefile')
if os.path.isfile('Makefile.android'):
os.remove('Makefile.android')
if os.path.isdir('android') and not os.listdir('android'):
os.rmdir('android')
if os.path.isdir('liblinphone-sdk') and not os.listdir('liblinphone-sdk'):
......@@ -202,7 +202,7 @@ TOPDIR=$(shell pwd)
.PHONY: all
.NOTPARALLEL: all
all: generate-sdk
all: generate-android-sdk
build: $(addsuffix -build, $(archs))
......@@ -232,7 +232,7 @@ copy-libs:
\t\tsh android/android-x86/strip.sh Xamarin/Xamarin/Xamarin.Droid/Libs/x86/*.so; \\
\tfi
generate-sdk: build copy-libs
generate-android-sdk: build copy-libs
{arch_targets}
......@@ -256,7 +256,7 @@ help: help-prepare-options
""".format(archs=' '.join(platforms), arch_opts='|'.join(platforms),
first_arch=platforms[0], options=' '.join(sys.argv),
arch_targets=arch_targets, generator=generator)
f = open('Makefile', 'w')
f = open('Makefile.android', 'w')
f.write(makefile)
f.close()
......
#!/usr/bin/env python
############################################################################
# prepare.py
# Copyright (C) 2016 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
############################################################################
import fnmatch
import os
import re
import sys
from distutils.spawn import find_executable
from logging import error, warning, info
from subprocess import Popen
from android import AndroidPreparator
sys.dont_write_bytecode = True
sys.path.insert(0, 'submodules/cmake-builder')
try:
import prepare
except Exception as e:
error(
"Could not find prepare module: {}, probably missing submodules/cmake-builder? Try running:\n"
"git submodule sync && git submodule update --init --recursive".format(e))
exit(1)
def main():
android = AndroidPreparator()
if android.check_environment() != 0:
android.show_environment_errors()
return 1
android.parse_args()
android.run()
makefile = """
.PHONY: all
.NOTPARALLEL: all
include Makefile.android
all: generate-android-sdk sdk
sdk:
\tzip -r liblinphone-xamarin-sdk.zip Xamarin
"""
f = open('Makefile', 'w')
f.write(makefile)
f.close()
return 0
if __name__ == "__main__":
sys.exit(main())
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment