You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Configure add apply plugin just like for [JVM](#jvm).
122
+
Configure add apply plugin just like for [JVM](#jvm).
123
123
124
124
### Native
125
125
@@ -149,16 +149,45 @@ dependencies {
149
149
}
150
150
```
151
151
152
-
###Additional configuration
152
+
## Additional configuration
153
153
154
-
There are the following additional parameters (with their defaults):
154
+
To set configuration options you should create `atomicfu` section in a `build.gradle` file,
155
+
like this:
156
+
```groovy
157
+
atomicfu {
158
+
dependenciesVersion = '0.17.0'
159
+
}
160
+
```
161
+
162
+
### JVM transformation options
163
+
164
+
To turn off transformation for Kotlin/JVM set option `transformJvm` to `false`.
165
+
166
+
Configuration option `jvmVariant` defines what Java class replaces atomics on Kotlin/JVM.
167
+
Here are the valid options:
168
+
-`FU` – atomics are replaced with [AtomicXxxFieldUpdater](https://docs.oracle.com/javase/10/docs/api/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.html).
169
+
-`VH` – atomics are replaced with [VarHandle](https://docs.oracle.com/javase/9/docs/api/java/lang/invoke/VarHandle.html),
170
+
this option is supported for Java 9+.
171
+
-`BOTH` – [multi-release jar file](https://openjdk.java.net/jeps/238) will be created with both `AtomicXxxFieldUpdater` for JDK <= 8 and `VarHandle` for for JDK9+.
172
+
173
+
### JS transformation options
174
+
175
+
To turn off transformation for Kotlin/JS set option `transformJs` to `false`.
155
176
177
+
Configuration option `jsVariant` defines how transformation is performed on Kotlin/JS.
178
+
Here are the valid options:
179
+
-`JS` – JavaScript transformer implemented in the library is applied to the compiled `*.js` files.
180
+
-`IR` – may be set if [Kotlin/JS IR backend](https://kotlinlang.org/docs/js-ir-compiler.html) is used for compilation,
181
+
then `IR` generated from the Kotlin source code is transformed by the `kotlinx-atomicfu` compiler plugin.
182
+
183
+
Here are all available configuration options (with their defaults):
156
184
```groovy
157
185
atomicfu {
158
186
dependenciesVersion = '0.17.0' // set to null to turn-off auto dependencies
159
187
transformJvm = true // set to false to turn off JVM transformation
160
188
transformJs = true // set to false to turn off JS transformation
161
-
variant = "FU" // JVM transformation variant: FU,VH, or BOTH
189
+
jvmVariant = "FU" // JVM transformation variant: FU,VH, or BOTH
190
+
jsVariant = "JS" // JS transformation variant: JS or IR
162
191
verbose = false // set to true to be more verbose
163
192
}
164
193
```
@@ -237,22 +266,6 @@ which is then transformed to a regular `classes` directory to be used later by t
237
266
238
267
AtomicFU provides some additional features that you can optionally use.
0 commit comments