Skip to content

Commit 6bbadd5

Browse files
atsushienoradekdoulik
authored andcommitted
Reorganize Xamarin.Android.NamingCustomAttributes. (dotnet#139)
context: dotnet/java-interop#58 dependent on: atsushieno/java.interop@5583d26 Copypasting the changes on Java.Interop We have complicated module interdependency between this and xamarin-android, so this set of changes is to fix the situation. So far, here is the changeset summary: - Xamarin.Android.NamingCustomAttributes.shproj is moved to xamarin-android - there will be new Java.Interop.NamingCustomAttributes.shproj which is for use in this repository. It will be shrinked in the later commits to have only required bits in Java/Interop. Now Xamarin.Android.sln has two NamingCustomAttributes.shproj: one for imported and then slightly stripped version of the original shared project in xamarin-android, and renamed and then significantly stripped version in Java.Interop. Build adjustment comes next.
1 parent 4fa1485 commit 6bbadd5

17 files changed

+432
-4
lines changed

Xamarin.Android.sln

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Java.Interop", "external\Ja
2121
EndProject
2222
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "generator", "external\Java.Interop\tools\generator\generator.csproj", "{D14A1B5C-2060-4930-92BE-F7190256C735}"
2323
EndProject
24-
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Xamarin.Android.NamingCustomAttributes", "external\Java.Interop\src\Xamarin.Android.NamingCustomAttributes\Xamarin.Android.NamingCustomAttributes.shproj", "{74598F5C-B8CC-4CE6-8EE2-AB9CA1400076}"
24+
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Java.Interop.NamingCustomAttributes", "external\Java.Interop\src\Java.Interop.NamingCustomAttributes\Java.Interop.NamingCustomAttributes.shproj", "{FE789F04-5E95-42C5-AEF1-E33F8DF06B3F}"
25+
EndProject
26+
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Xamarin.Android.NamingCustomAttributes", "src\Xamarin.Android.NamingCustomAttributes\Xamarin.Android.NamingCustomAttributes.shproj", "{74598F5C-B8CC-4CE6-8EE2-AB9CA1400076}"
2527
EndProject
2628
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Java.Interop.Tools.TypeNameMappings", "external\Java.Interop\src\Java.Interop.Tools.TypeNameMappings\Java.Interop.Tools.TypeNameMappings.shproj", "{E706B6F2-5562-4765-8F07-8CF84A797B30}"
2729
EndProject
@@ -410,6 +412,7 @@ Global
410412
{3FC3E78B-F7D4-42EA-BBE8-4535DF42BFF8} = {E351F97D-EA4F-4E7F-AAA0-8EBB1F2A4A62}
411413
{94BD81F7-B06F-4295-9636-F8A3B6BDC762} = {04E3E11E-B47D-4599-8AFC-50515A95E715}
412414
{D14A1B5C-2060-4930-92BE-F7190256C735} = {04E3E11E-B47D-4599-8AFC-50515A95E715}
415+
{FE789F04-5E95-42C5-AEF1-E33F8DF06B3F} = {04E3E11E-B47D-4599-8AFC-50515A95E715}
413416
{74598F5C-B8CC-4CE6-8EE2-AB9CA1400076} = {04E3E11E-B47D-4599-8AFC-50515A95E715}
414417
{E706B6F2-5562-4765-8F07-8CF84A797B30} = {04E3E11E-B47D-4599-8AFC-50515A95E715}
415418
{66CF299A-CE95-4131-BCD8-DB66E30C4BF7} = {04E3E11E-B47D-4599-8AFC-50515A95E715}

external/Java.Interop

src/Mono.Android/Mono.Android.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@
294294
<Compile Include="Xamarin.Android.Net\IAndroidAuthenticationModule.cs" />
295295
</ItemGroup>
296296
<Import Project="$(JavaInteropFullPath)\src\Java.Interop.Tools.TypeNameMappings\Java.Interop.Tools.TypeNameMappings.projitems" Label="Shared" Condition="Exists('$(JavaInteropFullPath)\src\Java.Interop.Tools.TypeNameMappings\Java.Interop.Tools.TypeNameMappings.projitems')" />
297-
<Import Project="$(JavaInteropFullPath)\src\Xamarin.Android.NamingCustomAttributes\Xamarin.Android.NamingCustomAttributes.projitems" Label="Shared" Condition="Exists('$(JavaInteropFullPath)\src\Xamarin.Android.NamingCustomAttributes\Xamarin.Android.NamingCustomAttributes.projitems')" />
297+
<Import Project="..\Xamarin.Android.NamingCustomAttributes\Xamarin.Android.NamingCustomAttributes.projitems" Label="Shared" Condition="Exists('..\Xamarin.Android.NamingCustomAttributes\Xamarin.Android.NamingCustomAttributes.projitems')" />
298298
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
299299
<PropertyGroup>
300300
<IntermediateOutputPath>$(IntermediateOutputPath)android-$(AndroidApiLevel)\</IntermediateOutputPath>

src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
1313
</PropertyGroup>
1414
<Import Project="..\..\Configuration.props" />
15-
<Import Project="$(JavaInteropFullPath)\src\Xamarin.Android.NamingCustomAttributes\Xamarin.Android.NamingCustomAttributes.projitems" Label="Shared" Condition="Exists('$(JavaInteropFullPath)\src\Xamarin.Android.NamingCustomAttributes\Xamarin.Android.NamingCustomAttributes.projitems')" />
15+
<Import Project="..\Xamarin.Android.NamingCustomAttributes\Xamarin.Android.NamingCustomAttributes.projitems" Label="Shared" Condition="Exists('..\Xamarin.Android.NamingCustomAttributes\Xamarin.Android.NamingCustomAttributes.projitems')" />
1616
<Import Project="$(JavaInteropFullPath)\src\Java.Interop.Tools.TypeNameMappings\Java.Interop.Tools.TypeNameMappings.projitems" Label="Shared" Condition="Exists('$(JavaInteropFullPath)\src\Java.Interop.Tools.TypeNameMappings\Java.Interop.Tools.TypeNameMappings.projitems')" />
1717
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1818
<DebugSymbols>True</DebugSymbols>
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
using System;
2+
3+
using Android.Content.PM;
4+
using Android.Views;
5+
6+
namespace Android.App
7+
{
8+
9+
[Serializable]
10+
[AttributeUsage (AttributeTargets.Class,
11+
AllowMultiple=false,
12+
Inherited=false)]
13+
public sealed partial class ActivityAttribute : Attribute {
14+
15+
public ActivityAttribute ()
16+
{
17+
}
18+
19+
public string Name {get; set;}
20+
21+
#if ANDROID_20
22+
public bool AllowEmbedded {get; set;}
23+
#endif
24+
public bool AllowTaskReparenting {get; set;}
25+
public bool AlwaysRetainTaskState {get; set;}
26+
public bool ClearTaskOnLaunch {get; set;}
27+
public ConfigChanges ConfigurationChanges {get; set;}
28+
public bool Enabled {get; set;}
29+
public bool ExcludeFromRecents {get; set;}
30+
public bool Exported {get; set;}
31+
public bool FinishOnTaskLaunch {get; set;}
32+
#if ANDROID_11
33+
public bool HardwareAccelerated {get; set;}
34+
#endif
35+
public string Icon {get; set;}
36+
public string Label {get; set;}
37+
public LaunchMode LaunchMode {get; set;}
38+
#if ANDROID_17
39+
[Obsolete ("There is no //activity/@android:layoutDirection attribute. This was a mistake. " +
40+
"Perhaps you wanted ConfigurationChanges=ConfigChanges.LayoutDirection?")]
41+
public LayoutDirection LayoutDirection {get; set;}
42+
#endif
43+
public bool MainLauncher {get; set;}
44+
public bool MultiProcess {get; set;}
45+
public bool NoHistory {get; set;}
46+
#if ANDROID_16
47+
public Type ParentActivity {get; set;}
48+
#endif
49+
public string Permission {get; set;}
50+
public string Process {get; set;}
51+
#if ANDROID_24
52+
public bool ResizeableActivity {get;set;}
53+
public bool SupportsPictureInPicture {get;set;}
54+
#endif
55+
public ScreenOrientation ScreenOrientation {get; set;}
56+
public bool StateNotNeeded {get; set;}
57+
public string TaskAffinity {get; set;}
58+
public string Theme {get; set;}
59+
#if ANDROID_14
60+
public UiOptions UiOptions {get; set;}
61+
#endif
62+
public SoftInput WindowSoftInputMode {get; set;}
63+
#if ANDROID_15 // this is not documented on http://developer.android.com/guide/topics/manifest/activity-element.html but on https://developers.google.com/glass/develop/gdk/immersions
64+
public bool Immersive {get; set;}
65+
#endif
66+
}
67+
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
using System;
2+
3+
using Android.Content.PM;
4+
using Android.Views;
5+
6+
namespace Android.App {
7+
8+
[Serializable]
9+
[AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class,
10+
AllowMultiple=false,
11+
Inherited=false)]
12+
public sealed partial class ApplicationAttribute : Attribute {
13+
14+
public ApplicationAttribute ()
15+
{
16+
}
17+
18+
public string Name {get; set;}
19+
20+
public bool AllowBackup {get; set;}
21+
public bool AllowClearUserData {get; set;}
22+
public bool AllowTaskReparenting {get; set;}
23+
#if ANDROID_8
24+
public Type BackupAgent {get; set;}
25+
#endif
26+
#if ANDROID_21
27+
public string Banner {get; set;}
28+
#endif
29+
public bool Debuggable {get; set;}
30+
public string Description {get; set;}
31+
public bool Enabled {get; set;}
32+
#if ANDROID_23
33+
public bool ExtractNativeLibs {get; set;}
34+
public bool FullBackupContent {get; set;}
35+
#endif
36+
#if ANDROID_11
37+
public bool HardwareAccelerated {get; set;}
38+
#endif
39+
public bool HasCode {get; set;}
40+
public string Icon {get; set;}
41+
public bool KillAfterRestore {get; set;}
42+
#if ANDROID_11
43+
public bool LargeHeap {get; set;}
44+
#endif
45+
public string Label {get; set;}
46+
#if ANDROID_11
47+
public string Logo {get; set;}
48+
#endif
49+
public Type ManageSpaceActivity {get; set;}
50+
public string Permission {get; set;}
51+
public bool Persistent {get; set;}
52+
public string Process {get; set;}
53+
#if ANDROID_18
54+
public string RequiredAccountType {get; set;}
55+
#endif
56+
public bool RestoreAnyVersion {get; set;}
57+
#if ANDROID_18
58+
public string RestrictedAccountType {get; set;}
59+
#endif
60+
#if ANDROID_17
61+
public bool SupportsRtl {get; set;}
62+
#endif
63+
public string TaskAffinity {get; set;}
64+
public string Theme {get; set;}
65+
#if ANDROID_14
66+
public UiOptions UiOptions {get; set;}
67+
#endif
68+
#if ANDROID_10
69+
public bool VMSafeMode {get; set;}
70+
#endif
71+
#if ANDROID_24
72+
public bool ResizeableActivity {get; set;}
73+
#endif
74+
}
75+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System;
2+
3+
namespace Android.App {
4+
5+
[Serializable]
6+
[AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class,
7+
AllowMultiple=true,
8+
Inherited=false)]
9+
public sealed partial class InstrumentationAttribute : Attribute {
10+
11+
public InstrumentationAttribute ()
12+
{
13+
}
14+
15+
public bool FunctionalTest {get; set;}
16+
public bool HandleProfiling {get; set;}
17+
public string Icon {get; set;}
18+
public string Label {get; set;}
19+
public string Name {get; set;}
20+
public string TargetPackage {get; set;}
21+
}
22+
}
23+
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using System;
2+
3+
using Android.Content.PM;
4+
using Android.Views;
5+
6+
namespace Android.App {
7+
8+
[Serializable]
9+
[AttributeUsage (AttributeTargets.Class,
10+
AllowMultiple=false,
11+
Inherited=false)]
12+
public sealed partial class ServiceAttribute : Attribute {
13+
14+
public ServiceAttribute ()
15+
{
16+
}
17+
18+
public string Name {get; set;}
19+
20+
public bool Enabled {get; set;}
21+
public bool Exported {get; set;}
22+
public string Icon {get; set;}
23+
#if ANDROID_16
24+
public bool IsolatedProcess {get; set;}
25+
#endif
26+
public string Label {get; set;}
27+
public string Permission {get; set;}
28+
public string Process {get; set;}
29+
}
30+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System;
2+
3+
namespace Android.Content {
4+
5+
[Serializable]
6+
[AttributeUsage (AttributeTargets.Class,
7+
AllowMultiple=false,
8+
Inherited=false)]
9+
public partial class BroadcastReceiverAttribute : Attribute {
10+
11+
public BroadcastReceiverAttribute ()
12+
{
13+
}
14+
15+
public bool DirectBootAware {get; set;}
16+
public bool Enabled {get; set;}
17+
public bool Exported {get; set;}
18+
public string Icon {get; set;}
19+
public string Label {get; set;}
20+
public string Name {get; set;}
21+
public string Permission {get; set;}
22+
public string Process {get; set;}
23+
}
24+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using System;
2+
3+
namespace Android.Content {
4+
5+
[Serializable]
6+
[AttributeUsage (AttributeTargets.Class,
7+
AllowMultiple=false,
8+
Inherited=false)]
9+
public partial class ContentProviderAttribute : Attribute {
10+
11+
public ContentProviderAttribute (string[] authorities)
12+
{
13+
if (authorities == null)
14+
throw new ArgumentNullException ("authorities");
15+
if (authorities.Length < 1)
16+
throw new ArgumentException ("At least one authority must be specified.", "authorities");
17+
Authorities = authorities;
18+
}
19+
20+
public string[] Authorities {get; private set;}
21+
public bool Enabled {get; set;}
22+
public bool Exported {get; set;}
23+
public bool GrantUriPermissions {get; set;}
24+
public string Icon {get; set;}
25+
public int InitOrder {get; set;}
26+
public string Label {get; set;}
27+
public bool MultiProcess {get; set;}
28+
public string Name {get; set;}
29+
public string Permission {get; set;}
30+
public string Process {get; set;}
31+
public string ReadPermission {get; set;}
32+
public bool Syncable {get; set;}
33+
public string WritePermission {get; set;}
34+
}
35+
}

0 commit comments

Comments
 (0)