Wizard: add some basic IOs module configurator

This commit is contained in:
Ilya Kirillov
2020-03-03 12:53:54 +03:00
parent 275212b6a9
commit 2f30195a6d
22 changed files with 1165 additions and 62 deletions
@@ -46,9 +46,7 @@ class CreateModuleOrTargetPopup private constructor(
+JvmSinglePlatformModuleConfigurator
if (allowAndroid) +AndroidSinglePlatformModuleConfigurator
if (allowSinglepaltformJs) +JsSingleplatformModuleConfigurator
//todo ios support
//if (allowIos) +IOSSinglePlatformModuleConfigurator
if (allowIos) +IOSSinglePlatformModuleConfigurator
}
) {
override fun getIconFor(value: ModuleConfigurator): Icon = value.icon
@@ -0,0 +1,628 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
47729E0622F447C800B9B36B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47729E0522F447C800B9B36B /* AppDelegate.swift */; };
47729E0822F447C800B9B36B /* Vie qwController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47729E0722F447C800B9B36B /* ViewController.swift */; };
47729E0B22F447C800B9B36B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 47729E0922F447C800B9B36B /* Main.storyboard */; };
47729E0D22F447CA00B9B36B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 47729E0C22F447CA00B9B36B /* Assets.xcassets */; };
47729E1022F447CA00B9B36B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 47729E0E22F447CA00B9B36B /* LaunchScreen.storyboard */; };
47729E1B22F447CA00B9B36B /* ${moduleName}Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47729E1A22F447CA00B9B36B /* ${moduleName}Tests.swift */; };
47729E2622F447CA00B9B36B /* ${moduleName}UITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47729E2522F447CA00B9B36B /* ${moduleName}UITests.swift */; };
47729E6E22F4806C00B9B36B /* ${sharedModuleName}.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 47729E6D22F4806B00B9B36B /* ${sharedModuleName}.framework */; };
47729E6F22F4806C00B9B36B /* ${sharedModuleName}.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 47729E6D22F4806B00B9B36B /* ${sharedModuleName}.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
47729E1722F447CA00B9B36B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 47729DFA22F447C800B9B36B /* Project object */;
proxyType = 1;
remoteGlobalIDString = 47729E0122F447C800B9B36B;
remoteInfo = ${moduleName};
};
47729E2222F447CA00B9B36B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 47729DFA22F447C800B9B36B /* Project object */;
proxyType = 1;
remoteGlobalIDString = 47729E0122F447C800B9B36B;
remoteInfo = ${moduleName};
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
47729E7022F4806C00B9B36B /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
47729E6F22F4806C00B9B36B /* ${sharedModuleName}.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
47729E0222F447C800B9B36B /* ${moduleName}.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ${moduleName}.app; sourceTree = BUILT_PRODUCTS_DIR; };
47729E0522F447C800B9B36B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
47729E0722F447C800B9B36B /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
47729E0A22F447C800B9B36B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
47729E0C22F447CA00B9B36B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
47729E0F22F447CA00B9B36B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
47729E1122F447CA00B9B36B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
47729E1622F447CA00B9B36B /* ${moduleName}Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ${moduleName}Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
47729E1A22F447CA00B9B36B /* ${moduleName}Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ${moduleName}Tests.swift; sourceTree = "<group>"; };
47729E1C22F447CA00B9B36B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
47729E2122F447CA00B9B36B /* ${moduleName}UITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ${moduleName}UITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
47729E2522F447CA00B9B36B /* ${moduleName}UITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ${moduleName}UITests.swift; sourceTree = "<group>"; };
47729E2722F447CA00B9B36B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
47729E6D22F4806B00B9B36B /* ${sharedModuleName}.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ${sharedModuleName}.framework; path = "${pathToSharedModule}/build/xcode-frameworks/${sharedModuleName}.framework"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
47729DFF22F447C800B9B36B /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
47729E6E22F4806C00B9B36B /* ${sharedModuleName}.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
47729E1322F447CA00B9B36B /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
47729E1E22F447CA00B9B36B /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
47729DF922F447C800B9B36B = {
isa = PBXGroup;
children = (
47729E6D22F4806B00B9B36B /* ${sharedModuleName}.framework */,
47729E0422F447C800B9B36B /* ${moduleName} */,
47729E1922F447CA00B9B36B /* ${moduleName}Tests */,
47729E2422F447CA00B9B36B /* ${moduleName}UITests */,
47729E0322F447C800B9B36B /* Products */,
);
sourceTree = "<group>";
};
47729E0322F447C800B9B36B /* Products */ = {
isa = PBXGroup;
children = (
47729E0222F447C800B9B36B /* ${moduleName}.app */,
47729E1622F447CA00B9B36B /* ${moduleName}Tests.xctest */,
47729E2122F447CA00B9B36B /* ${moduleName}UITests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
47729E0422F447C800B9B36B /* ${moduleName} */ = {
isa = PBXGroup;
children = (
47729E0522F447C800B9B36B /* AppDelegate.swift */,
47729E0722F447C800B9B36B /* ViewController.swift */,
47729E0922F447C800B9B36B /* Main.storyboard */,
47729E0C22F447CA00B9B36B /* Assets.xcassets */,
47729E0E22F447CA00B9B36B /* LaunchScreen.storyboard */,
47729E1122F447CA00B9B36B /* Info.plist */,
);
path = ${moduleName};
sourceTree = "<group>";
};
47729E1922F447CA00B9B36B /* ${moduleName}Tests */ = {
isa = PBXGroup;
children = (
47729E1A22F447CA00B9B36B /* ${moduleName}Tests.swift */,
47729E1C22F447CA00B9B36B /* Info.plist */,
);
path = ${moduleName}Tests;
sourceTree = "<group>";
};
47729E2422F447CA00B9B36B /* ${moduleName}UITests */ = {
isa = PBXGroup;
children = (
47729E2522F447CA00B9B36B /* ${moduleName}UITests.swift */,
47729E2722F447CA00B9B36B /* Info.plist */,
);
path = ${moduleName}UITests;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
47729E0122F447C800B9B36B /* ${moduleName} */ = {
isa = PBXNativeTarget;
buildConfigurationList = 47729E2A22F447CA00B9B36B /* Build configuration list for PBXNativeTarget "${moduleName}" */;
buildPhases = (
47729E7122F480EB00B9B36B /* ShellScript */,
47729DFE22F447C800B9B36B /* Sources */,
47729DFF22F447C800B9B36B /* Frameworks */,
47729E0022F447C800B9B36B /* Resources */,
47729E7022F4806C00B9B36B /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = ${moduleName};
productName = ${moduleName};
productReference = 47729E0222F447C800B9B36B /* ${moduleName}.app */;
productType = "com.apple.product-type.application";
};
47729E1522F447CA00B9B36B /* ${moduleName}Tests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 47729E2D22F447CA00B9B36B /* Build configuration list for PBXNativeTarget "${moduleName}Tests" */;
buildPhases = (
47729E1222F447CA00B9B36B /* Sources */,
47729E1322F447CA00B9B36B /* Frameworks */,
47729E1422F447CA00B9B36B /* Resources */,
);
buildRules = (
);
dependencies = (
47729E1822F447CA00B9B36B /* PBXTargetDependency */,
);
name = ${moduleName}Tests;
productName = ${moduleName}Tests;
productReference = 47729E1622F447CA00B9B36B /* ${moduleName}Tests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
47729E2022F447CA00B9B36B /* ${moduleName}UITests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 47729E3022F447CA00B9B36B /* Build configuration list for PBXNativeTarget "${moduleName}UITests" */;
buildPhases = (
47729E1D22F447CA00B9B36B /* Sources */,
47729E1E22F447CA00B9B36B /* Frameworks */,
47729E1F22F447CA00B9B36B /* Resources */,
);
buildRules = (
);
dependencies = (
47729E2322F447CA00B9B36B /* PBXTargetDependency */,
);
name = ${moduleName}UITests;
productName = ${moduleName}UITests;
productReference = 47729E2122F447CA00B9B36B /* ${moduleName}UITests.xctest */;
productType = "com.apple.product-type.bundle.ui-testing";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
47729DFA22F447C800B9B36B /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1030;
LastUpgradeCheck = 1030;
ORGANIZATIONNAME = "Evgeny Petrenko";
TargetAttributes = {
47729E0122F447C800B9B36B = {
CreatedOnToolsVersion = 10.3;
};
47729E1522F447CA00B9B36B = {
CreatedOnToolsVersion = 10.3;
TestTargetID = 47729E0122F447C800B9B36B;
};
47729E2022F447CA00B9B36B = {
CreatedOnToolsVersion = 10.3;
TestTargetID = 47729E0122F447C800B9B36B;
};
};
};
buildConfigurationList = 47729DFD22F447C800B9B36B /* Build configuration list for PBXProject "${moduleName}" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 47729DF922F447C800B9B36B;
productRefGroup = 47729E0322F447C800B9B36B /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
47729E0122F447C800B9B36B /* ${moduleName} */,
47729E1522F447CA00B9B36B /* ${moduleName}Tests */,
47729E2022F447CA00B9B36B /* ${moduleName}UITests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
47729E0022F447C800B9B36B /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
47729E1022F447CA00B9B36B /* LaunchScreen.storyboard in Resources */,
47729E0D22F447CA00B9B36B /* Assets.xcassets in Resources */,
47729E0B22F447C800B9B36B /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
47729E1422F447CA00B9B36B /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
47729E1F22F447CA00B9B36B /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
47729E7122F480EB00B9B36B /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Type a script or drag a script file from your workspace to insert its path.\n\ncd \"$SRCROOT/../../${sharedModuleName}/build/xcode-frameworks\"\n./gradlew :${sharedModuleName}:packForXCode -PXCODE_CONFIGURATION=${CONFIGURATION}\n";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
47729DFE22F447C800B9B36B /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
47729E0822F447C800B9B36B /* ViewController.swift in Sources */,
47729E0622F447C800B9B36B /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
47729E1222F447CA00B9B36B /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
47729E1B22F447CA00B9B36B /* ${moduleName}Tests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
47729E1D22F447CA00B9B36B /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
47729E2622F447CA00B9B36B /* ${moduleName}UITests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
47729E1822F447CA00B9B36B /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 47729E0122F447C800B9B36B /* ${moduleName} */;
targetProxy = 47729E1722F447CA00B9B36B /* PBXContainerItemProxy */;
};
47729E2322F447CA00B9B36B /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 47729E0122F447C800B9B36B /* ${moduleName} */;
targetProxy = 47729E2222F447CA00B9B36B /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
47729E0922F447C800B9B36B /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
47729E0A22F447C800B9B36B /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
47729E0E22F447CA00B9B36B /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
47729E0F22F447CA00B9B36B /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
47729E2822F447CA00B9B36B /* 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;
CODE_SIGN_IDENTITY = "iPhone Developer";
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 = 12.4;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
47729E2922F447CA00B9B36B /* 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;
CODE_SIGN_IDENTITY = "iPhone Developer";
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 = 12.4;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
47729E2B22F447CA00B9B36B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/../../${sharedModuleName}/build/xcode-frameworks";
INFOPLIST_FILE = ${moduleName}/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.jetbrains.handson.mpp.mobile.${moduleName};
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
47729E2C22F447CA00B9B36B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/../../${sharedModuleName}/build/xcode-frameworks";
INFOPLIST_FILE = ${moduleName}/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.jetbrains.handson.mpp.mobile.${moduleName};
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
47729E2E22F447CA00B9B36B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = ${moduleName}Tests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.jetbrains.handson.mpp.mobile.${moduleName}Tests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/${moduleName}.app/${moduleName}";
};
name = Debug;
};
47729E2F22F447CA00B9B36B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = ${moduleName}Tests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.jetbrains.handson.mpp.mobile.${moduleName}Tests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/${moduleName}.app/${moduleName}";
};
name = Release;
};
47729E3122F447CA00B9B36B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = ${moduleName}UITests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.jetbrains.handson.mpp.mobile.${moduleName}UITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = ${moduleName};
};
name = Debug;
};
47729E3222F447CA00B9B36B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = ${moduleName}UITests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.jetbrains.handson.mpp.mobile.${moduleName}UITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = ${moduleName};
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
47729DFD22F447C800B9B36B /* Build configuration list for PBXProject "${moduleName}" */ = {
isa = XCConfigurationList;
buildConfigurations = (
47729E2822F447CA00B9B36B /* Debug */,
47729E2922F447CA00B9B36B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
47729E2A22F447CA00B9B36B /* Build configuration list for PBXNativeTarget "${moduleName}" */ = {
isa = XCConfigurationList;
buildConfigurations = (
47729E2B22F447CA00B9B36B /* Debug */,
47729E2C22F447CA00B9B36B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
47729E2D22F447CA00B9B36B /* Build configuration list for PBXNativeTarget "${moduleName}Tests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
47729E2E22F447CA00B9B36B /* Debug */,
47729E2F22F447CA00B9B36B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
47729E3022F447CA00B9B36B /* Build configuration list for PBXNativeTarget "${moduleName}UITests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
47729E3122F447CA00B9B36B /* Debug */,
47729E3222F447CA00B9B36B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 47729DFA22F447C800B9B36B /* Project object */;
}
@@ -0,0 +1,38 @@
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
@@ -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"
}
}
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
@@ -0,0 +1,8 @@
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
}
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
@@ -0,0 +1,26 @@
import XCTest
@testable import ${moduleName}
class KotlinIOSTests: XCTestCase {
override func setUp() {
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}
}
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
@@ -0,0 +1,26 @@
import XCTest
class KotlinIOSUITests: XCTestCase {
override func setUp() {
// Put setup code here. This method is called before the invocation of each test method in the class.
// In UI tests it is usually best to stop immediately when a failure occurs.
continueAfterFailure = false
// UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
XCUIApplication().launch()
// In UI tests its important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
func testExample() {
// Use recording to get started writing UI tests.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
}
@@ -31,7 +31,7 @@ operator fun Path.div(other: String): Path =
resolve(other)
operator fun Path.div(other: Path): Path =
resolve(other)
resolve(other.toString())
operator fun String.div(other: Path): Path =
Paths.get(this).resolve(other)
@@ -23,6 +23,8 @@ object AndroidSinglePlatformModuleConfigurator :
override val suggestedModuleName = "android"
override val text = "Android"
override val requiresRootBuildFile: Boolean = true
override fun createBuildFileIRs(
readingContext: ReadingContext,
configurationData: ModuleConfigurationData,
@@ -0,0 +1,72 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.tools.projectWizard.moduleConfigurators
import org.jetbrains.kotlin.tools.projectWizard.core.TaskResult
import org.jetbrains.kotlin.tools.projectWizard.core.asPath
import org.jetbrains.kotlin.tools.projectWizard.core.context.WritingContext
import org.jetbrains.kotlin.tools.projectWizard.plugins.kotlin.ModuleConfigurationData
import org.jetbrains.kotlin.tools.projectWizard.plugins.templates.TemplatesPlugin
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.Module
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.ModuleKind
import org.jetbrains.kotlin.tools.projectWizard.core.buildList
import org.jetbrains.kotlin.tools.projectWizard.core.div
import org.jetbrains.kotlin.tools.projectWizard.templates.FileTemplate
import org.jetbrains.kotlin.tools.projectWizard.templates.FileTemplateDescriptor
import java.nio.file.Path
object IOSSinglePlatformModuleConfigurator :
SinglePlatformModuleConfigurator {
override val id = "IOS Module"
override val suggestedModuleName = "ios"
override val moduleKind: ModuleKind = ModuleKind.singleplatformJvm
override val greyText = "Requires Apple Xcode"
override val needCreateBuildFile: Boolean = false
override val requiresRootBuildFile: Boolean = true
override fun WritingContext.runArbitraryTask(
configurationData: ModuleConfigurationData,
module: Module,
modulePath: Path
): TaskResult<Unit> {
val settings = mapOf<String, Any?>(
"moduleName" to module.name,
"sharedModuleName" to "SHARED",
"pathToSharedModule" to "../SHARED"
)
fun fileTemplate(path: Path) = FileTemplate(descriptor(path, module.name), modulePath, settings)
return TemplatesPlugin::addFileTemplates.execute(buildList {
+fileTemplate("$DEFAULT_APP_NAME.xcodeproj" / "project.pbxproj")
+fileTemplate(DEFAULT_APP_NAME / "AppDelegate.swift")
+fileTemplate(DEFAULT_APP_NAME / "ViewController.swift")
+fileTemplate(DEFAULT_APP_NAME / "Info.plist")
+fileTemplate(DEFAULT_APP_NAME / "Base.lproj" / "LaunchScreen.storyboard")
+fileTemplate(DEFAULT_APP_NAME / "Base.lproj" / "Main.storyboard")
+fileTemplate(DEFAULT_APP_NAME / "Assets.xcassets" / "Contents.json")
+fileTemplate(DEFAULT_APP_NAME / "Assets.xcassets" / "AppIcon.appiconset" / "Contents.json")
+fileTemplate("${DEFAULT_APP_NAME}Tests" / "Info.plist")
+fileTemplate("${DEFAULT_APP_NAME}Tests" / "${DEFAULT_APP_NAME}Tests.swift")
+fileTemplate("${DEFAULT_APP_NAME}UITests" / "Info.plist")
+fileTemplate("${DEFAULT_APP_NAME}UITests" / "${DEFAULT_APP_NAME}UITests.swift")
})
}
private fun descriptor(path: Path, moduleName: String) =
FileTemplateDescriptor(
"ios/singleplatformProject/$path",
path.toString().removeSuffix(".vm").replace(DEFAULT_APP_NAME, moduleName).asPath()
)
private const val DEFAULT_APP_NAME = "moduleName"
}
@@ -205,6 +205,7 @@ interface ModuleConfigurator : DisplayableSettingItem, EntitiesOwnerDescriptor {
val suggestedModuleName: String? get() = null
val canContainSubModules: Boolean get() = false
val requiresRootBuildFile: Boolean get() = false
fun createBuildFileIRs(
readingContext: ReadingContext,
@@ -66,7 +66,9 @@ object MppModuleConfigurator : ModuleConfigurator {
}
interface SinglePlatformModuleConfigurator : ModuleConfigurator
interface SinglePlatformModuleConfigurator : ModuleConfigurator {
val needCreateBuildFile: Boolean get() = true
}
object JvmSinglePlatformModuleConfigurator : JvmModuleConfigurator,
SinglePlatformModuleConfigurator,
@@ -117,13 +119,7 @@ object JvmSinglePlatformModuleConfigurator : JvmModuleConfigurator,
}
object IOSSinglePlatformModuleConfigurator :
SinglePlatformModuleConfigurator {
override val id = "IOS Module"
override val suggestedModuleName = "ios"
override val moduleKind: ModuleKind get() = ModuleKind.singleplatformJvm
override val greyText = "Requires Apple Xcode"
}
val ModuleType.defaultTarget
@@ -9,7 +9,8 @@ enum class ModuleType(val projectTypeName: String) {
js("Kotlin/JS"),
native("Kotlin/Native"),
common("Common"),
android("Android")
android("Android"),
// ios("iOS")
;
@@ -6,9 +6,7 @@ import org.jetbrains.kotlin.tools.projectWizard.core.context.ReadingContext
import org.jetbrains.kotlin.tools.projectWizard.core.context.WritingContext
import org.jetbrains.kotlin.tools.projectWizard.core.*
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.*
import org.jetbrains.kotlin.tools.projectWizard.moduleConfigurators.AndroidSinglePlatformModuleConfigurator
import org.jetbrains.kotlin.tools.projectWizard.moduleConfigurators.GradleModuleConfigurator
import org.jetbrains.kotlin.tools.projectWizard.moduleConfigurators.TargetConfigurator
import org.jetbrains.kotlin.tools.projectWizard.moduleConfigurators.*
import org.jetbrains.kotlin.tools.projectWizard.plugins.buildSystem.BuildSystemType
import org.jetbrains.kotlin.tools.projectWizard.plugins.buildSystem.gradle.GradlePlugin
import org.jetbrains.kotlin.tools.projectWizard.plugins.buildSystem.isGradle
@@ -52,8 +50,8 @@ class ModulesToIRsConverter(
// which is redundant for a single module projects
private val needFlattening: Boolean
get() {
if ( // We want to have root build file for android projects
data.allModules.any { it.configurator == AndroidSinglePlatformModuleConfigurator }
if ( // We want to have root build file for android or ios projects
data.allModules.any { it.configurator.requiresRootBuildFile }
) return false
return isSingleRootModuleMode
}
@@ -91,68 +89,74 @@ class ModulesToIRsConverter(
private fun ReadingContext.createBuildFileForModule(
module: Module,
state: ModulesToIrsState
): TaskResult<List<BuildFileIR>> = when (module.kind) {
ModuleKind.multiplatform -> createMultiplatformModule(module, state)
ModuleKind.singleplatformJvm, ModuleKind.singleplatformJs -> createSinglePlatformModule(module, state)
): TaskResult<List<BuildFileIR>> = when (val configurator = module.configurator) {
is MppModuleConfigurator -> createMultiplatformModule(module, state)
is SinglePlatformModuleConfigurator -> createSinglePlatformModule(module, configurator, state)
else -> Success(emptyList())
}
private fun ReadingContext.createSinglePlatformModule(
module: Module,
configurator: SinglePlatformModuleConfigurator,
state: ModulesToIrsState
): TaskResult<List<BuildFileIR>> = with(data) {
val modulePath = calculatePathForModule(module, state.parentPath)
writingContext.mutateProjectStructureByModuleConfigurator(module, modulePath)
val configurator = module.configurator
val dependenciesIRs = buildPersistenceList<BuildSystemIR> {
+module.sourcesets.flatMap { sourceset ->
sourceset.dependencies.map { it.toIR(sourceset.sourcesetType.toDependencyType()) }
val buildFileIR = run {
if (!configurator.needCreateBuildFile) return@run null
val dependenciesIRs = buildPersistenceList<BuildSystemIR> {
+module.sourcesets.flatMap { sourceset ->
sourceset.dependencies.map { it.toIR(sourceset.sourcesetType.toDependencyType()) }
}
with(configurator) { +createModuleIRs(this@createSinglePlatformModule, data, module) }
addIfNotNull(
configurator.createStdlibType(data, module)?.let { stdlibType ->
KotlinStdlibDependencyIR(
type = stdlibType,
isInMppModule = false,
version = kotlinVersion,
dependencyType = DependencyType.MAIN
)
}
)
}
with(configurator) { +createModuleIRs(this@createSinglePlatformModule, data, module) }
addIfNotNull(
configurator.createStdlibType(data, module)?.let { stdlibType ->
KotlinStdlibDependencyIR(
type = stdlibType,
isInMppModule = false,
version = kotlinVersion,
dependencyType = DependencyType.MAIN
val moduleIr = SingleplatformModuleIR(
if (modulePath == projectPath) projectName else module.name,
modulePath,
dependenciesIRs,
module.template,
module,
module.sourcesets.map { sourceset ->
SingleplatformSourcesetIR(
sourceset.sourcesetType,
modulePath / Defaults.SRC_DIR / sourceset.sourcesetType.name,
sourceset.dependencies.map { it.toIR(sourceset.sourcesetType.toDependencyType()) }.toPersistentList(),
sourceset
)
}
)
BuildFileIR(
module.name,
modulePath,
SingleplatformModulesStructureWithSingleModuleIR(
moduleIr,
persistentListOf()
),
pomIr.copy(artifactId = module.name),
createBuildFileIRs(module, state)
)
}
val moduleIr = SingleplatformModuleIR(
if (modulePath == projectPath) projectName else module.name,
modulePath,
dependenciesIRs,
module.template,
module,
module.sourcesets.map { sourceset ->
SingleplatformSourcesetIR(
sourceset.sourcesetType,
modulePath / Defaults.SRC_DIR / sourceset.sourcesetType.name,
sourceset.dependencies.map { it.toIR(sourceset.sourcesetType.toDependencyType()) }.toPersistentList(),
sourceset
)
}
)
val buildFileIr = BuildFileIR(
module.name,
modulePath,
SingleplatformModulesStructureWithSingleModuleIR(
moduleIr,
persistentListOf()
),
pomIr.copy(artifactId = module.name),
createBuildFileIRs(module, state)
)
return module.subModules.mapSequence { subModule ->
createBuildFileForModule(
subModule,
state.stateForSubModule(modulePath)
)
}.map { it.flatten() + buildFileIr }
}.map { it.flatten() }
.map { children ->
buildFileIR?.let { children + it } ?: children
}
}
private fun ReadingContext.createMultiplatformModule(
@@ -80,6 +80,7 @@ sealed class ProjectTemplate : DisplayableSettingItem {
JvmServerJsClient,
MultiplatformLibrary,
AndroidApplication,
IOSApplication,
NativeConsoleApplication,
JsBrowserApplication
)
@@ -291,4 +292,30 @@ object JsBrowserApplication : ProjectTemplate() {
)
)
)
}
object IOSApplication : ProjectTemplate() {
override val title = "IOS Application"
@Language("HTML")
override val htmlDescription = """
Simple <b>IOS</b> application with single screen
""".trimIndent()
override val suggestedProjectName = "myIOSApplication"
override val projectKind = ProjectKind.Multiplatform
override val setsPluginSettings: List<SettingWithValue<*, *>>
get() = listOf(
KotlinPlugin::modules withValue listOf(
Module(
"iosApp",
ModuleKind.singleplatformJvm,
IOSSinglePlatformModuleConfigurator,
template = null,
sourcesets = SourcesetType.ALL.map { type ->
Sourceset(type, dependencies = emptyList())
},
subModules = emptyList()
)
)
)
}
@@ -28,7 +28,11 @@ interface TemplateEngine {
class VelocityTemplateEngine : TemplateEngine {
override fun renderTemplate(template: FileTemplateDescriptor, data: Map<String, Any?>): String {
val templatePath = template.templateId
val templateText = VelocityTemplateEngine::class.java.getResource(templatePath).readText()
val templateText = try {
VelocityTemplateEngine::class.java.getResource(templatePath).readText()
} catch (e: Throwable) {
throw e
}
val context = VelocityContext().apply {
data.forEach { (key, value) ->
put(key, value)
@@ -57,4 +61,34 @@ class VelocityTemplateEngine : TemplateEngine {
override fun log(level: Int, message: String?, t: Throwable?) = Unit
}
}
}
}
//
//object TemplateEngineHelper {
// fun getAllFileTemplatesByPath(path: Path, resultedPath: Path, settings: Map<String, Any?>): List<FileTemplate> {
// val rootUri = VelocityTemplateEngine::class.java.getResource(path.toString()).toURI()
// return getFileSystem(rootUri).use { fileSystem ->
// val rootPath = fileSystem.rootDirectories.firstOrNull() ?: return@use emptyList<FileTemplate>()
// val resourcePath = VelocityTemplateEngine::class.resourcesDirPath(rootPath)
// Files.walk(resourcePath / path.toString())
// .filter { path ->
// Files.isRegularFile(path) && path.fileName.toString().endsWith(".vm")
// }.map { file ->
// val relativePath = resourcePath.relativize(file)
// val templateDescriptor = FileTemplateDescriptor(
// relativePath.toString(),
// resourcePath.relativize(resourcePath / path.toString())
// )
// FileTemplate(templateDescriptor, resultedPath, settings)
// }.collect(Collectors.toList())
// }
// }
//
// private fun KClass<out Any>.resourcesDirPath(rootPath: Path) =
// java.`package`.name.split(".").fold(rootPath, Path::resolve)
//
// private fun getFileSystem(uri: URI): FileSystem = try {
// FileSystems.getFileSystem(uri)
// } catch (e: FileSystemNotFoundException) {
// FileSystems.newFileSystem(uri, emptyMap<String, Any>())
// }
//}