-
Notifications
You must be signed in to change notification settings - Fork 3
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
Feature/test #9
Feature/test #9
Changes from 3 commits
43932ac
2652065
5bad8ca
8697729
2ffd3bd
18b1130
c3a5810
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,198 +1,40 @@ | ||
import io.gitlab.arturbosch.detekt.Detekt | ||
import org.gradle.kotlin.dsl.support.listFilesOrdered | ||
import org.jetbrains.kotlin.build.joinToReadableString | ||
|
||
plugins { | ||
kotlin("multiplatform") version "2.0.0" | ||
id("maven-publish") | ||
id("signing") | ||
plugins {base | ||
id("org.jetbrains.dokka") | ||
id("io.github.gradle-nexus.publish-plugin") version "1.3.0" | ||
id("org.jetbrains.dokka") version "1.9.20" | ||
id("org.jetbrains.kotlinx.kover") version "0.8.0" | ||
id("io.gitlab.arturbosch.detekt") version "1.23.6" | ||
} | ||
|
||
val artifactVersion: String by extra | ||
group = "at.asitplus" | ||
version = artifactVersion | ||
|
||
repositories { | ||
mavenCentral() | ||
dependencies { | ||
dokka(project(":kmmresult")) | ||
dokka(project(":kmmresult-test")) | ||
} | ||
|
||
val dokkaOutputDir = "$projectDir/docs" | ||
tasks.dokkaHtml { | ||
|
||
dokka { | ||
val moduleDesc = File("$rootDir/dokka-tmp.md").also { it.createNewFile() } | ||
val readme = | ||
File("${rootDir}/README.md").readText() | ||
val moduleTitle = project.name | ||
moduleDesc.writeText("# Module ${project.name}\n\n$readme") | ||
moduleName.set(moduleTitle) | ||
|
||
dokkaSourceSets { | ||
named("commonMain") { | ||
|
||
includes.from(moduleDesc) | ||
sourceLink { | ||
localDirectory.set(file("src/$name/kotlin")) | ||
remoteUrl.set( | ||
uri("https://github.com/a-sit-plus/kmmresult/tree/development/src/$name/kotlin").toURL() | ||
) | ||
// Suffix which is used to append the line number to the URL. Use #L for GitHub | ||
remoteLineSuffix.set("#L") | ||
} | ||
} | ||
} | ||
outputDirectory.set(file("${rootDir}/docs")) | ||
doLast { | ||
rootDir.listFilesOrdered { it.extension.lowercase() == "png" || it.extension.lowercase() == "svg" } | ||
.forEach { it.copyTo(File("$rootDir/docs/${it.name}"), overwrite = true) } | ||
} | ||
} | ||
val deleteDokkaOutputDir by tasks.register<Delete>("deleteDokkaOutputDirectory") { | ||
delete(dokkaOutputDir) | ||
} | ||
val javadocJar = tasks.register<Jar>("javadocJar") { | ||
dependsOn(deleteDokkaOutputDir, tasks.dokkaHtml) | ||
archiveClassifier.set("javadoc") | ||
from(dokkaOutputDir) | ||
} | ||
moduleDesc.writeText("\n\n$readme") | ||
moduleName.set("KmmResult") | ||
|
||
tasks.getByName("check") { | ||
dependsOn("detektMetadataMain") | ||
} | ||
|
||
|
||
//first sign everything, then publish! | ||
tasks.withType<AbstractPublishToMaven>() { | ||
tasks.withType<Sign>().forEach { | ||
dependsOn(it) | ||
dokkaPublicationDirectory.set(file("${rootDir}/docs")) | ||
dokkaPublications.html { | ||
includes.from(moduleDesc) | ||
} | ||
} | ||
|
||
kotlin { | ||
|
||
val xcf = org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFrameworkConfig(project, "KmmResult") | ||
listOf( | ||
macosArm64(), | ||
macosX64(), | ||
tvosArm64(), | ||
tvosX64(), | ||
tvosSimulatorArm64(), | ||
iosX64(), | ||
iosArm64(), | ||
iosSimulatorArm64() | ||
).forEach { | ||
it.binaries.framework { | ||
baseName = "KmmResult" | ||
binaryOption("bundleId", "at.asitplus.KmmResult") | ||
embedBitcode("bitcode") | ||
xcf.add(this) | ||
isStatic = true | ||
} | ||
} | ||
|
||
jvmToolchain(11) | ||
jvm { | ||
compilations.all { | ||
kotlinOptions { | ||
freeCompilerArgs = listOf( | ||
"-Xjsr305=strict" | ||
) | ||
} | ||
} | ||
withJava() //for Java Interop tests | ||
} | ||
|
||
js(IR) { | ||
browser { testTask { enabled = false } } | ||
nodejs() | ||
} | ||
linuxX64() | ||
linuxArm64() | ||
mingwX64() | ||
|
||
sourceSets { | ||
commonMain.dependencies { | ||
implementation("io.arrow-kt:arrow-core:1.2.4") | ||
} | ||
|
||
commonTest.dependencies { | ||
implementation(kotlin("test")) | ||
} | ||
} | ||
|
||
|
||
|
||
tasks.withType<Detekt>().configureEach { | ||
reports { | ||
xml.required.set(true) | ||
html.required.set(false) | ||
txt.required.set(false) | ||
sarif.required.set(true) | ||
md.required.set(true) | ||
} | ||
} | ||
|
||
dependencies { | ||
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.6") | ||
} | ||
tasks.dokkaGenerate { | ||
doLast { | ||
rootDir.listFilesOrdered { it.extension.lowercase() == "png" || it.extension.lowercase() == "svg" } | ||
.forEach { it.copyTo(File("$rootDir/docs/html/${it.name}"), overwrite = true) } | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
publishing { | ||
publications { | ||
withType<MavenPublication> { | ||
artifact(javadocJar) | ||
pom { | ||
name.set("KmmResult") | ||
description.set("Functional equivalent of kotlin.Result but with KMM goodness") | ||
url.set("https://github.com/a-sit-plus/kmmresult") | ||
licenses { | ||
license { | ||
name.set("The Apache License, Version 2.0") | ||
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") | ||
} | ||
} | ||
developers { | ||
developer { | ||
id.set("JesusMcCloud") | ||
name.set("Bernd Prünster") | ||
email.set("[email protected]") | ||
} | ||
developer { | ||
id.set("nodh") | ||
name.set("Christian Kollmann") | ||
email.set("[email protected]") | ||
} | ||
} | ||
scm { | ||
connection.set("scm:git:[email protected]:a-sit-plus/kmmresult.git") | ||
developerConnection.set("scm:git:[email protected]:a-sit-plus/kmmresult.git") | ||
url.set("https://github.com/a-sit-plus/kmmresult") | ||
} | ||
} | ||
} | ||
} | ||
repositories { | ||
mavenLocal() { | ||
signing.isRequired = false | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
val signingKeyId: String? by project | ||
val signingKey: String? by project | ||
val signingPassword: String? by project | ||
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword) | ||
sign(publishing.publications) | ||
} | ||
|
||
nexusPublishing { | ||
repositories { | ||
sonatype { | ||
|
@@ -201,4 +43,3 @@ nexusPublishing { | |
} | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
|
||
dependencies { | ||
implementation("org.jetbrains.dokka:dokka-gradle-plugin:2.0.0-Beta") | ||
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.20") | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rootProject.name = 'backend_buildSrc' | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
object VersionsBackend { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. totally forgot to remove the actual sources. in the buildSrc. buildSrc is needed becasue dokka only works from plugins (such as our conventions, or buildSrc) for multi-module projects) |
||
const val zxing = "3.5.0" | ||
const val semver = "1.1.2" | ||
const val `google-cbor` = "0.01.02" | ||
const val hsmf = "0.8.3" | ||
const val pgsql = "42.7.3" | ||
const val mockito = "5.1.0" | ||
const val okhttp = "4.11.0" | ||
const val scrimage = "4.0.39" | ||
const val pupilidlib = "1.9.0-pupilid" | ||
const val attestation = "2.1.3" | ||
const val jose = "9.25.6" | ||
|
||
object spring { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we need spring dependency declarations here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed |
||
const val boot = "3.1.3" | ||
const val `dependency-management` = "1.1.3" | ||
const val `cloud-config-client` = "4.0.4" | ||
const val `admin-starter-client` = "3.1.6" | ||
const val doc = "2.3.0" | ||
const val swagger = "2.2.19" | ||
} | ||
|
||
object webjars { | ||
const val locator = "0.47" | ||
const val bootstrap = "5.3.1" | ||
const val jquery = "3.7.1" | ||
const val datatables = "1.13.5" | ||
} | ||
} |
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.
why
backend
?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.
overlooked this. renamed