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

chore: drop proto packages #1239

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 0 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,6 @@ dependencies {
kover(projects.packages.graalvmPy)
kover(projects.packages.graalvmRb)
kover(projects.packages.http)
kover(projects.packages.proto.protoCore)
kover(projects.packages.proto.protoKotlinx)
kover(projects.packages.proto.protoProtobuf)
kover(projects.packages.server)
kover(projects.packages.ssr)
kover(projects.packages.test)
Expand Down Expand Up @@ -355,7 +352,6 @@ apiValidation {
"transport-kqueue",
"transport-epoll",
"transport-uring",
"proto",
"reports",
).plus(
if (buildAuxImage == "true") {
Expand Down
4 changes: 4 additions & 0 deletions packages/base/api/base.api
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ public class elide/jvm/ResourceManager : elide/jvm/LifecycleBoundResources, java
public fun unregister (Ljava/lang/AutoCloseable;)V
}

public abstract interface class elide/proto/api/Named {
public abstract fun getName ()Ljava/lang/String;
}

public final class elide/runtime/LogLevel : java/lang/Enum {
public static final field DEBUG Lelide/runtime/LogLevel;
public static final field ERROR Lelide/runtime/LogLevel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 Elide Technologies, Inc.
* Copyright (c) 2024-2025 Elide Technologies, Inc.
*
* Licensed under the MIT license (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
Expand All @@ -14,11 +14,13 @@
package elide.proto.api

/**
* TBD.
* ## Named
*
* Simple interface for a thing which is associated with a name.
*/
public interface Named {
/**
* TBD.
* Name of the thing.
*/
public val name: String
}
46,185 changes: 46,185 additions & 0 deletions packages/graalvm/api/graalvm.api

Large diffs are not rendered by default.

50 changes: 47 additions & 3 deletions packages/graalvm/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
"DSL_SCOPE_VIOLATION",
)

import com.google.protobuf.gradle.id
import com.google.protobuf.gradle.proto
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import kotlinx.benchmark.gradle.JvmBenchmarkTarget
import kotlinx.benchmark.gradle.benchmark
Expand All @@ -30,6 +32,7 @@ plugins {
kotlin("plugin.allopen")
kotlin("plugin.serialization")

alias(libs.plugins.protobuf)
alias(libs.plugins.micronaut.minimal.library)
alias(libs.plugins.micronaut.graalvm)
id("org.graalvm.buildtools.native")
Expand All @@ -56,7 +59,7 @@ val enableTransportV2 = false
val ktCompilerArgs = emptyList<String>()
val javacArgs = listOf(
"--add-exports=java.base/jdk.internal.module=ALL-UNNAMED",
"--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk",
"--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk=ALL-UNNAMED",
"--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.hosted=ALL-UNNAMED",
"--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.hosted.c=ALL-UNNAMED",
)
Expand Down Expand Up @@ -116,6 +119,7 @@ elide {
spotless = true
diktat = false
ktlint = false
checkstyle = false // protobuf files
}
}

Expand Down Expand Up @@ -149,8 +153,16 @@ java {
sourceSets {
val main by getting {
java.srcDirs(
layout.projectDirectory.dir("src/main/java9")
layout.projectDirectory.dir("src/main/java9"),
layout.buildDirectory.dir("generated/proto/main/java"),
)
kotlin.srcDirs(
layout.projectDirectory.dir("src/main/kotlin"),
layout.buildDirectory.dir("generated/proto/main/kotlin"),
)
proto {
srcDir("${rootProject.projectDir}/proto")
}
}
if (enableBenchmarks) {
val benchmarks by creating {
Expand Down Expand Up @@ -332,6 +344,19 @@ val testLibArgs = sharedLibArgs.plus(
"--initialize-at-run-time=org.gradle.internal.nativeintegration.services.NativeServices${'$'}NativeFeatures${'$'}3",
))

protobuf {
protoc {
artifact = "com.google.protobuf:protoc:${libs.versions.protobuf.get()}"
}
generateProtoTasks {
ofSourceSet("main").forEach {
it.builtins {
id("kotlin")
}
}
}
}

graalvmNative {
testSupport = true
useArgFile = true
Expand Down Expand Up @@ -448,6 +473,16 @@ dependencies {
api(projects.packages.graalvmTs)
api(projects.packages.graalvmWasm)

// Protocol Dependencies
implementation(libs.google.common.html.types.proto) {
exclude(group = "com.google.protobuf", module = "protobuf-java")
exclude(group = "com.google.protobuf", module = "protobuf-util")
}
api(libs.google.common.html.types.types) {
exclude(group = "com.google.protobuf", module = "protobuf-java")
exclude(group = "com.google.protobuf", module = "protobuf-util")
}

// GraalVM / Truffle
api(libs.graalvm.truffle.api)
api(libs.graalvm.truffle.runtime)
Expand Down Expand Up @@ -521,7 +556,6 @@ dependencies {

implementation(libs.protobuf.java)
implementation(libs.protobuf.kotlin)
implementation(projects.packages.proto.protoProtobuf)

api(libs.graalvm.polyglot)
api(libs.graalvm.js.language)
Expand Down Expand Up @@ -622,7 +656,16 @@ tasks {
}
}

afterEvaluate {
listOf(named("kaptKotlin")).forEach { task ->
task.configure {
dependsOn(generateProto)
}
}
}

compileJava {
dependsOn(generateProto)
options.javaModuleVersion = version as String
if (enableJpms) modularity.inferModulePath = true

Expand All @@ -634,6 +677,7 @@ tasks {
}

compileTestJava {
dependsOn(generateProto)
options.javaModuleVersion = version as String
if (enableJpms) modularity.inferModulePath = true

Expand Down
Loading
Loading