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

Add support for Kotlin/JS and Kotlin/Native #23

Draft
wants to merge 34 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
06c41f9
Add kordx.emoji support to Kord Button Builders
DRSchlaubi Oct 5, 2021
463b018
Fix doc
DRSchlaubi Oct 5, 2021
2f5676d
MPP conversions
DRSchlaubi Apr 16, 2023
aeb6264
Merge remote-tracking branch 'schlaubi/master' into feature/mpp
DRSchlaubi Apr 16, 2023
fe88232
Update to explicitApi
DRSchlaubi Apr 16, 2023
1093ed9
More cleanup
DRSchlaubi Apr 17, 2023
56b370b
Switch to version catalogs
DRSchlaubi Apr 20, 2023
d6a1838
Add publishing again
DRSchlaubi Apr 20, 2023
e41f464
Do not publish javadoc jar for now
DRSchlaubi Apr 20, 2023
0c587f6
Fix tests
DRSchlaubi Apr 20, 2023
52018d3
FIX CI
DRSchlaubi Apr 20, 2023
077f636
Updates
DRSchlaubi Aug 7, 2023
f90d7e4
Update Gradle to 8.6
DRSchlaubi Mar 1, 2024
300ea05
Update dependencies
DRSchlaubi Mar 1, 2024
150d7a4
Update emojis.json file to reflect unicode changes
DRSchlaubi Mar 1, 2024
f5c7768
Migrate CI to Teamcity
DRSchlaubi Mar 1, 2024
68e2a78
Migrate Generator.kt to use codegen.kt
DRSchlaubi Mar 1, 2024
2eee481
Add nextPlannedVersion
DRSchlaubi Mar 1, 2024
63101b0
Fix Native build
DRSchlaubi Mar 1, 2024
3a41433
Fix publication
DRSchlaubi Mar 1, 2024
c59086b
Fix test runs
DRSchlaubi Mar 1, 2024
ff60427
Improvements
DRSchlaubi Mar 1, 2024
4e0ae48
Fix publishing
DRSchlaubi Mar 1, 2024
5d28c58
Enable signing
DRSchlaubi Mar 1, 2024
911fd8f
Update dependencies
DRSchlaubi Jul 18, 2024
b38538f
Trigger CI redeploy
DRSchlaubi Jul 29, 2024
3ca7f08
Update main branch
DRSchlaubi Jul 29, 2024
af33907
Fix gradlew permissions
DRSchlaubi Jul 29, 2024
a455d36
Fix dokka
DRSchlaubi Jul 29, 2024
830ea76
Fix invalid indent
DRSchlaubi Jul 29, 2024
f5cba64
Update dependencies
DRSchlaubi Sep 12, 2024
b926058
Upgrade yarn
DRSchlaubi Sep 12, 2024
5040050
Dependency updates
DRSchlaubi Oct 21, 2024
9185b6d
Fix OOME in Dokka
DRSchlaubi Oct 21, 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
71 changes: 0 additions & 71 deletions .github/workflows/deployment-ci.yml

This file was deleted.

15 changes: 15 additions & 0 deletions .github/workflows/documentation-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Documentation CI
on:
push:
pull_request:

permissions:
id-token: write
pages: write

jobs:
docs:
uses: kordlib/.teamcity/.github/workflows/documentation.yml@main
with:
main-branch: refs/heads/feature/mpp
multi-module: false
14 changes: 10 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
.gradle
.idea
build
out
.fleet/
.gradle/
.idea/*
!.idea/icon.png
.kotlin/

**/build/*
!**/build/generated/
# re-exclude BuildConfigGenerated.kt
common/build/generated/sources/buildConfig/main/dev/kord/common/BuildConfigGenerated.kt
190 changes: 94 additions & 96 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,128 +1,126 @@
import dev.kord.x.emoji.EmojiPlugin
import de.undercouch.gradle.tasks.download.org.apache.commons.codec.binary.Base64
import org.gradle.kotlin.dsl.assign
import org.gradle.kotlin.dsl.kord
import org.jetbrains.dokka.gradle.workers.ProcessIsolation
import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeSimulatorTest
import org.jetbrains.kotlin.konan.target.Family
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

version = Library.version
group = Library.group

plugins {
kotlin("jvm") version Versions.kotlin

signing
`maven-publish`
id("io.codearte.nexus-staging") version "0.30.0"
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.kord.gradle.plugin)
alias(libs.plugins.maven.publish.plugin)
alias(libs.plugins.dokka)
dev.kord.x.emoji
}

repositories {
mavenCentral()
maven("https://oss.sonatype.org/content/repositories/snapshots")
}

kord {
publicationName = "mavenCentral"
metadataHost = Family.OSX
jvmTarget = JvmTarget.JVM_1_8
}

dependencies {
implementation("dev.kord:kord-core:${Versions.kordRange}") {
/*
version {
prefer("latest.integration")
}
*/
commonMainImplementation(libs.kord.core)
commonTestImplementation(kotlin("test"))
}

kotlin {
explicitApi()
jvm()
js(IR) {
nodejs()
}

testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
}
linuxX64()
linuxArm64()

tasks.compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
mingwX64()

apply<EmojiPlugin>()
macosArm64()
macosX64()

val sourcesJar by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}
iosArm64()
iosX64()
iosSimulatorArm64()

watchosArm64()
watchosSimulatorArm64()

val javadocJar by tasks.registering(Jar::class) {
group = JavaBasePlugin.DOCUMENTATION_GROUP
archiveClassifier.set("javadoc")
tvosX64()
tvosArm64()
tvosSimulatorArm64()

sourceSets {
commonMain {
kotlin.srcDir(layout.buildDirectory.dir("generated/commonMain/kotlin"))
}
}
}

tasks.withType<PublishToMavenRepository>().configureEach {
doFirst { require(!Library.isUndefined) { "No release/snapshot version found." } }
tasks {
// CI does not seem to like simulators
withType<KotlinNativeSimulatorTest> {
enabled = false
}
}

publishing {
publications {
create<MavenPublication>(Library.name) {
from(components["kotlin"])
groupId = Library.group
artifactId = Library.name
version = Library.version

artifact(sourcesJar.get())

pom {
name.set(Library.name)
description.set(Library.description)
url.set(Library.description)

organization {
name.set("Kord")
url.set(Library.projectUrl)
}

developers {
developer {
name.set("The Kord Team")
}
}

issueManagement {
system.set("GitHub")
url.set("${Library.projectUrl}/issues")
}

licenses {
license {
name.set("MIT")
url.set("https://opensource.org/licenses/MIT")
}
}
scm {
connection.set("scm:git:ssh://github.com/kordlib/kordx.emoji.git")
developerConnection.set("scm:git:ssh://git@github.com:kordlib/kordx.emoji.git")
url.set(Library.projectUrl)
}
}
dokka {
// Dokka runs out of memory with the default maxHeapSize when ProcessIsolation is used
(dokkaGeneratorIsolation.get() as? ProcessIsolation)?.maxHeapSize = "1g"

if (!isJitPack) {
repositories {
maven {
url = if (Library.isSnapshot) uri(Repo.snapshotsUrl)
else uri(Repo.releasesUrl)

credentials {
username = System.getenv("NEXUS_USER")
password = System.getenv("NEXUS_PASSWORD")
}
}
}
}
dokkaSourceSets.configureEach {
sourceLink {
localDirectory = project.file("src/main/kotlin")
remoteUrl = project.uri("https://github.com/kordlib/kordx.emoji/tree/feature/mpp/src/$name/kotlin/")

remoteLineSuffix = "#L"
}
}

}

if (!isJitPack && Library.isRelease) {
signing {
val signingKey = findProperty("signingKey")?.toString()
val signingPassword = findProperty("signingPassword")?.toString()
if (signingKey != null && signingPassword != null) {
useInMemoryPgpKeys(String(Base64().decode(signingKey.toByteArray())), signingPassword)
mavenPublishing {
coordinates(artifactId = Library.name)
publishToMavenCentral()
signAllPublications()

pom {
name = Library.name
description = Library.description
url = Library.description

organization {
name = "Kord"
url = Library.projectUrl
}

developers {
developer {
name = "The Kord Team"
}
}

issueManagement {
system = "GitHub"
url = "${Library.projectUrl}/issues"
}

licenses {
license {
name = "MIT"
url = "https://opensource.org/licenses/MIT"
}
}
scm {
connection = "scm:git:ssh://github.com/kordlib/kordx.emoji.git"
developerConnection = "scm:git:ssh://git@github.com:kordlib/kord.emoji.git"
url = Library.projectUrl
}
sign(publishing.publications[Library.name])
}
}

nexusStaging { }
Loading