Skip to content

Commit

Permalink
Merge branch 'master' into feature/jdk-21
Browse files Browse the repository at this point in the history
# Conflicts:
#	klang/build.gradle.kts
#	klang/gradle-plugin/build.gradle.kts
  • Loading branch information
Alexandre Mommers committed Dec 7, 2023
2 parents ec9a3e5 + 5889fb0 commit d885c26
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 143 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish klang

on:
release:
types: [created]

jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
cache: 'gradle'
- name: Build and publish with Gradle
run: |
cd ./klang
./gradlew build publish --info
env:
VERSION: ${{ github.event.release.tag_name }}
URL: ${{ vars.GITLAB_URL }}
TOKEN: ${{ secrets.GITLAB_TOKEN }}

46 changes: 37 additions & 9 deletions klang/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,25 @@ plugins {
id("org.jetbrains.kotlinx.kover") version "0.7.3"
}

val projectVersion = System.getenv("VERSION")
?.takeIf { it.isNotBlank() }
?: "0.0.0"

allprojects {
apply(plugin = "maven-publish")
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "org.jetbrains.kotlin.plugin.serialization")
apply(plugin = "org.jetbrains.kotlinx.kover")

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

group = "io.ygdrasil"
version = "1.0.0-SNAPSHOT"
}
version = projectVersion

kotlin {
jvmToolchain(17)
kotlin {
jvmToolchain(17)

sourceSets.all {
languageSettings {
Expand All @@ -26,7 +33,28 @@ kotlin {
languageVersion = "2.0"
}


}
publishing {

publications {
create<MavenPublication>("maven") {
from(components["java"])
}
}

repositories {
maven {
name = "GitLab"
url = uri(System.getenv("URL") ?: "")
credentials(HttpHeaderCredentials::class) {
name = "Deploy-Token"
value = System.getenv("TOKEN")
}
authentication {
create<HttpHeaderAuthentication>("header")
}
}
}
}
}


14 changes: 0 additions & 14 deletions klang/docker-toolkit/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
plugins {
kotlin("jvm")
id("org.jetbrains.kotlinx.kover")
id("maven-publish")
}

dependencies {
implementation("io.github.microutils:kotlin-logging:1.7.4")
implementation("org.slf4j:slf4j-simple:1.7.26")
Expand All @@ -14,11 +8,3 @@ dependencies {
tasks.test {
useJUnitPlatform()
}

publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
}
}
}
15 changes: 6 additions & 9 deletions klang/gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
plugins {
id("com.gradle.plugin-publish") version "1.0.0"
kotlin("jvm")
kotlin("jvm") version "1.9.0"
}

gradlePlugin {
plugins {
create("klang") {
id = "io.ygdrasil.klang"
create("klang-plugin") {
id = "io.ygdrasil.klang-plugin"
implementationClass = "io.ygdrasil.KlangPlugin"
}
}
}

group = "io.ygdrasil"
version = "1.0.0-SNAPSHOT"


dependencies {
api(project(":klang"))
api(project(":docker-toolkit"))
Expand All @@ -24,5 +20,6 @@ dependencies {
}

tasks.test {
useJUnitPlatform()
}
useJUnitPlatform()
}

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class KlangPluginTest : FreeSpec({

"klang gradle plugin add generateBinding task" {
val project = ProjectBuilder.builder().build();
project.pluginManager.apply("io.ygdrasil.klang");
project.pluginManager.apply("io.ygdrasil.klang-plugin");

project.tasks.getByName("generateBinding") shouldNotBe null
}
Expand Down
16 changes: 0 additions & 16 deletions klang/klang/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent

plugins {
kotlin("jvm")
kotlin("plugin.serialization")
id("org.jetbrains.kotlinx.kover")
id("maven-publish")
}

tasks.test {
useJUnitPlatform()
maxHeapSize = "4g"
Expand Down Expand Up @@ -36,12 +29,3 @@ dependencies {
api(libs.kotlinpoet)
testImplementation(libs.kotest)
}


publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
}
}
}
42 changes: 0 additions & 42 deletions klang/libclang-generator/.gitignore

This file was deleted.

11 changes: 0 additions & 11 deletions klang/libclang-generator/build.gradle.kts

This file was deleted.

18 changes: 0 additions & 18 deletions klang/libclang-generator/src/main/kotlin/generate.kt

This file was deleted.

17 changes: 1 addition & 16 deletions klang/libclang/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask

plugins {
kotlin("jvm")
id("maven-publish")
}

dependencies {
api ("net.java.dev.jna:jna:5.13.0")
api("net.java.dev.jna:jna:5.13.0")
}

publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
}
}
}
1 change: 0 additions & 1 deletion klang/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
rootProject.name = "klang-toolkit"

include("docker-toolkit", "klang", "libclang", "toolkit-old")
include("libclang-generator")
include("gradle-plugin")
findProject(":gradle-plugin")?.name = "klang-gradle-plugin"
11 changes: 5 additions & 6 deletions klang/toolkit-old/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@

plugins {
kotlin("jvm")
kotlin("jvm")
id("org.jetbrains.kotlinx.kover")
}

repositories {
mavenCentral()
mavenCentral()
}

dependencies {
implementation (project(":libclang"))
implementation(project(":libclang"))
testImplementation(libs.kotest)
}

tasks.withType<Test>().configureEach {
useJUnitPlatform()
forkEvery = 1
useJUnitPlatform()
forkEvery = 1
exclude("klang/**")
}

0 comments on commit d885c26

Please sign in to comment.