-
-
Notifications
You must be signed in to change notification settings - Fork 69
Initial Kotlin Multiplatform setup #196
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
Open
aSemy
wants to merge
42
commits into
skrapeit:master
Choose a base branch
from
aSemy:feat/kotlin-multiplatform
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
6d10538
update to Gradle 7.5
aSemy 329e08d
merge .gitignore
aSemy 64cd016
minor readme fixes
aSemy ae0ffb2
set up buildSrc and convention plugins (with config mostly copied fro…
aSemy 3ad80da
update settings plugin to use shared repo config, and update Gradle p…
aSemy 04928e2
enable Gradle caching options (faster IDE, build, tests speeds)
aSemy 240e39d
update projects to use convention plugins, and remove custom dir sett…
aSemy 3cb0751
set snapshot repo as 'snapshots only' (better performance)
aSemy c0e9329
buildsrc - format plugins
aSemy e54e338
fix explicitApi, and add task-config avoidance on test tasks
aSemy cd9b95b
gradle does NOT like parallel! Lots of OOM exceptions
aSemy 9bc840c
enable detekt for Kotlin projects
aSemy df43ed3
move snapshot repo to common repo definitions
aSemy 0fdab96
apply version-management.gradle.kts plugin, update some log dependencies
aSemy e47e882
fix Maven publishing for JVM
aSemy 6bda350
add dokka to Javadoc Jar
aSemy 1c0de97
rm jsExecution feature TODO (it's Gradle config to create a feature v…
aSemy 0babfef
update project dependencies to use typesafe-accessors
aSemy c88edbc
rm idea plugin from buildSrc/build.gradle.kts
aSemy edc8596
initial migration to Kotlin Multiplatform
aSemy 4c6dca6
bump Kotlin, Ktor
aSemy cdc7fd6
set up test-utils
aSemy d33e4d5
Merge remote-tracking branch 'origin/master' into feat/kotlin-multipl…
aSemy 9ab5806
bump versions again (overwritten during merge)
aSemy 8abdfc6
update Gradle caching for GitHub actions
aSemy 6b2803b
add concurrency, timeout, and disable fail-fast for tests
aSemy 14a2c33
Merge branch 'github-actions-update' into feat/kotlin-multiplatform
aSemy 7f674fa
Merge branch 'github-actions-update' into feat/kotlin-multiplatform
aSemy 6c3bb86
Merge remote-tracking branch 'origin/master' into feat/kotlin-multipl…
aSemy 4854cbe
bump gradle
aSemy 685cb89
add jvm test dependencies
aSemy 53f5518
toLowerCase() -> lowercase()
aSemy 2b18c73
spelling scoope -> scope
aSemy 0a64903
fix code warnings
aSemy b429225
bump kover plugin version
aSemy 6bc29c3
try bumping kover version
aSemy 444aeaa
revert kover, try to fix the other bug by manually setting the engine…
aSemy 04c9d48
fix Kover coverage
aSemy ef935bd
fix Kover coverage
aSemy 09de5c7
remove jsExecution feature variant, publish browser-fetcher directly
aSemy a104400
configure kotlin-multiplatform publishing
aSemy f393237
all -> configureEach
aSemy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,10 +1,28 @@ | ||
| plugins { | ||
| buildsrc.convention.`kotlin-jvm` | ||
| buildsrc.convention.`publish-jvm` | ||
| buildsrc.convention.`kotlin-multiplatform` | ||
| buildsrc.convention.kover | ||
| buildsrc.convention.`publish-kotlin-multiplatform` | ||
| } | ||
|
|
||
| dependencies { | ||
| api(projects.htmlParser) | ||
| api(projects.dsl) | ||
| api(projects.fetcher.baseFetcher) | ||
| kotlin { | ||
| jvm {} | ||
|
|
||
| sourceSets { | ||
| val commonMain by getting { | ||
| dependencies { | ||
| api(projects.htmlParser) | ||
| api(projects.dsl) | ||
| api(projects.fetcher.baseFetcher) | ||
| } | ||
| } | ||
|
|
||
| val jvmTest by getting { | ||
| dependencies { | ||
| implementation(Deps.jUnit) | ||
| implementation(Deps.strikt) | ||
| implementation(Deps.Mockk.mockk) | ||
| implementation(Deps.Mockk.dslJvm) | ||
| } | ||
| } | ||
| } | ||
| } |
File renamed without changes.
This file contains hidden or 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
12 changes: 12 additions & 0 deletions
12
buildSrc/src/main/kotlin/buildsrc/convention/kover.gradle.kts
This file contains hidden or 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,12 @@ | ||
| package buildsrc.convention | ||
|
|
||
| import kotlinx.kover.api.IntellijEngine | ||
|
|
||
| plugins { | ||
| id("org.jetbrains.kotlinx.kover") | ||
| } | ||
|
|
||
| kover { | ||
| // https://search.maven.org/artifact/org.jetbrains.intellij.deps/intellij-coverage-agent | ||
| engine.set(IntellijEngine("1.0.681")) | ||
| } |
56 changes: 56 additions & 0 deletions
56
buildSrc/src/main/kotlin/buildsrc/convention/publish-kotlin-multiplatform.gradle.kts
This file contains hidden or 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,56 @@ | ||
| package buildsrc.convention | ||
|
|
||
| import buildsrc.config.createSkrapeItPom | ||
| import gradle.kotlin.dsl.accessors._4ad077ad74816558e52d7069eb18a2f7.publishing | ||
| import gradle.kotlin.dsl.accessors._4ad077ad74816558e52d7069eb18a2f7.signing | ||
| import org.gradle.api.provider.Provider | ||
| import org.gradle.api.publish.maven.MavenPublication | ||
| import org.gradle.kotlin.dsl.create | ||
| import org.gradle.kotlin.dsl.get | ||
| import org.gradle.kotlin.dsl.maven | ||
| import org.gradle.kotlin.dsl.provideDelegate | ||
|
|
||
| plugins { | ||
| `maven-publish` | ||
| signing | ||
| } | ||
|
|
||
| description = "Configuration for publishing Kotlin Multiplatform libraries to Sonatype Maven Central" | ||
|
|
||
| val signingKeyId: String? by project | ||
| val signingKey: String? by project | ||
| val signingPassword: String? by project | ||
|
|
||
| val signingEnabled: Provider<Boolean> = provider { | ||
| signingKeyId != null && signingKey != null && signingPassword != null | ||
| } | ||
|
|
||
| val javadocJar by tasks.registering(Jar::class) { | ||
| group = JavaBasePlugin.DOCUMENTATION_GROUP | ||
| description = "Empty Javadoc Jar (required by Maven Central)" | ||
| archiveClassifier.set("javadoc") | ||
| } | ||
|
|
||
| publishing { | ||
| repositories { | ||
| // publish to local dir, for testing | ||
| maven(rootProject.layout.buildDirectory.dir("maven-internal")) { | ||
| name = "LocalProjectDir" | ||
| } | ||
| } | ||
| publications.withType<MavenPublication>().configureEach { | ||
| artifact(javadocJar) | ||
|
|
||
| createSkrapeItPom { | ||
| name.set("skrape{it} ${project.name}") | ||
| } | ||
| } | ||
| } | ||
|
|
||
| signing { | ||
| if (signingEnabled.get()) { | ||
| sign(publishing.publications) | ||
|
|
||
| useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword) | ||
| } | ||
| } | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,4 +1,9 @@ | ||
| plugins { | ||
| buildsrc.convention.`kotlin-jvm` | ||
| buildsrc.convention.`publish-jvm` | ||
| buildsrc.convention.`kotlin-multiplatform` | ||
|
|
||
| buildsrc.convention.kover | ||
| } | ||
|
|
||
| kotlin { | ||
| jvm {} | ||
| } |
File renamed without changes.
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,15 +1,32 @@ | ||
| plugins { | ||
| buildsrc.convention.`kotlin-jvm` | ||
| buildsrc.convention.`publish-jvm` | ||
| buildsrc.convention.`kotlin-multiplatform` | ||
| buildsrc.convention.`publish-kotlin-multiplatform` | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation(projects.fetcher.baseFetcher) | ||
| implementation(Deps.Ktor.client) | ||
| implementation(Deps.Ktor.clientApache) | ||
| implementation(Deps.Ktor.clientLogging) | ||
| implementation(Deps.logback) | ||
| implementation(Deps.log4jOverSlf4j) | ||
| kotlin { | ||
| jvm {} | ||
|
|
||
| testImplementation(projects.testUtils) | ||
| sourceSets { | ||
| val commonMain by getting { | ||
| dependencies { | ||
| implementation(projects.fetcher.baseFetcher) | ||
| implementation(Deps.Ktor.client) | ||
| implementation(Deps.Ktor.clientApache) | ||
| implementation(Deps.Ktor.clientLogging) | ||
| } | ||
| } | ||
|
|
||
| val jvmMain by getting { | ||
| dependencies { | ||
| implementation(Deps.logback) | ||
| implementation(Deps.log4jOverSlf4j) | ||
| } | ||
| } | ||
|
|
||
| val jvmTest by getting { | ||
| dependencies { | ||
| implementation(projects.testUtils) | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,20 +1,36 @@ | ||
| @file:Suppress("PropertyName") | ||
|
|
||
| val kotlin_version: String by project | ||
|
|
||
| plugins { | ||
| buildsrc.convention.`kotlin-jvm` | ||
| buildsrc.convention.`publish-jvm` | ||
| buildsrc.convention.`kotlin-multiplatform` | ||
| buildsrc.convention.`publish-kotlin-multiplatform` | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation(projects.dsl) | ||
| implementation(Deps.Kotlin.reflect) { | ||
| because("to support Result#extractIt by creating instance of a class") | ||
| } | ||
| api(Deps.KotlinX.Coroutines.jdk8) | ||
| kotlin { | ||
| jvm {} | ||
| sourceSets { | ||
| val commonMain by getting { | ||
| dependencies { | ||
| implementation(projects.dsl) | ||
| api(Deps.KotlinX.Coroutines.core) | ||
| } | ||
| } | ||
|
|
||
| val jvmMain by getting { | ||
| dependencies { | ||
| api(Deps.jsoup) | ||
| implementation(Deps.Kotlin.reflect) { | ||
| because("to support Result#extractIt by creating instance of a class") | ||
| } | ||
| api(Deps.KotlinX.Coroutines.jdk8) | ||
| } | ||
| } | ||
|
|
||
| testImplementation(projects.testUtils) | ||
| testImplementation(Deps.Ktor.client) | ||
| testImplementation(Deps.Ktor.clientApache) | ||
| val jvmTest by getting { | ||
|
|
||
| dependencies { | ||
| implementation(projects.testUtils) | ||
|
|
||
| implementation(Deps.Ktor.client) | ||
| implementation(Deps.Ktor.clientApache) | ||
| } | ||
| } | ||
| } | ||
| } |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason Sonatype isn't defined here..
I would expect to see something like this:
https://github.com/kotest/kotest/blob/945e029b4aea4ca39487f2dcf10d9a066dd7050a/buildSrc/src/main/kotlin/kotest-publishing-conventions.gradle.kts#L22-L31
The same in the
publish-jvmconvention plugin...Was it removed, and it should be re-added now?