Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
- Switch CI to macos
- Add native targets
- Update Gradle to 8.2.1
- Update kotlin to 1.9.0
- Update kotlinx.serialization to 1.6.0-RC
- Update kotlinpoet to 1.14.2
  • Loading branch information
DRSchlaubi committed Aug 7, 2023
1 parent 52018d3 commit 077f636
Show file tree
Hide file tree
Showing 10 changed files with 231 additions and 186 deletions.
16 changes: 4 additions & 12 deletions .github/workflows/deployment-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@ on:
jobs:
build:
name: Build Kord
runs-on: ubuntu-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
runs-on: macos-latest

steps:
- uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
Expand All @@ -30,7 +27,7 @@ jobs:
- name: Build with gradle
uses: gradle/gradle-build-action@v2
with:
arguments: build --stacktrace --info
arguments: build
release:
name: Publish artifacts
runs-on: ubuntu-latest
Expand All @@ -45,7 +42,6 @@ jobs:
GITHUB_TAG_NAME: ${{ github.event.release.tag_name }}
GITHUB_TARGET_COMMITISH: ${{ github.event.release.target_commitish }}
GITHUB_BRANCH_NAME: ${{ github.ref }}
ACTIONS_ALLOW_UNSECURE_COMMANDS: true

steps:
- uses: actions/checkout@v3
Expand All @@ -59,13 +55,9 @@ jobs:
- name: Build with gradle
uses: gradle/gradle-build-action@v2
with:
arguments: --stacktrace --info build
arguments: build

- name: Publish with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: publish
# Disabled for now
#
# - name: Close and Release Repository
# run: ./gradlew closeAndReleaseRepository
arguments: -x test publish
46 changes: 23 additions & 23 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,25 @@ kotlin {
}
jvmToolchain(8)

sourceSets {
commonMain {
dependencies {
implementation(libs.kord.core)
}
}
linuxX64()

commonTest {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
}
mingwX64()

named("jvmTest") {
dependencies {
implementation(kotlin("test-junit"))
}
}
macosArm64()
macosX64()

iosArm64()
iosX64()
// iosSimulatorArm64()

watchosX64()
watchosArm64()
// watchosSimulatorArm64()

tvosX64()
tvosArm64()
// tvosSimulatorArm64()

named("jsTest") {
dependencies {
implementation(kotlin("test-js"))
}
}
}
}

publishing {
Expand Down Expand Up @@ -117,3 +110,10 @@ signing {
}
}
}

dependencies {
commonMainImplementation(libs.kord.core) {
exclude(module = "kord-ksp-annotations")
}
commonTestImplementation(kotlin("test"))
}
5 changes: 2 additions & 3 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
plugins {
`kotlin-dsl`
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.kotlin.plugin.serialization)
}

repositories {
mavenCentral()
gradlePluginPortal()
mavenCentral()
}

dependencies {
Expand Down
8 changes: 4 additions & 4 deletions buildSrc/src/main/kotlin/dev/kord/x/emoji/Generator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package dev.kord.x.emoji
import com.squareup.kotlinpoet.*
import com.squareup.kotlinpoet.ParameterizedTypeName.Companion.parameterizedBy
import kotlinx.serialization.Serializable
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
import org.gradle.api.DefaultTask
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.tasks.TaskAction
import org.gradle.kotlin.dsl.register
import kotlin.io.path.Path
import kotlin.io.path.div

Expand Down Expand Up @@ -48,7 +48,7 @@ data class EmojiItem(
class EmojiPlugin : Plugin<Project> {

override fun apply(project: Project) {
project.tasks.register("generateEmojisFile", GenerateEmojisTask::class.java)
project.tasks.register<GenerateEmojisTask>("generateEmojisFile")
}
}

Expand Down Expand Up @@ -176,7 +176,7 @@ private abstract class GenerateEmojisTask : DefaultTask() {
applyJsNameIfNeeded(camelCaseName)
getter(
FunSpec.getterBuilder()
.addStatement("""return %T("%L")""", EmojiType.Diverse.name, item.surrogates)
.addStatement("""return %T(%S)""", EmojiType.Diverse.name, item.surrogates)
.build()
)
}
Expand Down Expand Up @@ -207,7 +207,7 @@ private abstract class GenerateEmojisTask : DefaultTask() {
applyJsNameIfNeeded(camelCaseName)
getter(
FunSpec.getterBuilder()
.addStatement("""return %T("%L")""", EmojiType.Generic.name, item.surrogates)
.addStatement("""return %T(%S)""", EmojiType.Generic.name, item.surrogates)
.build()
)
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
systemProp.org.gradle.unsafe.kotlin.assignment=true
kotlin.native.ignoreDisabledTargets=true
14 changes: 5 additions & 9 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
[versions]
kotlin = "1.8.20"
kord = "0.9.x-SNAPSHOT"
kotlinx-serialization = "1.5.0"
kotlinpoet = "1.13.0"
kotlin = "1.9.0"

[libraries]
kord-core = { module = "dev.kord:kord-core", version.ref = "kord" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" }
kotlinpoet = {module="com.squareup:kotlinpoet", version.ref = "kotlinpoet" }
kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version = "1.6.0-RC" }
kotlinpoet = { group = "com.squareup", name = "kotlinpoet", version = "1.14.2" }
kord-core = { group = "dev.kord", name = "kord-core", version = "feature-native-SNAPSHOT" }

[plugins]
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-plugin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 4 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Wed Feb 05 15:19:42 CET 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 077f636

Please sign in to comment.