Git Product home page Git Product logo

apple-build-system's Introduction

iOS/macOS 打包,上传ipa,上传符号表,更新提示,工具包,灵活扩展,一体化Python解决方案。

安装

github

sh -c "$(curl -fsSL https://raw.githubusercontent.com/dingyusong/apple-build-system/master/setup.sh)" 
or
sh -c "$(wget -O- https://raw.githubusercontent.com/dingyusong/apple-build-system/master/setup.sh)" 
source ~/.zshrc

使用

Life is short, use python!

打个包

from build_ipa import IPABuilder
builder = IPABuilder(path_xp = path_xp)

是对打包工具 fastlane的封装,默认自动签名。

参数:bitcode_enable 两个可选值是'true','false'。默认是'true'。建议上传到AppStore用'true',开启bitcode可以获得一些好处,打测试包的时候就不要开启了,因为编译过程会变长且二进制会变得很大。

上传到fir

from upload_ipa_to_fir import UploadIPAToFir
path_ipa        = builder.build_ipa_path()
fir_token       = "xxx"
fir_shortlink   = "xxx"
ipa_uploader    = UploadIPAToFir(
    path_ipa        = path_ipa, 
    fir_token       = fir_token, 
    fir_shortlink   = fir_shortlink)

是对测试分发平台 fir-cli的封装。

上传到蒲公英

from upload_ipa_to_pgyer import UploadIPAToPgyer
pg_upload = UploadIPAToPgyer(   path_ipa=builder.build_ipa_path(),
                                pgyer_api_key="xxx")
builder.next = pg_upload

参考 https://github.com/PGYER/pgyer_api_example

上传到AppStore

from upload_ipa_to_appstore import UploadIPAToAppStore
path_ipa            = builder.build_ipa_path()
appstore_apiKey     = "xxx"
appstore_apiIssuer  = "xxx"
ipa_uploader        = UploadIPAToAppStore(
    path_ipa    = path_ipa,
    apiKey      = appstore_apiKey,
    apiIssuer   = appstore_apiIssuer)

是对命令行工具altool的封装。

altool的使用:xcrun altool --help

上传符号表

上传到友盟

from upload_symb_to_umeng import UploadDSYMToUmeng
umeng_appkey        = "xxx"
umeng_apikey        = xxx
umeng_apisecurity   = "xxx"
path_to_symbol      = builder.build_symbol_path()
umeng_appVersion    = builder.version
umeng_fileName      = builder.build_symbol_name()
symbol_uploader     = UploadDSYMToUmeng(
    appKey      = umeng_appkey,
    apiKey      = umeng_apikey,
    apiSecurity = umeng_apisecurity,
    pathToSym   = path_to_symbol,
    appVersion  = umeng_appVersion, 
    fileName    = umeng_fileName)

是对友盟上传符号表工具的封装。

生成更新信息

使用默认更新模板

from generate_update_info import GenerateUpdateInfo
buildNo         = builder.build_no
updateMsg       = "测试包已更新"
updateInfo_path = os.path.join(builder.build_dir(), "updateInfo")
url_to_download = fir_shortlink
update_info_builder = GenerateUpdateInfo(
    buildNo         = buildNo,
    updateMsg       = updateMsg,
    updateInfo_path = updateInfo_path,
    url_to_download = url_to_download)

自己写得根据模板生成一个json对象。

上传更新信息

上传更新信息到七牛云

from upload_info_to_qiniu import UploadInfoToQiNiu
ak              = 'xxx'
sk              = 'xxx'
space           = 'xxx'
path_update_info= xxx
update_url      = 'http://xxx'
refershName     = 'xxx'
qiniu_uploader = UploadInfoToQiNiu(
    ak              = ak,
    sk              = sk,
    space           = space,
    path_update_info= path_update_info,
    update_url      = update_url,
    refershName     = refershName)

七牛云qshell的上传文件并刷新cdn的功能封装。

组合

每个模块可视为一个链表的节点,可以将多个节点用next指针连接起来组成一个环环相扣的链表。

  1. 打包->上传到fir
builder.next                = ipa_uploader
builder.exec()
  1. 打包->上传到fir->上传符号表到友盟
builder.next                = ipa_uploader
ipa_uploader.next           = symbol_uploader
builder.exec()
  1. 打包->上传到fir->上传符号表到友盟->生成更新信息->上传更新信息到七牛云
builder.next                = ipa_uploader
ipa_uploader.next           = symbol_uploader
symbol_uploader.next        = update_info_builder
update_info_builder.next    = qiniu_uploader

builder.exec()

扩展

你可以任意新增一个类,在链表的任意环节插入或者替换一个节点,完成功能的扩展或者自定义。

更新

update_apple_build_system

apple-build-system's People

Contributors

dingyusong avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.