Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .github/workflows/build_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ jobs:
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Write Faktory Server Code
run: echo ${{ secrets.TOUCHLAB_TEST_ARTIFACT_CODE }} > kmmbridge/TOUCHLAB_TEST_ARTIFACT_CODE

- name: Read Faktory Server Code
run: cat kmmbridge/TOUCHLAB_TEST_ARTIFACT_CODE

- name: Local Publish For Tests
run: ./gradlew publishToMavenLocal --no-daemon --stacktrace --build-cache -PRELEASE_SIGNING_ENABLED=false -PVERSION_NAME=9.9.9

Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ build
*.xcbkptlist
!/.idea/codeStyles/*
!/.idea/inspectionProfiles/*
.kotlin
TOUCHLAB_TEST_ARTIFACT_CODE
.kotlin
22 changes: 0 additions & 22 deletions kmmbridge-test/src/main/kotlin/Extensions.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import co.touchlab.kmmbridge.findStringProperty
import co.touchlab.kmmbridge.test.TestArtifactManager
import co.touchlab.kmmbridge.test.TestUploadArtifactManager
import co.touchlab.kmmbridge.test.kmmBridgeExtension
import org.gradle.api.GradleException
import org.gradle.api.Project

@Suppress("unused")
Expand All @@ -11,22 +8,3 @@ fun Project.testArtifacts() {
artifactManager.set(TestArtifactManager())
artifactManager.finalizeValue()
}

/**
* This is for Touchlab use. See the code for more details.
*/
@Suppress("unused")
fun Project.testUploadArtifacts() {
val server = findStringProperty("TOUCHLAB_TEST_ARTIFACT_SERVER")
val code = findStringProperty("TOUCHLAB_TEST_ARTIFACT_CODE")

if (server == null || code == null) {
throw GradleException("TODO: Figure out a way for forks to not fail builds. But not today...")
}

val am = TestUploadArtifactManager(server, code)

val artifactManager = kmmBridgeExtension.artifactManager
artifactManager.set(am)
artifactManager.finalizeValue()
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package co.touchlab.kmmbridge

import java.io.File
import kotlin.test.assertEquals
import kotlin.test.assertFalse
import kotlin.test.assertTrue
import org.junit.jupiter.api.Test

Expand All @@ -14,8 +13,6 @@ class ArtifactManagerTest : BasePluginTest() {
val result =
ProcessHelper.runSh(
"./gradlew kmmBridgePublish " +
"-PTOUCHLAB_TEST_ARTIFACT_SERVER=api.touchlab.dev " +
"-PTOUCHLAB_TEST_ARTIFACT_CODE=${TOUCHLAB_TEST_ARTIFACT_CODE} " +
"--stacktrace",
workingDir = testProjectDir,
)
Expand All @@ -26,21 +23,19 @@ class ArtifactManagerTest : BasePluginTest() {
@Test
fun runKmmBridgePublish() {
val urlFile = File(testProjectDir, "allshared/build/kmmbridge/url")
assertFalse(urlFile.exists())
if (urlFile.exists()) urlFile.delete()

val result =
ProcessHelper.runSh(
"./gradlew clean kmmBridgePublish " +
"-PENABLE_PUBLISHING=true " +
"-PTOUCHLAB_TEST_ARTIFACT_SERVER=api.touchlab.dev " +
"-PTOUCHLAB_TEST_ARTIFACT_CODE=${TOUCHLAB_TEST_ARTIFACT_CODE} " +
"--stacktrace",
workingDir = testProjectDir,
)
logExecResult(result)

assertTrue(urlFile.exists())
val urlValue = urlFile.readText()
assertTrue(urlValue.startsWith("https://api.touchlab.dev/infoadmin/streamTestZip"))
assertEquals(0, result.status)
assertTrue(urlFile.exists())
assertEquals("test://0.1.8", urlFile.readText())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is "0.1.8" coming from? It's not going to fail if we bump a version, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's from the test project gradle.properties LIBRARY_VERSION=0.1.8

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,10 @@ abstract class BasePluginTest {
internal lateinit var settingsFile: File
internal lateinit var buildFile: File

@Suppress("ktlint:standard:property-naming")
internal lateinit var TOUCHLAB_TEST_ARTIFACT_CODE: String

abstract fun testProjectPath(): String

@BeforeEach
fun setup() {
TOUCHLAB_TEST_ARTIFACT_CODE = File("TOUCHLAB_TEST_ARTIFACT_CODE").readText().lines().first()
FileUtils.copyDirectory(testProjectSource, testProjectDir)
ProcessHelper.runSh("git init;git add .;git commit -m 'arst'", workingDir = testProjectDir)
settingsFile = File(testProjectDir, "settings.gradle.kts")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ class NonKmmBridgeTasksTest : BasePluginTest() {
fun runBasicBuild() {
val result =
ProcessHelper.runSh(
"./gradlew linkDebugFrameworkIosSimulatorArm64 " +
"-PTOUCHLAB_TEST_ARTIFACT_SERVER=api.touchlab.dev " +
"-PTOUCHLAB_TEST_ARTIFACT_CODE=${TOUCHLAB_TEST_ARTIFACT_CODE}",
"./gradlew linkDebugFrameworkIosSimulatorArm64",
workingDir = testProjectDir,
)
logExecResult(result)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ class SpmLocalDevTest : BasePluginTest() {
fun runSpmDevBuild() {
val result =
ProcessHelper.runSh(
"./gradlew spmDevBuild --stacktrace " +
"-PTOUCHLAB_TEST_ARTIFACT_SERVER=api.touchlab.dev " +
"-PTOUCHLAB_TEST_ARTIFACT_CODE=${TOUCHLAB_TEST_ARTIFACT_CODE}",
"./gradlew spmDevBuild --stacktrace",
workingDir = testProjectDir,
)
logExecResult(result)
Expand All @@ -27,9 +25,7 @@ class SpmLocalDevTest : BasePluginTest() {
ProcessHelper.runSh("rm -rdf .git", workingDir = testProjectDir)
val result =
ProcessHelper.runSh(
"./gradlew spmDevBuild --stacktrace " +
"-PTOUCHLAB_TEST_ARTIFACT_SERVER=api.touchlab.dev " +
"-PTOUCHLAB_TEST_ARTIFACT_CODE=${TOUCHLAB_TEST_ARTIFACT_CODE}",
"./gradlew spmDevBuild --stacktrace",
workingDir = testProjectDir,
)
logExecResult(result)
Expand Down
4 changes: 2 additions & 2 deletions test-projects/basic/allshared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ kotlin {
}

kmmbridge {
testUploadArtifacts()
spm(swiftToolVersion = "5.8") {
testArtifacts()
spm(swiftToolVersion = "5.8", spmDirectory = "../") {
iOS { v("14") }
}
}
Loading