Skip to content

Commit 45d616c

Browse files
committed
android: add support for android-arm64-v8a
1 parent bd3a802 commit 45d616c

File tree

11 files changed

+129
-15
lines changed

11 files changed

+129
-15
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,17 @@ jobs:
2929
rid: osx-x64
3030
- os: macos-latest
3131
rid: osx-arm64
32+
skipTest: true
3233
- os: macos-latest
3334
rid: ios-arm64
35+
targetOS: iOS
36+
skipTest: true
3437
- os: ubuntu-latest
3538
rid: linux-x64
39+
- os: ubuntu-latest
40+
rid: android-arm64-v8a
41+
targetOS: Android
42+
skipTest: true
3643
steps:
3744
- uses: actions/checkout@v2
3845
- uses: actions/setup-dotnet@v1
@@ -41,13 +48,13 @@ jobs:
4148
- name: Build
4249
run: |
4350
cd src/PinMame.Tests
44-
if [[ "${{ matrix.rid }}" == "ios-arm64" ]]; then
45-
dotnet build -c Release -r ${{ matrix.rid }} /p:TargetOS=iOS
51+
if [[ "${{ matrix.targetOS }}" ]]; then
52+
dotnet build -c Release -r ${{ matrix.rid }} /p:TargetOS=${{ matrix.targetOS }}
4653
else
4754
dotnet build -c Release -r ${{ matrix.rid }}
4855
fi
4956
- name: Test
50-
if: matrix.rid != 'osx-arm64' && matrix.rid != 'ios-arm64'
57+
if: matrix.skipTest != true
5158
run: |
5259
mkdir -p ~/.pinmame/roms
5360
curl -sl https://www.ipdb.org/files/4032/mm_109c.zip -o ~/.pinmame/roms/mm_109c.zip

.github/workflows/native.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,15 @@ jobs:
4242
mv libpinmame-*-osx-arm64 libpinmame-osx-arm64
4343
mv libpinmame-*-ios-arm64 libpinmame-ios-arm64
4444
mv libpinmame-*-linux-x64 libpinmame-linux-x64
45+
mv libpinmame-*-android-arm64-v8a libpinmame-android-arm64-v8a
4546
sed -i 's/__VERSION__/${{ needs.version.outputs.semver }}/g' *.nuspec
4647
nuget pack PinMame.Native.win-x64.nuspec -OutputDirectory nupkg
4748
nuget pack PinMame.Native.win-x86.nuspec -OutputDirectory nupkg
4849
nuget pack PinMame.Native.osx-x64.nuspec -OutputDirectory nupkg
4950
nuget pack PinMame.Native.osx-arm64.nuspec -OutputDirectory nupkg
5051
nuget pack PinMame.Native.ios-arm64.nuspec -OutputDirectory nupkg
5152
nuget pack PinMame.Native.linux-x64.nuspec -OutputDirectory nupkg
53+
nuget pack PinMame.Native.android-arm64-v8a.nuspec -OutputDirectory nupkg
5254
nuget pack PinMame.Native.nuspec -OutputDirectory nupkg
5355
- uses: actions/upload-artifact@v2
5456
with:
@@ -72,3 +74,4 @@ jobs:
7274
nuget push PinMame.Native.osx-arm64.${{ needs.version.outputs.semver }}.nupkg -ApiKey ${{ secrets.NUGET_KEY }} -src https://api.nuget.org/v3/index.json
7375
nuget push PinMame.Native.ios-arm64.${{ needs.version.outputs.semver }}.nupkg -ApiKey ${{ secrets.NUGET_KEY }} -src https://api.nuget.org/v3/index.json
7476
nuget push PinMame.Native.linux-x64.${{ needs.version.outputs.semver }}.nupkg -ApiKey ${{ secrets.NUGET_KEY }} -src https://api.nuget.org/v3/index.json
77+
nuget push PinMame.Native.android-arm64-v8a.${{ needs.version.outputs.semver }}.nupkg -ApiKey ${{ secrets.NUGET_KEY }} -src https://api.nuget.org/v3/index.json

.github/workflows/publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
ref: ${{ github.event.client_payload.commitish }}
1313
- run: |
1414
cd src/PinMame
15+
dotnet build -c Release /p:TargetOS=Android
1516
dotnet build -c Release /p:TargetOS=iOS
1617
dotnet build -c Release /p:TargetOS=OSX
1718
dotnet build -c Release /p:TargetOS=Linux
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<package xmlns="http://schemas.microsoft.com/packaging/2013/01/nuspec.xsd">
3+
<metadata>
4+
<!-- package -->
5+
<id>PinMame.Native.android-arm64-v8a</id>
6+
<title>PinMame - Native binaries for android-arm64-v8a</title>
7+
<version>__VERSION__</version>
8+
<description>This package complements the PinMame package and contains native binaries of libpinmame for android-arm64-v8a</description>
9+
<summary>Native binaries of libpinmame for android-arm64-v8a</summary>
10+
<projectUrl>https://github.com/VisualPinball/pinmame-dotnet</projectUrl>
11+
<repository type="git" url="https://github.com/VisualPinball/pinmame-dotnet" />
12+
<tags>libpinmame binaries</tags>
13+
<!-- legal -->
14+
<license type="expression">BSD-3-Clause</license>
15+
<authors>Jason Millard</authors>
16+
<owners>PinMAME development team and contributors</owners>
17+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
18+
<copyright>PinMAME development team and contributors</copyright>
19+
<dependencies>
20+
<group targetFramework="netstandard2.1" />
21+
</dependencies>
22+
</metadata>
23+
<files>
24+
<!-- The build bits -->
25+
<file src="targets\PinMame.Native.android-arm64-v8a.targets" target="build\netstandard2.1" />
26+
<!-- Include libpinmame android-arm64-v8a binaries -->
27+
<file src="libpinmame-android-arm64-v8a\libpinmame.*.so" target="runtimes\android-arm64-v8a\native" />
28+
<!-- Include the license -->
29+
<file src="..\..\LICENSE.txt" />
30+
<!-- A dummy reference which prevents NuGet from adding any compilation references when this package is imported -->
31+
<file src="_._" target="lib\netstandard2.1" />
32+
</files>
33+
</package>

native/nuget/PinMame.Native.nuspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<dependency id="PinMame.Native.osx-arm64" version="__VERSION__" include="native" />
2525
<dependency id="PinMame.Native.ios-arm64" version="__VERSION__" include="native" />
2626
<dependency id="PinMame.Native.linux-x64" version="__VERSION__" include="native" />
27+
<dependency id="PinMame.Native.android-arm64-v8a" version="__VERSION__" include="native" />
2728
</group>
2829
</dependencies>
2930
</metadata>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Condition="'$(MSBuildRuntimeType)' == 'Mono'">
4+
<None Include="$(MSBuildThisFileDirectory)..\..\runtimes\android-arm64-v8a\native\*">
5+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
6+
</None>
7+
</ItemGroup>
8+
</Project>

src/PinMame.Example/PinMame.Example.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</ItemGroup>
1818

1919
<ItemGroup>
20-
<PackageReference Include="PinMame.Native" Version="3.5.0-preview.6" />
20+
<PackageReference Include="PinMame.Native" Version="3.5.0-preview.12" />
2121
<PackageReference Include="NLog" Version="4.7.13" />
2222
</ItemGroup>
2323

src/PinMame.Tests/PinMame.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</ItemGroup>
2424

2525
<ItemGroup>
26-
<PackageReference Include="PinMame.Native" Version="3.5.0-preview.6" />
26+
<PackageReference Include="PinMame.Native" Version="3.5.0-preview.12" />
2727
</ItemGroup>
2828

2929
</Project>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// pinmame-dotnet
2+
// Copyright (C) 1999-2022 PinMAME development team and contributors
3+
//
4+
// Redistribution and use in source and binary forms, with or without
5+
// modification, are permitted provided that the following conditions
6+
// are met:
7+
//
8+
// 1. Redistributions of source code must retain the above copyright
9+
// notice, this list of conditions and the following disclaimer.
10+
//
11+
// 2. Redistributions in binary form must reproduce the above copyright
12+
// notice, this list of conditions and the following disclaimer in the
13+
// documentation and/or other materials provided with the distribution.
14+
//
15+
// 3. Neither the name of the copyright holder nor the names of its
16+
// contributors may be used to endorse or promote products derived
17+
// from this software without specific prior written permission.
18+
//
19+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22+
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23+
// COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24+
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25+
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26+
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28+
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29+
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30+
// POSSIBILITY OF SUCH DAMAGE.
31+
32+
namespace PinMame.Interop
33+
{
34+
internal static partial class Libraries
35+
{
36+
internal const string PinMame = "libpinmame.3.5.so";
37+
}
38+
}

src/PinMame/PinMame.csproj

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
<TargetOS Condition="$([MSBuild]::IsOSPlatform('Windows'))">Windows</TargetOS>
2727
</PropertyGroup>
2828
<ItemGroup>
29-
<PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0"/>
30-
<PackageReference Include="NLog" Version="4.7.13"/>
29+
<PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0" />
30+
<PackageReference Include="NLog" Version="4.7.13" />
3131
</ItemGroup>
3232
<!-- Append target operating system to output path -->
3333
<PropertyGroup>
@@ -39,16 +39,14 @@
3939
<Link>Interop\Libraries.cs</Link>
4040
</Compile>
4141
</ItemGroup>
42-
<!-- Include .NET Standard packages on macOS, iOS, and Linux -->
42+
<!-- Include .NET Standard packages on macOS, iOS, Linux, and Android -->
4343
<ItemGroup>
44-
<None Include="$(MSBuildThisFileDirectory)bin\$(Platform)\$(Configuration)\netstandard2.1\OSX\PinMame.dll" Pack="true" PackagePath="runtimes\osx\lib\netstandard2.1"/>
45-
<None Include="$(MSBuildThisFileDirectory)bin\$(Platform)\$(Configuration)\netstandard2.1\iOS\PinMame.dll" Pack="true" PackagePath="runtimes\ios\lib\netstandard2.1"/>
46-
<None Include="$(MSBuildThisFileDirectory)bin\$(Platform)\$(Configuration)\netstandard2.1\Linux\PinMame.dll" Pack="true" PackagePath="runtimes\linux\lib\netstandard2.1"/>
44+
<None Include="$(MSBuildThisFileDirectory)bin\$(Platform)\$(Configuration)\netstandard2.1\OSX\PinMame.dll" Pack="true" PackagePath="runtimes\osx\lib\netstandard2.1" />
45+
<None Include="$(MSBuildThisFileDirectory)bin\$(Platform)\$(Configuration)\netstandard2.1\iOS\PinMame.dll" Pack="true" PackagePath="runtimes\ios\lib\netstandard2.1" />
46+
<None Include="$(MSBuildThisFileDirectory)bin\$(Platform)\$(Configuration)\netstandard2.1\Linux\PinMame.dll" Pack="true" PackagePath="runtimes\linux\lib\netstandard2.1" />
47+
<None Include="$(MSBuildThisFileDirectory)bin\$(Platform)\$(Configuration)\netstandard2.1\Android\PinMame.dll" Pack="true" PackagePath="runtimes\android\lib\netstandard2.1" />
4748
</ItemGroup>
4849
<ItemGroup>
49-
<None Include="..\..\LICENSE.txt" Pack="true" PackagePath="LICENSE.txt"/>
50-
</ItemGroup>
51-
<ItemGroup>
52-
<Folder Include="Mono\"/>
50+
<None Include="..\..\LICENSE.txt" Pack="true" PackagePath="LICENSE.txt" />
5351
</ItemGroup>
5452
</Project>

0 commit comments

Comments
 (0)