[K/N] Add test for framework's bundle ID
This commit is contained in:
@@ -5470,6 +5470,36 @@ if (isAppleTarget(project)) {
|
|||||||
swiftSources = ['framework/stacktraceByLibbacktrace/']
|
swiftSources = ['framework/stacktraceByLibbacktrace/']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
frameworkTest("testFrameworkBundleId") {
|
||||||
|
def currentTarget = project.target.name
|
||||||
|
enabled = currentTarget.startsWith("mac")
|
||||||
|
|
||||||
|
konanArtifacts {
|
||||||
|
library("frameworkBundleIdLib", targets: [target.name]) {
|
||||||
|
srcFiles("framework/bundle_id/lib.kt")
|
||||||
|
delegate.getByTarget(target.name).configure{
|
||||||
|
UtilsKt.dependsOnDist(it)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
framework("Foo") {
|
||||||
|
sources = ["framework/bundle_id/main.kt"]
|
||||||
|
library = "frameworkBundleIdLib"
|
||||||
|
def exportedLib = konanArtifacts[library].getArtifactByTarget(target.name)
|
||||||
|
opts = ["-Xexport-library=$exportedLib"]
|
||||||
|
}
|
||||||
|
swiftSources = []
|
||||||
|
|
||||||
|
doLast {
|
||||||
|
def frameworkPath = "$testOutputFramework/testFrameworkBundleId/$target/Foo.framework"
|
||||||
|
def pattern = ~"<key>CFBundleIdentifier</key>\n\\s*<string>Foo</string>"
|
||||||
|
def plistContent = file("$frameworkPath/Resources/Info.plist").text
|
||||||
|
if (!pattern.matcher(plistContent).find()) {
|
||||||
|
throw new Error("Unexpected Info.plist content:\n$plistContent")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2021 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 lib
|
||||||
|
|
||||||
|
fun lib() {}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2021 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 main
|
||||||
|
|
||||||
|
fun main() {}
|
||||||
Reference in New Issue
Block a user