-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFluxoConfigurationExtensionKotlinOptions.kt
387 lines (353 loc) · 14.1 KB
/
FluxoConfigurationExtensionKotlinOptions.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
@file:Suppress("KDocUnresolvedReference")
package fluxo.conf.dsl
import fkcSetupGradlePlugin
import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode
@FluxoKmpConfDsl
public interface FluxoConfigurationExtensionKotlinOptions : FluxoConfigurationExtensionCommon {
/**
* The Kotlin language version.
* Provide source compatibility with the specified version of Kotlin.
*
* Possible values: '1.4 (deprecated)', '1.5 (deprecated)', '1.6', '1.7', '1.8', '1.9',
* '2.0 (experimental)', '2.1 (experimental)'.
* Set 'latest' or 'last' for the latest possible value.
* Set 'current' for the current Kotlin plugin base value.
*
* Inherited from the parent project if not set.
* Default value: `null`.
*
* Auto set using the version names in the toml version catalog:
* `kotlinLangVersion`, `kotlinLang`.
*
* Note: can't be lower than [kotlinApiVersion]!
*
* @see org.jetbrains.kotlin.gradle.plugin.LanguageSettingsBuilder.languageVersion
* @see org.jetbrains.kotlin.gradle.dsl.KotlinCommonCompilerOptions.languageVersion
* @see kotlinApiVersion
* @see kotlinCoreLibraries
* @see kotlinTestsLangVersion
*/
public var kotlinLangVersion: String?
/**
* The Kotlin api version.
* Allow using declarations only from the specified version of the bundled libraries.
*
* Possible values: '1.4 (deprecated)', '1.5 (deprecated)', '1.6', '1.7', '1.8', '1.9',
* '2.0 (experimental)', '2.1 (experimental)'.
* Set 'latest' or 'last' for the latest possible value.
* Set 'current' for the current Kotlin plugin base value.
*
* Inherited from the parent project if not set.
* Default value: [kotlinLangVersion].
*
* Auto set using the version names in the toml version catalog:
* `kotlinApiVersion`, `kotlinApi`.
*
* Note: can't be greater than [kotlinLangVersion]!
*
* @see org.jetbrains.kotlin.gradle.plugin.LanguageSettingsBuilder.apiVersion
* @see org.jetbrains.kotlin.gradle.dsl.KotlinCommonCompilerOptions.apiVersion
* @see kotlinLangVersion
* @see kotlinCoreLibraries
* @see kotlinTestsLangVersion
*/
public var kotlinApiVersion: String?
/**
* Override the Kotlin language/api version for tests.
* Provide source compatibility with the specified version of Kotlin.
*
* Possible values: '1.4 (deprecated)', '1.5 (deprecated)', '1.6', '1.7', '1.8', '1.9',
* '2.0 (experimental)', '2.1 (experimental)'.
* Set 'latest' or 'last' for the latest possible value.
* Set 'current' for the current Kotlin plugin base value.
*
* Inherited from the parent project if not set.
* Default value: `null`.
*
* Auto set using the version names in the toml version catalog:
* `testsKotlinLangVersion`, `testsKotlinLang`.
*
* Note: can't be lower than [kotlinApiVersion] or [kotlinLangVersion]!
*
* @see kotlinApiVersion
* @see kotlinLangVersion
* @see org.jetbrains.kotlin.gradle.plugin.LanguageSettingsBuilder.languageVersion
* @see org.jetbrains.kotlin.gradle.dsl.KotlinCommonCompilerOptions.languageVersion
* @see org.jetbrains.kotlin.gradle.plugin.LanguageSettingsBuilder.apiVersion
* @see org.jetbrains.kotlin.gradle.dsl.KotlinCommonCompilerOptions.apiVersion
*/
public var kotlinTestsLangVersion: String?
/**
* Version of the core Kotlin libraries added to Kotlin compile classpath,
* unless stdlib dependency already added to the project.
*
* Inherited from the parent project if not set.
* By default, this version is the same as the version of the used Kotlin Gradle plugin.
*
* Auto set using the version names in the toml version catalog:
* `kotlinCoreLibraries`, `kotlinCoreLibrariesVersion`, `kotlinStdlib`,
* `kotlin`, `kotlinVersion`.
*
* @see org.jetbrains.kotlin.gradle.dsl.KotlinTopLevelExtension.coreLibrariesVersion
* @see kotlinLangVersion
* @see kotlinApiVersion
*/
public var kotlinCoreLibraries: String?
/**
* The Java lang target (and source) version.
* Configures to generate class files suitable for the specified Java SE release.
* And compiles source code according to the rules of the Java programming language
* for the specified Java SE release.
*
* Set 'latest' or 'last' for the latest possible value.
* Set 'current' for the current Kotlin plugin base value.
*
* Inherited from the parent project if not set.
*
* Auto set using the version names in the toml version catalog:
* `jvmTarget`, `javaLangTarget`, `javaLangSource`, `javaToolchain`,
* `sourceCompatibility`, `targetCompatibility`.
*
* Note: the Java lang target must not be lower than the source release.
*
* @see org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompilerOptions.jvmTarget
* @see org.gradle.api.plugins.JavaPluginExtension.setSourceCompatibility
* @see org.gradle.api.plugins.JavaPluginExtension.setTargetCompatibility
* @see org.gradle.api.tasks.compile.AbstractCompile.setSourceCompatibility
* @see org.gradle.api.tasks.compile.AbstractCompile.setTargetCompatibility
* @see org.gradle.jvm.toolchain.JavaToolchainSpec.getLanguageVersion
* @see javaTestsLangTarget
*/
public var javaLangTarget: String?
/**
* Override the [Java lang target (and source) version][javaLangTarget] for tests.
*
* Inherited from the parent project if not set.
*
* Auto set using the version names in the toml version catalog:
* `jvmTestsTarget`, `javaTestsLangTarget`
*
* Note: can't be lower than [javaLangTarget]!
*
* @see javaLangTarget
* @see org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompilerOptions.jvmTarget
* @see org.gradle.api.plugins.JavaPluginExtension.setSourceCompatibility
* @see org.gradle.api.plugins.JavaPluginExtension.setTargetCompatibility
* @see org.gradle.api.tasks.compile.AbstractCompile.setSourceCompatibility
* @see org.gradle.api.tasks.compile.AbstractCompile.setTargetCompatibility
* @see org.gradle.jvm.toolchain.JavaToolchainSpec.getLanguageVersion
*/
public var javaTestsLangTarget: String?
/** Alias for [javaLangTarget] */
public var jvmTarget: String?
get() = javaLangTarget
set(value) {
javaLangTarget = value
}
/**
* Use `-Xjdk-release` option to compile against the specified JDK API version,
* similarly to javac's `-release`.
*
* Controls the target bytecode version and limits the API of the JDK in the
* classpath to the specified Java version.
*
* Default value: `true`.
* Inherited from the parent project if not set.
* Used only for Kotlin _1.7.0_ or newer and JDK _9_ or newer.
* And only for JVM non-Android builds.
*
* **WARN: This option isn't guaranteed to be effective for each JDK distribution!**
* If there's no `ct.sym` file in JDK but `-Xjdk-release` is used,
* the compiler will stop with an error.
*
* Links:
* * [Kotlin 1.7: JDK Release Compatibility](https://blog.jetbrains.com/kotlin/2022/02/kotlin-1-7-jdk-release-compatibility/)
* * [KT-29974](https://youtrack.jetbrains.com/issue/KT-29974)
* * [Kotlin's JDK Release Compatibility Flag](https://jakewharton.com/kotlins-jdk-release-compatibility-flag/)
* * [slack-gradle-plugin#778](https://github.com/slackhq/slack-gradle-plugin/pull/778/files)
*/
public var useJdkRelease: Boolean
/**
* Flag to configure [Java toolchain](https://docs.gradle.org/current/userguide/toolchains.html)
* both for Kotlin JVM and Java tasks.
*
* Turned off by default as it can slow down the build and usually suboptimal.
* See [Gradle Toolchains are rarely a good idea](https://jakewharton.com/gradle-toolchains-are-rarely-a-good-idea/)
* for details.
*
* Inherited from the parent project if not set.
*
* @see org.jetbrains.kotlin.gradle.dsl.KotlinTopLevelExtension.jvmToolchain
* @see org.gradle.jvm.toolchain.JavaToolchainSpec
*/
public var setupJvmToolchain: Boolean
/**
* Flag that allows to disable kotlin plugin configuration completely.
*
* Inherited from the parent project if not set. Default value: `true`.
*/
public var setupKotlin: Boolean
/**
* List of Kotlin opt-ins to add in the project.
*
* Default set of opt-ins:
* - [kotlin.RequiresOptIn]
* - [kotlin.contracts.ExperimentalContracts]
* - [kotlin.experimental.ExperimentalObjCName]
* - [kotlin.experimental.ExperimentalTypeInference]
*
* @see org.jetbrains.kotlin.gradle.plugin.LanguageSettingsBuilder.optIn
* @see org.jetbrains.kotlin.gradle.dsl.KotlinCommonCompilerToolOptions.freeCompilerArgs
*/
public var optIns: List<String>
/**
* Flag to add opt-ins for internal Kotlin and Coroutines features.
*
* For Coroutines:
* - [kotlinx.coroutines.DelicateCoroutinesApi]
* - [kotlinx.coroutines.ExperimentalCoroutinesApi]
* - [kotlinx.coroutines.InternalCoroutinesApi]
*
* Inherited from the parent project if not set.
*
* **Default value: `false`.**
*
* @see setupCoroutines
*/
public var optInInternal: Boolean?
/**
* Option that tells the Kotlin compiler
* if and how to report issues on all public API declarations
* without explicit visibility or return type.
*
* Inherited from the parent project if not set.
* Default value:
* * `ExplicitApiMode.Strict` for Gradle plugins configured via [fkcSetupGradlePlugin]!
* * in other cases `null`.
*
* @see org.jetbrains.kotlin.gradle.dsl.KotlinTopLevelExtension.explicitApi
*/
public var explicitApi: ExplicitApiMode?
/**
* Sets [explicitApi] option to report issues as errors.
*
* WARN: Automatically sets for Gradle plugins configured via [fkcSetupGradlePlugin]!
*/
public fun explicitApi() {
explicitApi = ExplicitApiMode.Strict
}
/**
* Sets [explicitApi] option to report issues as warnings.
*/
public fun explicitApiWarning() {
explicitApi = ExplicitApiMode.Warning
}
/**
* Flag to treat all warnings as errors.
*
* Inherited from the parent project if not set.
*
* **Default value: `false`.**
*
* @see org.jetbrains.kotlin.gradle.dsl.KotlinCommonOptions.allWarningsAsErrors
*/
public var allWarningsAsErrors: Boolean?
/**
* Generate metadata for Java 1.8 reflection on method parameters.
*
* Inherited from the parent project if not set.
*
* **Default value: `false`.**
*
* [More details](https://docs.oracle.com/javase/tutorial/reflect/member/methodparameterreflection.html)
*
* @see org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompilerOptions.javaParameters
* @TODO: set for Java compilation tasks too (https://stackoverflow.com/q/37463902)
*/
public var javaParameters: Boolean?
/**
* Flag to turn off dynamic invocations (`invokedynamic`) compilation for Kotlin lambdas
* and SAM conversions (`indy` mode).
*
* Inherited from the parent project if not set.
*
* **Default value: `true`.**
*
* Indy mode produces faster and more compact bytecode,
* using the `invokedynamic` JVM instruction.
* Note: legacy `class` mode provides names for lambda arguments. Indy mode doesn't!
*
* Uses `-Xlambdas` and `-Xsam-conversions` compiler options.
*
* [More info](https://kotlinlang.org/docs/whatsnew15.html#lambdas-via-invokedynamic)
*/
public var useIndyLambdas: Boolean?
/**
* Flag to turn on the progressive mode.
*
* Deprecations and bug fixes for unstable code take effect immediately in this mode.
* Instead of going through a graceful migration cycle.
*
* Progressive code is backward compatible. But not otherwise.
*
* Only applied if the latest [kotlinLangVersion] used (otherwise meaningless).
*
* Inherited from the parent project if not set.
* Default value: `true`.
*
* @see org.jetbrains.kotlin.gradle.plugin.LanguageSettingsBuilder.progressiveMode
*/
public var progressiveMode: Boolean?
/**
* Flag to create an experimental compilation with the latest language features.
*
* Inherited from the parent project if not set.
* Default value: `false`.
*/
public var latestSettingsForTests: Boolean?
/**
* Flag to create an experimental compilation with the latest language features.
*
* Inherited from the parent project if not set.
* Default value: `false`.
*/
public var experimentalLatestCompilation: Boolean?
/**
* Flag to remove utility bytecode, eliminating names/data leaks in release artifacts
* (better for minification and obfuscation).
*
* Inherited from the parent project if not set.
* Default value: `true`.
*
* Uses `-Xno-call-assertions`, `-Xno-param-assertions`, and `-Xno-receiver-assertions`
* compiler options.
*
* [More info](https://proandroiddev.com/kotlin-cleaning-java-bytecode-before-release-9567d4c63911)
* [2](https://www.guardsquare.com/blog/eliminating-data-leaks-caused-by-kotlin-assertions)
*/
public var removeAssertionsInRelease: Boolean?
/**
* Flag to enable autoconfiguring JVM compatibility options.
*
* Inherited from the parent project if not set.
* Default value: `true`.
*/
public var setupJvmCompatibility: Boolean
/**
* Flag to enable autoconfiguring Kotlin options.
*
* Inherited from the parent project if not set.
* Default value: `true`.
*/
public var setupKotlinOptions: Boolean
/**
* Flag to turn on the new faster version of JAR FS should make build faster,
* but it is experimental and causes warning.
* So auto turned off when [allWarningsAsErrors] enabled.
*
* Inherited from the parent project if not set. Default value: `true`.
*
* Uses `-Xuse-fast-jar-file-system` compiler option.
*/
public var useExperimentalFastJarFs: Boolean?
}