diff --git a/scripts/init.js b/scripts/init.js index d8099cb6..a085e83c 100644 --- a/scripts/init.js +++ b/scripts/init.js @@ -5,6 +5,7 @@ require('shelljs/global') const targetJSPath = `${__dirname}/../target/js` const targetAndroidPath = `${__dirname}/../target/android` +const targetiOSPath = `${__dirname}/../target/iOS` function copyFile(srcPath, tarPath, cb) { var rs = fs.createReadStream(srcPath) @@ -105,7 +106,23 @@ function initAndroid(path, name) { }) }) } - +function initiOS(path, name) { + if (fs.existsSync(path)) { + console.warn(`Dir:${process.cwd()}/${path} already exists`) + return; + } + console.log(`create dir ${path} success`); + fs.mkdir(path, function (err) { + if (err) { + return console.error(err); + } + copyFolder(`${targetiOSPath}`, `${path}`, () => { + const mainFiles = `Example/ViewController.m` + fs.writeFileSync(`${path}/${mainFiles}`, fs.readFileSync(`${targetiOSPath}/${mainFiles}`).toString().replace(/__\$__/g, name)) + console.log(`Create Doric Android Project Success`) + }) + }) +} module.exports = function (name) { if (fs.existsSync(name)) { console.warn(`Dir:${process.cwd()}/${name} already exists`) @@ -117,5 +134,6 @@ module.exports = function (name) { } initJS(`${process.cwd()}/${name}/js`, name) initAndroid(`${process.cwd()}/${name}/android`, name) + initiOS(`${process.cwd()}/${name}/iOS`, name) }) } \ No newline at end of file diff --git a/target/iOS/.gitignore b/target/iOS/.gitignore new file mode 100644 index 00000000..a63491b7 --- /dev/null +++ b/target/iOS/.gitignore @@ -0,0 +1,3 @@ +iOS/Example/Podfile.lock +iOS/Example/Example.xcworkspace/* +iOS/Example/Pods/* \ No newline at end of file diff --git a/target/iOS/Example.xcodeproj/project.pbxproj b/target/iOS/Example.xcodeproj/project.pbxproj new file mode 100644 index 00000000..ed7c2247 --- /dev/null +++ b/target/iOS/Example.xcodeproj/project.pbxproj @@ -0,0 +1,438 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 51; + objects = { + +/* Begin PBXBuildFile section */ + 95EDDB7EAB47A65821DBC7EC /* Pods_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB59FE64F1D814FD13C71BB2 /* Pods_Example.framework */; }; + E2F64CEF2399359C0006BD9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E2F64CEE2399359C0006BD9A /* AppDelegate.m */; }; + E2F64CF22399359C0006BD9A /* SceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E2F64CF12399359C0006BD9A /* SceneDelegate.m */; }; + E2F64CF52399359C0006BD9A /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E2F64CF42399359C0006BD9A /* ViewController.m */; }; + E2F64CF82399359C0006BD9A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E2F64CF62399359C0006BD9A /* Main.storyboard */; }; + E2F64CFA2399359E0006BD9A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E2F64CF92399359E0006BD9A /* Assets.xcassets */; }; + E2F64CFD2399359E0006BD9A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E2F64CFB2399359E0006BD9A /* LaunchScreen.storyboard */; }; + E2F64D002399359E0006BD9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E2F64CFF2399359E0006BD9A /* main.m */; }; + E2F64D07239936A70006BD9A /* src in Resources */ = {isa = PBXBuildFile; fileRef = E2F64D06239936A70006BD9A /* src */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 197D29BBE572343DDD72F8A6 /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.debug.xcconfig"; path = "Target Support Files/Pods-Example/Pods-Example.debug.xcconfig"; sourceTree = ""; }; + 5D47A9D4EA2836D57373FDF6 /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.release.xcconfig"; path = "Target Support Files/Pods-Example/Pods-Example.release.xcconfig"; sourceTree = ""; }; + AB59FE64F1D814FD13C71BB2 /* Pods_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + E2F64CEA2399359C0006BD9A /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; + E2F64CED2399359C0006BD9A /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + E2F64CEE2399359C0006BD9A /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + E2F64CF02399359C0006BD9A /* SceneDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SceneDelegate.h; sourceTree = ""; }; + E2F64CF12399359C0006BD9A /* SceneDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SceneDelegate.m; sourceTree = ""; }; + E2F64CF32399359C0006BD9A /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + E2F64CF42399359C0006BD9A /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + E2F64CF72399359C0006BD9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + E2F64CF92399359E0006BD9A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + E2F64CFC2399359E0006BD9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + E2F64CFE2399359E0006BD9A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + E2F64CFF2399359E0006BD9A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + E2F64D06239936A70006BD9A /* src */ = {isa = PBXFileReference; lastKnownFileType = folder; name = src; path = ../js/bundle/src; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + E2F64CE72399359C0006BD9A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 95EDDB7EAB47A65821DBC7EC /* Pods_Example.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 875E7B19E6A1ABA3F802B6B5 /* Pods */ = { + isa = PBXGroup; + children = ( + 197D29BBE572343DDD72F8A6 /* Pods-Example.debug.xcconfig */, + 5D47A9D4EA2836D57373FDF6 /* Pods-Example.release.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; + E2F64CE12399359C0006BD9A = { + isa = PBXGroup; + children = ( + E2F64D06239936A70006BD9A /* src */, + E2F64CEC2399359C0006BD9A /* Example */, + E2F64CEB2399359C0006BD9A /* Products */, + 875E7B19E6A1ABA3F802B6B5 /* Pods */, + F654B22175F1FDDC9AE817FA /* Frameworks */, + ); + sourceTree = ""; + }; + E2F64CEB2399359C0006BD9A /* Products */ = { + isa = PBXGroup; + children = ( + E2F64CEA2399359C0006BD9A /* Example.app */, + ); + name = Products; + sourceTree = ""; + }; + E2F64CEC2399359C0006BD9A /* Example */ = { + isa = PBXGroup; + children = ( + E2F64CED2399359C0006BD9A /* AppDelegate.h */, + E2F64CEE2399359C0006BD9A /* AppDelegate.m */, + E2F64CF02399359C0006BD9A /* SceneDelegate.h */, + E2F64CF12399359C0006BD9A /* SceneDelegate.m */, + E2F64CF32399359C0006BD9A /* ViewController.h */, + E2F64CF42399359C0006BD9A /* ViewController.m */, + E2F64CF62399359C0006BD9A /* Main.storyboard */, + E2F64CF92399359E0006BD9A /* Assets.xcassets */, + E2F64CFB2399359E0006BD9A /* LaunchScreen.storyboard */, + E2F64CFE2399359E0006BD9A /* Info.plist */, + E2F64CFF2399359E0006BD9A /* main.m */, + ); + path = Example; + sourceTree = ""; + }; + F654B22175F1FDDC9AE817FA /* Frameworks */ = { + isa = PBXGroup; + children = ( + AB59FE64F1D814FD13C71BB2 /* Pods_Example.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + E2F64CE92399359C0006BD9A /* Example */ = { + isa = PBXNativeTarget; + buildConfigurationList = E2F64D032399359E0006BD9A /* Build configuration list for PBXNativeTarget "Example" */; + buildPhases = ( + 8E2E7D30FF8381E7791EA41B /* [CP] Check Pods Manifest.lock */, + E2F64CE62399359C0006BD9A /* Sources */, + E2F64CE72399359C0006BD9A /* Frameworks */, + E2F64CE82399359C0006BD9A /* Resources */, + 489CC68D7F95811A10DFEC4E /* [CP] Embed Pods Frameworks */, + 825E7E0BA78A39B2E522054D /* [CP] Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Example; + productName = Example; + productReference = E2F64CEA2399359C0006BD9A /* Example.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + E2F64CE22399359C0006BD9A /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1120; + ORGANIZATIONNAME = pengfei.zhou; + TargetAttributes = { + E2F64CE92399359C0006BD9A = { + CreatedOnToolsVersion = 11.2.1; + }; + }; + }; + buildConfigurationList = E2F64CE52399359C0006BD9A /* Build configuration list for PBXProject "Example" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = E2F64CE12399359C0006BD9A; + productRefGroup = E2F64CEB2399359C0006BD9A /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + E2F64CE92399359C0006BD9A /* Example */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + E2F64CE82399359C0006BD9A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E2F64D07239936A70006BD9A /* src in Resources */, + E2F64CFD2399359E0006BD9A /* LaunchScreen.storyboard in Resources */, + E2F64CFA2399359E0006BD9A /* Assets.xcassets in Resources */, + E2F64CF82399359C0006BD9A /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 489CC68D7F95811A10DFEC4E /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 825E7E0BA78A39B2E522054D /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-resources-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + 8E2E7D30FF8381E7791EA41B /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Example-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + E2F64CE62399359C0006BD9A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E2F64CF52399359C0006BD9A /* ViewController.m in Sources */, + E2F64CEF2399359C0006BD9A /* AppDelegate.m in Sources */, + E2F64D002399359E0006BD9A /* main.m in Sources */, + E2F64CF22399359C0006BD9A /* SceneDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + E2F64CF62399359C0006BD9A /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + E2F64CF72399359C0006BD9A /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + E2F64CFB2399359E0006BD9A /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + E2F64CFC2399359E0006BD9A /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + E2F64D012399359E0006BD9A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.2; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + E2F64D022399359E0006BD9A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.2; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + E2F64D042399359E0006BD9A /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 197D29BBE572343DDD72F8A6 /* Pods-Example.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 7EE2RX3L3P; + INFOPLIST_FILE = Example/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = pub.doric.Example; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + E2F64D052399359E0006BD9A /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5D47A9D4EA2836D57373FDF6 /* Pods-Example.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 7EE2RX3L3P; + INFOPLIST_FILE = Example/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = pub.doric.Example; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + E2F64CE52399359C0006BD9A /* Build configuration list for PBXProject "Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E2F64D012399359E0006BD9A /* Debug */, + E2F64D022399359E0006BD9A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + E2F64D032399359E0006BD9A /* Build configuration list for PBXNativeTarget "Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E2F64D042399359E0006BD9A /* Debug */, + E2F64D052399359E0006BD9A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = E2F64CE22399359C0006BD9A /* Project object */; +} diff --git a/target/iOS/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/target/iOS/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..6d2a51bb --- /dev/null +++ b/target/iOS/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/target/iOS/Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/target/iOS/Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/target/iOS/Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/target/iOS/Example.xcodeproj/project.xcworkspace/xcuserdata/pengfei.xcuserdatad/UserInterfaceState.xcuserstate b/target/iOS/Example.xcodeproj/project.xcworkspace/xcuserdata/pengfei.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 00000000..038bec89 Binary files /dev/null and b/target/iOS/Example.xcodeproj/project.xcworkspace/xcuserdata/pengfei.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/target/iOS/Example.xcodeproj/xcuserdata/pengfei.xcuserdatad/xcschemes/xcschememanagement.plist b/target/iOS/Example.xcodeproj/xcuserdata/pengfei.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 00000000..7b7c1732 --- /dev/null +++ b/target/iOS/Example.xcodeproj/xcuserdata/pengfei.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + Example.xcscheme_^#shared#^_ + + orderHint + 7 + + + + diff --git a/target/iOS/Example.xcworkspace/contents.xcworkspacedata b/target/iOS/Example.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..a37cf193 --- /dev/null +++ b/target/iOS/Example.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/target/iOS/Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/target/iOS/Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/target/iOS/Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/target/iOS/Example/AppDelegate.h b/target/iOS/Example/AppDelegate.h new file mode 100644 index 00000000..71de879b --- /dev/null +++ b/target/iOS/Example/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// Example +// +// Created by pengfei.zhou on 2019/12/5. +// Copyright © 2019 pengfei.zhou. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + + +@end + diff --git a/target/iOS/Example/AppDelegate.m b/target/iOS/Example/AppDelegate.m new file mode 100644 index 00000000..8c617bf6 --- /dev/null +++ b/target/iOS/Example/AppDelegate.m @@ -0,0 +1,41 @@ +// +// AppDelegate.m +// Example +// +// Created by pengfei.zhou on 2019/12/5. +// Copyright © 2019 pengfei.zhou. All rights reserved. +// + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + return YES; +} + + +#pragma mark - UISceneSession lifecycle + + +- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role]; +} + + +- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet *)sceneSessions { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. +} + + +@end diff --git a/target/iOS/Example/Assets.xcassets/AppIcon.appiconset/Contents.json b/target/iOS/Example/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d8db8d65 --- /dev/null +++ b/target/iOS/Example/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/target/iOS/Example/Assets.xcassets/Contents.json b/target/iOS/Example/Assets.xcassets/Contents.json new file mode 100644 index 00000000..da4a164c --- /dev/null +++ b/target/iOS/Example/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/target/iOS/Example/Base.lproj/LaunchScreen.storyboard b/target/iOS/Example/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..865e9329 --- /dev/null +++ b/target/iOS/Example/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/target/iOS/Example/Base.lproj/Main.storyboard b/target/iOS/Example/Base.lproj/Main.storyboard new file mode 100644 index 00000000..808a21ce --- /dev/null +++ b/target/iOS/Example/Base.lproj/Main.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/target/iOS/Example/Info.plist b/target/iOS/Example/Info.plist new file mode 100644 index 00000000..7b6037c2 --- /dev/null +++ b/target/iOS/Example/Info.plist @@ -0,0 +1,64 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + SceneDelegate + UISceneStoryboardFile + Main + + + + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/target/iOS/Example/SceneDelegate.h b/target/iOS/Example/SceneDelegate.h new file mode 100644 index 00000000..b6321f23 --- /dev/null +++ b/target/iOS/Example/SceneDelegate.h @@ -0,0 +1,16 @@ +// +// SceneDelegate.h +// Example +// +// Created by pengfei.zhou on 2019/12/5. +// Copyright © 2019 pengfei.zhou. All rights reserved. +// + +#import + +@interface SceneDelegate : UIResponder + +@property (strong, nonatomic) UIWindow * window; + +@end + diff --git a/target/iOS/Example/SceneDelegate.m b/target/iOS/Example/SceneDelegate.m new file mode 100644 index 00000000..d6698dd7 --- /dev/null +++ b/target/iOS/Example/SceneDelegate.m @@ -0,0 +1,50 @@ +#import "SceneDelegate.h" + +@interface SceneDelegate () + +@end + +@implementation SceneDelegate + + +- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). +} + + +- (void)sceneDidDisconnect:(UIScene *)scene { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). +} + + +- (void)sceneDidBecomeActive:(UIScene *)scene { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. +} + + +- (void)sceneWillResignActive:(UIScene *)scene { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). +} + + +- (void)sceneWillEnterForeground:(UIScene *)scene { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. +} + + +- (void)sceneDidEnterBackground:(UIScene *)scene { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. +} + + +@end diff --git a/target/iOS/Example/ViewController.h b/target/iOS/Example/ViewController.h new file mode 100644 index 00000000..131f2547 --- /dev/null +++ b/target/iOS/Example/ViewController.h @@ -0,0 +1,15 @@ +// +// ViewController.h +// Example +// +// Created by pengfei.zhou on 2019/12/5. +// Copyright © 2019 pengfei.zhou. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + + +@end + diff --git a/target/iOS/Example/ViewController.m b/target/iOS/Example/ViewController.m new file mode 100644 index 00000000..87327211 --- /dev/null +++ b/target/iOS/Example/ViewController.m @@ -0,0 +1,37 @@ +// +// ViewController.m +// Example +// +// Created by pengfei.zhou on 2019/12/5. +// Copyright © 2019 pengfei.zhou. All rights reserved. +// + +#import "ViewController.h" +#import + +@interface ViewController () +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + self.view.backgroundColor = [UIColor whiteColor]; + NSString *bundleName = @"__$__"; + NSString *path = [[NSBundle mainBundle] bundlePath]; + NSString *demoPath = [path stringByAppendingPathComponent:@"src"]; + NSString *fullPath = [demoPath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.js",bundleName]]; + NSString *jsContent = [NSString stringWithContentsOfFile:fullPath encoding:NSUTF8StringEncoding error:nil]; + DoricPanel *panel = [DoricPanel new]; + [panel.view also:^(UIView *it) { + it.width = self.view.width; + it.height = self.view.height - 88; + it.top = 88; + [self.view addSubview:it]; + }]; + [self addChildViewController:panel]; + [panel config:jsContent alias:bundleName]; +} + + +@end diff --git a/target/iOS/Example/main.m b/target/iOS/Example/main.m new file mode 100644 index 00000000..743b38cb --- /dev/null +++ b/target/iOS/Example/main.m @@ -0,0 +1,19 @@ +// +// main.m +// Example +// +// Created by pengfei.zhou on 2019/12/5. +// Copyright © 2019 pengfei.zhou. All rights reserved. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + NSString * appDelegateClassName; + @autoreleasepool { + // Setup code that might create autoreleased objects goes here. + appDelegateClassName = NSStringFromClass([AppDelegate class]); + } + return UIApplicationMain(argc, argv, nil, appDelegateClassName); +} diff --git a/target/iOS/Podfile b/target/iOS/Podfile new file mode 100644 index 00000000..48b7b7ee --- /dev/null +++ b/target/iOS/Podfile @@ -0,0 +1,10 @@ +# Uncomment the next line to define a global platform for your project +# platform :ios, '9.0' + +target 'Example' do + # Comment the next line if you don't want to use dynamic frameworks + use_frameworks! + + # Pods for Example + pod 'Doric-framework' +end