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

Fix common source sets not propogated #3814

Draft
wants to merge 26 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ecc43a5
Fix common source sets not propogated
adam-enko Sep 19, 2024
fc6319b
Add some kdoc
adam-enko Sep 23, 2024
1482ecf
refine test
adam-enko Sep 23, 2024
1522d04
Fix fetching platform sources
adam-enko Oct 16, 2024
e45e4d9
Merge branch 'master' into adam/feat/KT-70336/pass-common-src-to-depe…
adam-enko Oct 16, 2024
c41a249
Merge branch 'master' into adam/feat/KT-70336/pass-common-src-to-depe…
adam-enko Oct 17, 2024
a639d51
wip
adam-enko Oct 17, 2024
148f821
Merge branch 'master' into adam/feat/KT-70336/pass-common-src-to-depe…
adam-enko Oct 22, 2024
b39e793
Fix issues in KotlinAdapter
adam-enko Oct 22, 2024
ad6a532
Sort DokkaSourceSets (helps with debugging)
adam-enko Oct 22, 2024
169a859
Fix convention for `DokkaSourceSetSpec.suppress`
adam-enko Oct 22, 2024
0c8605d
Fix convention for `DokkaSourceSetSpec.suppress`
adam-enko Oct 22, 2024
586d603
Add 'Dokka' to warn message
adam-enko Oct 22, 2024
f80f5b4
remove analysis platform convention, otherwise it overrides the conve…
adam-enko Oct 22, 2024
ead23da
Deprecate unused `KotlinPlatform.DEFAULT`
adam-enko Oct 22, 2024
a3919ed
IT Android with DGPv2
adam-enko Oct 24, 2024
22cd3d5
test Android Compose project
adam-enko Oct 24, 2024
e895ca1
Tidy DokkaGradlePluginTestExtension, split up file into separate clas…
adam-enko Oct 30, 2024
651cdf8
Tidy GradleTestProjectInitializer
adam-enko Oct 30, 2024
91ee7d0
run tests with Java 17
adam-enko Oct 30, 2024
cb7e331
Merge branch 'master' into adam/feat/KT-70336/pass-common-src-to-depe…
adam-enko Nov 4, 2024
7fe86c9
tidy after merge
adam-enko Nov 4, 2024
c65a390
add project path to log message
adam-enko Nov 4, 2024
718cc3a
remove unused code... (maybe use it again in the future?)
adam-enko Nov 4, 2024
2a4239a
fix after merge: remove duplicated `devMavenPublish.configureTask(this)`
adam-enko Nov 4, 2024
b87bab1
update `WithGradleProperties` to be a repeatable annotation (easier t…
adam-enko Nov 4, 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
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ idea {
"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
28 changes: 27 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 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,51 @@
import org.jetbrains.dokka.gradle.engine.parameters.KotlinPlatform
import org.jetbrains.dokka.gradle.internal.DokkaInternalApi
import org.jetbrains.dokka.gradle.tasks.DokkaGenerateTask

plugins {
// id("com.android.library")
// kotlin("multiplatform")
// id("org.jetbrains.compose")
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