From 3620693275cd9c639559d8e58a33582487ab5ad5 Mon Sep 17 00:00:00 2001 From: Ali <> Date: Mon, 4 Jan 2021 18:00:29 +0400 Subject: [PATCH 1/4] WIP --- Telegram/BUILD | 18 +-- build-system/bazel_version | 1 - .../example-configuration}/BUILD | 0 build-system/example-configuration/WORKSPACE | 0 .../example-configuration/provisioning/BUILD | 4 + .../provisioning/Intents.mobileprovision | Bin 0 -> 4632 bytes .../NotificationContent.mobileprovision | Bin 0 -> 4655 bytes .../NotificationService.mobileprovision | Bin 0 -> 4655 bytes .../provisioning/Share.mobileprovision | Bin 0 -> 4613 bytes .../provisioning/Telegram.mobileprovision | Bin 0 -> 6015 bytes .../provisioning/WatchApp.mobileprovision | Bin 0 -> 4629 bytes .../WatchExtension.mobileprovision | Bin 0 -> 4670 bytes .../provisioning/Widget.mobileprovision | Bin 0 -> 4615 bytes .../example-configuration/variables.bzl | 13 ++ build-system/example-generate-configuration | 7 + build-system/manage-developer-portal-app.sh | 129 ------------------ build-system/xcode_version | 1 - versions.json | 4 + 18 files changed, 37 insertions(+), 140 deletions(-) delete mode 100644 build-system/bazel_version rename {build-input => build-system/example-configuration}/BUILD (100%) create mode 100644 build-system/example-configuration/WORKSPACE create mode 100644 build-system/example-configuration/provisioning/BUILD create mode 100644 build-system/example-configuration/provisioning/Intents.mobileprovision create mode 100644 build-system/example-configuration/provisioning/NotificationContent.mobileprovision create mode 100644 build-system/example-configuration/provisioning/NotificationService.mobileprovision create mode 100644 build-system/example-configuration/provisioning/Share.mobileprovision create mode 100644 build-system/example-configuration/provisioning/Telegram.mobileprovision create mode 100644 build-system/example-configuration/provisioning/WatchApp.mobileprovision create mode 100644 build-system/example-configuration/provisioning/WatchExtension.mobileprovision create mode 100644 build-system/example-configuration/provisioning/Widget.mobileprovision create mode 100644 build-system/example-configuration/variables.bzl create mode 100755 build-system/example-generate-configuration delete mode 100644 build-system/manage-developer-portal-app.sh delete mode 100644 build-system/xcode_version create mode 100644 versions.json diff --git a/Telegram/BUILD b/Telegram/BUILD index d570c88f26..f7b29682b4 100644 --- a/Telegram/BUILD +++ b/Telegram/BUILD @@ -18,7 +18,7 @@ load("//build-system/bazel-utils:plist_fragment.bzl", ) load( - "//build-input/data:variables.bzl", + "@build_configuration//:variables.bzl", "telegram_build_number", "telegram_version", "telegram_bundle_id", @@ -482,7 +482,7 @@ watchos_extension( ":WatchExtensionNSExtensionInfoPlist", ], minimum_os_version = "5.0", - provisioning_profile = "//build-input/data/provisioning-profiles:WatchExtension.mobileprovision", + provisioning_profile = "@build_configuration//data/provisioning-profiles:WatchExtension.mobileprovision", resources = [ ":TelegramWatchExtensionResources", ], @@ -509,7 +509,7 @@ watchos_application( ":WatchAppCompanionInfoPlist", ], minimum_os_version = "5.0", - provisioning_profile = "//build-input/data/provisioning-profiles:WatchApp.mobileprovision", + provisioning_profile = "@build_configuration//data/provisioning-profiles:WatchApp.mobileprovision", resources = [ ":TelegramWatchAppResources", ":TelegramWatchAppAssets", @@ -1055,7 +1055,7 @@ ios_extension( ":AppNameInfoPlist", ], minimum_os_version = "9.0", - provisioning_profile = "//build-input/data/provisioning-profiles:Share.mobileprovision", + provisioning_profile = "@build_configuration//data/provisioning-profiles:Share.mobileprovision", deps = [":ShareExtensionLib"], frameworks = [ ":TelegramUIFramework" @@ -1123,7 +1123,7 @@ ios_extension( ":AppNameInfoPlist", ], minimum_os_version = "10.0", - provisioning_profile = "//build-input/data/provisioning-profiles:NotificationContent.mobileprovision", + provisioning_profile = "@build_configuration//data/provisioning-profiles:NotificationContent.mobileprovision", deps = [":NotificationContentExtensionLib"], frameworks = [ ":TelegramUIFramework" @@ -1195,7 +1195,7 @@ ios_extension( ], minimum_os_version = "14.0", provides_main = True, - provisioning_profile = "//build-input/data/provisioning-profiles:Widget.mobileprovision", + provisioning_profile = "@build_configuration//data/provisioning-profiles:Widget.mobileprovision", deps = [":WidgetExtensionLib"], frameworks = [ ":SwiftSignalKitFramework", @@ -1283,7 +1283,7 @@ ios_extension( ":AppNameInfoPlist", ], minimum_os_version = "10.0", - provisioning_profile = "//build-input/data/provisioning-profiles:Intents.mobileprovision", + provisioning_profile = "@build_configuration//data/provisioning-profiles:Intents.mobileprovision", deps = [":IntentsExtensionLib"], frameworks = [ ":SwiftSignalKitFramework", @@ -1334,7 +1334,7 @@ ios_extension( ":AppNameInfoPlist", ], minimum_os_version = "10.0", - provisioning_profile = "//build-input/data/provisioning-profiles:NotificationService.mobileprovision", + provisioning_profile = "@build_configuration//data/provisioning-profiles:NotificationService.mobileprovision", deps = ["//Telegram/NotificationService:NotificationServiceExtensionLib"], frameworks = [ ":MtProtoKitFramework", @@ -1522,7 +1522,7 @@ ios_application( ), families = ["iphone", "ipad"], minimum_os_version = "9.0", - provisioning_profile = "//build-input/data/provisioning-profiles:Telegram.mobileprovision", + provisioning_profile = "@build_configuration//data/provisioning-profiles:Telegram.mobileprovision", entitlements = ":TelegramEntitlements.entitlements", infoplists = [ ":TelegramInfoPlist", diff --git a/build-system/bazel_version b/build-system/bazel_version deleted file mode 100644 index 7c69a55dbb..0000000000 --- a/build-system/bazel_version +++ /dev/null @@ -1 +0,0 @@ -3.7.0 diff --git a/build-input/BUILD b/build-system/example-configuration/BUILD similarity index 100% rename from build-input/BUILD rename to build-system/example-configuration/BUILD diff --git a/build-system/example-configuration/WORKSPACE b/build-system/example-configuration/WORKSPACE new file mode 100644 index 0000000000..e69de29bb2 diff --git a/build-system/example-configuration/provisioning/BUILD b/build-system/example-configuration/provisioning/BUILD new file mode 100644 index 0000000000..171ad85d32 --- /dev/null +++ b/build-system/example-configuration/provisioning/BUILD @@ -0,0 +1,4 @@ + +exports_files(glob([ + "*.mobileprovision", +]) diff --git a/build-system/example-configuration/provisioning/Intents.mobileprovision b/build-system/example-configuration/provisioning/Intents.mobileprovision new file mode 100644 index 0000000000000000000000000000000000000000..8cb484f943475109f8084a30cc018da6febabadc GIT binary patch literal 4632 zcmcgwd2|zX9&g%GCckd0xB*@Hq2|DS6gVI_Jq^31_@D8cAX?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=bz-AKi25`NR1sT@SqT1dy()7lU0ZDQGUOl}COR z2l%>%zW+qjUs~NDk8JogP^;*JVq2&!NU9235>?IE?lD^sJz!k86{KGOgM~A{OYTp` zTUW1`7&vp;@HgG9c4F8V!!0-bPfMK|x^2YeRq(9or)J%t9kqVLSL?Q) z+JQ|RrhD%^cHdgy&+g%$@3(J$?d^uSExQlQoTL5wi31wb`OW*NE3BGB%U4y+iX5DM z7TdA+xr6k~^h4LJ$vUoIbNJpzPt8t!DxLA|uqmHW(159Tq#w8f8aQEsbj@=tz+Gn vLyjK5a>vUrEuC~$f4i_mw=8{Hcy#v*|2}^Ht(y<-;m`RyXE%S@OB(+N72paU literal 0 HcmV?d00001 diff --git a/build-system/example-configuration/provisioning/NotificationContent.mobileprovision b/build-system/example-configuration/provisioning/NotificationContent.mobileprovision new file mode 100644 index 0000000000000000000000000000000000000000..bd054573e96889963fbf96db225efcf8d55be245 GIT binary patch literal 4655 zcmcgw36K+I7M^4d%#1iH3Wx~ftcoyZ(zz!vGuWN(T$9e(Im=@^NvG3EC+T!|CWi_` z7D2@m7%49nmytt+#q}sp)Dc}oShZFc4-^zE9YNWxbyXC1w=+i)S=@5BO1mmm{r~^_ z-~HbAI>11aWZp8BlBkh8iG44N5N7#)}VZOIn(w!g*y@EJ1Y{Qd8x2(Jrb~&CEl#5}?tB{q|(X+&;SQzK43PyxQuL4j2QaK=1s4=;2zDhSAPzAeXqetU9IcS`ZrrG3w zC{Qtxvb%p=w3+h@VIxpHg_A_2!X%2*93h+V9!&HTblLTK!TV!QBDf0egej74K`*=) zHJjm3QLhID$AURC1d_rJ18oqQ$ixzqQI`WC(8(D<7>b}+B4^75V6W2&!!QJeO%NA! zLkRA-0pTP~Mf@%%q)=(h1{WPNdQ;(~fj1*T-0I1r&H|Wr76VEr5Kw!HE}z$($RkD2 z1(7x{1ahdJwiz%ah`BuxyUXLu>x-ae>@0wRv=>7ml^@2;ITQm6b_`LXMKo{sriDH9 zH0NR8lya?*#a{93|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tk9wFmsho%>`7lc?a0=9A6~b1`GM&5{#055D95Nj;1nyb3bn?Ra2PZvwr)$r%d}ZvBe|$B1|Ea%xy3e|M-QC7h zv0mGue=T)fpxnRhE)k#q4Ujyu^wx(=dtSWnDm=w-l_)%6wC^>kob>zJ-q(Wp_Qn_Fsc&8;oMc~hfzg>(|UD{6Z5m5-k3zH!g| z_Q|tPyvOc1a_=KE-}~i*Tem+jaQ~vcKAY#STjR$}mFG81?0hUiZn(`na|t-+xuy9P z3hPT-?|Sj^l_yW5*L)+k%=T^Z2cHd1dGDravM~=V*|rkOuIG;($bNGB?gziD*c`u$ zF1|zm*7DB&LvJ2gUbu6^!OLFi4L&1pb-h3J#Ffl1D)izTR`=hs>&UHZw^8p%pPn97 zo&FN~?Wga*o7w%!oSRSYk8?YAz4s-!@pF9V@*Oj7+!CLsAf3bs z2mir_y?@@i^iQwfcwD|@!PG;udgi_0dM!Qw?|b^9t%Yx;_uR5&>OcQ@mF<#OzMeke zlRX0`w*UU24Xfo9@l!&{JzlN0$d8=iRT=d!`HdCPEMRJ_z}uST?X|^d5pa2J(bgiL z+;ZWmF>8`>ViZ&{|NPk9{p?pLd*5at+u9}syG2ydp4TFe{Uio(t?k2qP_&&VZkNY4 z{uEwo=z~IAXsL*rpdfLoW9=U{Z5O`JR_FWg-LQ#!xMS1H@+0f!-D+Gh#IkYV(W#4PHAT}WbF1FjUi|F%4gKr76N{Ek i-_5?;ZhB^m66)Buw)v~;K0hwW$QNB3{qV&h(D*meW(;Kj literal 0 HcmV?d00001 diff --git a/build-system/example-configuration/provisioning/Share.mobileprovision b/build-system/example-configuration/provisioning/Share.mobileprovision new file mode 100644 index 0000000000000000000000000000000000000000..e49de2d713a6c6c3aa158448d2b18f3c6c1c6e21 GIT binary patch literal 4613 zcmcgwd6X0N9pCIO3)$sR)&d2@b&Ddb*-Y-uvb#8wnaw#lC#M2VlF4K?lVmb8*&HB8 z1U&HMkOvB4%K7S)MoEHfhP8~Ysh&8j3aB6uZCo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> zm8v$0HjKAPBEg_mCDUqfg;IX5SkJ&@U1BvPMphwlC~O_l{_(e~s{h$osNsM@O%fifr9vD@c@kI^7L_b@m1vGUv?%JA>fDjg%Xo7`-nx%s2;+)&wbdFD&t|~it zx~vhnxOlZ;WW5Wqbi0gtD+2d_FbJDdq! z=45ZzKX`cRo=wWhn{F=j>HBovwTl*xo89?FEw!c zMqWB|>69rKKl#_g;>8nc<}cs0=I}4}O4{GAfA9Ja>@!|iTU{fn5KYpRDY0FYo)~(Z!jS8{WA5R6HZ;p+)$wB-FWBnTb@38+v@GqpCnIC z4k^Dp13iEG!}pVW4$ipg)z(5`=gj>)f79H1e*L%fBTpYY18)2Re{At1mo3>8nJFi2 z#3?KP(S{e_-n#Iu*Oq)BTQF-v-?WaIFW6sAbpB&sPpB^Qy=3hznI<cu_|A`+Q?TG!2+gDsXX)tf90RE&_g4T8L|9 z<7zLtwZ8G;Sz~WR;%|!Yc+h3pk+Si*WOunCQd}trEe?EI)EwuNn z?(JFc1!rpRTfc9fbk6AM((lK~ufO`SNrAdiM|>v^rLXzcm_7NMx|zr)OE>)fKdXV= zzCTPl@VsuSC%9rnpnmSzr69{*^5r#WH}BOQ`TRTfzHPxTR9$_K);EV6YxyLt3ss9|gY2R}rr*39m$gi}&!ffC6+OE@MUpe@3 iK|JS#xn^tdE57FHGcFL`f*wC{e=IlGCAww+H2w>=?EPT? literal 0 HcmV?d00001 diff --git a/build-system/example-configuration/provisioning/Telegram.mobileprovision b/build-system/example-configuration/provisioning/Telegram.mobileprovision new file mode 100644 index 0000000000000000000000000000000000000000..1592674339b219bd9d2779c2abccdaf365494d3b GIT binary patch literal 6015 zcmcgw3zQS(z2EFEi_3zF+yX^`?fQf@$xL3G;O=^6GL!e@IeE6$PBN3pY$h|4nMo!I zDv*nyMcOK$N7~E9mP+voR;jfRBZS;L=00(LwZ zMEeDnk>vhh6!y98{R3LP9ufqW((4f%=@0tc5xifOq1U7Sf&PJ5lt{yHesxoIYUaq8Dr582Y73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D} z26FL58qGhtySqAPt_H4ZjIV5rF9R0!Trk+9nK5H#S9j~buAXl7d&g9C)pSzP)pR`g z+}q#Rt=%`$H~*SrN5tKSxBk}^N51^+oe$i%=Rdx z?|$uxZ+}$x`hSvHd8h5wH3J(C{qpb{Wz)8oKKJZs;`?Av@aV#0R|z-Q*_HqP)eW~l ze)x_pyO`f{~$%i{N4seEOTcfr~#Q)1Wt$KCG5LBpL3jy}Ka z&Axd9T?fqc)5)D%-7CFwy61L2c)&3D_P&8XuA2QpIja5U!N(SxA2}SoQ literal 0 HcmV?d00001 diff --git a/build-system/example-configuration/provisioning/WatchApp.mobileprovision b/build-system/example-configuration/provisioning/WatchApp.mobileprovision new file mode 100644 index 0000000000000000000000000000000000000000..2b0558a24075004e55209dc4db8e53c1905a2a48 GIT binary patch literal 4629 zcmcgwd6X0N9p7Y^g=IlhL@6SyTM%WN%}mY>X4lSSCimo=oL-&GOeV9LTr-nvwXmdI z7V+TFCn8-HK`DoL@Sdoss4Z1c(YAOXo_!TjJZeR2TRYh!i5B0}KQ!;{d-+}8Q25_^Yr}L7&iN^C0w+WAU(2gv}3Sx&R06T4_j!uPA z31zb!tyCg7(&2I1{CI~XL#aevogJMCQOqt-DvQNpH&MOSO=eQni-OX_XR=O8=u-hIKmh^@l@C$01SBrGlakth9`@zVgw0#y$FK9FlmK_s2@g&unQnl z97~0L*_cYBvzdKd%o0qKDYIxpql7b1!n|cD;~j{oy+A}881RLH{$vRqfP66H3c`?p znK+jjN29nuK)HPZZ^<+O*+hKp$w?!`&D^DNdqp}st0Ia0#CTISeeQeU_0fDLMFm%&+5Wf4;N+w4kl7mt8{oE zWsBJ|0&Uk?f*xDQ6i%})pU&g5J99}FTu!n!XV_<;kf1gN#Y<7jL!r2!b$JWC2rvv! z8sZu2fV5hk>ch9JdoF_loA<%7#hM%k!o&Gb}25(qL;+rjKyRUERZ)~hKm>q zOAf#cYKFZe0u>{u^qzx|Q`7|HmSTxQJl3BPSshyF2b^ZMKdVkVM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#ewC0Hq*1UY` zx%01@G2_e!{(eZcY)bQ@)mv^p^vg%p^ImIvb>UmyxsTtfY*sWWZkKBpI9(3pxf2zN zZ(CZLmE)HJv#RS0tLy2&)YelvTNUHRjc;zLy*0PC$mdOs-j&ly_O7C7$AJ$X>{`CB zXTsz;M_(6q9@%jB%-65EW7}Pucm4LV{lR|!``eOl+A5E3n%Hqqir(~V`^?4ADUU1} zyh`hQYTMc;?_F{1bL^7;C>?WxTSAeCqi4T<^;FF%n-|}?0?uue-aM51_=dfAd|Byt zKb^SZM)NDnI#wV4^O0qRn>M|8{!_h?2f&|Le9Te|c{CTj1gaQx4Cz%zxbbEZ6goeFKTs!nf*MS8bW{@0Tv>pLXEu z>8F3ZZ`aYgp5MCZda$D0EtlNA)oP3X#2H?dQU5|8swidyQ)&gSY6d6N7ULDb1+|5$ z1)SXS3*Tnr&6|_c&fEun`RJV4x!eAEyY3?(*Q%0(-J+-%&u9V3pTz*Nb;9T$52`bi z6F_q4=kQuXAC%idOGVL?`1WORkMq%o-e9(jTlgNSXg)rF!IM|6-T2a1^S*iJp`n8Z z9&zvLetZ_Y^|Oy>T+z1T?#!{FaU1W!Ziyb9bWIcW?&B{mU+h^iO;djBrE}(}?)u&C zB|V3y^<>yrCV%=u{>?k)A6fYRvi#kT9nZHtZJbfE9KYwr=W+|cdAs-Q!W27V?p2+O zl;55jShHP-W!643e?!w}9)3;crRTW|j(sqF@6P`!)~#N(honRP&vYx5_hlAu_V&Oa;dDk>f-f_ n4(^> "$FASTFILE" -echo " produce(" >> "$FASTFILE" -echo " username: '$APPLE_ID'," >> "$FASTFILE" -echo " app_identifier: '${BASE_BUNDLE_ID}'," >> "$FASTFILE" -echo " app_name: '$APP_NAME'," >> "$FASTFILE" -echo " language: 'English'," >> "$FASTFILE" -echo " app_version: '1.0'," >> "$FASTFILE" -echo " team_id: '$TEAM_ID'," >> "$FASTFILE" -echo " skip_itc: true," >> "$FASTFILE" -echo " )" >> "$FASTFILE" - -echo " produce(" >> "$FASTFILE" -echo " username: '$APPLE_ID'," >> "$FASTFILE" -echo " app_identifier: '${BASE_BUNDLE_ID}.watchkitapp'," >> "$FASTFILE" -echo " app_name: '$APP_NAME Watch App'," >> "$FASTFILE" -echo " language: 'English'," >> "$FASTFILE" -echo " app_version: '1.0'," >> "$FASTFILE" -echo " team_id: '$TEAM_ID'," >> "$FASTFILE" -echo " skip_itc: true," >> "$FASTFILE" -echo " )" >> "$FASTFILE" - -echo " produce(" >> "$FASTFILE" -echo " username: '$APPLE_ID'," >> "$FASTFILE" -echo " app_identifier: '${BASE_BUNDLE_ID}.watchkitapp.watchkitextension'," >> "$FASTFILE" -echo " app_name: '$APP_NAME Watch App Extension'," >> "$FASTFILE" -echo " language: 'English'," >> "$FASTFILE" -echo " app_version: '1.0'," >> "$FASTFILE" -echo " team_id: '$TEAM_ID'," >> "$FASTFILE" -echo " skip_itc: true," >> "$FASTFILE" -echo " )" >> "$FASTFILE" - -for EXTENSION in ${APP_EXTENSIONS[@]}; do - echo " produce(" >> "$FASTFILE" - echo " username: '$APPLE_ID'," >> "$FASTFILE" - echo " app_identifier: '${BASE_BUNDLE_ID}.${EXTENSION}'," >> "$FASTFILE" - echo " app_name: '${APP_NAME} ${EXTENSION}'," >> "$FASTFILE" - echo " language: 'English'," >> "$FASTFILE" - echo " app_version: '1.0'," >> "$FASTFILE" - echo " team_id: '$TEAM_ID'," >> "$FASTFILE" - echo " skip_itc: true," >> "$FASTFILE" - echo " )" >> "$FASTFILE" -done - -echo "end" >> "$FASTFILE" - -pushd "$BASE_DIR" - -fastlane cert ${CREDENTIALS[@]} --development - -fastlane manage_app - -fastlane produce group -g "group.$BASE_BUNDLE_ID" -n "$APP_NAME Group" ${CREDENTIALS[@]} - -fastlane produce enable_services -a "$BASE_BUNDLE_ID" ${CREDENTIALS[@]} \ - --app-group \ - --push-notification \ - --sirikit - -fastlane produce associate_group -a "$BASE_BUNDLE_ID" "group.$BASE_BUNDLE_ID" ${CREDENTIALS[@]} -for EXTENSION in ${APP_EXTENSIONS[@]}; do - fastlane produce enable_services -a "${BASE_BUNDLE_ID}.${EXTENSION}" ${CREDENTIALS[@]} \ - --app-group - - fastlane produce associate_group -a "${BASE_BUNDLE_ID}.${EXTENSION}" "group.$BASE_BUNDLE_ID" ${CREDENTIALS[@]} -done - -for DEVELOPMENT_FLAG in "--development"; do - fastlane sigh -a "$BASE_BUNDLE_ID" ${CREDENTIALS[@]} -o "$PROVISIONING_DIRECTORY" $DEVELOPMENT_FLAG \ - --skip_install - for EXTENSION in ${APP_EXTENSIONS[@]}; do - fastlane sigh -a "${BASE_BUNDLE_ID}.${EXTENSION}" ${CREDENTIALS[@]} -o "$PROVISIONING_DIRECTORY" $DEVELOPMENT_FLAG \ - --skip_install - done -done - -popd - -rm -rf "$BASE_DIR" diff --git a/build-system/xcode_version b/build-system/xcode_version deleted file mode 100644 index 5807e59269..0000000000 --- a/build-system/xcode_version +++ /dev/null @@ -1 +0,0 @@ -12.2 diff --git a/versions.json b/versions.json new file mode 100644 index 0000000000..f20027f5a5 --- /dev/null +++ b/versions.json @@ -0,0 +1,4 @@ +{ + "bazel": "3.7.0", + "xcode": "12.3" +} From f89e30b17f71f625c395f6fb53708574ad99dd80 Mon Sep 17 00:00:00 2001 From: Ali <> Date: Thu, 7 Jan 2021 02:04:35 +0400 Subject: [PATCH 2/4] WIP --- Telegram/BUILD | 52 +- build-system/Make/BuildEnvironment.py | 112 +++++ build-system/Make/Make.py | 446 ++++++++++++++++++ build-system/Make/ProjectGeneration.py | 155 ++++++ .../example-configuration/provisioning/BUILD | 11 +- .../example-configuration/variables.bzl | 1 - build-system/tulsi | 2 +- 7 files changed, 758 insertions(+), 21 deletions(-) create mode 100644 build-system/Make/BuildEnvironment.py create mode 100644 build-system/Make/Make.py create mode 100644 build-system/Make/ProjectGeneration.py diff --git a/Telegram/BUILD b/Telegram/BUILD index f7b29682b4..3d6ddc2f4b 100644 --- a/Telegram/BUILD +++ b/Telegram/BUILD @@ -1,3 +1,7 @@ +load("@bazel_skylib//rules:common_settings.bzl", + "bool_flag" +) + load("@build_bazel_rules_apple//apple:ios.bzl", "ios_application", "ios_extension", @@ -24,7 +28,6 @@ load( "telegram_bundle_id", "telegram_aps_environment", "telegram_team_id", - "telegram_disable_extensions", ) config_setting( @@ -34,6 +37,19 @@ config_setting( }, ) +bool_flag( + name = "disableExtensions", + build_setting_default = False, + visibility = ["//visibility:public"], +) + +config_setting( + name = "disableExtensionsSetting", + flag_values = { + ":disableExtensions": "True", + }, +) + genrule( name = "empty", outs = ["empty.swift"], @@ -482,7 +498,7 @@ watchos_extension( ":WatchExtensionNSExtensionInfoPlist", ], minimum_os_version = "5.0", - provisioning_profile = "@build_configuration//data/provisioning-profiles:WatchExtension.mobileprovision", + provisioning_profile = "@build_configuration//provisioning:WatchExtension.mobileprovision", resources = [ ":TelegramWatchExtensionResources", ], @@ -509,7 +525,7 @@ watchos_application( ":WatchAppCompanionInfoPlist", ], minimum_os_version = "5.0", - provisioning_profile = "@build_configuration//data/provisioning-profiles:WatchApp.mobileprovision", + provisioning_profile = "@build_configuration//provisioning:WatchApp.mobileprovision", resources = [ ":TelegramWatchAppResources", ":TelegramWatchAppAssets", @@ -1055,7 +1071,7 @@ ios_extension( ":AppNameInfoPlist", ], minimum_os_version = "9.0", - provisioning_profile = "@build_configuration//data/provisioning-profiles:Share.mobileprovision", + provisioning_profile = "@build_configuration//provisioning:Share.mobileprovision", deps = [":ShareExtensionLib"], frameworks = [ ":TelegramUIFramework" @@ -1123,7 +1139,7 @@ ios_extension( ":AppNameInfoPlist", ], minimum_os_version = "10.0", - provisioning_profile = "@build_configuration//data/provisioning-profiles:NotificationContent.mobileprovision", + provisioning_profile = "@build_configuration//provisioning:NotificationContent.mobileprovision", deps = [":NotificationContentExtensionLib"], frameworks = [ ":TelegramUIFramework" @@ -1195,7 +1211,7 @@ ios_extension( ], minimum_os_version = "14.0", provides_main = True, - provisioning_profile = "@build_configuration//data/provisioning-profiles:Widget.mobileprovision", + provisioning_profile = "@build_configuration//provisioning:Widget.mobileprovision", deps = [":WidgetExtensionLib"], frameworks = [ ":SwiftSignalKitFramework", @@ -1283,7 +1299,7 @@ ios_extension( ":AppNameInfoPlist", ], minimum_os_version = "10.0", - provisioning_profile = "@build_configuration//data/provisioning-profiles:Intents.mobileprovision", + provisioning_profile = "@build_configuration//provisioning:Intents.mobileprovision", deps = [":IntentsExtensionLib"], frameworks = [ ":SwiftSignalKitFramework", @@ -1334,7 +1350,7 @@ ios_extension( ":AppNameInfoPlist", ], minimum_os_version = "10.0", - provisioning_profile = "@build_configuration//data/provisioning-profiles:NotificationService.mobileprovision", + provisioning_profile = "@build_configuration//provisioning:NotificationService.mobileprovision", deps = ["//Telegram/NotificationService:NotificationServiceExtensionLib"], frameworks = [ ":MtProtoKitFramework", @@ -1522,7 +1538,7 @@ ios_application( ), families = ["iphone", "ipad"], minimum_os_version = "9.0", - provisioning_profile = "@build_configuration//data/provisioning-profiles:Telegram.mobileprovision", + provisioning_profile = "@build_configuration//provisioning:Telegram.mobileprovision", entitlements = ":TelegramEntitlements.entitlements", infoplists = [ ":TelegramInfoPlist", @@ -1547,14 +1563,16 @@ ios_application( strings = [ ":AppStringResources", ], - extensions = [ - ] if telegram_disable_extensions else [ - ":ShareExtension", - ":NotificationContentExtension", - ":NotificationServiceExtension", - ":IntentsExtension", - ":WidgetExtension", - ], + extensions = select({ + ":disableExtensionsSetting": [], + "//conditions:default": [ + ":ShareExtension", + ":NotificationContentExtension", + ":NotificationServiceExtension", + ":IntentsExtension", + ":WidgetExtension", + ], + }), watch_application = ":TelegramWatchApp", deps = [ ":Main", diff --git a/build-system/Make/BuildEnvironment.py b/build-system/Make/BuildEnvironment.py new file mode 100644 index 0000000000..0769f580bb --- /dev/null +++ b/build-system/Make/BuildEnvironment.py @@ -0,0 +1,112 @@ +import json +import os +import platform +import subprocess + + +def is_apple_silicon(): + if platform.processor() == 'arm': + return True + else: + return False + + +def get_clean_env(): + clean_env = os.environ.copy() + clean_env['PATH'] = '/usr/bin:/bin:/usr/sbin:/sbin' + return clean_env + + +def run_executable_with_output(path, arguments): + process = subprocess.Popen( + [path] + arguments, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + env=get_clean_env() + ) + output_data, _ = process.communicate() + output_string = output_data.decode('utf-8') + return output_string + + +def call_executable(arguments): + subprocess.check_call(arguments, env=get_clean_env()) + + +def get_bazel_version(bazel_path): + command_result = run_executable_with_output(bazel_path, ['--version']).strip('\n') + if not command_result.startswith('bazel '): + raise Exception('{} is not a valid bazel binary'.format(bazel_path)) + command_result.replace('bazel ', '') + return command_result + + +def get_xcode_version(): + xcode_path = run_executable_with_output('xcode-select', ['-p']).strip('\n') + if not os.path.isdir(xcode_path): + print('The path reported by \'xcode-select -p\' does not exist') + exit(1) + + plist_path = '{}/../Info.plist'.format(xcode_path) + + info_plist_lines = run_executable_with_output('plutil', [ + '-p', plist_path + ]).split('\n') + + pattern = 'CFBundleShortVersionString" => ' + for line in info_plist_lines: + index = line.find(pattern) + if index != -1: + version = line[index + len(pattern):].strip('"') + return version + + print('Could not parse the Xcode version from {}'.format(plist_path)) + exit(1) + + +class BuildEnvironment: + def __init__( + self, + base_path, + bazel_path, + bazel_x86_64_path, + override_bazel_version, + override_xcode_version + ): + self.base_path = base_path + self.bazel_path = bazel_path + self.bazel_x86_64_path = bazel_x86_64_path + + configuration_path = os.path.join(base_path, 'versions.json') + with open(configuration_path) as file: + configuration_dict = json.load(file) + if configuration_dict['bazel'] is None: + raise Exception('Missing bazel version in {}'.format(configuration_path)) + else: + self.bazel_version = configuration_dict['bazel'] + if configuration_dict['xcode'] is None: + raise Exception('Missing xcode version in {}'.format(configuration_path)) + else: + self.xcode_version = configuration_dict['xcode'] + + actual_bazel_version = get_bazel_version(self.bazel_path) + if actual_bazel_version != self.bazel_version: + if override_bazel_version: + print('Overriding the required bazel version {} with {} as reported by {}'.format( + self.bazel_version, actual_bazel_version, self.bazel_path)) + self.bazel_version = actual_bazel_version + else: + print('Required bazel version is {}, but {} is reported by {}'.format( + self.bazel_version, actual_bazel_version, self.bazel_path)) + exit(1) + + actual_xcode_version = get_xcode_version() + if actual_xcode_version != self.xcode_version: + if override_xcode_version: + print('Overriding the required Xcode version {} with {} as reported by \'xcode-select -p\''.format( + self.xcode_version, actual_xcode_version, self.bazel_path)) + self.xcode_version = actual_xcode_version + else: + print('Required Xcode version is {}, but {} is reported by \'xcode-select -p\''.format( + self.xcode_version, actual_xcode_version, self.bazel_path)) + exit(1) diff --git a/build-system/Make/Make.py b/build-system/Make/Make.py new file mode 100644 index 0000000000..2e6878a95c --- /dev/null +++ b/build-system/Make/Make.py @@ -0,0 +1,446 @@ +#!/bin/python3 + +import argparse +import os +import sys +import tempfile + +from BuildEnvironment import is_apple_silicon, call_executable, BuildEnvironment +from ProjectGeneration import generate + + +class BazelCommandLine: + def __init__(self, bazel_path, bazel_x86_64_path, override_bazel_version, override_xcode_version): + self.build_environment = BuildEnvironment( + base_path=os.getcwd(), + bazel_path=bazel_path, + bazel_x86_64_path=bazel_x86_64_path, + override_bazel_version=override_bazel_version, + override_xcode_version=override_xcode_version + ) + self.remote_cache = None + self.cache_dir = None + self.additional_args = None + self.configuration_args = None + self.configuration_path = None + + self.common_args = [ + # https://docs.bazel.build/versions/master/command-line-reference.html + # Ask bazel to print the actual resolved command line options. + '--announce_rc', + + # https://github.com/bazelbuild/rules_swift + # If enabled, Swift compilation actions will use the same global Clang module + # cache used by Objective-C compilation actions. This is disabled by default + # because under some circumstances Clang module cache corruption can cause the + # Swift compiler to crash (sometimes when switching configurations or syncing a + # repository), but disabling it also causes a noticeable build time regression + # so it can be explicitly re-enabled by users who are not affected by those + # crashes. + '--features=swift.use_global_module_cache', + + # https://docs.bazel.build/versions/master/command-line-reference.html + # Print the subcommand details in case of failure. + '--verbose_failures', + ] + + self.common_build_args = [ + # https://github.com/bazelbuild/rules_swift + # If enabled and whole module optimisation is being used, the `*.swiftdoc`, + # `*.swiftmodule` and `*-Swift.h` are generated with a separate action + # rather than as part of the compilation. + '--features=swift.split_derived_files_generation', + + # https://github.com/bazelbuild/rules_swift + # If enabled the skip function bodies frontend flag is passed when using derived + # files generation. + '--features=swift.skip_function_bodies_for_derived_files', + + # Set the number of parallel processes to match the available CPU core count. + '--jobs={}'.format(os.cpu_count()), + ] + + self.common_debug_args = [ + # https://github.com/bazelbuild/rules_swift + # If enabled, Swift compilation actions will use batch mode by passing + # `-enable-batch-mode` to `swiftc`. This is a new compilation mode as of + # Swift 4.2 that is intended to speed up non-incremental non-WMO builds by + # invoking a smaller number of frontend processes and passing them batches of + # source files. + '--features=swift.enable_batch_mode', + + # https://docs.bazel.build/versions/master/command-line-reference.html + # Set the number of parallel jobs per module to saturate the available CPU resources. + '--swiftcopt=-j{}'.format(os.cpu_count() - 1), + ] + + self.common_release_args = [ + # https://github.com/bazelbuild/rules_swift + # Enable whole module optimization. + '--features=swift.opt_uses_wmo', + + # https://github.com/bazelbuild/rules_swift + # Use -Osize instead of -O when building swift modules. + '--features=swift.opt_uses_osize', + + # --num-threads 0 forces swiftc to generate one object file per module; it: + # 1. resolves issues with the linker caused by the swift-objc mixing. + # 2. makes the resulting binaries significantly smaller (up to 9% for this project). + '--swiftcopt=-num-threads', '--swiftcopt=0', + + # Strip unsused code. + '--features=dead_strip', + '--objc_enable_binary_stripping', + + # Always embed bitcode into Watch binaries. This is required by the App Store. + '--apple_bitcode=watchos=embedded', + ] + + def add_remote_cache(self, host): + self.remote_cache = host + + def add_cache_dir(self, path): + self.cache_dir = path + + def add_additional_args(self, additional_args): + self.additional_args = additional_args + + def set_configuration_path(self, path): + self.configuration_path = path + + def set_configuration(self, configuration): + if configuration == 'debug_arm64': + self.configuration_args = [ + # bazel debug build configuration + '-c', 'dbg', + + # Build single-architecture binaries. It is almost 2 times faster is 32-bit support is not required. + '--ios_multi_cpus=arm64', + + # Always build universal Watch binaries. + '--watchos_cpus=armv7k,arm64_32' + ] + self.common_debug_args + elif configuration == 'release_arm64': + self.configuration_args = [ + # bazel optimized build configuration + '-c', 'opt', + + # Build single-architecture binaries. It is almost 2 times faster is 32-bit support is not required. + '--ios_multi_cpus=arm64', + + # Always build universal Watch binaries. + '--watchos_cpus=armv7k,arm64_32' + ] + self.common_release_args + elif configuration == 'release': + self.configuration_args = [ + # bazel optimized build configuration + '-c', 'opt', + + # Build universal binaries. + '--ios_multi_cpus=armv7,arm64', + + # Always build universal Watch binaries. + '--watchos_cpus=armv7k,arm64_32' + + # Generate DSYM files when building. + '--apple_generate_dsym', + + # Require DSYM files as build output. + '--output_groups=+dsyms' + ] + self.common_release_args + else: + raise Exception('Unknown configuration {}'.format(configuration)) + + def invoke_clean(self): + combined_arguments = [ + self.build_environment.bazel_path, + 'clean', + '--expunge' + ] + + print('TelegramBuild: running {}'.format(combined_arguments)) + call_executable(combined_arguments) + + def get_project_generation_arguments(self): + combined_arguments = [] + combined_arguments += self.common_args + combined_arguments += self.common_debug_args + + if self.remote_cache is not None: + combined_arguments += [ + '--remote_cache={}'.format(self.remote_cache), + '--experimental_remote_downloader="{}"'.format(self.remote_cache) + ] + elif self.cache_dir is not None: + combined_arguments += [ + '--disk_cache={path}'.format(path=self.cache_dir) + ] + + return combined_arguments + + def invoke_build(self): + combined_arguments = [ + self.build_environment.bazel_path, + 'build', + 'Telegram/Telegram' + ] + + if self.configuration_path is None: + raise Exception('configuration_path is not defined') + + combined_arguments += [ + '--override_repository=build_configuration={}'.format(self.configuration_path) + ] + + combined_arguments += self.common_args + combined_arguments += self.common_build_args + + if self.remote_cache is not None: + combined_arguments += [ + '--remote_cache={}'.format(self.remote_cache), + '--experimental_remote_downloader="{}"'.format(self.remote_cache) + ] + elif self.cache_dir is not None: + combined_arguments += [ + '--disk_cache={path}'.format(path=self.cache_dir) + ] + + combined_arguments += self.configuration_args + + print('TelegramBuild: running {}'.format(combined_arguments)) + call_executable(combined_arguments) + + +def clean(arguments): + bazel_command_line = BazelCommandLine( + bazel_path=arguments.bazel, + bazel_x86_64_path=None, + override_bazel_version=arguments.overrideBazelVersion, + override_xcode_version=arguments.overrideXcodeVersion + ) + + bazel_command_line.invoke_clean() + + +def resolve_configuration(bazel_command_line: BazelCommandLine, arguments): + if arguments.configurationGenerator is not None: + if not os.path.isfile(arguments.configurationGenerator): + print('{} is not a valid executable'.format(arguments.configurationGenerator)) + exit(1) + + temp_configuration_path = tempfile.mkdtemp() + call_executable([ + arguments.configurationGenerator, + temp_configuration_path + ]) + + print('TelegramBuild: using generated configuration in {}'.format(temp_configuration_path)) + bazel_command_line.set_configuration_path(temp_configuration_path) + elif arguments.configurationPath is not None: + absolute_configuration_path = os.path.abspath(arguments.configurationPath) + if not os.path.isdir(absolute_configuration_path): + print('Error: {} does not exist'.format(absolute_configuration_path)) + exit(1) + bazel_command_line.set_configuration_path(absolute_configuration_path) + else: + raise Exception('Neither configurationPath nor configurationGenerator are set') + + +def generate_project(arguments): + bazel_command_line = BazelCommandLine( + bazel_path=arguments.bazel, + bazel_x86_64_path=arguments.bazel_x86_64, + override_bazel_version=arguments.overrideBazelVersion, + override_xcode_version=arguments.overrideXcodeVersion + ) + + if arguments.cacheDir is not None: + bazel_command_line.add_cache_dir(arguments.cacheDir) + elif arguments.cacheHost is not None: + bazel_command_line.add_remote_cache(arguments.cacheDir) + + resolve_configuration(bazel_command_line, arguments) + + disable_extensions = False + if arguments.disableExtensions is not None: + disable_extensions = arguments.disableExtensions + + generate( + build_environment=bazel_command_line.build_environment, + disable_extensions=disable_extensions, + configuration_path=bazel_command_line.configuration_path, + bazel_app_arguments=bazel_command_line.get_project_generation_arguments() + ) + + +def build(arguments): + bazel_command_line = BazelCommandLine( + bazel_path=arguments.bazel, + bazel_x86_64_path=None, + override_bazel_version=arguments.overrideBazelVersion, + override_xcode_version=arguments.overrideXcodeVersion + ) + + if arguments.cacheDir is not None: + bazel_command_line.add_cache_dir(arguments.cacheDir) + elif arguments.cacheHost is not None: + bazel_command_line.add_remote_cache(arguments.cacheDir) + + resolve_configuration(bazel_command_line, arguments) + + bazel_command_line.set_configuration(arguments.configuration) + + bazel_command_line.invoke_build() + + +def add_project_and_build_common_arguments(current_parser: argparse.ArgumentParser): + group = current_parser.add_mutually_exclusive_group(required=True) + group.add_argument( + '--configurationPath', + help=''' + Path to a folder containing build configuration and provisioning profiles. + See build-system/example-configuration for an example. + ''', + metavar='path' + ) + group.add_argument( + '--configurationGenerator', + help=''' + Path to an executable that will generate configuration data + (project constants and provisioning profiles). + The executable will be invoked with one parameter — path to the destination directory. + See build-system/generate-configuration.sh for an example. + ''', + metavar='path' + ) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(prog='Make') + + parser.add_argument( + '--verbose', + action='store_true', + default=False, + help='Print debug info' + ) + + parser.add_argument( + '--bazel', + required=True, + help='Use custom bazel binary', + metavar='path' + ) + + parser.add_argument( + '--overrideBazelVersion', + action='store_true', + help='Override bazel version with the actual version reported by the bazel binary' + ) + + parser.add_argument( + '--overrideXcodeVersion', + action='store_true', + help='Override xcode version with the actual version reported by \'xcode-select -p\'' + ) + + parser.add_argument( + '--bazelArguments', + required=False, + help='Add additional arguments to all bazel invocations.', + metavar='arguments' + ) + + cacheTypeGroup = parser.add_mutually_exclusive_group() + cacheTypeGroup.add_argument( + '--cacheHost', + required=False, + help='Use remote build artifact cache to speed up rebuilds (See https://github.com/buchgr/bazel-remote).', + metavar='http://host:9092' + ) + cacheTypeGroup.add_argument( + '--cacheDir', + required=False, + help='Cache build artifacts in a local directory to speed up rebuilds.', + metavar='path' + ) + + subparsers = parser.add_subparsers(dest='commandName', help='Commands') + + cleanParser = subparsers.add_parser( + 'clean', help=''' + Clean local bazel cache. Does not affect files cached remotely (via --cacheHost=...) or + locally in an external directory ('--cacheDir=...') + ''' + ) + + generateProjectParser = subparsers.add_parser('generateProject', help='Generate Xcode project') + if is_apple_silicon(): + generateProjectParser.add_argument( + '--bazel_x86_64', + required=True, + help='A standalone bazel x86_64 binary is required to generate a project on Apple Silicon.', + metavar='path' + ) + generateProjectParser.add_argument( + '--buildNumber', + required=False, + type=int, + default=10000, + help='Build number.', + metavar='number' + ) + add_project_and_build_common_arguments(generateProjectParser) + generateProjectParser.add_argument( + '--disableExtensions', + action='store_true', + default=False, + help=''' + The generated project will not include app extensions. + This allows Xcode to properly index the source code. + ''' + ) + + buildParser = subparsers.add_parser('build', help='Build the app') + buildParser.add_argument( + '--buildNumber', + required=True, + type=int, + help='Build number.', + metavar='number' + ) + add_project_and_build_common_arguments(buildParser) + buildParser.add_argument( + '--configuration', + choices=[ + 'debug_arm64', + 'release_arm64', + 'release_universal' + ], + required=True, + help='Build configuration' + ) + + if len(sys.argv) < 2: + parser.print_help() + sys.exit(1) + + args = parser.parse_args() + + if args.verbose: + print(args) + + if args.commandName is None: + exit(0) + + try: + if args.commandName == 'clean': + clean(arguments=args) + elif args.commandName == 'generateProject': + generate_project(arguments=args) + elif args.commandName == 'build': + build(arguments=args) + else: + raise Exception('Unknown command') + except KeyboardInterrupt: + pass diff --git a/build-system/Make/ProjectGeneration.py b/build-system/Make/ProjectGeneration.py new file mode 100644 index 0000000000..dab2520e34 --- /dev/null +++ b/build-system/Make/ProjectGeneration.py @@ -0,0 +1,155 @@ +import json +import os +import shutil + +from BuildEnvironment import is_apple_silicon, call_executable, BuildEnvironment + + +def remove_directory(path): + if os.path.isdir(path): + shutil.rmtree(path) + + +def generate(build_environment: BuildEnvironment, disable_extensions, configuration_path, bazel_app_arguments): + project_path = os.path.join(build_environment.base_path, 'build-input/gen/project') + app_target = 'Telegram' + + ''' + TULSI_APP="build-input/gen/project/Tulsi.app" + TULSI="$TULSI_APP/Contents/MacOS/Tulsi" + + rm -rf "$GEN_DIRECTORY/${APP_TARGET}.tulsiproj" + rm -rf "$TULSI_APP" + ''' + + os.makedirs(project_path, exist_ok=True) + remove_directory('{}/Tulsi.app'.format(project_path)) + remove_directory('{project}/{target}.tulsiproj'.format(project=project_path, target=app_target)) + + tulsi_path = os.path.join(project_path, 'Tulsi.app/Contents/MacOS/Tulsi') + + if is_apple_silicon(): + tulsi_build_bazel_path = build_environment.bazel_x86_64_path + if tulsi_build_bazel_path is None or not os.path.isfile(tulsi_build_bazel_path): + print('Could not find a valid bazel x86_64 binary at {}'.format(tulsi_build_bazel_path)) + exit(1) + else: + tulsi_build_bazel_path = build_environment.bazel_path + + current_dir = os.getcwd() + os.chdir(os.path.join(build_environment.base_path, 'build-system/tulsi')) + call_executable([ + tulsi_build_bazel_path, + 'build', '//:tulsi', + '--xcode_version={}'.format(build_environment.xcode_version), + '--use_top_level_targets_for_symlinks', + '--verbose_failures' + ]) + os.chdir(current_dir) + + bazel_wrapper_path = os.path.abspath('build-input/gen/project/bazel') + + bazel_wrapper_arguments = [] + bazel_wrapper_arguments += ['--override_repository=build_configuration={}'.format(configuration_path)] + if disable_extensions and False: + bazel_wrapper_arguments += ['--//Telegram:disableExtensions'] + + with open(bazel_wrapper_path, 'wb') as bazel_wrapper: + bazel_wrapper.write('''#!/bin/sh +{bazel} "$@" {arguments} +'''.format( + bazel=build_environment.bazel_path, + arguments=' '.join(bazel_wrapper_arguments) + ).encode('utf-8')) + + call_executable(['chmod', '+x', bazel_wrapper_path]) + + call_executable([ + 'unzip', '-oq', + 'build-system/tulsi/bazel-bin/tulsi.zip', + '-d', project_path + ]) + + user_defaults_path = os.path.expanduser('~/Library/Preferences/com.google.Tulsi.plist') + if os.path.isfile(user_defaults_path): + os.unlink(user_defaults_path) + + with open(user_defaults_path, 'wb') as user_defaults: + user_defaults.write(''' + + + + + defaultBazelURL + {} + + +'''.format(bazel_wrapper_path).encode('utf-8')) + + bazel_build_arguments = [] + bazel_build_arguments += ['--override_repository=build_configuration={}'.format(configuration_path)] + if disable_extensions: + bazel_build_arguments += ['--//Telegram:disableExtensions'] + + call_executable([ + tulsi_path, + '--', + '--verbose', + '--create-tulsiproj', app_target, + '--workspaceroot', './', + '--bazel', bazel_wrapper_path, + '--outputfolder', project_path, + '--target', '{target}:{target}'.format(target=app_target), + '--build-options', ' '.join(bazel_build_arguments) + ]) + + additional_arguments = [] + additional_arguments += ['--override_repository=build_configuration={}'.format(configuration_path)] + additional_arguments += bazel_app_arguments + if disable_extensions: + additional_arguments += ['--//Telegram:disableExtensions'] + + additional_arguments_string = ' '.join(additional_arguments) + + tulsi_config_path = 'build-input/gen/project/{target}.tulsiproj/Configs/{target}.tulsigen'.format(target=app_target) + with open(tulsi_config_path, 'rb') as tulsi_config: + tulsi_config_json = json.load(tulsi_config) + for category in ['BazelBuildOptionsDebug', 'BazelBuildOptionsRelease']: + tulsi_config_json['optionSet'][category]['p'] += ' {}'.format(additional_arguments_string) + tulsi_config_json['sourceFilters'] = [ + 'Telegram/...', + 'submodules/...', + 'third-party/...' + ] + with open(tulsi_config_path, 'wb') as tulsi_config: + tulsi_config.write(json.dumps(tulsi_config_json, indent=2).encode('utf-8')) + + call_executable([ + tulsi_path, + '--', + '--verbose', + '--genconfig', '{project}/{target}.tulsiproj:{target}'.format(project=project_path, target=app_target), + '--bazel', bazel_wrapper_path, + '--outputfolder', project_path, + '--no-open-xcode' + ]) + + xcodeproj_path = '{project}/{target}.xcodeproj'.format(project=project_path, target=app_target) + + bazel_build_settings_path = '{}/.tulsi/Scripts/bazel_build_settings.py'.format(xcodeproj_path) + + with open(bazel_build_settings_path, 'rb') as bazel_build_settings: + bazel_build_settings_contents = bazel_build_settings.read().decode('utf-8') + bazel_build_settings_contents = bazel_build_settings_contents.replace( + 'BUILD_SETTINGS = BazelBuildSettings(', + 'import os\nBUILD_SETTINGS = BazelBuildSettings(' + ) + bazel_build_settings_contents = bazel_build_settings_contents.replace( + '\'--cpu=ios_arm64\'', + '\'--cpu=ios_arm64\'.replace(\'ios_arm64\', \'ios_sim_arm64\' if os.environ.get(\'EFFECTIVE_PLATFORM_NAME\') ' + '== \'-iphonesimulator\' else \'ios_arm64\')' + ) + with open(bazel_build_settings_path, 'wb') as bazel_build_settings: + bazel_build_settings.write(bazel_build_settings_contents.encode('utf-8')) + + call_executable(['open', xcodeproj_path]) diff --git a/build-system/example-configuration/provisioning/BUILD b/build-system/example-configuration/provisioning/BUILD index 171ad85d32..9abb88a19d 100644 --- a/build-system/example-configuration/provisioning/BUILD +++ b/build-system/example-configuration/provisioning/BUILD @@ -1,4 +1,11 @@ -exports_files(glob([ - "*.mobileprovision", +exports_files([ + "Intents.mobileprovision", + "NotificationContent.mobileprovision", + "NotificationService.mobileprovision", + "Share.mobileprovision", + "Telegram.mobileprovision", + "WatchApp.mobileprovision", + "WatchExtension.mobileprovision", + "Widget.mobileprovision", ]) diff --git a/build-system/example-configuration/variables.bzl b/build-system/example-configuration/variables.bzl index 0d2d187fa2..84476eb7a2 100644 --- a/build-system/example-configuration/variables.bzl +++ b/build-system/example-configuration/variables.bzl @@ -10,4 +10,3 @@ telegram_is_appstore_build = "true" telegram_appstore_id = "0" telegram_app_specific_url_scheme = "tg" telegram_aps_environment = "production" -telegram_disable_extensions = False diff --git a/build-system/tulsi b/build-system/tulsi index b965114f31..ee28952fc9 160000 --- a/build-system/tulsi +++ b/build-system/tulsi @@ -1 +1 @@ -Subproject commit b965114f31a464185318c71ef3d0c1538d0c52de +Subproject commit ee28952fc91b493b5e1d11e4ccf12d7df4454504 From 9ebb5b0a9f8e90fc92de53eb6978e834b0834003 Mon Sep 17 00:00:00 2001 From: Ali <> Date: Thu, 7 Jan 2021 18:12:33 +0400 Subject: [PATCH 3/4] WIP --- build-system/Make/BuildEnvironment.py | 40 ++++++++++++++++++++++----- build-system/Make/Make.py | 29 ++++++++++++------- 2 files changed, 52 insertions(+), 17 deletions(-) diff --git a/build-system/Make/BuildEnvironment.py b/build-system/Make/BuildEnvironment.py index 0769f580bb..49d7da60f5 100644 --- a/build-system/Make/BuildEnvironment.py +++ b/build-system/Make/BuildEnvironment.py @@ -17,9 +17,24 @@ def get_clean_env(): return clean_env +def resolve_executable(program): + def is_executable(fpath): + return os.path.isfile(fpath) and os.access(fpath, os.X_OK) + + for path in get_clean_env()["PATH"].split(os.pathsep): + executable_file = os.path.join(path, program) + if is_executable(executable_file): + return executable_file + return None + + def run_executable_with_output(path, arguments): + executable_path = resolve_executable(path) + if executable_path is None: + raise Exception('Could not resolve {} to a valid executable file'.format(path)) + process = subprocess.Popen( - [path] + arguments, + [executable_path] + arguments, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=get_clean_env() @@ -29,8 +44,16 @@ def run_executable_with_output(path, arguments): return output_string -def call_executable(arguments): - subprocess.check_call(arguments, env=get_clean_env()) +def call_executable(arguments, use_clean_environment=True): + executable_path = resolve_executable(arguments[0]) + if executable_path is None: + raise Exception('Could not resolve {} to a valid executable file'.format(arguments[0])) + + if use_clean_environment: + resolved_env = get_clean_env() + else: + resolved_env = os.environ + subprocess.check_call([executable_path] + arguments[1:], env=resolved_env) def get_bazel_version(bazel_path): @@ -73,11 +96,14 @@ class BuildEnvironment: override_bazel_version, override_xcode_version ): - self.base_path = base_path - self.bazel_path = bazel_path - self.bazel_x86_64_path = bazel_x86_64_path + self.base_path = os.path.expanduser(base_path) + self.bazel_path = os.path.expanduser(bazel_path) + if bazel_x86_64_path is not None: + self.bazel_x86_64_path = os.path.expanduser(bazel_x86_64_path) + else: + self.bazel_x86_64_path = None - configuration_path = os.path.join(base_path, 'versions.json') + configuration_path = os.path.join(self.base_path, 'versions.json') with open(configuration_path) as file: configuration_dict = json.load(file) if configuration_dict['bazel'] is None: diff --git a/build-system/Make/Make.py b/build-system/Make/Make.py index 2e6878a95c..d7d5c18e7f 100644 --- a/build-system/Make/Make.py +++ b/build-system/Make/Make.py @@ -2,10 +2,11 @@ import argparse import os +import shlex import sys import tempfile -from BuildEnvironment import is_apple_silicon, call_executable, BuildEnvironment +from BuildEnvironment import is_apple_silicon, resolve_executable, call_executable, BuildEnvironment from ProjectGeneration import generate @@ -224,15 +225,21 @@ def clean(arguments): def resolve_configuration(bazel_command_line: BazelCommandLine, arguments): if arguments.configurationGenerator is not None: - if not os.path.isfile(arguments.configurationGenerator): - print('{} is not a valid executable'.format(arguments.configurationGenerator)) + configuration_generator_arguments = shlex.split(arguments.configurationGenerator) + + configuration_generator_executable = resolve_executable(configuration_generator_arguments[0]) + + if configuration_generator_executable is None: + print('{} is not a valid executable'.format(configuration_generator_arguments[0])) exit(1) temp_configuration_path = tempfile.mkdtemp() - call_executable([ - arguments.configurationGenerator, - temp_configuration_path - ]) + + resolved_configuration_generator_arguments = [configuration_generator_executable] + resolved_configuration_generator_arguments += configuration_generator_arguments[1:] + resolved_configuration_generator_arguments += [temp_configuration_path] + + call_executable(resolved_configuration_generator_arguments, use_clean_environment=False) print('TelegramBuild: using generated configuration in {}'.format(temp_configuration_path)) bazel_command_line.set_configuration_path(temp_configuration_path) @@ -306,12 +313,14 @@ def add_project_and_build_common_arguments(current_parser: argparse.ArgumentPars group.add_argument( '--configurationGenerator', help=''' - Path to an executable that will generate configuration data + A command line invocation that will dynamically generate the configuration data (project constants and provisioning profiles). - The executable will be invoked with one parameter — path to the destination directory. + The expression will be parsed according to the shell parsing rules into program and arguments parts. + The program will be then invoked with the given arguments plus the path to the output directory. See build-system/generate-configuration.sh for an example. + Example: --configurationGenerator="sh ~/my_script.sh argument1" ''', - metavar='path' + metavar='command' ) From fdc850e0112a0f37a1388d834e95159aa9687581 Mon Sep 17 00:00:00 2001 From: Ali <> Date: Fri, 8 Jan 2021 02:23:18 +0400 Subject: [PATCH 4/4] WIP --- Telegram/BUILD | 133 +++++++----------- build-system/Make/BuildEnvironment.py | 14 +- build-system/Make/Make.py | 17 +++ .../example-configuration/variables.bzl | 4 +- versions.json | 1 + 5 files changed, 78 insertions(+), 91 deletions(-) diff --git a/Telegram/BUILD b/Telegram/BUILD index 3d6ddc2f4b..e946fafd0f 100644 --- a/Telegram/BUILD +++ b/Telegram/BUILD @@ -1,5 +1,5 @@ load("@bazel_skylib//rules:common_settings.bzl", - "bool_flag" + "bool_flag", ) load("@build_bazel_rules_apple//apple:ios.bzl", @@ -23,8 +23,6 @@ load("//build-system/bazel-utils:plist_fragment.bzl", load( "@build_configuration//:variables.bzl", - "telegram_build_number", - "telegram_version", "telegram_bundle_id", "telegram_aps_environment", "telegram_team_id", @@ -43,6 +41,12 @@ bool_flag( visibility = ["//visibility:public"], ) +string_flag( + name = "buildNumber", + build_setting_default = "10000", + visibility = ["//visibility:public"], +) + config_setting( name = "disableExtensionsSetting", flag_values = { @@ -206,14 +210,20 @@ swift_library( ) plist_fragment( - name = "AdditionalInfoPlist", + name = "BuildNumberInfoPlist", extension = "plist", template = """ - CFBundleShortVersionString - {telegram_version} CFBundleVersion - {telegram_build_number} + {buildNumber} + """ +) + +plist_fragment( + name = "UrlTypesInfoPlist", + extension = "plist", + template = + """ CFBundleURLTypes @@ -226,16 +236,6 @@ plist_fragment( telegram - - CFBundleTypeRole - Viewer - CFBundleURLName - {telegram_bundle_id}.ton - CFBundleURLSchemes - - ton - - CFBundleTypeRole Viewer @@ -248,8 +248,6 @@ plist_fragment( """.format( - telegram_version = telegram_version, - telegram_build_number = telegram_build_number, telegram_bundle_id = telegram_bundle_id, ) ) @@ -387,13 +385,8 @@ plist_fragment( template = """ CFBundleShortVersionString - {telegram_version} - CFBundleVersion - {telegram_build_number} - """.format( - telegram_version = telegram_version, - telegram_build_number = telegram_build_number, - ) + {telegramVersion} + """ ) plist_fragment( @@ -494,6 +487,7 @@ watchos_extension( infoplists = [ ":WatchExtensionInfoPlist", ":VersionInfoPlist", + ":BuildNumberInfoPlist", ":AppNameInfoPlist", ":WatchExtensionNSExtensionInfoPlist", ], @@ -521,6 +515,7 @@ watchos_application( infoplists = [ ":WatchAppInfoPlist", ":VersionInfoPlist", + "BuildNumberInfoPlist", ":AppNameInfoPlist", ":WatchAppCompanionInfoPlist", ], @@ -544,20 +539,14 @@ plist_fragment( """ CFBundleIdentifier {telegram_bundle_id}.MtProtoKit - CFBundleVersion - {telegram_build_number} CFBundleDevelopmentRegion en CFBundleName MtProtoKit - CFBundleShortVersionString - {telegram_version} CFBundlePackageType FMWK """.format( telegram_bundle_id = telegram_bundle_id, - telegram_version = telegram_version, - telegram_build_number = telegram_build_number, ) ) @@ -572,6 +561,8 @@ ios_framework( ], infoplists = [ ":MtProtoKitInfoPlist", + ":BuildNumberInfoPlist", + ":VersionInfoPlist", ], minimum_os_version = "9.0", ipa_post_processor = strip_framework, @@ -587,20 +578,14 @@ plist_fragment( """ CFBundleIdentifier {telegram_bundle_id}.SwiftSignalKit - CFBundleVersion - {telegram_build_number} CFBundleDevelopmentRegion en CFBundleName SwiftSignalKit - CFBundleShortVersionString - {telegram_version} CFBundlePackageType FMWK """.format( telegram_bundle_id = telegram_bundle_id, - telegram_version = telegram_version, - telegram_build_number = telegram_build_number, ) ) @@ -615,6 +600,8 @@ ios_framework( ], infoplists = [ ":SwiftSignalKitInfoPlist", + ":BuildNumberInfoPlist", + ":VersionInfoPlist", ], minimum_os_version = "9.0", ipa_post_processor = strip_framework, @@ -630,20 +617,14 @@ plist_fragment( """ CFBundleIdentifier {telegram_bundle_id}.Postbox - CFBundleVersion - {telegram_build_number} CFBundleDevelopmentRegion en CFBundleName Postbox - CFBundleShortVersionString - {telegram_version} CFBundlePackageType FMWK """.format( telegram_bundle_id = telegram_bundle_id, - telegram_version = telegram_version, - telegram_build_number = telegram_build_number, ) ) @@ -658,6 +639,8 @@ ios_framework( ], infoplists = [ ":PostboxInfoPlist", + ":BuildNumberInfoPlist", + ":VersionInfoPlist", ], frameworks = [ ":SwiftSignalKitFramework", @@ -676,20 +659,14 @@ plist_fragment( """ CFBundleIdentifier {telegram_bundle_id}.TelegramApi - CFBundleVersion - {telegram_build_number} CFBundleDevelopmentRegion en CFBundleName TelegramApi - CFBundleShortVersionString - {telegram_version} CFBundlePackageType FMWK """.format( telegram_bundle_id = telegram_bundle_id, - telegram_version = telegram_version, - telegram_build_number = telegram_build_number, ) ) @@ -704,6 +681,8 @@ ios_framework( ], infoplists = [ ":TelegramApiInfoPlist", + ":BuildNumberInfoPlist", + ":VersionInfoPlist", ], minimum_os_version = "9.0", ipa_post_processor = strip_framework, @@ -719,20 +698,14 @@ plist_fragment( """ CFBundleIdentifier {telegram_bundle_id}.SyncCore - CFBundleVersion - {telegram_build_number} CFBundleDevelopmentRegion en CFBundleName SyncCore - CFBundleShortVersionString - {telegram_version} CFBundlePackageType FMWK """.format( telegram_bundle_id = telegram_bundle_id, - telegram_version = telegram_version, - telegram_build_number = telegram_build_number, ) ) @@ -747,6 +720,8 @@ ios_framework( ], infoplists = [ ":SyncCoreInfoPlist", + ":BuildNumberInfoPlist", + ":VersionInfoPlist", ], frameworks = [ ":SwiftSignalKitFramework", @@ -766,20 +741,14 @@ plist_fragment( """ CFBundleIdentifier {telegram_bundle_id}.TelegramCore - CFBundleVersion - {telegram_build_number} CFBundleDevelopmentRegion en CFBundleName TelegramCore - CFBundleShortVersionString - {telegram_version} CFBundlePackageType FMWK """.format( telegram_bundle_id = telegram_bundle_id, - telegram_version = telegram_version, - telegram_build_number = telegram_build_number, ) ) @@ -794,13 +763,14 @@ ios_framework( ], infoplists = [ ":TelegramCoreInfoPlist", + ":BuildNumberInfoPlist", + ":VersionInfoPlist", ], frameworks = [ ":MtProtoKitFramework", ":SwiftSignalKitFramework", ":PostboxFramework", ":SyncCoreFramework", - #":TelegramApiFramework", ], minimum_os_version = "9.0", ipa_post_processor = strip_framework, @@ -816,20 +786,14 @@ plist_fragment( """ CFBundleIdentifier {telegram_bundle_id}.AsyncDisplayKit - CFBundleVersion - {telegram_build_number} CFBundleDevelopmentRegion en CFBundleName AsyncDisplayKit - CFBundleShortVersionString - {telegram_version} CFBundlePackageType FMWK """.format( telegram_bundle_id = telegram_bundle_id, - telegram_version = telegram_version, - telegram_build_number = telegram_build_number, ) ) @@ -844,6 +808,8 @@ ios_framework( ], infoplists = [ ":AsyncDisplayKitInfoPlist", + ":BuildNumberInfoPlist", + ":VersionInfoPlist", ], minimum_os_version = "9.0", ipa_post_processor = strip_framework, @@ -859,20 +825,14 @@ plist_fragment( """ CFBundleIdentifier {telegram_bundle_id}.Display - CFBundleVersion - {telegram_build_number} CFBundleDevelopmentRegion en CFBundleName Display - CFBundleShortVersionString - {telegram_version} CFBundlePackageType FMWK """.format( telegram_bundle_id = telegram_bundle_id, - telegram_version = telegram_version, - telegram_build_number = telegram_build_number, ) ) @@ -930,6 +890,8 @@ ios_framework( ], infoplists = [ ":DisplayInfoPlist", + ":BuildNumberInfoPlist", + ":VersionInfoPlist", ], frameworks = [ ":SwiftSignalKitFramework", @@ -949,20 +911,14 @@ plist_fragment( """ CFBundleIdentifier {telegram_bundle_id}.TelegramUI - CFBundleVersion - {telegram_build_number} CFBundleDevelopmentRegion en CFBundleName TelegramUI - CFBundleShortVersionString - {telegram_version} CFBundlePackageType FMWK """.format( telegram_bundle_id = telegram_bundle_id, - telegram_version = telegram_version, - telegram_build_number = telegram_build_number, ) ) @@ -977,12 +933,13 @@ ios_framework( ], infoplists = [ ":TelegramUIInfoPlist", + ":BuildNumberInfoPlist", + ":VersionInfoPlist", ], frameworks = [ ":MtProtoKitFramework", ":SwiftSignalKitFramework", ":PostboxFramework", - #":TelegramApiFramework", ":SyncCoreFramework", ":TelegramCoreFramework", ":AsyncDisplayKitFramework", @@ -1068,6 +1025,7 @@ ios_extension( infoplists = [ ":ShareInfoPlist", ":VersionInfoPlist", + ":BuildNumberInfoPlist", ":AppNameInfoPlist", ], minimum_os_version = "9.0", @@ -1136,6 +1094,7 @@ ios_extension( infoplists = [ ":NotificationContentInfoPlist", ":VersionInfoPlist", + ":BuildNumberInfoPlist", ":AppNameInfoPlist", ], minimum_os_version = "10.0", @@ -1207,6 +1166,7 @@ ios_extension( infoplists = [ ":WidgetInfoPlist", ":VersionInfoPlist", + ":BuildNumberInfoPlist", ":AppNameInfoPlist", ], minimum_os_version = "14.0", @@ -1296,6 +1256,7 @@ ios_extension( infoplists = [ ":IntentsInfoPlist", ":VersionInfoPlist", + ":BuildNumberInfoPlist", ":AppNameInfoPlist", ], minimum_os_version = "10.0", @@ -1305,7 +1266,6 @@ ios_extension( ":SwiftSignalKitFramework", ":PostboxFramework", ":TelegramCoreFramework", - #":TelegramApiFramework", ":SyncCoreFramework", ], ) @@ -1347,6 +1307,7 @@ ios_extension( infoplists = [ ":NotificationServiceInfoPlist", ":VersionInfoPlist", + ":BuildNumberInfoPlist", ":AppNameInfoPlist", ], minimum_os_version = "10.0", @@ -1356,8 +1317,6 @@ ios_extension( ":MtProtoKitFramework", ":SwiftSignalKitFramework", ":PostboxFramework", - #":TelegramApiFramework", - #":SyncCoreFramework", ], ) @@ -1542,7 +1501,9 @@ ios_application( entitlements = ":TelegramEntitlements.entitlements", infoplists = [ ":TelegramInfoPlist", - ":AdditionalInfoPlist", + ":BuildNumberInfoPlist", + ":VersionInfoPlist", + ":UrlTypesInfoPlist", ], ipa_post_processor = ":AddAlternateIcons", resources = [ diff --git a/build-system/Make/BuildEnvironment.py b/build-system/Make/BuildEnvironment.py index 49d7da60f5..ce0a313253 100644 --- a/build-system/Make/BuildEnvironment.py +++ b/build-system/Make/BuildEnvironment.py @@ -44,7 +44,7 @@ def run_executable_with_output(path, arguments): return output_string -def call_executable(arguments, use_clean_environment=True): +def call_executable(arguments, use_clean_environment=True, check_result=True): executable_path = resolve_executable(arguments[0]) if executable_path is None: raise Exception('Could not resolve {} to a valid executable file'.format(arguments[0])) @@ -53,7 +53,13 @@ def call_executable(arguments, use_clean_environment=True): resolved_env = get_clean_env() else: resolved_env = os.environ - subprocess.check_call([executable_path] + arguments[1:], env=resolved_env) + + resolved_arguments = [executable_path] + arguments[1:] + + if check_result: + subprocess.check_call(resolved_arguments, env=resolved_env) + else: + subprocess.call(resolved_arguments, env=resolved_env) def get_bazel_version(bazel_path): @@ -106,6 +112,10 @@ class BuildEnvironment: configuration_path = os.path.join(self.base_path, 'versions.json') with open(configuration_path) as file: configuration_dict = json.load(file) + if configuration_dict['app'] is None: + raise Exception('Missing app version in {}'.format(configuration_path)) + else: + self.app_version = configuration_dict['app'] if configuration_dict['bazel'] is None: raise Exception('Missing bazel version in {}'.format(configuration_path)) else: diff --git a/build-system/Make/Make.py b/build-system/Make/Make.py index d7d5c18e7f..214a6cd422 100644 --- a/build-system/Make/Make.py +++ b/build-system/Make/Make.py @@ -22,6 +22,7 @@ class BazelCommandLine: self.remote_cache = None self.cache_dir = None self.additional_args = None + self.build_number = None self.configuration_args = None self.configuration_path = None @@ -106,6 +107,9 @@ class BazelCommandLine: def add_additional_args(self, additional_args): self.additional_args = additional_args + def set_build_number(self, build_number): + self.build_number = build_number + def set_configuration_path(self, path): self.configuration_path = path @@ -162,10 +166,17 @@ class BazelCommandLine: print('TelegramBuild: running {}'.format(combined_arguments)) call_executable(combined_arguments) + def get_define_arguments(self): + return [ + '--define=buildNumber={}'.format(self.build_number), + '--define=telegramVersion={}'.format(self.build_environment.app_version) + ] + def get_project_generation_arguments(self): combined_arguments = [] combined_arguments += self.common_args combined_arguments += self.common_debug_args + combined_arguments += self.get_define_arguments() if self.remote_cache is not None: combined_arguments += [ @@ -195,6 +206,7 @@ class BazelCommandLine: combined_arguments += self.common_args combined_arguments += self.common_build_args + combined_arguments += self.get_define_arguments() if self.remote_cache is not None: combined_arguments += [ @@ -268,10 +280,14 @@ def generate_project(arguments): resolve_configuration(bazel_command_line, arguments) + bazel_command_line.set_build_number(arguments.buildNumber) + disable_extensions = False if arguments.disableExtensions is not None: disable_extensions = arguments.disableExtensions + call_executable(['killall', 'Xcode'], check_result=False) + generate( build_environment=bazel_command_line.build_environment, disable_extensions=disable_extensions, @@ -296,6 +312,7 @@ def build(arguments): resolve_configuration(bazel_command_line, arguments) bazel_command_line.set_configuration(arguments.configuration) + bazel_command_line.set_build_number(arguments.buildNumber) bazel_command_line.invoke_build() diff --git a/build-system/example-configuration/variables.bzl b/build-system/example-configuration/variables.bzl index 84476eb7a2..a89c790a17 100644 --- a/build-system/example-configuration/variables.bzl +++ b/build-system/example-configuration/variables.bzl @@ -1,9 +1,7 @@ -telegram_build_number = "10000" -telegram_version = "7.3" telegram_bundle_id = "ph.telegra.Telegraph" telegram_api_id = "8" -telegram_team_id = "C67CF9S4VU" telegram_api_hash = "7245de8e747a0d6fbe11f7cc14fcc0bb" +telegram_team_id = "C67CF9S4VU" telegram_app_center_id = "0" telegram_is_internal_build = "false" telegram_is_appstore_build = "true" diff --git a/versions.json b/versions.json index f20027f5a5..0e265af4f4 100644 --- a/versions.json +++ b/versions.json @@ -1,4 +1,5 @@ { + "app": "7.3", "bazel": "3.7.0", "xcode": "12.3" }