Skip to content
Snippets Groups Projects
Verified Commit dfab40da authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

build: restructure build tools

parent 25d070b8
Branches
Tags
No related merge requests found
......@@ -8,5 +8,6 @@
*/
plugins {
id("com.vanniktech.maven.publish")
id("justjanne.kotlin")
id("justjanne.publication")
}
#
# 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/.
#
POM_ARTIFACT_ID=libquassel-annotations
POM_NAME=libquassel Annotations
POM_DESCRIPTION=Annotations for the libquassel code generator
......@@ -8,14 +8,16 @@
*/
plugins {
id("com.vanniktech.maven.publish")
id("justjanne.kotlin")
id("justjanne.publication")
id("jacoco-report-aggregation")
}
dependencies {
api(project(":libquassel-protocol"))
val testcontainersCiVersion: String by project
testImplementation("de.justjanne", "testcontainers-ci", testcontainersCiVersion)
val sl4jVersion: String by project
implementation("org.slf4j", "slf4j-simple", sl4jVersion)
testImplementation(libs.testcontainers)
implementation(libs.slf4j)
}
tasks.check {
dependsOn(tasks.named<JacocoReport>("testCodeCoverageReport"))
}
#
# 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/.
#
POM_ARTIFACT_ID=libquassel-client
POM_NAME=libquassel Client
POM_DESCRIPTION=High-Level Client interface for Quassel
......@@ -7,14 +7,13 @@
* obtain one at https://mozilla.org/MPL/2.0/.
*/
repositories {
google()
plugins {
id("justjanne.kotlin")
id("justjanne.publication")
}
dependencies {
val kspVersion: String by project
implementation("com.google.devtools.ksp", "symbol-processing-api", kspVersion)
implementation(project(":libquassel-annotations"))
val kotlinPoetVersion: String by project
implementation("com.squareup", "kotlinpoet", kotlinPoetVersion)
implementation(libs.ksp)
implementation(libs.kotlinpoet)
}
......@@ -27,7 +27,7 @@ data class RpcFunctionAnnotation(
val annotation = it.findAnnotationWithType<SyncedCall>(resolver)
?: return null
return RpcFunctionAnnotation(
name = annotation.getMember("name"),
name = annotation.getMember<String>("name")?.ifBlank { null },
target = annotation.getMember<KSType>("target")
?.toEnum<ProtocolSide>(),
)
......
......@@ -27,11 +27,16 @@ class KotlinSaver : KotlinModelVisitor<CodeGenerator, Unit> {
"Source may not be empty. Sources was empty for $model"
}
val writer = data.createNewFile(
val file = try {
data.createNewFile(
generateDependencies(model.source),
model.data.packageName,
model.data.name
).bufferedWriter(Charsets.UTF_8)
)
} catch (_: FileAlreadyExistsException) {
return
}
val writer = file.bufferedWriter(Charsets.UTF_8)
model.data.writeTo(writer)
try {
writer.close()
......
......@@ -8,20 +8,16 @@
*/
plugins {
id("java-library")
id("com.vanniktech.maven.publish")
id("com.google.devtools.ksp") version "1.5.10-1.0.0-beta01"
id("justjanne.kotlin")
id("justjanne.publication")
}
dependencies {
val threetenBpVersion: String by project
api("org.threeten", "threetenbp", threetenBpVersion)
val kotlinBitflagsVersion: String by project
api("de.justjanne", "kotlin-bitflags", kotlinBitflagsVersion)
val bouncyCastleVersion: String by project
implementation("org.bouncycastle", "bcpkix-jdk15on", bouncyCastleVersion)
val sl4jVersion: String by project
implementation("org.slf4j", "slf4j-simple", sl4jVersion)
api(project(":libquassel-annotations"))
ksp(project(":libquassel-generator"))
api(libs.threetenbp)
api(libs.kotlin.bitflags)
implementation(libs.bouncycastle)
implementation(libs.slf4j)
testImplementation(libs.hamcrest)
}
#
# 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/.
#
POM_ARTIFACT_ID=libquassel-protocol
POM_NAME=libquassel Protocol
POM_DESCRIPTION=Library implementing Quassel's transport-level protocol in Kotlin
......@@ -6,9 +6,12 @@
* 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/.
*/
enableFeaturePreview("VERSION_CATALOGS")
rootProject.name = "libquassel"
includeBuild("gradle/convention")
include(
":libquassel-annotations",
":libquassel-protocol",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment