Browse Source

Refactor with_kotlin(c) from bool to flags

Refactor with_kotlin(c) from bool to flags
4f48002306b62eb54db67dec6e06a31eb667af8a
dimdim11 1 year ago
parent
commit
1f5e61d528

+ 18 - 6
build/conf/java.conf

@@ -1774,11 +1774,15 @@ macro WITH_JDK() {
 
 # tag:kotlin-specific
 WITH_KOTLIN_VALUE=
+_WITH_KOTLIN_SEM=
+_KOTLIN_VERSION_SEM=
 ### @usage: WITH_KOTLIN()
 ###
 ### Compile kotlin source code in this java module
 macro WITH_KOTLIN() {
     SET(WITH_KOTLIN_VALUE yes)
+    SET(_WITH_KOTLIN_SEM && with_kotlin)
+    SET(_KOTLIN_VERSION_SEM && kotlin_version ${KOTLIN_VERSION})
 }
 
 # tag:kotlin-specific
@@ -1810,9 +1814,11 @@ macro KOTLINC_FLAGS(Args...) {
 
 # tag:kotlin-sppecific
 WITH_KOTLINC_PLUGIN_ALLOPEN=
+_WITH_KOTLINC_PLUGIN_ALLOPEN_SEM=
 macro _WITH_KOTLINC_ALLOPEN(Options...) {
     SET_APPEND(KOTLINC_OPTS_VALUE ${pre=-P plugin\:org.jetbrains.kotlin.allopen\::Options})
     SET(WITH_KOTLINC_PLUGIN_ALLOPEN yes)
+    SET(_WITH_KOTLINC_ALLOPEN_SEM && with_kotlinc_plugin_allopen)
 }
 
 # tag:kotlin-specific
@@ -1826,31 +1832,37 @@ macro WITH_KOTLINC_ALLOPEN(HEAD, TAIL...) {
 
 # tag:kotlin-specific
 WITH_KOTLINC_PLUGIN_LOMBOK=
+_WITH_KOTLINC_PLUGIN_LOMBOK_SEM=
 ### @usage: WITH_KOTLINC_LOMBOK(-flags)
 ###
 ### Enable lombok kotlin compiler plugin https://kotlinlang.org/docs/lombok.html
 macro WITH_KOTLINC_LOMBOK(Options...) {
     SET_APPEND(KOTLINC_OPTS_VALUE ${pre=-P plugin\:org.jetbrains.kotlin.lombok\::Options})
     SET(WITH_KOTLINC_PLUGIN_LOMBOK yes)
+    SET(_WITH_KOTLINC_PLUGIN_LOMBOK_SEM && with_kotlinc_plugin_lombok)
 }
 
 # tag:kotlin-specific
 WITH_KOTLINC_PLUGIN_NOARG=
+_WITH_KOTLINC_PLUGIN_NOARG_SEM=
 ### @usage: WITH_KOTLINC_NOARG(-flags)
 ###
 ### Enable noarg kotlin compiler plugin https://kotlinlang.org/docs/no-arg-plugin.html
 macro WITH_KOTLINC_NOARG(Options...) {
     SET_APPEND(KOTLINC_OPTS_VALUE ${pre=-P plugin\:org.jetbrains.kotlin.noarg\::Options})
     SET(WITH_KOTLINC_PLUGIN_NOARG yes)
+    SET(_WITH_KOTLINC_PLUGIN_NOARG_SEM && with_kotlinc_plugin_noarg)
 }
 
 # tag:kotlin-specific
 WITH_KOTLINC_PLUGIN_SERIALIZATION=
+_WITH_KOTLINC_PLUGIN_SERIALIZATION_SEM=
 ### @usage: WITH_KOTLINC_SERIALIZATION()
 ###
 ### Enable serialization kotlin compiler plugin https://kotlinlang.org/docs/serialization.html
 macro WITH_KOTLINC_SERIALIZATION() {
     SET(WITH_KOTLINC_PLUGIN_SERIALIZATION yes)
+    SET(_WITH_KOTLINC_PLUGIN_SERIALIZATION_SEM && with_kotlinc_plugin_serialization)
 }
 
 # tag:kotlin-specific
@@ -1860,12 +1872,12 @@ KOTLIN_BOM_FILE=${ARCADIA_ROOT}/contrib/java/org/jetbrains/kotlin/kotlin-bom/1.9
 GROOVY_VERSION=3.0.5
 
 _KOTLIN_SEM= \
-    && kotlin_version ${KOTLIN_VERSION} \
-    && with_kotlin ${WITH_KOTLIN_VALUE} \
-    && with_kotlinc_plugin_allopen ${WITH_KOTLINC_PLUGIN_ALLOPEN} \
-    && with_kotlinc_plugin_lombok ${WITH_KOTLINC_PLUGIN_LOMBOK} \
-    && with_kotlinc_plugin_noarg ${WITH_KOTLINC_PLUGIN_NOARG} \
-    && with_kotlinc_plugin_serialization ${WITH_KOTLINC_PLUGIN_SERIALIZATION}
+    ${_WITH_KOTLIN_SEM} \
+    ${_KOTLIN_VERSION_SEM} \
+    ${_WITH_KOTLINC_PLUGIN_ALLOPEN_SEM} \
+    ${_WITH_KOTLINC_PLUGIN_LOMBOK_SEM} \
+    ${_WITH_KOTLINC_PLUGIN_NOARG_SEM} \
+    ${_WITH_KOTLINC_PLUGIN_SERIALIZATION_SEM}
 
 
 _JAVA_PROTO_GRPC_SEM=

+ 5 - 5
build/export_generators/gradle/generator.toml

@@ -37,11 +37,11 @@ proto_grpc="flag"
 proto_grpc_version="str"
 
 kotlin_version="str"
-with_kotlin="bool"
-with_kotlinc_plugin_allopen="bool"
-with_kotlinc_plugin_lombok="bool"
-with_kotlinc_plugin_noarg="bool"
-with_kotlinc_plugin_serialization="bool"
+with_kotlin="flag"
+with_kotlinc_plugin_allopen="flag"
+with_kotlinc_plugin_lombok="flag"
+with_kotlinc_plugin_noarg="flag"
+with_kotlinc_plugin_serialization="flag"
 
 [attrs.root]
 

+ 5 - 5
build/export_generators/ide-gradle/generator.toml

@@ -39,11 +39,11 @@ proto_grpc="flag"
 proto_grpc_version="str"
 
 kotlin_version="str"
-with_kotlin="bool"
-with_kotlinc_plugin_allopen="bool"
-with_kotlinc_plugin_lombok="bool"
-with_kotlinc_plugin_noarg="bool"
-with_kotlinc_plugin_serialization="bool"
+with_kotlin="flag"
+with_kotlinc_plugin_allopen="flag"
+with_kotlinc_plugin_lombok="flag"
+with_kotlinc_plugin_noarg="flag"
+with_kotlinc_plugin_serialization="flag"
 
 runs="list"
 runs-args="list"