Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Kotlin 1.4.21 #1059

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions Android/Kotlin/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,14 @@
"artifactId" : "annotations",
"version" : "13.0",
"nugetId" : "Xamarin.Jetbrains.Annotations",
"nugetVersion" : "13.0.0.3"
"nugetVersion" : "13.0.0.4"
},
{
"groupId" : "org.jetbrains.kotlinx",
"artifactId" : "kotlinx-coroutines-android",
"version" : "1.3.4",
"nugetId" : "Xamarin.KotlinX.Coroutines.CoroutinesAndroid",
"nugetVersion" : "1.3.4"
},
{
"groupId" : "org.jetbrains.kotlinx",
"artifactId" : "kotlinx-coroutines-core",
"version" : "1.3.4",
"nugetId" : "Xamarin.KotlinX.Coroutines.Core",
"nugetVersion" : "1.3.4"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this no longer needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should merge #1050 first maybe

}
]
}]
2 changes: 1 addition & 1 deletion Android/Kotlin/native/KotlinSample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.4.20'
ext.kotlin_version = '1.4.21'
repositories {
google()
jcenter()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 29
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,38 @@ package com.example.kotlinsamplelibrary
import java.util.ArrayList

class TestClass {

companion object {
private val isEven = IntPredicate { it % 2 == 0 }
}

var testProperty: String = "Not an empty string!"

fun Test(array: Array<String>): List<String> {
fun test(array: Array<String>): List<String> {
val list = ArrayList<String>()
array.forEach { str -> list.add(str) }
return list
}

fun TestUnsignedArray(): ULongArray {
fun testUnsignedArray(): ULongArray {
return ulongArrayOf(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, 9u, 10u, 18446744073709551614u, 18446744073709551615u)
}

fun TestUnsigned(): UInt {
fun testUnsigned(): UInt {
var i: UInt = 4294967294u
i = i + 1u;
return i;
i = i + 1u
return i
}

fun TestIsEven(i: Int): String {
return "Is ${i} even? - ${isEven.accept(i)}"
fun testIsEven(i: Int): String {
return "Is $i even? - ${isEven.accept(i)}"
}

fun interface IntPredicate {
private fun interface IntPredicate {
fun accept(i: Int): Boolean
}

private val isEven = IntPredicate { it % 2 == 0 }

fun TestBitOperations() : String {
fun testBitOperations() : String {
val number = "1010000".toUInt(radix = 2)
return "countOneBits:${number.countOneBits()},\n" +
"countTrailingZeroBits:${number.countTrailingZeroBits()},\n" +
Expand Down
7 changes: 4 additions & 3 deletions Android/Kotlin/samples/KotlinSample/KotlinSample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@
<Reference Include="Mono.Android" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.2.0.5" />
<PackageReference Include="Xamarin.Kotlin.StdLib" Version="1.4.20" />
<PackageReference Include="Xamarin.Kotlin.Reflect" Version="1.4.20" />
<PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.2.0.6" />
<PackageReference Include="Xamarin.Kotlin.StdLib.Jdk7" Version="1.4.21" />
<PackageReference Include="Xamarin.Kotlin.Reflect" Version="1.4.21" />
<PackageReference Include="Xamarin.AndroidX.ConstraintLayout" Version="2.0.4.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\KotlinSampleLibrary\KotlinSampleLibrary.csproj">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<Reference Include="Mono.Android" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Kotlin.StdLib" Version="1.4.20" />
<PackageReference Include="Xamarin.Kotlin.StdLib.Jdk7" Version="1.4.21" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this change needed? Do we no longer need the stdlib?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Xamarin.Kotlin.StdLib.Jdk7 has dependency to Xamarin.Kotlin.StdLib

</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down