Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.

Commit

Permalink
Merge pull request #28 from jamesmontemagno/3-0-standard
Browse files Browse the repository at this point in the history
integrate .net standard support
  • Loading branch information
jamesmontemagno authored Jul 3, 2017
2 parents fdc5144 + 95df7c2 commit 233abe4
Show file tree
Hide file tree
Showing 29 changed files with 279 additions and 1,093 deletions.
97 changes: 97 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Suppress: EC112
# top-most EditorConfig file
root = true

# Don't use tabs for indentation.
[*]
indent_style = tab
# (Please don't specify an indent_size here; that has too many unintended consequences.)

# Code files
[*.{cs,csx,vb,vbx}]
indent_size = 4

# Xml project files
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
indent_size = 2

# Xml config files
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
indent_size = 2

# JSON files
[*.json]
indent_size = 2

# Dotnet code style settings:
[*.{cs,vb}]
# Sort using and Import directives with System.* appearing first
dotnet_sort_system_directives_first = false
# Avoid "this." and "Me." if not necessary
dotnet_style_qualification_for_field = false:suggestion
dotnet_style_qualification_for_property = false:suggestion
dotnet_style_qualification_for_method = false:suggestion
dotnet_style_qualification_for_event = false:suggestion

# Use language keywords instead of framework type names for type references
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion

# Suggest more modern language features when available
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion

# Naming Conventions:
# Pascal Casing
dotnet_naming_symbols.method_and_property_symbols.applicable_kinds= method,property,enum
dotnet_naming_symbols.method_and_property_symbols.applicable_accessibilities = *
dotnet_naming_style.pascal_case_style.capitalization = pascal_case

dotnet_naming_rule.methods_and_properties_must_be_pascal_case.severity = warning
dotnet_naming_rule.methods_and_properties_must_be_pascal_case.symbols = method_and_property_symbols
dotnet_naming_rule.methods_and_properties_must_be_pascal_case.style = pascal_case_style

# Non-public members must be lower-case
dotnet_naming_symbols.non_public_symbols.applicable_kinds = property,method,field,event,delegate
dotnet_naming_symbols.non_public_symbols.applicable_accessibilities = private
dotnet_naming_style.all_lower_case_style.capitalization = camel_case

dotnet_naming_rule.non_public_members_must_be_lower_case.severity = warning
dotnet_naming_rule.non_public_members_must_be_lower_case.symbols = non_public_symbols
dotnet_naming_rule.non_public_members_must_be_lower_case.style = all_lower_case_style

# CSharp code style settings:
[*.cs]
# Do not prefer "var" everywhere
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = true:suggestion

# Prefer method-like constructs to have a block body
csharp_style_expression_bodied_methods = true:suggestion
csharp_style_expression_bodied_constructors = true:none
csharp_style_expression_bodied_operators = true:none

# Prefer property-like constructs to have an expression-body
csharp_style_expression_bodied_properties = true:suggestion
csharp_style_expression_bodied_indexers = true:none
csharp_style_expression_bodied_accessors = true:none

# Suggest more modern language features when available
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion

# Newline settings
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true

16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ Build status: [![Build status](https://ci.appveyor.com/api/projects/status/9y9lk
**Platform Support**

|Platform|Supported|Version|
| ------------------- | :-----------: | :------------------: |
|Xamarin.iOS|Yes|iOS 7+|
|Xamarin.Android|Yes|API 10+|
|Windows Phone Silverlight|Yes|8.0+|
|Windows Phone RT|Yes|8.1+|
|Windows Store RT|Yes|8.1+|
|Windows 10 UWP|Yes|10+|
|Xamarin.Mac|No||
| ------------------- | :------------------: |
|Xamarin.iOS|iOS 7+|
|Xamarin.Android|API 10+|
|Windows 10 UWP|10+|
|Xamarin.Mac|All|
|Xamarin.Mac|All|
|watchOS|All|
|tvOS|All|


### API Usage
Expand Down
13 changes: 8 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
version: 2.1.3-beta.{build}
version: 3.0.0.{build}-alpha
image: Visual Studio 2017
assembly_info:
patch: true
file: '**\AssemblyInfo.*'
assembly_version: '{version}'
assembly_file_version: '{version}'
assembly_informational_version: '{version}'
install:
- echo y | "C:\Program Files (x86)\Android\android-sdk\tools\android.bat" update sdk -u -a -t tools
- echo y | "C:\Program Files (x86)\Android\android-sdk\tools\android.bat" update sdk -u -a -t platform-tools
- echo y | "C:\Program Files (x86)\Android\android-sdk\tools\android.bat" update sdk -u -a -t build-tools-25.0.6
- echo y | "C:\Program Files (x86)\Android\android-sdk\tools\android.bat" update sdk -u -a -t android-25
- echo y | "C:\Program Files (x86)\Android\android-sdk\tools\android.bat" update sdk -u -a -t android-15
build_script:
- cmd: >-
powershell .\install-android-sdk.ps1
powershell .\bootstrapper.ps1 -Target Default -Verbosity diagnostic
artifacts:
- path: ./Build/nuget/*.nupkg
name: NuGet
- path: ./component/*.xam
name: Component
35 changes: 2 additions & 33 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ var libraries = new Dictionary<string, string> {
{ "./src/DeviceInfo.sln", "Any" },
};

var samples = new Dictionary<string, string> {
{ "./samples/DeviceInfoSample.sln", "Win" },
};

var BuildAction = new Action<Dictionary<string, string>> (solutions =>
{
Expand Down Expand Up @@ -59,15 +56,9 @@ Task("Libraries").Does(()=>
BuildAction(libraries);
});

Task("Samples")
.IsDependentOn("Libraries")
.Does(()=>
{
BuildAction(samples);
});

Task ("NuGet")
.IsDependentOn ("Samples")
.IsDependentOn ("Libraries")
.Does (() =>
{
if(!DirectoryExists("./Build/nuget/"))
Expand All @@ -82,31 +73,9 @@ Task ("NuGet")
});
});

Task("Component")
.IsDependentOn("Samples")
.IsDependentOn("NuGet")
.Does(()=>
{
if(!version.Contains("beta"))
{
// Clear out xml files from build (they interfere with the component packaging)
DeleteFiles ("./Build/**/*.xml");

// Generate component.yaml files from templates
CopyFile ("./component/component.template.yaml", "./component/component.yaml");

// Replace version in template files
ReplaceTextInFiles ("./**/component.yaml", "{VERSION}", version);

var xamCompSettings = new XamarinComponentSettings { ToolPath = "./tools/xamarin-component.exe" };

// Package both components
PackageComponent ("./component/", xamCompSettings);
}
});

//Build the component, which build samples, nugets, and libraries
Task ("Default").IsDependentOn("Component");
Task ("Default").IsDependentOn("NuGet");


Task ("Clean").Does (() =>
Expand Down
46 changes: 30 additions & 16 deletions nuget/Plugin.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,51 @@
<summary>Get device information such as Model, OS, and other properties.</summary>
<tags>xamarin, pcl, xam.pcl, settings, windows phone, winphone, wp8, winrt, android, xamarin.forms, ios</tags>
<dependencies>
<group targetFramework="net">
</group>
<group targetFramework="win">
</group>
<group targetFramework="wp">
</group>
<group targetFramework="wpa">
</group>
<group targetFramework="netstandard1.0">
<dependency id="NETStandard.Library" version="1.6.1" />
</group>
<group targetFramework="MonoAndroid10">
<dependency id="Plugin.CurrentActivity" version="1.0.1"/>
</group>
<group targetFramework="Xamarin.iOS10">
</group>
<group targetFramework="Xamarin.Mac20">
</group>
<group targetFramework="portable-net45+win+wpa81+wp80">
</group>
<group targetFramework="uap">
</group>
<group targetFramework="dotnet">
</group>
<group targetFramework="xamarintvos">
</group>
<group targetFramework="xamarinwatchos">
</group>
</dependencies>
</metadata>
<files>
<file src="nuget\readme.txt" target="readme.txt" />
<!--Core-->
<file src="src\DeviceInfo.Plugin\bin\Release\Plugin.DeviceInfo.*" target="lib\portable-net45+wp80+win8+wpa81" />


<!--Win Phone Silverlight-->
<file src="src\DeviceInfo.Plugin.WindowsPhone8\bin\Release\Plugin.DeviceInfo.*" target="lib\wp8" />


<!--Win Phone 81-->
<file src="src\DeviceInfo.Plugin.WindowsPhone81\bin\Release\Plugin.DeviceInfo.*" target="lib\wpa81" />

<!--Core-->
<file src="src\DeviceInfo.Plugin\bin\Release\netstandard1.0\Plugin.DeviceInfo.*" target="lib\netstandard1.0" />

<!--WinStore-->
<file src="src\DeviceInfo.Plugin.WindowsStore\bin\Release\Plugin.DeviceInfo.*" target="lib\win8" />


<!--Xamarin.Android-->
<file src="src\DeviceInfo.Plugin.Android\bin\Release\Plugin.DeviceInfo.*" target="lib\MonoAndroid10" />


<!--Xamarin.iOS Unified-->
<file src="src\DeviceInfo.Plugin.iOSUnified\bin\iPhone\Release\Plugin.DeviceInfo.*" target="lib\Xamarin.iOS10" />
<!--Xamarin.iOS-->
<file src="src\DeviceInfo.Plugin.iOS\bin\iPhone\Release\Plugin.DeviceInfo.*" target="lib\Xamarin.iOS10" />

<!--watchos-->
<!--watchos-->
<file src="src\DeviceInfo.Plugin.watchOS\bin\Release\Plugin.DeviceInfo.*" target="lib\XamarinWatchOS" />


Expand Down
34 changes: 0 additions & 34 deletions nuget/readme.txt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,54 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<MinimumVisualStudioVersion>10.0</MinimumVisualStudioVersion>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{6EDB0588-FFC5-4EF5-8A99-9E241D0F878D}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Plugin.DeviceInfo.Abstractions</RootNamespace>
<TargetFramework>netstandard1.0</TargetFramework>
<AssemblyName>Plugin.DeviceInfo.Abstractions</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TargetFrameworkProfile>Profile259</TargetFrameworkProfile>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<RootNamespace>Plugin.DeviceInfo.Abstractions</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Plugin.DeviceInfo.Abstractions.xml</DocumentationFile>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\Release\netstandard1.0\Plugin.DeviceInfo.Abstractions.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .NET Framework is automatically included -->
</ItemGroup>
<ItemGroup>
<Compile Include="Idiom.cs" />
<Compile Include="Platform.cs" />
<Compile Include="IDeviceInfo.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->

</Project>
Loading

0 comments on commit 233abe4

Please sign in to comment.