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

Commit 626ebfe

Browse files
authored
Merge pull request #1053 from xamarin/kotlin-coroutines
KotlinX coroutines
2 parents 14be056 + da0d0d0 commit 626ebfe

File tree

10 files changed

+292
-0
lines changed

10 files changed

+292
-0
lines changed

Android/Kotlin/cgmanifest.json

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"Registrations": [
3+
{
4+
"Component": {
5+
"Type": "Maven",
6+
"Maven": {
7+
"ArtifactId": "kotlin-stdlib",
8+
"GroupId": "org.jetbrains.kotlin",
9+
"Version": "1.4.20"
10+
}
11+
}
12+
},
13+
{
14+
"Component": {
15+
"Type": "Maven",
16+
"Maven": {
17+
"ArtifactId": "kotlin-stdlib-common",
18+
"GroupId": "org.jetbrains.kotlin",
19+
"Version": "1.4.20"
20+
}
21+
}
22+
},
23+
{
24+
"Component": {
25+
"Type": "Maven",
26+
"Maven": {
27+
"ArtifactId": "kotlin-reflect",
28+
"GroupId": "org.jetbrains.kotlin",
29+
"Version": "1.4.20"
30+
}
31+
}
32+
},
33+
{
34+
"Component": {
35+
"Type": "Maven",
36+
"Maven": {
37+
"ArtifactId": "kotlin-stdlib-jdk7",
38+
"GroupId": "org.jetbrains.kotlin",
39+
"Version": "1.4.20"
40+
}
41+
}
42+
},
43+
{
44+
"Component": {
45+
"Type": "Maven",
46+
"Maven": {
47+
"ArtifactId": "kotlin-stdlib-jdk8",
48+
"GroupId": "org.jetbrains.kotlin",
49+
"Version": "1.4.20"
50+
}
51+
}
52+
},
53+
{
54+
"Component": {
55+
"Type": "Maven",
56+
"Maven": {
57+
"ArtifactId": "annotations",
58+
"GroupId": "org.jetbrains.kotlin",
59+
"Version": "13.0.0.3"
60+
}
61+
}
62+
},
63+
{
64+
"Component": {
65+
"Type": "Maven",
66+
"Maven": {
67+
"ArtifactId": "kotlinx-coroutines-android",
68+
"GroupId": "org.jetbrains.kotlinx",
69+
"Version": "1.3.4"
70+
}
71+
}
72+
},
73+
{
74+
"Component": {
75+
"Type": "Maven",
76+
"Maven": {
77+
"ArtifactId": "kotlinx-coroutines-core",
78+
"GroupId": "org.jetbrains.kotlinx",
79+
"Version": "1.3.4"
80+
}
81+
}
82+
}
83+
],
84+
"Version": 1
85+
}

Android/Kotlin/config.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,20 @@
7373
"version" : "13.0",
7474
"nugetId" : "Xamarin.Jetbrains.Annotations",
7575
"nugetVersion" : "13.0.0.3"
76+
},
77+
{
78+
"groupId" : "org.jetbrains.kotlinx",
79+
"artifactId" : "kotlinx-coroutines-android",
80+
"version" : "1.3.4",
81+
"nugetId" : "Xamarin.KotlinX.Coroutines.CoroutinesAndroid",
82+
"nugetVersion" : "1.3.4"
83+
},
84+
{
85+
"groupId" : "org.jetbrains.kotlinx",
86+
"artifactId" : "kotlinx-coroutines-core",
87+
"version" : "1.3.4",
88+
"nugetId" : "Xamarin.KotlinX.Coroutines.Core",
89+
"nugetVersion" : "1.3.4"
7690
}
7791
]
7892
}]
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<enum-field-mappings>
3+
<!--
4+
This example converts the constants Fragment_id, Fragment_name,
5+
and Fragment_tag from android.support.v4.app.FragmentActivity.FragmentTag
6+
to an enum called Android.Support.V4.App.FragmentTagType with values
7+
Id, Name, and Tag.
8+
9+
<mapping clr-enum-type="Android.Support.V4.App.FragmentTagType" jni-class="android/support/v4/app/FragmentActivity$FragmentTag">
10+
<field clr-name="Id" jni-name="Fragment_id" value="1" />
11+
<field clr-name="Name" jni-name="Fragment_name" value="0" />
12+
<field clr-name="Tag" jni-name="Fragment_tag" value="2" />
13+
</type>
14+
15+
Notes:
16+
- An optional "bitfield" attribute marks the enum type with [Flags].
17+
- For Java interfaces, use "jni-interface" attribute instead of "jni-class" attribute.
18+
-->
19+
</enum-field-mappings>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<enum-method-mappings>
3+
<!--
4+
This example changes the Java method:
5+
android.support.v4.app.Fragment.SavedState.writeToParcel (int flags)
6+
to be:
7+
android.support.v4.app.Fragment.SavedState.writeToParcel (Android.OS.ParcelableWriteFlags flags)
8+
when bound in C#.
9+
10+
<mapping jni-class="android/support/v4/app/Fragment.SavedState">
11+
<method jni-name="writeToParcel" parameter="flags" clr-enum-type="Android.OS.ParcelableWriteFlags" />
12+
</mapping>
13+
14+
Notes:
15+
- For Java interfaces, use "jni-interface" attribute instead of "jni-class" attribute.
16+
- To change the type of the return value, use "return" as the parameter name.
17+
- The parameter names will be p0, p1, ... unless you provide JavaDoc file in the project.
18+
-->
19+
</enum-method-mappings>
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<metadata>
3+
<attr
4+
path="/api/package[@name='kotlinx.coroutines']"
5+
name="managedName"
6+
>
7+
Xamarin.KotlinX.Coroutines
8+
</attr>
9+
<attr
10+
path="/api/package[@name='kotlinx.coroutines.channels']"
11+
name="managedName"
12+
>
13+
Xamarin.KotlinX.Coroutines.Channels
14+
</attr>
15+
<attr
16+
path="/api/package[@name='kotlinx.coroutines.flow']"
17+
name="managedName"
18+
>
19+
Xamarin.KotlinX.Coroutines.Flow
20+
</attr>
21+
<attr
22+
path="/api/package[@name='kotlinx.coroutines.flow.internal']"
23+
name="managedName"
24+
>
25+
Xamarin.KotlinX.Coroutines.Flow.Internal
26+
</attr>
27+
<attr
28+
path="/api/package[@name='kotlinx.coroutines.internal']"
29+
name="managedName"
30+
>
31+
Xamarin.KotlinX.Coroutines.Internal
32+
</attr>
33+
<attr
34+
path="/api/package[@name='kotlinx.coroutines.intrinsics']"
35+
name="managedName"
36+
>
37+
Xamarin.KotlinX.Coroutines.Intrinsics
38+
</attr>
39+
<attr
40+
path="/api/package[@name='kotlinx.coroutines.scheduling']"
41+
name="managedName"
42+
>
43+
Xamarin.KotlinX.Coroutines.Scheduling
44+
</attr>
45+
<attr
46+
path="/api/package[@name='kotlinx.coroutines.selects']"
47+
name="managedName"
48+
>
49+
Xamarin.KotlinX.Coroutines.Selects
50+
</attr>
51+
<attr
52+
path="/api/package[@name='kotlinx.coroutines.sync']"
53+
name="managedName"
54+
>
55+
Xamarin.KotlinX.Coroutines.Sync
56+
</attr>
57+
<attr
58+
path="/api/package[@name='kotlinx.coroutines.test']"
59+
name="managedName"
60+
>
61+
Xamarin.KotlinX.Coroutines.Test
62+
</attr>
63+
64+
</metadata>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<metadata>
3+
<!--
4+
duplicate
5+
6+
removed:
7+
obsolete
8+
-->
9+
<remove-node
10+
path="/api/package[@name='kotlinx.coroutines.channels']/class[@name='ChannelsKt']/method[@name='filterIndexedTo' and count(parameter)=4 and parameter[1][@type='kotlinx.coroutines.channels.ReceiveChannel&lt;? extends E&gt;'] and parameter[2][@type='C'] and parameter[3][@type='kotlin.jvm.functions.Function2&lt;? super java.lang.Integer, ? super E, java.lang.Boolean&gt;'] and parameter[4][@type='kotlin.coroutines.Continuation&lt;? super C&gt;']]"
11+
/>
12+
<remove-node
13+
path="/api/package[@name='kotlinx.coroutines.channels']/class[@name='ChannelsKt']/method[@name='filterIndexedTo' and count(parameter)=4 and parameter[1][@type='kotlinx.coroutines.channels.ReceiveChannel&lt;? extends E&gt;'] and parameter[2][@type='C'] and parameter[3][@type='kotlin.jvm.functions.Function2&lt;? super java.lang.Integer, ? super E, java.lang.Boolean&gt;'] and parameter[4][@type='kotlin.coroutines.Continuation&lt;? super C&gt;']]"
14+
/>
15+
<remove-node
16+
path="/api/package[@name='kotlinx.coroutines.channels']/class[@name='ChannelsKt']/method[@name='filterNotTo' and count(parameter)=4 and parameter[1][@type='kotlinx.coroutines.channels.ReceiveChannel&lt;? extends E&gt;'] and parameter[2][@type='C'] and parameter[3][@type='kotlin.jvm.functions.Function1&lt;? super E, java.lang.Boolean&gt;'] and parameter[4][@type='kotlin.coroutines.Continuation&lt;? super C&gt;']]"
17+
/>
18+
<remove-node
19+
path="/api/package[@name='kotlinx.coroutines.channels']/class[@name='ChannelsKt']/method[@name='filterNotTo' and count(parameter)=4 and parameter[1][@type='kotlinx.coroutines.channels.ReceiveChannel&lt;? extends E&gt;'] and parameter[2][@type='C'] and parameter[3][@type='kotlin.jvm.functions.Function1&lt;? super E, java.lang.Boolean&gt;'] and parameter[4][@type='kotlin.coroutines.Continuation&lt;? super C&gt;']]"
20+
/>
21+
<remove-node
22+
path="/api/package[@name='kotlinx.coroutines.channels']/class[@name='ChannelsKt']/method[@name='filterNotNullTo' and count(parameter)=3 and parameter[1][@type='kotlinx.coroutines.channels.ReceiveChannel&lt;? extends E&gt;'] and parameter[2][@type='C'] and parameter[3][@type='kotlin.coroutines.Continuation&lt;? super C&gt;']]"
23+
/>
24+
<remove-node
25+
path="/api/package[@name='kotlinx.coroutines.channels']/class[@name='ChannelsKt']/method[@name='filterNotNullTo' and count(parameter)=3 and parameter[1][@type='kotlinx.coroutines.channels.ReceiveChannel&lt;? extends E&gt;'] and parameter[2][@type='C'] and parameter[3][@type='kotlin.coroutines.Continuation&lt;? super C&gt;']]"
26+
/>
27+
28+
<remove-node
29+
path="/api/package[@name='kotlinx.coroutines.internal']"
30+
/>
31+
32+
</metadata>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<enum-field-mappings>
3+
<!--
4+
This example converts the constants Fragment_id, Fragment_name,
5+
and Fragment_tag from android.support.v4.app.FragmentActivity.FragmentTag
6+
to an enum called Android.Support.V4.App.FragmentTagType with values
7+
Id, Name, and Tag.
8+
9+
<mapping clr-enum-type="Android.Support.V4.App.FragmentTagType" jni-class="android/support/v4/app/FragmentActivity$FragmentTag">
10+
<field clr-name="Id" jni-name="Fragment_id" value="1" />
11+
<field clr-name="Name" jni-name="Fragment_name" value="0" />
12+
<field clr-name="Tag" jni-name="Fragment_tag" value="2" />
13+
</type>
14+
15+
Notes:
16+
- An optional "bitfield" attribute marks the enum type with [Flags].
17+
- For Java interfaces, use "jni-interface" attribute instead of "jni-class" attribute.
18+
-->
19+
</enum-field-mappings>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<enum-method-mappings>
3+
<!--
4+
This example changes the Java method:
5+
android.support.v4.app.Fragment.SavedState.writeToParcel (int flags)
6+
to be:
7+
android.support.v4.app.Fragment.SavedState.writeToParcel (Android.OS.ParcelableWriteFlags flags)
8+
when bound in C#.
9+
10+
<mapping jni-class="android/support/v4/app/Fragment.SavedState">
11+
<method jni-name="writeToParcel" parameter="flags" clr-enum-type="Android.OS.ParcelableWriteFlags" />
12+
</mapping>
13+
14+
Notes:
15+
- For Java interfaces, use "jni-interface" attribute instead of "jni-class" attribute.
16+
- To change the type of the return value, use "return" as the parameter name.
17+
- The parameter names will be p0, p1, ... unless you provide JavaDoc file in the project.
18+
-->
19+
</enum-method-mappings>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<metadata>
3+
4+
<attr
5+
path="/api/package[@name='kotlinx.coroutines.android']"
6+
name="managedName"
7+
>
8+
Xamarin.KotlinX.Coroutines.CoroutinesAndroid
9+
</attr>
10+
11+
</metadata>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<metadata>
3+
4+
<attr
5+
path="/api/package[@name='kotlinx.coroutines.android']/class[@name='HandlerDispatcher']/method[@name='getImmediate' and count(parameter)=0]" name="managedReturn"
6+
>
7+
Xamarin.KotlinX.Coroutines.MainCoroutineDispatcher
8+
</attr>
9+
10+
</metadata>

0 commit comments

Comments
 (0)