Skip to content

Commit

Permalink
Optionally enable kapt
Browse files Browse the repository at this point in the history
  • Loading branch information
AZWN committed Jul 24, 2023
1 parent 65c1024 commit 66fdc99
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 2 deletions.
14 changes: 14 additions & 0 deletions nabl2.terms/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ plugins {
}

fun compositeBuild(name: String) = "$group:$name:$version"
// Used for refsyn: disabled by default
fun kaptEnabled() = extra.has("kaptEnabled") && extra["kaptEnabled"] as Boolean
val spoofax2Version: String by ext
dependencies {
api(platform("org.metaborg:parent:$spoofax2Version"))
testImplementation(platform("org.metaborg:parent:$spoofax2Version"))
annotationProcessor(platform("org.metaborg:parent:$spoofax2Version"))
testAnnotationProcessor(platform("org.metaborg:parent:$spoofax2Version"))
if(kaptEnabled()) {
kapt(platform("org.metaborg:parent:$version"))
kaptTest(platform("org.metaborg:parent:$version"))
}

// !! Update dependencies in pom.xml as well

Expand All @@ -23,6 +29,10 @@ dependencies {
// Annotation processing
annotationProcessor("org.immutables:value")
annotationProcessor("org.immutables:serial")
if(kaptEnabled()) {
kapt("org.immutables:value")
kapt("org.immutables:serial")
}
compileOnly("org.immutables:value")
compileOnly("org.immutables:serial")
compileOnly("javax.annotation:javax.annotation-api")
Expand All @@ -36,6 +46,10 @@ dependencies {
// Test Annotation processing
testAnnotationProcessor("org.immutables:value")
testAnnotationProcessor("org.immutables:serial")
if(kaptEnabled()) {
kaptTest("org.immutables:value")
kaptTest("org.immutables:serial")
}
testCompileOnly("org.immutables:value")
testCompileOnly("org.immutables:serial")
testCompileOnly("javax.annotation:javax.annotation-api")
Expand Down
14 changes: 14 additions & 0 deletions p_raffrayi/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ plugins {
}

fun compositeBuild(name: String) = "$group:$name:$version"
// Used for refsyn: disabled by default
fun kaptEnabled() = extra.has("kaptEnabled") && extra["kaptEnabled"] as Boolean
val spoofax2Version: String by ext
dependencies {
api(platform("org.metaborg:parent:$spoofax2Version"))
testImplementation(platform("org.metaborg:parent:$spoofax2Version"))
annotationProcessor(platform("org.metaborg:parent:$spoofax2Version"))
testAnnotationProcessor(platform("org.metaborg:parent:$spoofax2Version"))
if(kaptEnabled()) {
kapt(platform("org.metaborg:parent:$version"))
kaptTest(platform("org.metaborg:parent:$version"))
}

// !! Update dependencies in pom.xml as well

Expand All @@ -22,6 +28,10 @@ dependencies {
// Annotation processing
annotationProcessor("org.immutables:value")
annotationProcessor("org.immutables:serial")
if(kaptEnabled()) {
kapt("org.immutables:value")
kapt("org.immutables:serial")
}
compileOnly("org.immutables:value")
compileOnly("org.immutables:serial")
compileOnly("javax.annotation:javax.annotation-api")
Expand All @@ -35,6 +45,10 @@ dependencies {
// Test Annotation processing
testAnnotationProcessor("org.immutables:value")
testAnnotationProcessor("org.immutables:serial")
if(kaptEnabled()) {
kaptTest("org.immutables:value")
kaptTest("org.immutables:serial")
}
testCompileOnly("org.immutables:value")
testCompileOnly("org.immutables:serial")
testCompileOnly("javax.annotation:javax.annotation-api")
Expand Down
14 changes: 14 additions & 0 deletions scopegraph/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ plugins {
}

fun compositeBuild(name: String) = "$group:$name:$version"
// Used for refsyn: disabled by default
fun kaptEnabled() = extra.has("kaptEnabled") && extra["kaptEnabled"] as Boolean
val spoofax2Version: String by ext
dependencies {
api(platform("org.metaborg:parent:$spoofax2Version"))
testImplementation(platform("org.metaborg:parent:$spoofax2Version"))
annotationProcessor(platform("org.metaborg:parent:$spoofax2Version"))
testAnnotationProcessor(platform("org.metaborg:parent:$spoofax2Version"))
if(kaptEnabled()) {
kapt(platform("org.metaborg:parent:$version"))
kaptTest(platform("org.metaborg:parent:$version"))
}

// !! Update dependencies in pom.xml as well

Expand All @@ -21,6 +27,10 @@ dependencies {
// Annotation processing
annotationProcessor("org.immutables:value")
annotationProcessor("org.immutables:serial")
if(kaptEnabled()) {
kapt("org.immutables:value")
kapt("org.immutables:serial")
}
compileOnly("org.immutables:value")
compileOnly("org.immutables:serial")
compileOnly("javax.annotation:javax.annotation-api")
Expand All @@ -34,6 +44,10 @@ dependencies {
// Test Annotation processing
testAnnotationProcessor("org.immutables:value")
testAnnotationProcessor("org.immutables:serial")
if(kaptEnabled()) {
kaptTest("org.immutables:value")
kaptTest("org.immutables:serial")
}
testCompileOnly("org.immutables:value")
testCompileOnly("org.immutables:serial")
testCompileOnly("javax.annotation:javax.annotation-api")
Expand Down
19 changes: 17 additions & 2 deletions statix.solver/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
plugins {
id("org.metaborg.gradle.config.java-library")
id("org.metaborg.gradle.config.junit-testing")
id("org.metaborg.gradle.config.java-library") version("0.4.7")
id("org.metaborg.gradle.config.junit-testing") version("0.4.7")
}

fun compositeBuild(name: String) = "$group:$name:$version"
// Used for refsyn: disabled by default
fun kaptEnabled() = extra.has("kaptEnabled") && extra["kaptEnabled"] as Boolean
val spoofax2Version: String by ext
dependencies {
api(platform("org.metaborg:parent:$spoofax2Version"))
testImplementation(platform("org.metaborg:parent:$spoofax2Version"))
annotationProcessor(platform("org.metaborg:parent:$spoofax2Version"))
testAnnotationProcessor(platform("org.metaborg:parent:$spoofax2Version"))
if(kaptEnabled()) {
kapt(platform("org.metaborg:parent:$version"))
kaptTest(platform("org.metaborg:parent:$version"))
}

// !! Update dependencies in pom.xml as well

Expand All @@ -26,9 +32,14 @@ dependencies {
// Annotation processing
annotationProcessor("org.immutables:value")
annotationProcessor("org.immutables:serial")
if(kaptEnabled()) {
kapt("org.immutables:value")
kapt("org.immutables:serial")
}
compileOnly("org.immutables:value")
compileOnly("org.immutables:serial")
compileOnly("javax.annotation:javax.annotation-api")
compileOnly("javax.inject:javax.inject:1")

// Tests
testImplementation("junit:junit")
Expand All @@ -39,6 +50,10 @@ dependencies {
// Test Annotation processing
testAnnotationProcessor("org.immutables:value")
testAnnotationProcessor("org.immutables:serial")
if(kaptEnabled()) {
kaptTest("org.immutables:value")
kaptTest("org.immutables:serial")
}
testCompileOnly("org.immutables:value")
testCompileOnly("org.immutables:serial")
testCompileOnly("javax.annotation:javax.annotation-api")
Expand Down

0 comments on commit 66fdc99

Please sign in to comment.