File tree Expand file tree Collapse file tree 7 files changed +77
-12
lines changed Expand file tree Collapse file tree 7 files changed +77
-12
lines changed Original file line number Diff line number Diff line change 1-
21buildscript {
32
43 /*
@@ -49,11 +48,6 @@ repositories {
4948 mavenCentral()
5049}
5150
52- java {
53- sourceCompatibility = JavaVersion . VERSION_1_8
54- targetCompatibility = JavaVersion . VERSION_1_8
55- }
56-
5751dependencies {
5852 testImplementation " org.jetbrains.kotlin:kotlin-test:$kotlin_version "
5953 implementation " org.jetbrains.kotlin:kotlin-stdlib-jdk8"
@@ -78,12 +72,10 @@ task mavenTest(type: Test) {
7872 classpath = sourceSet. runtimeClasspath
7973}
8074
81- compileTestKotlin {
82- kotlinOptions . jvmTarget = " 1.8 "
75+ kotlin {
76+ jvmToolchain( 11 )
8377}
8478
85- compileKotlin {
86- kotlinOptions {
87- jvmTarget = " 1.8"
88- }
79+ check {
80+ dependsOn([mavenTest, ' jvm-sample:build' ])
8981}
Original file line number Diff line number Diff line change 1+ buildscript {
2+ val atomicfu_version = rootProject.properties[" atomicfu_version" ]
3+ val kotlin_version = rootProject.properties[" kotlin_version" ]
4+
5+ repositories {
6+ mavenLocal()
7+ }
8+
9+ dependencies {
10+ classpath(" org.jetbrains.kotlinx:atomicfu-gradle-plugin:$atomicfu_version " )
11+ }
12+ }
13+
14+ plugins {
15+ kotlin(" jvm" ) version " 1.9.0"
16+ }
17+
18+ apply (plugin = " kotlinx-atomicfu" )
19+
20+ repositories {
21+ mavenLocal()
22+ mavenCentral()
23+ maven(" https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev" )
24+ }
25+
26+ dependencies {
27+ implementation(kotlin(" stdlib" ))
28+ implementation(kotlin(" test-junit" ))
29+ }
Original file line number Diff line number Diff line change 1+ kotlin_version =1.9.0
2+ atomicfu_version =0.22.0-SNAPSHOT
3+
4+ kotlinx.atomicfu.enableJvmIrTransformation =true
Original file line number Diff line number Diff line change 1+ rootProject.name = " jvm-sample"
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2017-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3+ */
4+
5+ import kotlinx.atomicfu.*
6+
7+ class IntArithmetic {
8+ private val _x = atomic(0 )
9+ val x get() = _x .value
10+
11+ fun doWork () {
12+ _x .getAndSet(3 )
13+ _x .compareAndSet(3 , 8 )
14+ }
15+ }
16+
17+ // minimal example that forces ASM to call AtomicFUTransformer.CW.getCommonSuperClass
18+ private fun checkTransformerFindCommonSuperClass () {
19+ val (a, b) = 0 to 1
20+ if (a == 0 ) {
21+ val c = listOf (a, b)
22+ }
23+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2017-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3+ */
4+
5+ import kotlin.test.*
6+
7+ class ArithmeticTest {
8+ @Test
9+ fun testInt () {
10+ val a = IntArithmetic ()
11+ a.doWork()
12+ check(a.x == 1234 )
13+ }
14+ }
Original file line number Diff line number Diff line change @@ -7,4 +7,6 @@ pluginManagement {
77 }
88}
99
10+ include ' jvm-sample'
11+
1012rootProject. name = " kotlinx-atomicfu-integration-testing"
You can’t perform that action at this time.
0 commit comments