File tree Expand file tree Collapse file tree 4 files changed +40
-2
lines changed
Expand file tree Collapse file tree 4 files changed +40
-2
lines changed Original file line number Diff line number Diff line change 3030
3131 - uses : ZNotify/test-server-action@master
3232
33+ - name : Get Kotlin version
34+ uses : gradle/gradle-build-action@main
35+ with :
36+ arguments : kotlinVersion
37+
38+ - name : Cache KotlinNative
39+ uses : actions/cache@v2
40+ with :
41+ path : ~/.konan
42+ key : ${{ runner.os }}-konan-${{ hashFiles('build/kotlinVersion.txt') }}
43+
3344 - name : Build with Gradle
3445 uses : gradle/gradle-build-action@main
3546 with :
Original file line number Diff line number Diff line change 3131
3232 - uses : ZNotify/test-server-action@master
3333
34+ - name : Get Kotlin version
35+ uses : gradle/gradle-build-action@main
36+ with :
37+ arguments : kotlinVersion
38+
39+ - name : Cache KotlinNative
40+ uses : actions/cache@v2
41+ with :
42+ path : ~/.konan
43+ key : ${{ runner.os }}-konan-${{ hashFiles('build/kotlinVersion.txt') }}
44+
3445 - name : Build with Gradle
3546 uses : gradle/gradle-build-action@main
3647 with :
Original file line number Diff line number Diff line change 3030 java-version : ' 17'
3131 cache : ' gradle'
3232
33- - name : Grant execute permission for gradlew
34- run : chmod +x gradlew
33+ - name : Get Kotlin version
34+ uses : gradle/gradle-build-action@main
35+ with :
36+ arguments : kotlinVersion
37+
38+ - name : Cache KotlinNative
39+ uses : actions/cache@v2
40+ with :
41+ path : ~/.konan
42+ key : ${{ runner.os }}-konan-${{ hashFiles('build/kotlinVersion.txt') }}
3543
3644 - name : Run unit tests
3745 uses : gradle/gradle-build-action@main
Original file line number Diff line number Diff line change 11@file:Suppress(" UnstableApiUsage" , " UNUSED_VARIABLE" )
22
33import com.codingfeline.buildkonfig.compiler.FieldSpec
4+ import org.jetbrains.kotlin.config.KotlinCompilerVersion
45
56group = " dev.zxilly"
67
@@ -257,3 +258,10 @@ signing {
257258 sign(publishing.publications)
258259}
259260
261+ tasks.register(" kotlinVersion" ){
262+ doLast {
263+ println (" Kotlin version: ${KotlinCompilerVersion .VERSION } " )
264+ buildDir.mkdir()
265+ buildDir.resolve(" kotlinVersion.txt" ).writeText(KotlinCompilerVersion .VERSION )
266+ }
267+ }
You can’t perform that action at this time.
0 commit comments