ffi.json 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. {
  2. "version": 1,
  3. "variables": {
  4. "VERSION": "$(go run github.com/sagernet/sing-box/cmd/internal/read_tag@latest)",
  5. "WORKSPACE_ROOT": "../../..",
  6. "DEPLOY_ANDROID": "${WORKSPACE_ROOT}/sing-box-for-android/app/libs",
  7. "DEPLOY_APPLE": "${WORKSPACE_ROOT}/sing-box-for-apple",
  8. "DEPLOY_WINDOWS": "${WORKSPACE_ROOT}/sing-box-for-windows/local-packages"
  9. },
  10. "packages": [
  11. {
  12. "id": "libbox",
  13. "path": ".",
  14. "java_package": "io.nekohasekai.libbox",
  15. "csharp_namespace": "SagerNet",
  16. "csharp_entrypoint": "Libbox",
  17. "apple_prefix": "Libbox"
  18. }
  19. ],
  20. "builds": [
  21. {
  22. "id": "android-main",
  23. "packages": ["libbox"],
  24. "default": {
  25. "tags": [
  26. "with_gvisor",
  27. "with_quic",
  28. "with_wireguard",
  29. "with_utls",
  30. "with_naive_outbound",
  31. "with_clash_api",
  32. "badlinkname",
  33. "tfogo_checklinkname0",
  34. "with_tailscale",
  35. "ts_omit_logtail",
  36. "ts_omit_ssh",
  37. "ts_omit_drive",
  38. "ts_omit_taildrop",
  39. "ts_omit_webclient",
  40. "ts_omit_doctor",
  41. "ts_omit_capture",
  42. "ts_omit_kube",
  43. "ts_omit_aws",
  44. "ts_omit_synology",
  45. "ts_omit_bird"
  46. ],
  47. "ldflags": "-X github.com/sagernet/sing-box/constant.Version=${VERSION} -X internal/godebug.defaultGODEBUG=multipathtcp=0 -s -w -buildid= -checklinkname=0",
  48. "trimpath": true
  49. }
  50. },
  51. {
  52. "id": "android-legacy",
  53. "packages": ["libbox"],
  54. "default": {
  55. "tags": [
  56. "with_gvisor",
  57. "with_quic",
  58. "with_wireguard",
  59. "with_utls",
  60. "with_clash_api",
  61. "badlinkname",
  62. "tfogo_checklinkname0",
  63. "with_tailscale",
  64. "ts_omit_logtail",
  65. "ts_omit_ssh",
  66. "ts_omit_drive",
  67. "ts_omit_taildrop",
  68. "ts_omit_webclient",
  69. "ts_omit_doctor",
  70. "ts_omit_capture",
  71. "ts_omit_kube",
  72. "ts_omit_aws",
  73. "ts_omit_synology",
  74. "ts_omit_bird"
  75. ],
  76. "ldflags": "-X github.com/sagernet/sing-box/constant.Version=${VERSION} -X internal/godebug.defaultGODEBUG=multipathtcp=0 -s -w -buildid= -checklinkname=0",
  77. "trimpath": true
  78. }
  79. },
  80. {
  81. "id": "apple",
  82. "packages": ["libbox"],
  83. "default": {
  84. "tags": [
  85. "with_gvisor",
  86. "with_quic",
  87. "with_wireguard",
  88. "with_utls",
  89. "with_naive_outbound",
  90. "with_clash_api",
  91. "badlinkname",
  92. "tfogo_checklinkname0",
  93. "with_dhcp",
  94. "grpcnotrace",
  95. "with_tailscale",
  96. "ts_omit_logtail",
  97. "ts_omit_ssh",
  98. "ts_omit_drive",
  99. "ts_omit_taildrop",
  100. "ts_omit_webclient",
  101. "ts_omit_doctor",
  102. "ts_omit_capture",
  103. "ts_omit_kube",
  104. "ts_omit_aws",
  105. "ts_omit_synology",
  106. "ts_omit_bird"
  107. ],
  108. "ldflags": "-X github.com/sagernet/sing-box/constant.Version=${VERSION} -X internal/godebug.defaultGODEBUG=multipathtcp=0 -s -w -buildid= -checklinkname=0",
  109. "trimpath": true
  110. },
  111. "overrides": [
  112. {
  113. "match": { "os": "ios" },
  114. "tags_append": ["with_low_memory"]
  115. },
  116. {
  117. "match": { "os": "tvos" },
  118. "tags_append": ["with_low_memory"]
  119. }
  120. ]
  121. },
  122. {
  123. "id": "windows",
  124. "packages": ["libbox"],
  125. "default": {
  126. "tags": [
  127. "with_gvisor",
  128. "with_quic",
  129. "with_wireguard",
  130. "with_utls",
  131. "with_naive_outbound",
  132. "with_purego",
  133. "with_clash_api",
  134. "badlinkname",
  135. "tfogo_checklinkname0",
  136. "with_tailscale",
  137. "ts_omit_logtail",
  138. "ts_omit_ssh",
  139. "ts_omit_drive",
  140. "ts_omit_taildrop",
  141. "ts_omit_webclient",
  142. "ts_omit_doctor",
  143. "ts_omit_capture",
  144. "ts_omit_kube",
  145. "ts_omit_aws",
  146. "ts_omit_synology",
  147. "ts_omit_bird"
  148. ],
  149. "ldflags": "-X github.com/sagernet/sing-box/constant.Version=${VERSION} -X internal/godebug.defaultGODEBUG=multipathtcp=0 -s -w -buildid= -checklinkname=0",
  150. "trimpath": true
  151. }
  152. }
  153. ],
  154. "platforms": [
  155. {
  156. "type": "android",
  157. "build": "android-main",
  158. "min_sdk": 23,
  159. "ndk_version": "28.0.13004108",
  160. "lib_name": "box",
  161. "languages": [{ "type": "java" }],
  162. "artifacts": [
  163. {
  164. "type": "aar",
  165. "output_path": "libbox.aar",
  166. "execute_after": [
  167. "if [ -d \"${DEPLOY_ANDROID}\" ]; then",
  168. " rm -f \"${DEPLOY_ANDROID}/$$(basename \"${OUTPUT_PATH}\")\"",
  169. " mv \"${OUTPUT_PATH}\" \"${DEPLOY_ANDROID}/\"",
  170. "fi"
  171. ]
  172. }
  173. ]
  174. },
  175. {
  176. "type": "android",
  177. "build": "android-legacy",
  178. "min_sdk": 21,
  179. "ndk_version": "28.0.13004108",
  180. "lib_name": "box",
  181. "languages": [{ "type": "java" }],
  182. "artifacts": [
  183. {
  184. "type": "aar",
  185. "output_path": "libbox-legacy.aar",
  186. "execute_after": [
  187. "if [ -d \"${DEPLOY_ANDROID}\" ]; then",
  188. " rm -f \"${DEPLOY_ANDROID}/$$(basename \"${OUTPUT_PATH}\")\"",
  189. " mv \"${OUTPUT_PATH}\" \"${DEPLOY_ANDROID}/\"",
  190. "fi"
  191. ]
  192. }
  193. ]
  194. },
  195. {
  196. "type": "apple",
  197. "build": "apple",
  198. "targets": [
  199. "ios/arm64",
  200. "ios/simulator/arm64",
  201. "ios/simulator/amd64",
  202. "tvos/arm64",
  203. "tvos/simulator/arm64",
  204. "tvos/simulator/amd64",
  205. "macos/arm64",
  206. "macos/amd64"
  207. ],
  208. "languages": [{ "type": "objc" }],
  209. "artifacts": [
  210. {
  211. "type": "xcframework",
  212. "module_name": "Libbox",
  213. "execute_after": [
  214. "if [ -d \"${DEPLOY_APPLE}\" ]; then",
  215. " rm -rf \"${DEPLOY_APPLE}/${MODULE_NAME}.xcframework\"",
  216. " mv \"${OUTPUT_PATH}\" \"${DEPLOY_APPLE}/\"",
  217. "fi"
  218. ]
  219. }
  220. ]
  221. },
  222. {
  223. "type": "csharp",
  224. "build": "windows",
  225. "targets": [
  226. "windows/amd64"
  227. ],
  228. "languages": [{ "type": "csharp" }],
  229. "artifacts": [
  230. {
  231. "type": "nuget",
  232. "package_id": "SagerNet.Libbox",
  233. "package_version": "0.0.0-local",
  234. "execute_after": {
  235. "windows": [
  236. "$$deployPath = '${DEPLOY_WINDOWS}'",
  237. "if (Test-Path $$deployPath) {",
  238. " Remove-Item \"$$deployPath\\${PACKAGE_ID}.*.nupkg\" -ErrorAction SilentlyContinue",
  239. " Move-Item -Force '${OUTPUT_PATH}' \"$$deployPath\\\"",
  240. " $$cachePath = if ($$env:NUGET_PACKAGES) { $$env:NUGET_PACKAGES } else { \"$$env:USERPROFILE\\.nuget\\packages\" }",
  241. " Remove-Item -Recurse -Force \"$$cachePath\\sagernet.libbox\\${PACKAGE_VERSION}\" -ErrorAction SilentlyContinue",
  242. "}"
  243. ],
  244. "default": [
  245. "if [ -d \"${DEPLOY_WINDOWS}\" ]; then",
  246. " rm -f \"${DEPLOY_WINDOWS}/${PACKAGE_ID}.*.nupkg\"",
  247. " mv \"${OUTPUT_PATH}\" \"${DEPLOY_WINDOWS}/\"",
  248. " cache_path=\"$${NUGET_PACKAGES:-$${HOME}/.nuget/packages}\"",
  249. " rm -rf \"$${cache_path}/sagernet.libbox/${PACKAGE_VERSION}\"",
  250. "fi"
  251. ]
  252. }
  253. }
  254. ]
  255. }
  256. ]
  257. }