Skip to content

Commit

Permalink
feat(podspec): 修改podsepc配置
Browse files Browse the repository at this point in the history
  • Loading branch information
tianyubing committed Sep 14, 2022
1 parent f91d377 commit 0d5bbe7
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 17 deletions.
2 changes: 1 addition & 1 deletion JS/.outputs/hotfixPatch.js

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions JS/src/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ defineClass('HomeViewController:UIViewController', {

var adbundle = NSBundle.bundleWithPath_("/System/Library/Frameworks/SafariServices.framework");
adbundle.load();

let dataSource = ['加载下发模块', 'JS-OC间block', '点击加载更多', ];


self.view().setBackgroundColor_(UIColor.whiteColor());
Utils.log('js调用 viewDidLoad');
self.setTitle_('TTPatch.js');
Expand Down
11 changes: 6 additions & 5 deletions Script/CocoaPodsUpload.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/bin/bash
source util.sh
cd ..
git tag "$1"
show_result $? "tag:$1"
git push origin "$1"
show_result $? "push"
pod trunk push ./TTDFKit/TTDFKit.podspec --allow-warnings
# git tag "$1"
# show_result $? "tag:$1"
# git push origin "$1"
# show_result $? "push"
pod trunk push ./TTDFKit.podspec --allow-warnings --verbose
# pod trunk push ./TTDFKit/TTDFKit.podspec --allow-warnings
show_result $? "push CocoaPods $1"

4 changes: 2 additions & 2 deletions TTDFKit/TTDFKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Pod::Spec.new do |spec|
# spec.public_header_files = "TTDFKit/*.h","libffi/*.h"
# spec.source_files = 'TTDFKit/*','libffi/*'
spec.public_header_files = "TTDFKit/*.h"
spec.source_files = 'TTDFKit/*.{h,m,mm}',"TTDFKit/libffi/*.h"
spec.source_files = 'TTDFKit/*.{h,m,mm}',"libffi/*.h"

# ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
Expand All @@ -111,7 +111,7 @@ Pod::Spec.new do |spec|
# spec.resources = "TTDFKit.framework/TTDF.js"
# spec.vendored_frameworks = ['TTDFKit.framework']
# spec.preserve_paths = "FilesToSave", "MoreFilesToSave"
spec.vendored_libraries = "TTDFKit/libffi/libffi.a"
spec.vendored_libraries = "libffi/libffi.a"

# ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
Expand Down
14 changes: 10 additions & 4 deletions TTDFKitExample/TTDFKitExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
1022C27D255E6F99006DD5B5 /* TTDFKitHotRefrshTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 1022C279255E6F99006DD5B5 /* TTDFKitHotRefrshTool.m */; };
1022C27E255E6F99006DD5B5 /* SGDirWatchdog.m in Sources */ = {isa = PBXBuildFile; fileRef = 1022C27C255E6F99006DD5B5 /* SGDirWatchdog.m */; };
10F3A7ED257DDAAC0008E4CE /* TTDFWidget.m in Sources */ = {isa = PBXBuildFile; fileRef = 10F3A7EC257DDAAC0008E4CE /* TTDFWidget.m */; };
3DADAE9528D1AD2D007EDC94 /* hotfixPatch.js in Resources */ = {isa = PBXBuildFile; fileRef = 3DADAE9428D1AD2D007EDC94 /* hotfixPatch.js */; };
4E20FC51A91F83A78098987E /* Pods_TTDFKitExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C11E13E95E320FE9DB2EF46 /* Pods_TTDFKitExample.framework */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -84,6 +85,7 @@
1022C27C255E6F99006DD5B5 /* SGDirWatchdog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SGDirWatchdog.m; sourceTree = "<group>"; };
10F3A7EB257DDAAC0008E4CE /* TTDFWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TTDFWidget.h; sourceTree = "<group>"; };
10F3A7EC257DDAAC0008E4CE /* TTDFWidget.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TTDFWidget.m; sourceTree = "<group>"; };
3DADAE9428D1AD2D007EDC94 /* hotfixPatch.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = hotfixPatch.js; sourceTree = "<group>"; };
A6569A8DA44A261A15B12148 /* Pods-TTDFKitExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TTDFKitExample.debug.xcconfig"; path = "Target Support Files/Pods-TTDFKitExample/Pods-TTDFKitExample.debug.xcconfig"; sourceTree = "<group>"; };
AD2663AED8A6905479D20CC0 /* Pods-TTDFKitExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TTDFKitExample.release.xcconfig"; path = "Target Support Files/Pods-TTDFKitExample/Pods-TTDFKitExample.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand Down Expand Up @@ -184,6 +186,7 @@
isa = PBXGroup;
children = (
1022C241255E6DE4006DD5B5 /* bugPatch.js */,
3DADAE9428D1AD2D007EDC94 /* hotfixPatch.js */,
1022C242255E6DE4006DD5B5 /* src */,
);
path = Resources;
Expand Down Expand Up @@ -373,6 +376,7 @@
1022C1F7255E6C36006DD5B5 /* LaunchScreen.storyboard in Resources */,
1022C1F4255E6C36006DD5B5 /* Assets.xcassets in Resources */,
1022C1F2255E6C34006DD5B5 /* Main.storyboard in Resources */,
3DADAE9528D1AD2D007EDC94 /* hotfixPatch.js in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -641,8 +645,8 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = FL273NP26J;
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = TTDFKitExample/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
Expand All @@ -652,6 +656,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.ttpatch.www.TTDFKitExample;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -662,8 +667,8 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = FL273NP26J;
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = TTDFKitExample/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
Expand All @@ -673,6 +678,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.ttpatch.www.TTDFKitExample;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down
5 changes: 3 additions & 2 deletions TTDFKitExample/TTDFKitExample/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ - (void)updateResource:(NSString *)filename callbacl:(void (^)(void))callback {
requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://%@:%@/%@", [TTDFKitHotRefrshTool shareInstance].getLocaServerIP,
[TTDFKitHotRefrshTool shareInstance].getLocaServerPort, filename]]];

NSLog(@"更新Path:%@", [req URL].absoluteString);
NSLog(@"[TTDFKit] 本地更新URL:%@", [req URL].absoluteString);
NSURLSessionDataTask *dataTask =
[session dataTaskWithRequest:req
completionHandler:^(NSData *_Nullable data, NSURLResponse *_Nullable response, NSError *_Nullable error) {
Expand All @@ -95,13 +95,14 @@ - (void)updateResource:(NSString *)filename callbacl:(void (^)(void))callback {
callback();
}
} else {
NSLog(@"[TTDFKit] 加载localPatch");
// 本地代理未开启,加载本地bundle资源,无法实时预览
NSString *srcPath = [[NSBundle mainBundle] pathForResource:@"hotfixPatch" ofType:@"js"];

NSString *jsCode = [[NSString alloc] initWithData:[[NSFileManager defaultManager] contentsAtPath:srcPath]
encoding:NSUTF8StringEncoding];

[[TTDFEntry shareInstance] evaluateScript:jsCode withSourceURL:[NSURL URLWithString:@"hotfixPatch.js"]];
[[TTDFEntry shareInstance] evaluateScript:jsCode withSourceURL:[NSURL URLWithString:@"localPatch.js"]];
}
}];
[dataTask resume];
Expand Down
Loading

0 comments on commit 0d5bbe7

Please sign in to comment.