From 6700ab503ab40b4308fe65312f0f3b83f5c4542c Mon Sep 17 00:00:00 2001 From: yicheng <11733500+yichengchen@users.noreply.github.com> Date: Tue, 7 Apr 2020 15:40:18 +0800 Subject: [PATCH] update project structure --- .gitignore | 3 +++ ClashX.xcodeproj/project.pbxproj | 14 ++++++++------ ClashX/ClashX-Bridging-Header.h | 2 +- ClashX/{ => goClash}/build_clash.py | 0 ClashX/{ => goClash}/go.mod | 0 ClashX/{ => goClash}/go.sum | 0 ClashX/{ => goClash}/main.go | 0 ClashX/{ => goClash}/upgrade_core.py | 0 install_dependency.sh | 6 ++++-- 9 files changed, 16 insertions(+), 9 deletions(-) rename ClashX/{ => goClash}/build_clash.py (100%) rename ClashX/{ => goClash}/go.mod (100%) rename ClashX/{ => goClash}/go.sum (100%) rename ClashX/{ => goClash}/main.go (100%) rename ClashX/{ => goClash}/upgrade_core.py (100%) diff --git a/.gitignore b/.gitignore index 679a6d493..7a1ea483c 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,6 @@ ClashX.app *.pyc ClashX/clash/ .DS_Store +.vscode +ClashX/goClash/goClash.h +ClashX/goClash/goClash.a diff --git a/ClashX.xcodeproj/project.pbxproj b/ClashX.xcodeproj/project.pbxproj index b35c9d106..4adf69d33 100644 --- a/ClashX.xcodeproj/project.pbxproj +++ b/ClashX.xcodeproj/project.pbxproj @@ -11,7 +11,6 @@ 4913C82321157D0200F6B87C /* Notification.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4913C82221157D0200F6B87C /* Notification.swift */; }; 492C4869210EE6B9004554A0 /* ApiRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 492C4868210EE6B9004554A0 /* ApiRequest.swift */; }; 492C4871210EF62E004554A0 /* ClashConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 492C4870210EF62E004554A0 /* ClashConfig.swift */; }; - 492D7321216CEC4000146BC1 /* ClashX.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 492D731F216CEC4000146BC1 /* ClashX.a */; }; 493AEAE3221AE3420016FE98 /* AppVersionUtil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 493AEAE2221AE3420016FE98 /* AppVersionUtil.swift */; }; 493AEAE5221AE7230016FE98 /* ProxyMenuItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 493AEAE4221AE7230016FE98 /* ProxyMenuItem.swift */; }; 4949D154213242F600EF85E6 /* Paths.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4949D153213242F600EF85E6 /* Paths.swift */; }; @@ -71,6 +70,7 @@ F977FAAC2366790500C17F1F /* AutoUpgardeManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F977FAAB2366790500C17F1F /* AutoUpgardeManager.swift */; }; F977FAAE23669D6400C17F1F /* ConnectionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F977FAAD23669D6400C17F1F /* ConnectionManager.swift */; }; F9A7C06C2306E874007163C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F9A7C06B2306E874007163C7 /* main.m */; }; + F9C180A3243C6590005EE8C4 /* goClash.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F9C180A1243C6590005EE8C4 /* goClash.a */; }; F9E754D0239CC21F00CEE7CC /* WebPortalManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9E754CF239CC21F00CEE7CC /* WebPortalManager.swift */; }; F9E754D2239CC28D00CEE7CC /* NSAlert+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9E754D1239CC28D00CEE7CC /* NSAlert+Extension.swift */; }; F9E8F34623A12B89002DE5E8 /* String+Encode.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9E8F34523A12B89002DE5E8 /* String+Encode.swift */; }; @@ -115,8 +115,6 @@ 4913C82221157D0200F6B87C /* Notification.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Notification.swift; sourceTree = ""; }; 492C4868210EE6B9004554A0 /* ApiRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApiRequest.swift; sourceTree = ""; }; 492C4870210EF62E004554A0 /* ClashConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClashConfig.swift; sourceTree = ""; }; - 492D731F216CEC4000146BC1 /* ClashX.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = ClashX.a; path = ClashX/ClashX.a; sourceTree = SOURCE_ROOT; }; - 492D7320216CEC4000146BC1 /* ClashX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClashX.h; path = ClashX/ClashX.h; sourceTree = SOURCE_ROOT; }; 493AEAE2221AE3420016FE98 /* AppVersionUtil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppVersionUtil.swift; sourceTree = ""; }; 493AEAE4221AE7230016FE98 /* ProxyMenuItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProxyMenuItem.swift; sourceTree = ""; }; 4949D153213242F600EF85E6 /* Paths.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Paths.swift; sourceTree = ""; }; @@ -191,6 +189,8 @@ F977FAAD23669D6400C17F1F /* ConnectionManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectionManager.swift; sourceTree = ""; }; F9A7C0692306E874007163C7 /* com.west2online.ClashX.ProxyConfigHelper */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = com.west2online.ClashX.ProxyConfigHelper; sourceTree = BUILT_PRODUCTS_DIR; }; F9A7C06B2306E874007163C7 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + F9C180A1243C6590005EE8C4 /* goClash.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = goClash.a; path = ClashX/goClash/goClash.a; sourceTree = SOURCE_ROOT; }; + F9C180A2243C6590005EE8C4 /* goClash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = goClash.h; path = ClashX/goClash/goClash.h; sourceTree = SOURCE_ROOT; }; F9E754CF239CC21F00CEE7CC /* WebPortalManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebPortalManager.swift; sourceTree = ""; }; F9E754D1239CC28D00CEE7CC /* NSAlert+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSAlert+Extension.swift"; sourceTree = ""; }; F9E8F34523A12B89002DE5E8 /* String+Encode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Encode.swift"; sourceTree = ""; }; @@ -201,8 +201,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 492D7321216CEC4000146BC1 /* ClashX.a in Frameworks */, 0D318CDAC9464E01DAD1F92B /* Pods_ClashX.framework in Frameworks */, + F9C180A3243C6590005EE8C4 /* goClash.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -407,8 +407,8 @@ 49CF3B3A20CD783A001EBF94 /* Support Files */ = { isa = PBXGroup; children = ( - 492D731F216CEC4000146BC1 /* ClashX.a */, - 492D7320216CEC4000146BC1 /* ClashX.h */, + F9C180A1243C6590005EE8C4 /* goClash.a */, + F9C180A2243C6590005EE8C4 /* goClash.h */, 4981C88D216BAE4A008CC14A /* Localizable.strings */, ); path = "Support Files"; @@ -879,6 +879,7 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/ClashX", + "$(PROJECT_DIR)/ClashX/goClash", ); MACOSX_DEPLOYMENT_TARGET = 10.12; MARKETING_VERSION = 1.19.0; @@ -919,6 +920,7 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/ClashX", + "$(PROJECT_DIR)/ClashX/goClash", ); MACOSX_DEPLOYMENT_TARGET = 10.12; MARKETING_VERSION = 1.19.0; diff --git a/ClashX/ClashX-Bridging-Header.h b/ClashX/ClashX-Bridging-Header.h index db81e47ed..59300fdfc 100644 --- a/ClashX/ClashX-Bridging-Header.h +++ b/ClashX/ClashX-Bridging-Header.h @@ -1,5 +1,5 @@ // // Use this file to import your target's public headers that you would like to expose to Swift. // -#import "ClashX.h" +#import "goClash.h" #import "ProxyConfigRemoteProcessProtocol.h" diff --git a/ClashX/build_clash.py b/ClashX/goClash/build_clash.py similarity index 100% rename from ClashX/build_clash.py rename to ClashX/goClash/build_clash.py diff --git a/ClashX/go.mod b/ClashX/goClash/go.mod similarity index 100% rename from ClashX/go.mod rename to ClashX/goClash/go.mod diff --git a/ClashX/go.sum b/ClashX/goClash/go.sum similarity index 100% rename from ClashX/go.sum rename to ClashX/goClash/go.sum diff --git a/ClashX/main.go b/ClashX/goClash/main.go similarity index 100% rename from ClashX/main.go rename to ClashX/goClash/main.go diff --git a/ClashX/upgrade_core.py b/ClashX/goClash/upgrade_core.py similarity index 100% rename from ClashX/upgrade_core.py rename to ClashX/goClash/upgrade_core.py diff --git a/install_dependency.sh b/install_dependency.sh index e09fc66a3..66c680fbc 100755 --- a/install_dependency.sh +++ b/install_dependency.sh @@ -1,6 +1,10 @@ #!/bin/bash set -eu +echo "Build Clash core" +cd ClashX/goClash +python3 build_clash.py echo "Pod install" +cd ../.. pod install echo "delete old files" rm -f ./ClashX/Resources/Country.mmdb @@ -12,5 +16,3 @@ mv GeoIP2-Country.mmdb ./ClashX/Resources/Country.mmdb echo "install dashboard" cd ClashX/Resources git clone -b gh-pages https://github.com/Dreamacro/clash-dashboard.git dashboard -cd .. -python3 build_clash.py