Skip to content

Commit

Permalink
nuspec-related changes for macOS rendering support
Browse files Browse the repository at this point in the history
(Implemented in previous commit, but was not prepared for nuget.)

Also add some necessary bits to the readme file.
  • Loading branch information
knocte committed Nov 5, 2018
1 parent c0b33db commit 729475c
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<OutputPath>..\..\Build\Forms\Debug\xammac\</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand All @@ -32,7 +32,7 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<OutputPath>..\..\Build\Forms\Release\xammac\</OutputPath>
<DefineConstants></DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand Down
12 changes: 8 additions & 4 deletions Source/ZXing.Net.Mobile.macOS/ZXing.Net.Mobile.macOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<ProjectGuid>{A7E26AE0-12AF-4CFD-9B1E-3101347CC6F4}</ProjectGuid>
<ProjectTypeGuids>{A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>ZXing.Net.Mobile.macOS</RootNamespace>
<AssemblyName>ZXing.Net.Mobile.macOS</AssemblyName>
<RootNamespace>ZXing.Mobile</RootNamespace>
<AssemblyName>ZXingNetMobile</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkIdentifier>Xamarin.Mac</TargetFrameworkIdentifier>
<MonoMacResourcePrefix>Resources</MonoMacResourcePrefix>
Expand All @@ -16,7 +16,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<OutputPath>..\..\Build\Debug\xammac\</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand All @@ -31,7 +31,7 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<OutputPath>..\..\Build\Release\xammac\</OutputPath>
<DefineConstants></DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand All @@ -55,6 +55,10 @@
<Compile Include="BarcodeWriter.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ZXing.Net.Mobile.Core\ZXing.Net.Mobile.Core.csproj">
<Project>{7528DD0A-1781-47F4-ADBF-EEDDB011F6BB}</Project>
<Name>ZXing.Net.Mobile.Core</Name>
</ProjectReference>
<ProjectReference Include="..\ZXing.Net\Source\lib\zxing.portable.csproj">
<Project>{24B441F2-CBE9-4405-9FD0-72EBCBEA0EC3}</Project>
<Name>zxing.portable</Name>
Expand Down
6 changes: 6 additions & 0 deletions ZXing.Net.Mobile.Forms.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
<dependency id="Xamarin.Forms" version="2.5.0.122203" />
</group>
<group targetFramework="Xamarin.Mac20">
<dependency id="ZXing.Net.Xamarin" version="$version$" />
<dependency id="Xamarin.Forms" version="2.5.0.122203" />
</group>
<group targetFramework="portable-net45+win+wpa81+wp80">
<dependency id="ZXing.Net.Xamarin" version="$version$" />
Expand All @@ -68,6 +70,10 @@
<!-- iOS Unified API -->
<file src="Build/Forms/Release/ios-unified/ZXing.Net.Mobile.Forms.dll" target="lib\Xamarin.iOS10\ZXing.Net.Mobile.Forms.dll" />
<file src="Build/Forms/Release/ios-unified/ZXing.Net.Mobile.Forms.iOS.dll" target="lib\Xamarin.iOS10\ZXing.Net.Mobile.Forms.iOS.dll" />

<!-- Xamarin.Mac API -->
<file src="Build/Forms/Release/xammac/ZXing.Net.Mobile.Forms.dll" target="lib\Xamarin.Mac\ZXing.Net.Mobile.Forms.dll" />
<file src="Build/Forms/Release/xammac/ZXing.Net.Mobile.Forms.macOS.dll" target="lib\Xamarin.Mac\ZXing.Net.Mobile.Forms.macOS.dll" />

<!-- Windows RT / Store -->
<!-- Not supported -->
Expand Down
5 changes: 5 additions & 0 deletions ZXing.Net.Mobile.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@
<file src="Build/Release/ios-unified/ZXing.Net.Mobile.Core.dll" target="lib\Xamarin.iOS10\ZXing.Net.Mobile.Core.dll" />
<file src="Build/Release/ios-unified/ZXingNetMobile.dll" target="lib\Xamarin.iOS10\ZXingNetMobile.dll" />

<!-- Xamarin.Mac API -->
<file src="Build/Release/xammac/zxing.portable.dll" target="lib\Xamarin.Mac\zxing.portable.dll" />
<file src="Build/Release/xammac/ZXing.Net.Mobile.Core.dll" target="lib\Xamarin.Mac\ZXing.Net.Mobile.Core.dll" />
<file src="Build/Release/xammac/ZXingNetMobile.dll" target="lib\Xamarin.Mac\ZXingNetMobile.dll" />

<!-- Windows RT / Store -->
<!-- Not supported, the PCL's will get installed for this platform and throw implementation errors at runtime -->

Expand Down
14 changes: 12 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![ZXing.Net.Xamarin Logo](https://raw.github.com/nblockchain/ZXing.Net.Xamarin/master/zxing.net.mobile_128x128.png)

ZXing.Net.Xamarin is a C#/.NET library based on the open source Barcode Library: [ZXing (Zebra Crossing)](https://github.com/zxing/zxing), using the [ZXing.Net Port](https://github.com/micjahn/ZXing.Net). It works with Xamarin.iOS, Xamarin.Android, and Windows Phone. The goal of ZXing.Net.Xamarin is to make scanning barcodes as effortless and painless as possible in your own applications. The new iOS7 AVCaptureSession barcode scanning is now also supported!
ZXing.Net.Xamarin is a C#/.NET library based on the open source Barcode Library: [ZXing (Zebra Crossing)](https://github.com/zxing/zxing), using the [ZXing.Net Port](https://github.com/micjahn/ZXing.Net). It works with Xamarin.iOS, Xamarin.Android, Xamarin.Mac, and Windows Phone. The goal of ZXing.Net.Xamarin is to make scanning barcodes as effortless and painless as possible in your own applications. The new iOS7 AVCaptureSession barcode scanning is now also supported!

[![AzureDevOps CI status](https://dev.azure.com/diginex/ZXing.Net.Xamarin/_apis/build/status/ZXing.Net.Xamarin-CI)](https://dev.azure.com/diginex/ZXing.Net.Xamarin/_build/latest?definitionId=1)
[![NuGet](https://img.shields.io/nuget/v/ZXing.Net.Xamarin.svg)](https://www.nuget.org/packages/ZXing.Net.Xamarin/)
Expand Down Expand Up @@ -65,6 +65,15 @@ ZXing.Net.Mobile.Forms.iOS.Platform.Init();
```


##### macOS

In your `AppDelegate`'s `DidFinishedLaunching (..)` implementation, call:

```csharp
ZXing.Net.Mobile.Forms.macOS.Platform.Init();
```


##### Windows Phone
In your main `Page`'s constructor, you should add:

Expand All @@ -85,12 +94,13 @@ If you notice that finishing scanning or pressing the back button is causing you

### Features
- Xamarin.iOS
- Xamarin.Mac (rendering only, not scanning)
- Xamarin.Android (Including Google Glass)
- Windows Phone 8
- Simple API - Scan in as little as 2 lines of code!
- Scanner as a View - UIView (iOS) / Fragment (Android) / Control (WP)


### Android Versions
The component should work on Android 2.2 or higher. In Xamarin.Android there are 3 places in the project settings relating to Android version. YOU ***MUST*** set the Project Options -> Build -> General -> Target Framework to ***2.3*** or higher. If you still want to use 2.2, you can set the Project Options -> Build -> Android Application -> Minimum Android version to 2.2, but be sure to set the Target Android version in this section to 2.3 or higher.

Expand Down

0 comments on commit 729475c

Please sign in to comment.