Add support for tjava
This commit is contained in:
+59
-7
@@ -32,14 +32,18 @@ repositories {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
val detag by configurations.creating {
|
||||||
implementation(platform("org.apache.logging.log4j:log4j-bom:2.25.2"))
|
isCanBeConsumed = false
|
||||||
implementation("org.apache.logging.log4j:log4j-api")
|
isCanBeResolved = true
|
||||||
runtimeOnly("org.apache.logging.log4j:log4j-core")
|
}
|
||||||
compileOnly("org.jetbrains:annotations:26.0.2-1")
|
|
||||||
|
|
||||||
implementation("com.r35157.libs:valuetypes-basic-api:0.1-dev")
|
dependencies {
|
||||||
implementation("com.r35157.nenjim:valuetypes-api:0.1-dev")
|
detag("com.r35157.tools:detag-impl_ref:0.1-dev")
|
||||||
|
compileOnly("org.jetbrains:annotations:26.1.0")
|
||||||
|
runtimeOnly("org.apache.logging.log4j:log4j-core:2.26.0")
|
||||||
|
runtimeOnly("org.apache.logging.log4j:log4j-slf4j2-impl:2.26.0")
|
||||||
|
|
||||||
|
implementation("org.slf4j:slf4j-api:2.0.18")
|
||||||
implementation("com.r35157.nenjim:hubd-api:0.1-dev")
|
implementation("com.r35157.nenjim:hubd-api:0.1-dev")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,6 +53,54 @@ java {
|
|||||||
|
|
||||||
tasks.withType<JavaCompile>().configureEach {
|
tasks.withType<JavaCompile>().configureEach {
|
||||||
options.release.set(25)
|
options.release.set(25)
|
||||||
|
options.compilerArgs.addAll(listOf("-Xmaxerrs", "1"))
|
||||||
|
}
|
||||||
|
|
||||||
|
val generatedDetagMain = layout.buildDirectory.dir("generated/sources/detag/main/java")
|
||||||
|
|
||||||
|
val cleanGeneratedDetagMain by tasks.registering(Delete::class) {
|
||||||
|
delete(generatedDetagMain)
|
||||||
|
}
|
||||||
|
|
||||||
|
val detagMain by tasks.registering(JavaExec::class) {
|
||||||
|
group = "build"
|
||||||
|
description = "Generates Java sources from .tjava files"
|
||||||
|
|
||||||
|
classpath = detag
|
||||||
|
mainClass.set("com.r35157.tools.detag.impl.ref.Main")
|
||||||
|
|
||||||
|
val configFile = layout.projectDirectory.file("../detag.conf")
|
||||||
|
val sourceRoot = layout.projectDirectory.dir("src/main/tjava")
|
||||||
|
|
||||||
|
inputs.file(configFile)
|
||||||
|
inputs.dir(sourceRoot)
|
||||||
|
outputs.dir(generatedDetagMain)
|
||||||
|
|
||||||
|
dependsOn(cleanGeneratedDetagMain)
|
||||||
|
|
||||||
|
args(
|
||||||
|
"--config", configFile.asFile.absolutePath,
|
||||||
|
"--source-root", sourceRoot.asFile.absolutePath,
|
||||||
|
"--out", generatedDetagMain.get().asFile.absolutePath
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
// Human-written Detag source files. IntelliJ should treat this as a source root.
|
||||||
|
// Gradle's Java compiler will still only compile .java files directly from sourceSets,
|
||||||
|
// so the .tjava files are not compiled directly.
|
||||||
|
java.srcDir("src/main/tjava")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.named<JavaCompile>("compileJava") {
|
||||||
|
dependsOn(detagMain)
|
||||||
|
|
||||||
|
// Compiler input generated from src/main/tjava.
|
||||||
|
// Do not add this directory to sourceSets, or IntelliJ will see duplicate classes:
|
||||||
|
// MyClass.tjava + build/generated/.../MyClass.java.
|
||||||
|
source(generatedDetagMain)
|
||||||
}
|
}
|
||||||
|
|
||||||
val libsDir = layout.buildDirectory.dir("libs")
|
val libsDir = layout.buildDirectory.dir("libs")
|
||||||
|
|||||||
+2
-3
@@ -2,7 +2,6 @@ package com.r35157.nenjim.hubd.impl.ref;
|
|||||||
|
|
||||||
import com.r35157.nenjim.hubd.ctx.Context;
|
import com.r35157.nenjim.hubd.ctx.Context;
|
||||||
import com.r35157.nenjim.hubd.ctx.ContextManager;
|
import com.r35157.nenjim.hubd.ctx.ContextManager;
|
||||||
import com.r35157.nenjim.valuetypes.ctx.ContextId;
|
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@@ -17,12 +16,12 @@ public class ContextManagerImpl implements ContextManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Context get(ContextId contextId) {
|
public Context get(ΩContextIdΩ contextId) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<ContextId> getList() {
|
public Set<ΩContextIdΩ> getList() {
|
||||||
return Set.of();
|
return Set.of();
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user