Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • justJanne/libquassel
1 result
Show changes
Commits on Source (2)
Showing
with 560 additions and 205 deletions
......@@ -5,3 +5,27 @@ insert_final_newline = true
indent_style = space
indent_size = 2
max_line_length = 120
[{*.mod,*.dtd,*.ent,*.elt}]
indent_style = space
indent_size = 2
[{*.jhm,*.rng,*.wsdl,*.fxml,*.xslt,*.jrxml,*.ant,*.xul,*.xsl,*.xsd,*.tld,*.jnlp,*.xml}]
indent_style = space
indent_size = 2
[*.json]
indent_style = space
indent_size = 2
[*.java]
indent_style = space
indent_size = 2
[{*.kts,*.kt}]
indent_style = space
indent_size = 2
[{*.yml,*.yaml}]
indent_style = space
indent_size = 2
......@@ -9,8 +9,12 @@
plugins {
id("justjanne.version")
id("justjanne.dokka")
id("justjanne.publish-maven-central")
alias(libs.plugins.kotlin) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.dokka) apply false
alias(libs.plugins.ktlint) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.nexus.publish) apply false
idea
eclipse
}
......
......@@ -9,15 +9,32 @@ repositories {
}
dependencies {
implementation("io.github.gradle-nexus:publish-plugin:1.1.0")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10")
implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.6.10")
implementation("com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:1.6.10-1.0.4")
implementation("org.jlleitschuh.gradle:ktlint-gradle:10.2.1")
compileOnly(libs.nexus.publish.gradlePlugin)
compileOnly(libs.kotlin.gradlePlugin)
compileOnly(libs.dokka.gradlePlugin)
compileOnly(libs.ksp.gradlePlugin)
compileOnly(libs.ktlint.gradlePlugin)
}
gradlePlugin {
plugins {
register("kotlin") {
id = "justjanne.kotlin"
implementationClass = "KotlinConvention"
}
register("publication") {
id = "justjanne.publication"
implementationClass = "PublicationConvention"
}
register("version") {
id = "justjanne.version"
implementationClass = "VersionConvention"
}
}
}
configure<JavaPluginExtension> {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
languageVersion.set(JavaLanguageVersion.of(17))
}
}
rootProject.name = "convention"
dependencyResolutionManagement {
repositories {
gradlePluginPortal()
mavenCentral()
google()
}
versionCatalogs {
create("libs") {
from(files("../libs.versions.toml"))
}
}
}
/*
* Quasseldroid - Quassel client for Android
*
* Copyright (c) 2024 Janne Mareike Koschinski
* Copyright (c) 2024 The Quassel Project
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3 as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import org.gradle.api.JavaVersion
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.artifacts.VersionCatalogsExtension
import org.gradle.api.plugins.JavaPluginExtension
import org.gradle.api.tasks.testing.Test
import org.gradle.jvm.toolchain.JavaLanguageVersion
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.getByType
import org.gradle.kotlin.dsl.provideDelegate
import org.gradle.kotlin.dsl.repositories
import org.gradle.kotlin.dsl.withType
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
class KotlinConvention : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
with(pluginManager) {
apply("org.jetbrains.kotlin.jvm")
apply("com.google.devtools.ksp")
apply("org.jetbrains.dokka")
apply("org.jlleitschuh.gradle.ktlint")
apply("org.jetbrains.kotlin.plugin.serialization")
}
version = rootProject.version
group = rootProject.group
repositories {
mavenCentral()
}
// Use withType to workaround https://youtrack.jetbrains.com/issue/KT-55947
tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
// Set JVM target to 11
jvmTarget.set(JvmTarget.JVM_11)
// Treat all Kotlin warnings as errors (disabled by default)
// Override by setting warningsAsErrors=true in your ~/.gradle/gradle.properties
val warningsAsErrors: String? by target
allWarningsAsErrors.set(warningsAsErrors.toBoolean())
freeCompilerArgs.add(
"-opt-in=kotlin.ExperimentalUnsignedTypes"
)
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
val libs = extensions.getByType<VersionCatalogsExtension>().named("libs")
dependencies {
add("implementation", libs.findLibrary("kotlin-stdlib").get())
add("implementation", libs.findLibrary("kotlinx-coroutines-core").get())
add("testImplementation", libs.findLibrary("kotlinx-coroutines-test").get())
add("testImplementation", libs.findLibrary("junit-api").get())
add("testImplementation", libs.findLibrary("junit-params").get())
add("testImplementation", libs.findLibrary("junit-kotlin").get())
add("testRuntimeOnly", libs.findLibrary("junit-engine").get())
}
configure<JavaPluginExtension> {
// Up to Java 11 APIs are available through desugaring
// https://developer.android.com/studio/write/java11-minimal-support-table
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
withJavadocJar()
withSourcesJar()
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
}
}
}
/*
* Quasseldroid - Quassel client for Android
*
* Copyright (c) 2024 Janne Mareike Koschinski
* Copyright (c) 2024 The Quassel Project
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3 as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import io.github.gradlenexus.publishplugin.NexusPublishExtension
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.get
import org.gradle.kotlin.dsl.getByType
import org.gradle.kotlin.dsl.repositories
import org.gradle.plugins.signing.SigningExtension
class PublicationConvention : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
with(pluginManager) {
apply("maven-publish")
apply("signing")
}
version = rootProject.version
group = rootProject.group
val canSign = project.properties.keys
.any { it.startsWith("signing.") }
configure<PublishingExtension> {
publications {
create("mavenJava", MavenPublication::class.java) {
val projectName = project.name
.removePrefix("core")
.removePrefix("-")
artifactId = buildArtifactName(
extractArtifactGroup(project.group as String),
rootProject.name,
projectName.ifEmpty { null }
)
from(components["java"])
pom {
name.set(buildHumanReadableName(artifactId))
description.set("Pure-Kotlin implementation of the Quassel Protocol")
url.set("https://git.kuschku.de/justJanne/libquassel")
licenses {
license {
name.set("Mozilla Public License Version 2.0")
url.set("https://www.mozilla.org/en-US/MPL/2.0/")
}
}
developers {
developer {
id.set("justJanne")
name.set("Janne Mareike Koschinski")
}
}
scm {
connection.set("scm:git:https://git.kuschku.de/justJanne/libquassel.git")
developerConnection.set("scm:git:ssh://git.kuschku.de:2222/justJanne/libquassel.git")
url.set("https://git.kuschku.de/justJanne/libquassel")
}
}
}
}
}
if (canSign) {
configure<SigningExtension> {
sign(extensions.getByType<PublishingExtension>().publications["maven"])
}
configure<NexusPublishExtension> {
repositories {
sonatype()
}
}
}
}
}
private fun buildArtifactName(group: String? = null, project: String? = null, module: String? = null): String {
return removeConsecutive(listOfNotNull(group, project, module).flatMap { it.split('-') })
.joinToString("-")
}
private fun buildHumanReadableName(name: String) = name
.splitToSequence('-')
.joinToString(" ", transform = String::capitalize)
private fun extractArtifactGroup(group: String): String? {
// split into parts by domain separator
val elements = group.split('.')
// drop the tld/domain part, e.g. io.datalbry
val withoutDomain = elements.drop(2)
// if anything remains, that’s our artifact group
return withoutDomain.lastOrNull()
}
private fun <T> removeConsecutive(list: List<T>): List<T> {
val result = mutableListOf<T>()
for (el in list) {
if (el != result.lastOrNull()) {
result.add(el)
}
}
return result
}
}
/*
* Quasseldroid - Quassel client for Android
*
* Copyright (c) 2020 Janne Mareike Koschinski
* Copyright (c) 2020 The Quassel Project
* Copyright (c) 2024 Janne Mareike Koschinski
* Copyright (c) 2024 The Quassel Project
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3 as published
......@@ -17,22 +17,20 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.justjanne.libquassel.protocol.syncables.invoker
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.provider.Provider
import de.justjanne.libquassel.annotations.ProtocolSide
import de.justjanne.libquassel.protocol.util.reflect.objectByName
object Invokers {
private val registry: InvokerRegistry =
objectByName("${Invokers::class.java.`package`.name}.GeneratedInvokerRegistry")
fun get(side: ProtocolSide, name: String): Invoker? = when (side) {
ProtocolSide.CLIENT -> registry.clientInvokers[name]
ProtocolSide.CORE -> registry.coreInvokers[name]
class VersionConvention : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
version = git("describe", "--always", "--tags", "HEAD")
}
}
fun list(side: ProtocolSide): Set<String> = when (side) {
ProtocolSide.CLIENT -> registry.clientInvokers.keys
ProtocolSide.CORE -> registry.coreInvokers.keys
}
private fun Project.git(vararg command: String): Provider<String> =
providers.exec { commandLine("git", *command) }
.standardOutput
.asText
.map { it.trim() }
}
plugins {
java
jacoco
}
version = rootProject.version
group = rootProject.group
tasks.getByName("jacocoTestReport") {
enabled = false
}
tasks.withType<JavaCompile> {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
}
tasks.withType<Test> {
useJUnitPlatform()
}
configure<JavaPluginExtension> {
withJavadocJar()
withSourcesJar()
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("justjanne.java")
id("justjanne.dokka")
id("justjanne.ktlint")
id("com.google.devtools.ksp")
kotlin("jvm")
}
repositories {
mavenCentral()
google()
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.6.10")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.0")
testImplementation("org.junit.jupiter", "junit-jupiter-api", "5.8.2")
testImplementation("org.junit.jupiter", "junit-jupiter-params", "5.8.2")
testRuntimeOnly("org.junit.jupiter", "junit-jupiter-engine")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5:1.6.10")
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf(
"-opt-in=kotlin.ExperimentalUnsignedTypes"
)
jvmTarget = "1.8"
}
}
/*
* libquassel
* Copyright (c) 2022 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
plugins {
id("maven-publish")
id("signing")
}
version = rootProject.version
group = rootProject.group
val canSign = project.properties.keys
.any { it.startsWith("signing.") }
publishing {
publications {
create<MavenPublication>("maven") {
publication()
pom()
}
}
}
configure<SigningExtension> {
if (canSign) {
sign(publishing.publications["maven"])
}
}
fun MavenPublication.pom() {
pom {
name.set(buildHumanReadableName(artifactId))
description.set("Pure-Kotlin implementation of the Quassel Protocol")
url.set("https://git.kuschku.de/justJanne/libquassel")
licenses {
license {
name.set("Mozilla Public License Version 2.0")
url.set("https://www.mozilla.org/en-US/MPL/2.0/")
}
}
developers {
developer {
id.set("justJanne")
name.set("Janne Mareike Koschinski")
}
}
scm {
connection.set("scm:git:https://git.kuschku.de/justJanne/libquassel.git")
developerConnection.set("scm:git:ssh://git.kuschku.de:2222/justJanne/libquassel.git")
url.set("https://git.kuschku.de/justJanne/libquassel")
}
}
}
fun MavenPublication.publication() {
val projectName = project.name
.removePrefix("core")
.removePrefix("-")
artifactId = buildArtifactName(
extractArtifactGroup(project.group as String),
rootProject.name,
projectName.ifEmpty { null }
)
from(components["java"])
}
fun buildArtifactName(group: String? = null, project: String? = null, module: String? = null): String {
return removeConsecutive(listOfNotNull(group, project, module).flatMap { it.split('-') })
.joinToString("-")
}
fun buildHumanReadableName(name: String) = name
.splitToSequence('-')
.joinToString(" ", transform = String::capitalize)
fun extractArtifactGroup(group: String): String? {
// split into parts by domain separator
val elements = group.split('.')
// drop the tld/domain part, e.g. io.datalbry
val withoutDomain = elements.drop(2)
// if anything remains, that’s our artifact group
return withoutDomain.lastOrNull()
}
fun <T> removeConsecutive(list: List<T>): List<T> {
val result = mutableListOf<T>()
for (el in list) {
if (el != result.lastOrNull()) {
result.add(el)
}
}
return result
}
plugins {
id("io.github.gradle-nexus.publish-plugin")
}
val canSign = project.properties.keys
.any { it.startsWith("signing.") }
if (canSign) {
nexusPublishing {
repositories {
sonatype()
}
}
}
/*
* Quasseldroid - Quassel client for Android
*
* Copyright (c) 2024 Janne Mareike Koschinski
* Copyright (c) 2024 The Quassel Project
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3 as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package util
import org.gradle.api.Project
import org.gradle.api.provider.Provider
import java.util.*
[versions]
bouncycastle = "1.70"
kotlin = "2.0.21"
ksp = "2.0.21-1.0.28"
bouncycastle = "1.79"
dagger = "2.52"
dokka = "1.9.20"
hamcrest = "2.2"
junit = "5.11.3"
kotlin-bitflags = "1.3.0"
kotlinpoet = "1.10.2"
ksp = "1.6.10-1.0.4"
kotlinx-coroutines = "1.9.0"
kotlinx-serialization = "2.0.21"
ktlint = "12.1.1"
nexus-publish = "2.0.0"
room = "2.7.0-alpha07"
slf4j = "1.7.30"
testcontainers = "1.3.0"
threetenbp = "1.5.2"
sqlite = "2.5.0-alpha07"
threetenbp = "1.7.0"
[libraries]
bouncycastle = { module = "org.bouncycastle:bcpkix-jdk15on", version.ref = "bouncycastle" }
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin"}
bouncycastle = { module = "org.bouncycastle:bcpkix-jdk18on", version.ref = "bouncycastle" }
hamcrest = { module = "org.hamcrest:hamcrest-library", version.ref = "hamcrest" }
kotlin-bitflags = { module = "de.justjanne:kotlin-bitflags", version.ref = "kotlin-bitflags" }
kotlinpoet = { module = "com.squareup:kotlinpoet", version.ref = "kotlinpoet" }
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines"}
kotlinx-coroutines-test ={ module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinx-coroutines"}
ksp = { module = "com.google.devtools.ksp:symbol-processing-api", version.ref = "ksp" }
slf4j = { module = "org.slf4j:slf4j-simple", version.ref = "slf4j" }
testcontainers = { module = "de.justjanne:testcontainers-ci", version.ref = "testcontainers" }
threetenbp = { module = "org.threeten:threetenbp", version.ref = "threetenbp" }
dagger-core = { module = "com.google.dagger:dagger", version.ref = "dagger"}
dagger-compiler = { module = "com.google.dagger:dagger-compiler", version.ref = "dagger"}
junit-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit"}
junit-params = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "junit"}
junit-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit"}
junit-kotlin = { module = "org.jetbrains.kotlin:kotlin-test-junit5", version.ref = "kotlin"}
room-compiler = { module = "androidx.room:room-compiler", version.ref = "room" }
room-runtime = { module = "androidx.room:room-runtime", version.ref = "room" }
sqlite = { module = "androidx.sqlite:sqlite-bundled", version.ref = "sqlite" }
nexus-publish-gradlePlugin = { module = "io.github.gradle-nexus:publish-plugin", version.ref = "nexus-publish" }
kotlin-gradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
dokka-gradlePlugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" }
ksp-gradlePlugin = { module = "com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin", version.ref = "ksp" }
ktlint-gradlePlugin = { module = "org.jlleitschuh.gradle:ktlint-gradle", version.ref = "ktlint" }
[plugins]
nexus-publish = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "nexus-publish" }
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlinx-serialization" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" }
......@@ -11,5 +11,5 @@ package de.justjanne.libquassel.annotations
enum class ProtocolSide {
CLIENT,
CORE
CORE,
}
......@@ -10,7 +10,7 @@
package de.justjanne.libquassel.annotations
@Retention(AnnotationRetention.SOURCE)
annotation class SyncedCall(
annotation class RpcApi(
val name: String = "",
val target: ProtocolSide
val side: ProtocolSide
)
/*
* libquassel
* Copyright (c) 2021 Janne Mareike Koschinski
* Copyright (c) 2024 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
......@@ -10,6 +10,6 @@
package de.justjanne.libquassel.annotations
@Retention(AnnotationRetention.SOURCE)
annotation class SyncedObject(
val name: String
annotation class RpcCall(
val name: String = "",
)
/*
* libquassel
* Copyright (c) 2021 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.annotations
@Retention(AnnotationRetention.SOURCE)
annotation class RpcParam {
@Retention(AnnotationRetention.SOURCE)
annotation class Void
@Retention(AnnotationRetention.SOURCE)
annotation class Bool
@Retention(AnnotationRetention.SOURCE)
annotation class Char
@Retention(AnnotationRetention.SOURCE)
annotation class UChar
@Retention(AnnotationRetention.SOURCE)
annotation class Short
@Retention(AnnotationRetention.SOURCE)
annotation class UShort
@Retention(AnnotationRetention.SOURCE)
annotation class Int
@Retention(AnnotationRetention.SOURCE)
annotation class UInt
@Retention(AnnotationRetention.SOURCE)
annotation class Long
@Retention(AnnotationRetention.SOURCE)
annotation class ULong
@Retention(AnnotationRetention.SOURCE)
annotation class Float
@Retention(AnnotationRetention.SOURCE)
annotation class Double
@Retention(AnnotationRetention.SOURCE)
annotation class Uuid
@Retention(AnnotationRetention.SOURCE)
annotation class QDate
@Retention(AnnotationRetention.SOURCE)
annotation class QTime
@Retention(AnnotationRetention.SOURCE)
annotation class QDateTime
@Retention(AnnotationRetention.SOURCE)
annotation class QChar
@Retention(AnnotationRetention.SOURCE)
annotation class QString
@Retention(AnnotationRetention.SOURCE)
annotation class QStringList
@Retention(AnnotationRetention.SOURCE)
annotation class QByteArray
@Retention(AnnotationRetention.SOURCE)
annotation class QVariant
@Retention(AnnotationRetention.SOURCE)
annotation class QVariantMap
@Retention(AnnotationRetention.SOURCE)
annotation class QVariantList
@Retention(AnnotationRetention.SOURCE)
annotation class UserType(
val name: String
) {
@Retention(AnnotationRetention.SOURCE)
annotation class BufferId
@Retention(AnnotationRetention.SOURCE)
annotation class BufferInfo
@Retention(AnnotationRetention.SOURCE)
annotation class DccConfigIpDetectionMode
@Retention(AnnotationRetention.SOURCE)
annotation class DccConfigPortSelectionMode
@Retention(AnnotationRetention.SOURCE)
annotation class IrcUser
@Retention(AnnotationRetention.SOURCE)
annotation class IrcChannel
@Retention(AnnotationRetention.SOURCE)
annotation class Identity
@Retention(AnnotationRetention.SOURCE)
annotation class IdentityId
@Retention(AnnotationRetention.SOURCE)
annotation class Message
@Retention(AnnotationRetention.SOURCE)
annotation class MsgId
@Retention(AnnotationRetention.SOURCE)
annotation class NetworkId
@Retention(AnnotationRetention.SOURCE)
annotation class NetworkInfo
@Retention(AnnotationRetention.SOURCE)
annotation class NetworkServer
@Retention(AnnotationRetention.SOURCE)
annotation class QHostAddress
@Retention(AnnotationRetention.SOURCE)
annotation class TransferDirection
@Retention(AnnotationRetention.SOURCE)
annotation class TransferIdList
@Retention(AnnotationRetention.SOURCE)
annotation class TransferStatus
@Retention(AnnotationRetention.SOURCE)
annotation class PeerPtr
}
}
......@@ -7,16 +7,20 @@
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.models.alias
plugins {
id("justjanne.kotlin")
id("justjanne.publication")
}
data class Alias(
val name: String,
val expansion: String
) {
companion object {
fun of(name: String?, expansion: String?) = Alias(
name ?: "",
expansion ?: ""
)
}
dependencies {
api(project(":libquassel-annotations"))
ksp(project(":libquassel-generator"))
implementation(project(":libquassel-protocol"))
api(libs.threetenbp)
api(libs.kotlin.bitflags)
implementation(libs.bouncycastle)
implementation(libs.slf4j)
testImplementation(libs.hamcrest)
implementation(libs.dagger.core)
ksp(libs.dagger.compiler)
}
/*
* libquassel
* Copyright (c) 2022 Janne Mareike Koschinski
* Copyright (c) 2024 Janne Mareike Koschinski
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*/
plugins {
id("org.jetbrains.dokka")
}
package de.justjanne.libquassel.protocol.api
repositories {
mavenCentral()
google()
@JvmInline
value class ObjectName(val objectName: String) {
companion object {
val EMPTY = ObjectName("")
}
}
......@@ -7,15 +7,16 @@
* obtain one at https://mozilla.org/MPL/2.0/.
*/
package de.justjanne.libquassel.protocol.util.collections
package de.justjanne.libquassel.protocol.api.client
import de.justjanne.libquassel.protocol.models.types.QtType
import de.justjanne.libquassel.protocol.variant.QVariantList
import de.justjanne.libquassel.annotations.ProtocolSide
import de.justjanne.libquassel.annotations.RpcApi
import de.justjanne.libquassel.annotations.RpcParam
import de.justjanne.libquassel.annotations.RpcCall
import de.justjanne.libquassel.protocol.variant.QVariantMap
import de.justjanne.libquassel.protocol.variant.QVariant_
import de.justjanne.libquassel.protocol.variant.qVariant
fun List<QVariantMap>.transpose(): QVariantMap =
flatMap { it.keys }.toSet().map { key ->
Pair(key, qVariant(map { it[key] as QVariant_ }, QtType.QVariantList))
}.toMap()
@RpcApi("AliasManager", side = ProtocolSide.CORE)
interface AliasManagerClientApi {
@RpcCall("update")
fun update(@RpcParam.QVariantMap properties: QVariantMap)
}