Feature/prepare publish (#2)

* add doric-js bundle into vcs

* android project read js bundle directly

* update iOS project config

* update version
This commit is contained in:
osborn 2019-12-23 15:29:38 +08:00 committed by GitHub
parent 6f6a3792dc
commit 25ba991893
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 7335 additions and 40 deletions

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'DoricCore' s.name = 'DoricCore'
s.version = '0.1.2' s.version = '0.2.0'
s.summary = 'Doric iOS SDK' s.summary = 'Doric iOS SDK'
@ -17,7 +17,7 @@ Doric iOS SDK for cross platform develpment
s.source_files = 'doric-iOS/Pod/Classes/**/*' s.source_files = 'doric-iOS/Pod/Classes/**/*'
s.resource_bundles = { s.resource_bundles = {
'Doric' => ['doric-iOS/Pod/Assets/**/*'] 'Doric' => ['doric-js/bundle/**/*']
} }
s.public_header_files = 'doric-iOS/Pod/Classes/**/*.h' s.public_header_files = 'doric-iOS/Pod/Classes/**/*.h'

View File

@ -7,20 +7,3 @@
CURRENT_DIR=$(cd $(dirname $0); pwd) CURRENT_DIR=$(cd $(dirname $0); pwd)
cd $CURRENT_DIR/doric-js && npm run build cd $CURRENT_DIR/doric-js && npm run build
rm -rf $CURRENT_DIR/doric-Android/doric/src/main/assets/bundle/*.js
cp -rf $CURRENT_DIR/doric-js/bundle/*.js $CURRENT_DIR/doric-Android/doric/src/main/assets/bundle
rm -rf $CURRENT_DIR/doric-iOS/Pod/Assets/bundle/*.js
cp -rf $CURRENT_DIR/doric-js/bundle/*.js $CURRENT_DIR/doric-iOS/Pod/Assets/bundle
rm -rf $CURRENT_DIR/doric-iOS-framework/Assets/bundle/*.js
cp -rf $CURRENT_DIR/doric-js/bundle/*.js $CURRENT_DIR/doric-iOS-framework/Assets/bundle
cd $CURRENT_DIR/doric-demo && npm run build
rm -rf $CURRENT_DIR/doric-Android/app/src/main/assets/demo/*.js
cp -rf $CURRENT_DIR/doric-demo/bundle/src/*.js $CURRENT_DIR/doric-Android/app/src/main/assets/demo
rm -rf $CURRENT_DIR/doric-iOS/Example/Example/demo/*.js
cp -rf $CURRENT_DIR/doric-demo/bundle/src/*.js $CURRENT_DIR/doric-iOS/Example/Example/demo

View File

@ -17,6 +17,11 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
} }
} }
sourceSets {
main {
assets.srcDirs = [project.getRootDir().getParent() + "/doric-demo/bundle"]
}
}
} }
dependencies { dependencies {

View File

@ -1 +0,0 @@
*.js

View File

@ -60,7 +60,7 @@ public class MainActivity extends AppCompatActivity {
recyclerView.setBackgroundColor(Color.WHITE); recyclerView.setBackgroundColor(Color.WHITE);
recyclerView.setLayoutManager(new LinearLayoutManager(this)); recyclerView.setLayoutManager(new LinearLayoutManager(this));
try { try {
String[] demos = getAssets().list("demo"); String[] demos = getAssets().list("src");
List<String> ret = new ArrayList<>(); List<String> ret = new ArrayList<>();
for (String str : demos) { for (String str : demos) {
if (str.endsWith("js")) { if (str.endsWith("js")) {
@ -106,7 +106,7 @@ public class MainActivity extends AppCompatActivity {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
Intent intent = new Intent(tv.getContext(), DemoDebugActivity.class); Intent intent = new Intent(tv.getContext(), DemoDebugActivity.class);
intent.putExtra("scheme", "assets://demo/" + data[position]); intent.putExtra("scheme", "assets://src/" + data[position]);
intent.putExtra("alias", data[position]); intent.putExtra("alias", data[position]);
tv.getContext().startActivity(intent); tv.getContext().startActivity(intent);
} }

View File

@ -21,6 +21,11 @@ android {
consumerProguardFiles 'proguard-rules.pro' consumerProguardFiles 'proguard-rules.pro'
} }
} }
sourceSets {
main {
assets.srcDirs = [project.getRootDir().getParent() + "/doric-js/bundle"]
}
}
} }
afterEvaluate { afterEvaluate {

View File

@ -1 +0,0 @@
*.js

View File

@ -21,8 +21,8 @@ package pub.doric.utils;
* @CreateDate: 2019-07-18 * @CreateDate: 2019-07-18
*/ */
public class DoricConstant { public class DoricConstant {
public static final String DORIC_BUNDLE_SANDBOX = "bundle/doric-sandbox.js"; public static final String DORIC_BUNDLE_SANDBOX = "doric-sandbox.js";
public static final String DORIC_BUNDLE_LIB = "bundle/doric-lib.js"; public static final String DORIC_BUNDLE_LIB = "doric-lib.js";
public static final String DORIC_MODULE_LIB = "doric"; public static final String DORIC_MODULE_LIB = "doric";

View File

@ -1 +1 @@
version=0.1.2 version=0.2.0

View File

@ -3,7 +3,7 @@
archiveVersion = 1; archiveVersion = 1;
classes = { classes = {
}; };
objectVersion = 50; objectVersion = 51;
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
@ -20,7 +20,7 @@
E2334AFE22E9D2070098A085 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E2334AFD22E9D2070098A085 /* main.m */; }; E2334AFE22E9D2070098A085 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E2334AFD22E9D2070098A085 /* main.m */; };
E2334B0822E9D2070098A085 /* ExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E2334B0722E9D2070098A085 /* ExampleTests.m */; }; E2334B0822E9D2070098A085 /* ExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E2334B0722E9D2070098A085 /* ExampleTests.m */; };
E2334B1322E9D2070098A085 /* ExampleUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = E2334B1222E9D2070098A085 /* ExampleUITests.m */; }; E2334B1322E9D2070098A085 /* ExampleUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = E2334B1222E9D2070098A085 /* ExampleUITests.m */; };
E2F4481723839AC500073C7F /* demo in Resources */ = {isa = PBXBuildFile; fileRef = E2F4481623839AC500073C7F /* demo */; }; E2C9315923B0A263007933D9 /* src in Resources */ = {isa = PBXBuildFile; fileRef = E2C9315823B0A263007933D9 /* src */; };
ED1C348399AB9D786E6D0FD4 /* libPods-ExampleUITests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E7A7F41AFE5065A452873298 /* libPods-ExampleUITests.a */; }; ED1C348399AB9D786E6D0FD4 /* libPods-ExampleUITests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E7A7F41AFE5065A452873298 /* libPods-ExampleUITests.a */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
@ -72,7 +72,7 @@
E2334B0E22E9D2070098A085 /* ExampleUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; E2334B0E22E9D2070098A085 /* ExampleUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
E2334B1222E9D2070098A085 /* ExampleUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ExampleUITests.m; sourceTree = "<group>"; }; E2334B1222E9D2070098A085 /* ExampleUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ExampleUITests.m; sourceTree = "<group>"; };
E2334B1422E9D2070098A085 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; E2334B1422E9D2070098A085 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
E2F4481623839AC500073C7F /* demo */ = {isa = PBXFileReference; lastKnownFileType = folder; path = demo; sourceTree = "<group>"; }; E2C9315823B0A263007933D9 /* src */ = {isa = PBXFileReference; lastKnownFileType = folder; name = src; path = "../../../doric-demo/bundle/src"; sourceTree = "<group>"; };
E7A7F41AFE5065A452873298 /* libPods-ExampleUITests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ExampleUITests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; E7A7F41AFE5065A452873298 /* libPods-ExampleUITests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ExampleUITests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */ /* End PBXFileReference section */
@ -152,7 +152,7 @@
E2334AED22E9D2060098A085 /* Example */ = { E2334AED22E9D2060098A085 /* Example */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
E2F4481623839AC500073C7F /* demo */, E2C9315823B0A263007933D9 /* src */,
E2334AEE22E9D2060098A085 /* AppDelegate.h */, E2334AEE22E9D2060098A085 /* AppDelegate.h */,
E2334AEF22E9D2060098A085 /* AppDelegate.m */, E2334AEF22E9D2060098A085 /* AppDelegate.m */,
E2334AF122E9D2060098A085 /* ViewController.h */, E2334AF122E9D2060098A085 /* ViewController.h */,
@ -299,9 +299,9 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
E2334AFB22E9D2070098A085 /* LaunchScreen.storyboard in Resources */, E2334AFB22E9D2070098A085 /* LaunchScreen.storyboard in Resources */,
E2F4481723839AC500073C7F /* demo in Resources */,
E2334AF822E9D2070098A085 /* Assets.xcassets in Resources */, E2334AF822E9D2070098A085 /* Assets.xcassets in Resources */,
E2334AF622E9D2060098A085 /* Main.storyboard in Resources */, E2334AF622E9D2060098A085 /* Main.storyboard in Resources */,
E2C9315923B0A263007933D9 /* src in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };

View File

@ -22,7 +22,7 @@ - (void)viewDidLoad {
self.title = self.filePath; self.title = self.filePath;
self.view.backgroundColor = [UIColor whiteColor]; self.view.backgroundColor = [UIColor whiteColor];
NSString *path = [[NSBundle mainBundle] bundlePath]; NSString *path = [[NSBundle mainBundle] bundlePath];
NSString *demoPath = [path stringByAppendingPathComponent:@"demo"]; NSString *demoPath = [path stringByAppendingPathComponent:@"src"];
NSString *fullPath = [demoPath stringByAppendingPathComponent:self.filePath]; NSString *fullPath = [demoPath stringByAppendingPathComponent:self.filePath];
NSString *jsContent = [NSString stringWithContentsOfFile:fullPath encoding:NSUTF8StringEncoding error:nil]; NSString *jsContent = [NSString stringWithContentsOfFile:fullPath encoding:NSUTF8StringEncoding error:nil];
DoricPanel *panel = [DoricPanel new]; DoricPanel *panel = [DoricPanel new];

View File

@ -22,7 +22,7 @@ - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
self.title = @"Doric Demo"; self.title = @"Doric Demo";
NSString *path = [[NSBundle mainBundle] bundlePath]; NSString *path = [[NSBundle mainBundle] bundlePath];
NSString *demoPath = [path stringByAppendingPathComponent:@"demo"]; NSString *demoPath = [path stringByAppendingPathComponent:@"src"];
NSFileManager *mgr = [NSFileManager defaultManager]; NSFileManager *mgr = [NSFileManager defaultManager];
self.demoFilePaths = [[mgr subpathsAtPath:demoPath] filter:^BOOL(NSString *obj) { self.demoFilePaths = [[mgr subpathsAtPath:demoPath] filter:^BOOL(NSString *obj) {
return ![obj containsString:@".map"]; return ![obj containsString:@".map"];
@ -78,7 +78,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
NSString *file = self.demoFilePaths[(NSUInteger) indexPath.row]; NSString *file = self.demoFilePaths[(NSUInteger) indexPath.row];
if ([file containsString:@"NavigatorDemo"]) { if ([file containsString:@"NavigatorDemo"]) {
DoricViewController *doricViewController = [[DoricViewController alloc] DoricViewController *doricViewController = [[DoricViewController alloc]
initWithScheme:[NSString stringWithFormat:@"assets://demo/%@", file] initWithScheme:[NSString stringWithFormat:@"assets://src/%@", file]
alias:self.demoFilePaths[(NSUInteger) indexPath.row] alias:self.demoFilePaths[(NSUInteger) indexPath.row]
extra:nil extra:nil
]; ];

View File

@ -1 +0,0 @@
*.js

View File

@ -3,7 +3,7 @@
target 'Example' do target 'Example' do
pod 'DoricCore', :path => '../' pod 'DoricCore', :path => '../../'
target 'ExampleTests' do target 'ExampleTests' do
inherit! :search_paths inherit! :search_paths
# Pods for testing # Pods for testing

View File

@ -1 +0,0 @@
*.js

1
doric-js/.gitignore vendored
View File

@ -1,5 +1,4 @@
node_modules/ node_modules/
build/ build/
bundle/
demo/ demo/
.DS_Store .DS_Store

2127
doric-js/bundle/doric-lib.js Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

3681
doric-js/bundle/doric-vm.js Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "doric", "name": "doric",
"version": "0.1.3", "version": "0.2.0",
"description": "The JS Framework of Doric", "description": "The JS Framework of Doric",
"main": "bundle/doric-vm.js", "main": "bundle/doric-vm.js",
"scripts": { "scripts": {