From 35d69c5076287d7f2cb447d0c4b9ef70b60176a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=8A=B2=E9=B9=8F?= Date: Wed, 12 May 2021 16:20:24 +0800 Subject: [PATCH] add conan script --- doric-Qt/.gitignore | 5 ++-- doric-Qt/example/conanfile-macos.py | 12 ++++++++ doric-Qt/example/conanfile-windows.py | 12 ++++++++ doric-Qt/example/doric/doric.pro | 4 +++ doric-Qt/example/package-macos.py | 40 +++++++++++++++++++++++++++ doric-Qt/example/package-windows.py | 40 +++++++++++++++++++++++++++ 6 files changed, 110 insertions(+), 3 deletions(-) create mode 100644 doric-Qt/example/conanfile-macos.py create mode 100644 doric-Qt/example/conanfile-windows.py create mode 100755 doric-Qt/example/package-macos.py create mode 100644 doric-Qt/example/package-windows.py diff --git a/doric-Qt/.gitignore b/doric-Qt/.gitignore index 5d1f0cba..53b461bf 100644 --- a/doric-Qt/.gitignore +++ b/doric-Qt/.gitignore @@ -1,3 +1,2 @@ -/build-doric-*/ -/build-example-*/ -.DS_Store \ No newline at end of file +.DS_Store +binary/ \ No newline at end of file diff --git a/doric-Qt/example/conanfile-macos.py b/doric-Qt/example/conanfile-macos.py new file mode 100644 index 00000000..5f2749eb --- /dev/null +++ b/doric-Qt/example/conanfile-macos.py @@ -0,0 +1,12 @@ +from conans import ConanFile + +class DoricCore(ConanFile): + license = "MIT" + name = "DoricCore" + settings = "os", "compiler", "build_type", "arch" + + def package(self): + self.copy("*.h", dst="include", src="doric") + self.copy("*.a", dst="lib",src="../binary/dest") + def package_info(self): + self.cpp_info.libs = ["DoricCore"] \ No newline at end of file diff --git a/doric-Qt/example/conanfile-windows.py b/doric-Qt/example/conanfile-windows.py new file mode 100644 index 00000000..5631411b --- /dev/null +++ b/doric-Qt/example/conanfile-windows.py @@ -0,0 +1,12 @@ +from conans import ConanFile + +class DoricCore(ConanFile): + license = "MIT" + name = "DoricCore" + settings = "os", "compiler", "build_type", "arch" + + def package(self): + self.copy("*.h", dst="include", src="doric") + self.copy("*.lib", dst="lib",src="../binary/dest") + def package_info(self): + self.cpp_info.libs = ["DoricCore"] \ No newline at end of file diff --git a/doric-Qt/example/doric/doric.pro b/doric-Qt/example/doric/doric.pro index bc3e4a7d..32f0da8e 100644 --- a/doric-Qt/example/doric/doric.pro +++ b/doric-Qt/example/doric/doric.pro @@ -5,6 +5,10 @@ CONFIG += c++14 TEMPLATE = lib CONFIG += staticlib +DESTDIR = ../../binary/dest +MOC_DIR = ../../binary/moc +OBJECTS_DIR = ../../binary/objects + # The following define makes your compiler emit warnings if you use # any Qt feature that has been marked deprecated (the exact warnings # depend on your compiler). Refer to the documentation for the diff --git a/doric-Qt/example/package-macos.py b/doric-Qt/example/package-macos.py new file mode 100755 index 00000000..a5fe0eee --- /dev/null +++ b/doric-Qt/example/package-macos.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python +# -*- coding:utf-8 -*- +import os +import sys +import time +import platform +import shutil +import glob +import requests +import json +import zipfile + +def system(command): + retcode = os.system(command) + if retcode != 0: + raise Exception("Error while executing:\n\t %s" % command) +def main(): + version = "0.0.0" + isOnline = "0" + paramlen = len(sys.argv) + if paramlen == 3: + version = sys.argv[1] + isOnline = sys.argv[2] + print("version:"+str(version)+" isOnline:"+str(isOnline)) + elif paramlen == 2: + version = sys.argv[1] + print("version:"+str(version)) + elif paramlen == 1: + print("version:"+str(version)+" isOnline:"+str(isOnline)) + else: + print("params error."); + return; + system('conan export-pkg ./conanfile-macos.py DoricCore/%s@bixin/stable -s build_type=Debug -s os=Macos' % version) + system('conan export-pkg ./conanfile-macos.py DoricCore/%s@bixin/stable -s build_type=Release -s os=Macos' % version) + if isOnline == "1": + system('conan upload DoricCore/%s@bixin/stable --all -r=pc' % version) + system('git tag %s' % version) + system('git push --tags') +if __name__ == "__main__": + main() diff --git a/doric-Qt/example/package-windows.py b/doric-Qt/example/package-windows.py new file mode 100644 index 00000000..7b37f514 --- /dev/null +++ b/doric-Qt/example/package-windows.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python +# -*- coding:utf-8 -*- +import os +import sys +import time +import platform +import shutil +import glob +import requests +import json +import zipfile + +def system(command): + retcode = os.system(command) + if retcode != 0: + raise Exception("Error while executing:\n\t %s" % command) +def main(): + version = "0.0.0" + isOnline = "0" + paramlen = len(sys.argv) + if paramlen == 3: + version = sys.argv[1] + isOnline = sys.argv[2] + print("version:"+str(version)+" isOnline:"+str(isOnline)) + elif paramlen == 2: + version = sys.argv[1] + print("version:"+str(version)) + elif paramlen == 1: + print("version:"+str(version)+" isOnline:"+str(isOnline)) + else: + print("params error."); + return; + system('conan export-pkg ./conanfile-windows.py DoricCore/%s@bixin/stable -s build_type=Debug -s os=Windows' % version) + system('conan export-pkg ./conanfile-windows.py DoricCore/%s@bixin/stable -s build_type=Release -s os=Windows' % version) + if isOnline == "1": + system('conan upload DoricCore/%s@bixin/stable --all -r=pc' % version) + system('git tag %s' % version) + system('git push --tags') +if __name__ == "__main__": + main()