Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DGPv2 Android integration tests #3904

Merged
merged 37 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
ee91c75
DGPv2 Android integration tests
adam-enko Nov 5, 2024
6109ba0
updated expected data
adam-enko Nov 5, 2024
4cced1f
IJ exclude dokka-integration-tests/.kotlin
adam-enko Nov 5, 2024
cec0a7a
Add more kdoc
adam-enko Nov 5, 2024
8221b9f
update assertions, use `loadConfigurationCacheReportData` util to avo…
adam-enko Nov 5, 2024
cdbe9b0
Skip testing AGP8 until KT-70855 is fixed
adam-enko Nov 5, 2024
1959c37
improve loadConfigurationCacheReportData, tidy assertions
adam-enko Nov 5, 2024
92fb66c
rm commented out code
adam-enko Nov 5, 2024
5cc2de2
fix `updateProjectLocalMavenDir()`
adam-enko Nov 5, 2024
fd6297a
Improve directory-contents assertion to provide much more detailed fa…
adam-enko Nov 5, 2024
51c18a4
tidy `shouldBeDirectoryWithSameContentAs` assertion
adam-enko Nov 5, 2024
f6c3d38
fix gradle task dependency
adam-enko Nov 5, 2024
f8ffcb8
Improve directory comparison assertion
adam-enko Nov 5, 2024
958e662
Merge branch 'adam/feat/improve-directory-compare-assertion' into ada…
adam-enko Nov 5, 2024
492a055
comparing fix binary data
adam-enko Nov 5, 2024
de2834c
Merge branch 'adam/feat/improve-directory-compare-assertion' into ada…
adam-enko Nov 5, 2024
f9ccd37
replace non-printable characters with the codepoint
adam-enko Nov 5, 2024
9c7a32a
tidy replaceNonPrintableWithCodepoint
adam-enko Nov 5, 2024
66726d0
Merge branch 'adam/feat/improve-directory-compare-assertion' into ada…
adam-enko Nov 5, 2024
05f2c46
Merge branch 'master' into adam/feat/KT-70336/android-integration-tests
adam-enko Nov 7, 2024
76e30c1
try re-building to prevent CC miss on TeamCity
adam-enko Nov 11, 2024
13ef2d5
clear CC reports
adam-enko Nov 11, 2024
01d1674
clear CC reports
adam-enko Nov 11, 2024
9a4e2e7
formatting
adam-enko Nov 11, 2024
5053890
fix import
adam-enko Nov 12, 2024
ed5b511
Merge branch 'master' into adam/feat/KT-70336/android-integration-tests
adam-enko Nov 13, 2024
2b37748
order properties alphabetically
adam-enko Nov 13, 2024
ddcd84c
Only update versions in specific files, to avoid reading and writing …
adam-enko Nov 13, 2024
7913ad6
add workaround for Gradle not logging aborted tests
adam-enko Nov 19, 2024
6e66872
- rename test tag annotations
adam-enko Nov 19, 2024
c0f8c79
fix Gradle version
adam-enko Nov 19, 2024
9015efa
Fix finding the annotations for the tested element by searching the p…
adam-enko Nov 19, 2024
0d4370d
fix Gradle version
adam-enko Nov 19, 2024
4b86360
Fix test assertion
adam-enko Nov 19, 2024
dd87e63
Merge branch 'adam/fix/OverrideJsonConfig-fix-test-assertion' into ad…
adam-enko Nov 19, 2024
09999fc
Improve `shouldHaveOutcome` assertion message
adam-enko Nov 19, 2024
a774f69
Fix build cache tests
adam-enko Nov 19, 2024
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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ docs-developer/** linguist-doc
examples/** linguist-documentation
dokka-integration-tests/gradle/projects/** linguist-documentation

# exclude test data
dokka-integration-tests/gradle/projects/**/expectedData/** linguist-generated
dokka-integration-tests/gradle/src/testExampleProjects/expectedData/** linguist-generated
dokka-runners/dokka-gradle-plugin/src/testFunctional/resources/KotlinDslAccessorsTest/** linguist-generated

Expand Down
3 changes: 3 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,15 @@ idea {
".idea",
".husky",
".kotlin",
"dokka-integration-tests/.kotlin",
"dokka-runners/dokka-gradle-plugin/.kotlin",
"dokka-runners/runner-cli/.kotlin",
"dokka-runners/runner-maven-plugin/.kotlin",
"dokka-runners/dokka-gradle-plugin/src/testFunctional/resources/KotlinDslAccessorsTest/",

"dokka-integration-tests/gradle/src/testExampleProjects/expectedData",
"dokka-integration-tests/gradle/projects/it-android/expectedData",
"dokka-integration-tests/gradle/projects/it-android-compose/expectedData",
)
)
}
Expand Down
31 changes: 30 additions & 1 deletion dokka-integration-tests/gradle/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies {
api(libs.kotlin.test)
api(libs.junit.jupiterApi)
api(libs.junit.jupiterParams)

api(libs.kotest.assertionsCore)
api(gradleTestKit())

api(testFixtures("org.jetbrains.dokka:dokka-gradle-plugin:$dokkaVersion"))
Expand Down Expand Up @@ -176,6 +176,32 @@ fun registerTestProjectSuite(
}
}

testing.suites.named<JvmTestSuite>("test") {
targets.configureEach {
testTask {
systemProperty
.inputDirectory("templateProjectsDir", templateProjectsDir)
.withPathSensitivity(RELATIVE)

// Don't register ANDROID_HOME as a Task input, because the path is different on everyone's machine,
// which means Gradle will never be able to cache the task.
dokkaBuild.androidSdkDir.orNull?.let { androidSdkDir ->
environment("ANDROID_HOME", androidSdkDir)
}

// Use a stable Java version for running Gradle in integration tests.
// There's no need to parameterise the version, to re-run the tests with different JDKs.
// There are a few reasons for this:
// - Some tests use AGP 8, which requires Gradle 17+.
// - DGP functional tests are already run with Java 8, so we don't need to re-test Java 8 compatibility here.
// - The JDK used to run Gradle doesn't affect the Dokka output. The Java Toolchain used to compile
// the code in test projects does affect the output... but that can be parameterised in the
// individual tests if necessary.
javaLauncher = javaToolchains.launcherFor { languageVersion = JavaLanguageVersion.of(17) }
}
}
}

val checkoutKotlinxCoroutines by tasks.registering(GitCheckoutTask::class) {
uri = "https://github.com/Kotlin/kotlinx.coroutines.git"
commitId = "b78bbf518bd8e90e9ed2133ebdacc36441210cd6"
Expand All @@ -193,6 +219,9 @@ testing {
targets.configureEach {
testTask.configure {
devMavenPublish.configureTask(this)

// temp workaround, remove when all `testTemplateProject*` source sets are removed
mustRunAfter(tasks.withType<GitCheckoutTask>())
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
plugins {
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.multiplatform) apply false

if ("/* %{KGP_VERSION} */".startsWith("2.")) {
id("org.jetbrains.kotlin.plugin.compose") version "/* %{KGP_VERSION} */" apply false
}
alias(libs.plugins.compose.multiplatform) apply false

id("org.jetbrains.dokka") version "/* %{DGP_VERSION} */"
}

dependencies {
dokka(project(":core"))
dokka(project(":material3"))
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.multiplatform)
id("org.jetbrains.dokka")

if ("/* %{KGP_VERSION} */".startsWith("2.")) {
id("org.jetbrains.kotlin.plugin.compose")
}
alias(libs.plugins.compose.multiplatform)
}

group = "org.dokka.it.android.kmp"
version = "1.0"

android {
namespace = "org.dokka.it.android.kmp"

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
}

kotlin {
jvmToolchain(17)

androidTarget {
publishLibraryVariants("release")
}

sourceSets {
commonMain {
dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.animation)
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest />
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.dokka.it.android.kmp.core

import androidx.compose.runtime.Stable
import androidx.compose.ui.graphics.vector.ImageVector

@Stable
public data class MenuItem(
val label: String,
val imageVector: ImageVector,
val onClick: () -> Unit,
val isImportant: Boolean,
)

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading