KT-55243 Fix Gradle 7.6 incompatible root project podspec generation

Merge-request: KT-MR-7988
Merged-by: Artem Daugel-Dauge <Artem.Daugel-Dauge@jetbrains.com>
This commit is contained in:
Artem Daugel-Dauge
2022-12-13 12:38:36 +00:00
committed by Space Team
parent c6d8af003d
commit 82a3ac830e
13 changed files with 719 additions and 61 deletions
@@ -14,6 +14,7 @@ import org.jetbrains.kotlin.gradle.plugin.cocoapods.KotlinCocoapodsPlugin.Compan
import org.jetbrains.kotlin.gradle.plugin.cocoapods.KotlinCocoapodsPlugin.Companion.POD_INSTALL_TASK_NAME
import org.jetbrains.kotlin.gradle.plugin.cocoapods.KotlinCocoapodsPlugin.Companion.POD_SETUP_BUILD_TASK_NAME
import org.jetbrains.kotlin.gradle.plugin.cocoapods.KotlinCocoapodsPlugin.Companion.POD_SPEC_TASK_NAME
import org.jetbrains.kotlin.gradle.testbase.TestVersions
import org.jetbrains.kotlin.gradle.transformProjectWithPluginsDsl
import org.jetbrains.kotlin.gradle.util.createTempDir
import org.jetbrains.kotlin.gradle.util.modify
@@ -34,11 +35,6 @@ import kotlin.test.fail
private val String.validFrameworkName: String
get() = replace('-', '_')
private val invalidTaskNameCharacters = "[/\\\\:<>\"?*|]".toRegex()
private val String.validTaskName
get() = replace(invalidTaskNameCharacters, "_")
class CocoaPodsIT : BaseGradleIT() {
@@ -51,8 +47,8 @@ class CocoaPodsIT : BaseGradleIT() {
override fun defaultBuildOptions(): BuildOptions =
super.defaultBuildOptions().copy(customEnvironmentVariables = getEnvs())
private val PODFILE_IMPORT_DIRECTIVE_PLACEHOLDER = "<import_mode_directive>"
private val PODFILE_IMPORT_POD_PLACEHOLDER = "#import_pod_directive"
private val podfileImportDirectivePlaceholder = "<import_mode_directive>"
private val podfileImportPodPlaceholder = "#import_pod_directive"
private val cocoapodsSingleKtPod = "native-cocoapods-single"
private val cocoapodsMultipleKtPods = "native-cocoapods-multiple"
@@ -111,7 +107,9 @@ class CocoaPodsIT : BaseGradleIT() {
@Before
fun configure() {
hooks = CustomHooks()
project = getProjectByName(templateProjectName)
project = getProjectByName(templateProjectName).apply {
preparePodfile("ios-app", ImportMode.FRAMEWORKS)
}
}
@Test
@@ -159,6 +157,27 @@ class CocoaPodsIT : BaseGradleIT() {
mapOf("kotlin-library" to "MultiplatformLibrary")
)
@Test
fun testXcodeBuildsWithKotlinLibraryFromRootProject() {
val project = transformProjectWithPluginsDsl(templateProjectName, GradleVersionRequired.AtLeast(TestVersions.Gradle.G_7_6))
project.gradleBuildScript().appendToCocoapodsBlock("""
framework {
baseName = "kotlin-library"
}
name = "kotlin-library"
podfile = project.file("ios-app/Podfile")
""".trimIndent())
doTestXcode(
project,
ImportMode.FRAMEWORKS,
"ios-app",
mapOf("" to null),
)
}
@Test
fun testPodImportSingle() = doTestImportSingle()
@@ -1103,11 +1122,6 @@ class CocoaPodsIT : BaseGradleIT() {
writeText(text.removeRange(begin..index))
}
private fun File.changePod(podName: String, newConfiguration: String? = null) {
removePod(podName)
addPod(podName, newConfiguration)
}
private fun File.addSpecRepo(specRepo: String) = appendToCocoapodsBlock("url(\"$specRepo\")".wrap("specRepos"))
private fun File.appendToKotlinBlock(str: String) = appendLine(str.wrap("kotlin"))
@@ -1144,48 +1158,6 @@ class CocoaPodsIT : BaseGradleIT() {
// proposition phase
private fun checkTag(gitDir: File, tagName: String) {
runCommand(
gitDir,
"git", "name-rev",
"--tags",
"--name-only",
"HEAD"
) {
val (retCode, out, errorMessage) = this
assertEquals(0, retCode, errorMessage)
assertTrue(out.contains(tagName), errorMessage)
}
}
private fun checkPresentCommits(gitDir: File, commitName: String?) {
runCommand(
gitDir,
"git", "log", "--pretty=oneline"
) {
val (retCode, out, _) = this
assertEquals(0, retCode)
// get rid of '\n' at the end
assertEquals(1, out.trimEnd().lines().size)
if (commitName != null) {
assertEquals(commitName, out.substringBefore(" "))
}
}
}
private fun checkBranch(gitDir: File, branchName: String) {
runCommand(
gitDir,
"git", "show-branch"
) {
val (retCode, out, errorMessage) = this
assertEquals(0, retCode)
// get rid of '\n' at the end
assertEquals(1, out.trimEnd().lines().size, errorMessage)
assertEquals("[$branchName]", out.substringBefore(" "), errorMessage)
}
}
private fun isRepoAvailable(repo: String): Boolean {
var responseCode = 0
runCommand(
@@ -1325,10 +1297,25 @@ class CocoaPodsIT : BaseGradleIT() {
projectName: String,
mode: ImportMode,
iosAppLocation: String?,
subprojectsToFrameworkNamesMap: Map<String, String?>
subprojectsToFrameworkNamesMap: Map<String, String?>,
) {
val gradleProject = transformProjectWithPluginsDsl(projectName, gradleVersion)
doTestXcode(
gradleProject = gradleProject,
mode = mode,
iosAppLocation = iosAppLocation,
subprojectsToFrameworkNamesMap = subprojectsToFrameworkNamesMap,
)
}
private fun doTestXcode(
gradleProject: Project,
mode: ImportMode,
iosAppLocation: String?,
subprojectsToFrameworkNamesMap: Map<String, String?>,
) {
gradleProject.projectDir.resolve("gradle.properties")
.takeIf(File::exists)
?.let {
@@ -1341,20 +1328,22 @@ class CocoaPodsIT : BaseGradleIT() {
for ((subproject, frameworkName) in subprojectsToFrameworkNamesMap) {
val taskPrefix = if (subproject.isNotEmpty()) ":$subproject" else ""
// Add property with custom framework name
frameworkName?.let {
useCustomFrameworkName(subproject, it, iosAppLocation)
}
// Generate podspec.
build(":$subproject:podspec", "-Pkotlin.native.cocoapods.generate.wrapper=true") {
build("$taskPrefix:podspec", "-Pkotlin.native.cocoapods.generate.wrapper=true") {
assertSuccessful()
}
iosAppLocation?.also {
// Set import mode for Podfile.
preparePodfile(it, mode)
// Install pods.
build(":$subproject:podInstall", "-Pkotlin.native.cocoapods.generate.wrapper=true") {
build("$taskPrefix:podInstall", "-Pkotlin.native.cocoapods.generate.wrapper=true") {
assertSuccessful()
}
@@ -1392,14 +1381,14 @@ class CocoaPodsIT : BaseGradleIT() {
// Set import mode for Podfile.
iosAppDir.resolve("Podfile").takeIf { it.exists() }?.modify {
it.replace(PODFILE_IMPORT_DIRECTIVE_PLACEHOLDER, mode.directive)
it.replace(podfileImportDirectivePlaceholder, mode.directive)
}
}
private fun Project.addPodToPodfile(iosAppLocation: String, pod: String) {
val iosAppDir = projectDir.resolve(iosAppLocation)
iosAppDir.resolve("Podfile").takeIf { it.exists() }?.modify {
it.replace(PODFILE_IMPORT_POD_PLACEHOLDER, "pod '$pod'")
it.replace(podfileImportPodPlaceholder, "pod '$pod'")
}
}
@@ -0,0 +1,7 @@
<import_mode_directive>
platform :ios, '13.5'
target 'ios-app' do
pod 'kotlin-library', :path => '../'
end
@@ -0,0 +1,412 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
2C4835762268863D00C928E6 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C4835752268863D00C928E6 /* AppDelegate.swift */; };
2C4835782268863D00C928E6 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C4835772268863D00C928E6 /* ViewController.swift */; };
2C48357B2268863D00C928E6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2C4835792268863D00C928E6 /* Main.storyboard */; };
2C48357D2268863E00C928E6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2C48357C2268863E00C928E6 /* Assets.xcassets */; };
2C4835802268863E00C928E6 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2C48357E2268863E00C928E6 /* LaunchScreen.storyboard */; };
7A8FD316CA50E2E8DB0D2E1F /* Pods_ios_app.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79A90FE0891295265092998A /* Pods_ios_app.framework */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
2C4835722268863D00C928E6 /* ios-app.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ios-app.app"; sourceTree = BUILT_PRODUCTS_DIR; };
2C4835752268863D00C928E6 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
2C4835772268863D00C928E6 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
2C48357A2268863D00C928E6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
2C48357C2268863E00C928E6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
2C48357F2268863E00C928E6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
2C4835812268863E00C928E6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
39AA8CDDA5FAB17AD7272A34 /* Pods-ios-app.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ios-app.release.xcconfig"; path = "Target Support Files/Pods-ios-app/Pods-ios-app.release.xcconfig"; sourceTree = "<group>"; };
79A90FE0891295265092998A /* Pods_ios_app.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ios_app.framework; sourceTree = BUILT_PRODUCTS_DIR; };
8897ED03DAD11C439BD35DA2 /* Pods-ios-app.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ios-app.debug.xcconfig"; path = "Target Support Files/Pods-ios-app/Pods-ios-app.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
2C48356F2268863D00C928E6 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
7A8FD316CA50E2E8DB0D2E1F /* Pods_ios_app.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
2C4835692268863D00C928E6 = {
isa = PBXGroup;
children = (
2C4835742268863D00C928E6 /* ios-app */,
2C4835732268863D00C928E6 /* Products */,
75B0236CA0D69AB91740F84B /* Pods */,
B503D3AF3A2FD132899BF9C3 /* Frameworks */,
);
sourceTree = "<group>";
};
2C4835732268863D00C928E6 /* Products */ = {
isa = PBXGroup;
children = (
2C4835722268863D00C928E6 /* ios-app.app */,
);
name = Products;
sourceTree = "<group>";
};
2C4835742268863D00C928E6 /* ios-app */ = {
isa = PBXGroup;
children = (
2C4835752268863D00C928E6 /* AppDelegate.swift */,
2C4835772268863D00C928E6 /* ViewController.swift */,
2C4835792268863D00C928E6 /* Main.storyboard */,
2C48357C2268863E00C928E6 /* Assets.xcassets */,
2C48357E2268863E00C928E6 /* LaunchScreen.storyboard */,
2C4835812268863E00C928E6 /* Info.plist */,
);
path = "ios-app";
sourceTree = "<group>";
};
75B0236CA0D69AB91740F84B /* Pods */ = {
isa = PBXGroup;
children = (
8897ED03DAD11C439BD35DA2 /* Pods-ios-app.debug.xcconfig */,
39AA8CDDA5FAB17AD7272A34 /* Pods-ios-app.release.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
B503D3AF3A2FD132899BF9C3 /* Frameworks */ = {
isa = PBXGroup;
children = (
79A90FE0891295265092998A /* Pods_ios_app.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
2C4835712268863D00C928E6 /* ios-app */ = {
isa = PBXNativeTarget;
buildConfigurationList = 2C4835842268863E00C928E6 /* Build configuration list for PBXNativeTarget "ios-app" */;
buildPhases = (
7B4CDBDA6EC98FDDF547B2AA /* [CP] Check Pods Manifest.lock */,
2C48356E2268863D00C928E6 /* Sources */,
2C48356F2268863D00C928E6 /* Frameworks */,
2C4835702268863D00C928E6 /* Resources */,
F845F16848C8A553686D03C2 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = "ios-app";
productName = "ios-app";
productReference = 2C4835722268863D00C928E6 /* ios-app.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
2C48356A2268863D00C928E6 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1020;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = jetbrains;
TargetAttributes = {
2C4835712268863D00C928E6 = {
CreatedOnToolsVersion = 10.2;
};
};
};
buildConfigurationList = 2C48356D2268863D00C928E6 /* Build configuration list for PBXProject "ios-app" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 2C4835692268863D00C928E6;
productRefGroup = 2C4835732268863D00C928E6 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
2C4835712268863D00C928E6 /* ios-app */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
2C4835702268863D00C928E6 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2C4835802268863E00C928E6 /* LaunchScreen.storyboard in Resources */,
2C48357D2268863E00C928E6 /* Assets.xcassets in Resources */,
2C48357B2268863D00C928E6 /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
7B4CDBDA6EC98FDDF547B2AA /* [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-ios-app-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;
};
F845F16848C8A553686D03C2 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-ios-app/Pods-ios-app-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-ios-app/Pods-ios-app-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ios-app/Pods-ios-app-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
2C48356E2268863D00C928E6 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2C4835782268863D00C928E6 /* ViewController.swift in Sources */,
2C4835762268863D00C928E6 /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
2C4835792268863D00C928E6 /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
2C48357A2268863D00C928E6 /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
2C48357E2268863E00C928E6 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
2C48357F2268863E00C928E6 /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
2C4835822268863E00C928E6 /* 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.2;
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;
};
2C4835832268863E00C928E6 /* 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.2;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
2C4835852268863E00C928E6 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 8897ED03DAD11C439BD35DA2 /* Pods-ios-app.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = "ios-app/Info.plist";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.jetbrains.konan.ios-app";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
2C4835862268863E00C928E6 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 39AA8CDDA5FAB17AD7272A34 /* Pods-ios-app.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = "ios-app/Info.plist";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.jetbrains.konan.ios-app";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
2C48356D2268863D00C928E6 /* Build configuration list for PBXProject "ios-app" */ = {
isa = XCConfigurationList;
buildConfigurations = (
2C4835822268863E00C928E6 /* Debug */,
2C4835832268863E00C928E6 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
2C4835842268863E00C928E6 /* Build configuration list for PBXNativeTarget "ios-app" */ = {
isa = XCConfigurationList;
buildConfigurations = (
2C4835852268863E00C928E6 /* Debug */,
2C4835862268863E00C928E6 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 2C48356A2268863D00C928E6 /* Project object */;
}
@@ -0,0 +1,8 @@
<?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>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
@@ -0,0 +1,34 @@
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,10 @@
import UIKit
import kotlin_library
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
AKt.foo()
// Do any additional setup after loading the view.
}
}
@@ -138,7 +138,7 @@ open class PodspecTask : DefaultTask() {
val xcConfig = if (publishing.get() || extraSpecAttributes.get().containsKey("pod_target_xcconfig")) "" else
""" |
| spec.pod_target_xcconfig = {
| 'KOTLIN_PROJECT_PATH' => '${project.path}',
| 'KOTLIN_PROJECT_PATH' => '${if (project.depth != 0) project.path else ""}',
| 'PRODUCT_MODULE_NAME' => '${frameworkName.get()}',
| }
""".trimMargin()