Split annotations to separate project

Use fabric mixin dependency
Enable preview features for annotation processor only
This commit is contained in:
Fury_Phoenix 2023-12-03 11:11:10 -08:00
parent 631913cbf9
commit 4645c26227
No known key found for this signature in database
GPG Key ID: 0595F98084987DB8
8 changed files with 25 additions and 3 deletions

View File

@ -5,12 +5,24 @@ plugins {
repositories { repositories {
mavenCentral() mavenCentral()
maven {
name "Fabric"
url uri("https://maven.fabricmc.net")
}
} }
dependencies { dependencies {
implementation 'com.google.code.gson:gson:2.10.1' implementation 'com.google.code.gson:gson:2.10.1'
annotationProcessor 'com.google.auto.service:auto-service:1.1.1' annotationProcessor 'com.google.auto.service:auto-service:1.1.1'
compileOnly 'com.google.auto.service:auto-service:1.1.1' compileOnly 'com.google.auto.service:auto-service:1.1.1'
implementation "net.fabricmc:sponge-mixin:0.12.5+"
implementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
implementation project(":annotations")
}
tasks.withType(JavaCompile) {
options.compilerArgs += '--enable-preview'
} }
spotless { spotless {
@ -18,4 +30,4 @@ spotless {
removeUnusedImports() removeUnusedImports()
} }
} }
version = '1.0' version = '1.1.0'

6
annotations/build.gradle Normal file
View File

@ -0,0 +1,6 @@
plugins {
id 'modernfix.common-conventions'
id 'java-library'
}
version = '1.0.0'

View File

@ -16,6 +16,7 @@ dependencies {
parchment("org.parchmentmc.data:parchment-${minecraft_version}:${parchment_version}@zip") parchment("org.parchmentmc.data:parchment-${minecraft_version}:${parchment_version}@zip")
} }
} }
implementation project(":annotations")
annotationProcessor project(":annotation-processor") annotationProcessor project(":annotation-processor")
} }
@ -30,6 +31,8 @@ tasks {
} }
tasks.withType(JavaCompile) { tasks.withType(JavaCompile) {
options.fork = true
options.forkOptions.jvmArgs << '--enable-preview'
configure(options) { configure(options) {
options.compilerArgs << "-ArootProject.name=${rootProject.name}" << "-Aproject.name=${project.name}" options.compilerArgs << "-ArootProject.name=${rootProject.name}" << "-Aproject.name=${project.name}"
} }

View File

@ -8,6 +8,7 @@ pluginManagement {
} }
include("annotation-processor") include("annotation-processor")
include("annotations")
include("test_agent") include("test_agent")
include("common") include("common")