-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
95940e1
commit 6bb0d82
Showing
11 changed files
with
432 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ build/ | |
*.podspec | ||
node_modules | ||
js-chat/dist | ||
test.properties | ||
|
||
### IntelliJ IDEA ### | ||
.idea/modules.xml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
|
||
import com.codingfeline.buildkonfig.compiler.FieldSpec.Type | ||
import java.util.Properties | ||
|
||
plugins { | ||
alias(libs.plugins.benmanes.versions) | ||
id("pubnub.shared") | ||
id("pubnub.ios-simulator-test") | ||
id("pubnub.base.multiplatform") | ||
alias(libs.plugins.codingfeline.buildkonfig) | ||
} | ||
|
||
kotlin { | ||
sourceSets { | ||
val commonMain by getting { | ||
dependencies { | ||
api(project(":pubnub-chat-api")) | ||
api(kotlin("test")) | ||
api(libs.coroutines.test) | ||
} | ||
} | ||
|
||
val jvmMain by getting { | ||
dependencies { | ||
api(kotlin("test-junit")) | ||
} | ||
} | ||
} | ||
|
||
ktlint { | ||
filter { | ||
exclude { it: FileTreeElement -> it.file.absolutePath.also { println(it) }.contains("/build/") } | ||
} | ||
} | ||
|
||
buildkonfig { | ||
packageName = "com.pubnub.test" | ||
exposeObjectWithName = "Keys" | ||
|
||
defaultConfigs { | ||
val testProps = Properties() | ||
try { | ||
val bytes = providers.fileContents(rootProject.layout.projectDirectory.file("test.properties")).asBytes.get() | ||
testProps.load(bytes.inputStream()) | ||
} catch (e: Exception) { | ||
println("No test.properties found in root project. Trying to get keys from env") | ||
try { | ||
testProps.setProperty("pubKey", providers.environmentVariable("SDK_PUB_KEY").get()) | ||
testProps.setProperty("subKey", providers.environmentVariable("SDK_SUB_KEY").get()) | ||
testProps.setProperty("pamPubKey", providers.environmentVariable("SDK_PAM_PUB_KEY").get()) | ||
testProps.setProperty("pamSubKey", providers.environmentVariable("SDK_PAM_SUB_KEY").get()) | ||
testProps.setProperty("pamSecKey", providers.environmentVariable("SDK_PAM_SEC_KEY").get()) | ||
} catch (e: IllegalStateException) { | ||
println("No env variables found. Setting all keys to demo") | ||
testProps.setProperty("pubKey", "demo") | ||
testProps.setProperty("subKey", "demo") | ||
testProps.setProperty("pamPubKey", "demo") | ||
testProps.setProperty("pamSubKey", "demo") | ||
testProps.setProperty("pamSecKey", "demo") | ||
} | ||
} | ||
buildConfigField(Type.STRING, "pubKey", testProps.getProperty("pubKey")) | ||
buildConfigField(Type.STRING, "subKey", testProps.getProperty("subKey")) | ||
buildConfigField(Type.STRING, "pamPubKey", testProps.getProperty("pamPubKey")) | ||
buildConfigField(Type.STRING, "pamSubKey", testProps.getProperty("pamSubKey")) | ||
buildConfigField(Type.STRING, "pamSecKey", testProps.getProperty("pamSecKey")) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<baseline version="1.0"> | ||
</baseline> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package testlauncher | ||
|
||
import platform.CoreFoundation.CFRunLoopRun | ||
import kotlin.experimental.ExperimentalNativeApi | ||
import kotlin.native.concurrent.TransferMode | ||
import kotlin.native.concurrent.Worker | ||
import kotlin.native.concurrent.freeze | ||
import kotlin.native.internal.test.testLauncherEntryPoint | ||
import kotlin.system.exitProcess | ||
|
||
@OptIn(ExperimentalNativeApi::class) | ||
fun mainBackground(args: Array<String>) { | ||
val worker = Worker.start(name = "main-background") | ||
worker.execute(TransferMode.SAFE, { args.freeze() }) { | ||
val result = testLauncherEntryPoint(it) | ||
exitProcess(result) | ||
} | ||
CFRunLoopRun() | ||
error("CFRunLoopRun should never return") | ||
} |
Oops, something went wrong.