init commit

Signed-off-by: Faumaray <faumaray@gmail.com>
This commit is contained in:
faumaray committed 2025-10-15 17:41:37 +03:00
commit a78c6a3bb6
21 files changed
+1238

No files matched your search

+56
View File
@@ -0,0 +1,56 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This project uses @Incubating APIs which are subject to change.
*/
plugins {
// Apply the java-library plugin for API and implementation separation.
`java-library`
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
version = "1.0.0"
tasks.withType<Jar>().configureEach {
archiveBaseName.set(rootProject.name)
from(sourceSets.main.get().output)
dependsOn(configurations.runtimeClasspath)
from({
configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) }
})
val cppProject = project(":CppAgent")
val nativeLibPath = cppProject.layout.buildDirectory
.dir("lib/main/debug") // or "release" if you're building release
.map { it.asFile }
.get()
.listFiles { file -> file.name.matches(Regex("lib.*\\.(so|dll|dylib)")) }
?.firstOrNull()
if (nativeLibPath != null) {
from(nativeLibPath) {
into(".") // 👈 root of the jar
}
} else {
doFirst {
throw GradleException("Native library not found in expected CppAgent build path")
}
}
manifest {
attributes(
"Main-Class" to "org.faumaray.FabricPPAgent",
"Agent-Class" to "org.faumaray.FabricPPAgent",
"Premain-Class" to "org.faumaray.FabricPPAgent"
)
}
}
tasks.named("compileJava") {
dependsOn(":CppAgent:build")
}