Skip to content

Commit

Permalink
feat: Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sGeeK44 committed May 15, 2024
0 parents commit 89695ef
Show file tree
Hide file tree
Showing 10 changed files with 207 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/common.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish
on:
workflow_call:
inputs:
lib-version:
required: true
type: string
configuration:
required: true
type: string
publish-package:
default: false
type: boolean

jobs:
common:
name: Build and Publish lib
runs-on: [self-hosted, xamarin-android]
steps:
- name: Clean Workspace
uses: mickem/clean-after-action@v1

- name: Checkout
uses: actions/checkout@v3

- name: Modify AssemblyInfo files
uses: mingjun97/file-regex-replace@v1
with:
regex: 'AssemblyVersion\("(.*?)"\)'
replacement: 'AssemblyVersion("${{ inputs.lib-version }}")'
include: 'AssemblyInfo.cs'

- name: Restore packages
run: nuget restore AndroidX.Work.Testing.sln

- name: Build the lib
run: msbuild AndroidX.Work.Testing.sln -p:Configuration=${{ inputs.configuration }} -clp:Summary

- name: Package the lib
if: ${{ inputs.publish-package == true }}
run: nuget pack AndroidX.Work.Testing/AndroidX.Work.Testing.csproj -properties Configuration=${{ inputs.configuration }} -Version ${{ inputs.lib-version }}

- name: Publish the lib
if: ${{ inputs.publish-package == true }}
run: nuget push *.nupkg -ApiKey ${{ secrets.NUGET_API_KEY }} -Source https://api.nuget.org/v3/index.json -SkipDuplicate
13 changes: 13 additions & 0 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: PullRequest

on:
workflow_dispatch:
pull_request:

jobs:
build:
uses: ./.github/workflows/common.yml
with:
lib-version: 1.0.${{ github.event.pull_request.number }}.${{ github.run_number }}
configuration: Release
secrets: inherit
16 changes: 16 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Release

on:
workflow_dispatch:
push:
tags:
- '*'

jobs:
publish:
uses: ./.github/workflows/common.yml
with:
lib-version: ${{github.ref_name}}
configuration: Release
publish-package: true
secrets: inherit
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Artifacts
bin
obj

# Visual studio
.vs
*.user

# Resharper
_ReSharper.Caches

# NCrunch
*.ncrunchsolution
_NCrunch*
25 changes: 25 additions & 0 deletions AndroidX.Work.Testing.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34728.123
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AndroidX.Work.Testing", "AndroidX.Work.Testing\AndroidX.Work.Testing.csproj", "{900872E6-329C-4FAF-A35C-B11F452051E1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{900872E6-329C-4FAF-A35C-B11F452051E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{900872E6-329C-4FAF-A35C-B11F452051E1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{900872E6-329C-4FAF-A35C-B11F452051E1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{900872E6-329C-4FAF-A35C-B11F452051E1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {16E7C639-92C2-4C1D-9E4C-88E68020BC06}
EndGlobalSection
EndGlobal
61 changes: 61 additions & 0 deletions AndroidX.Work.Testing/AndroidX.Work.Testing.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{900872E6-329C-4FAF-A35C-B11F452051E1}</ProjectGuid>
<ProjectTypeGuids>{10368E6C-D01B-4462-8E8B-01FC667A7035};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TemplateGuid>{77efb91c-a7e9-4b0e-a7c5-31eeec3c6d46}</TemplateGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AndroidX.Work.Testing</RootNamespace>
<AssemblyName>AndroidX.Work.Testing</AssemblyName>
<FileAlignment>512</FileAlignment>
<Deterministic>True</Deterministic>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
<AndroidClassParser>class-parse</AndroidClassParser>
<AndroidCodegenTarget>XAJavaInterop1</AndroidCodegenTarget>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>portable</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\AndroidX.Work.Testing.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Android" />
<Reference Include="System" />
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<LibraryProjectZip Include="Jars\work-testing-2.9.0.aar" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.Bindings.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>
Binary file added AndroidX.Work.Testing/Jars/work-testing-2.9.0.aar
Binary file not shown.
24 changes: 24 additions & 0 deletions AndroidX.Work.Testing/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AndroidX.Work.Testing")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AndroidX.Work.Testing")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
4 changes: 4 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Custom Activity on Crash library
Copyright (c) 2014-2017 Eduard Ereza, http://www.eduardereza.com/

This product is licensed under the terms of the Apache Software License 2.0. See the LICENSE file for the full license text.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This package add Xamarin Binding for Android Java library AndroidX.Work.Testing

.aar taken on maven repo: https://mvnrepository.com/artifact/androidx.work/work-testing/

Xamarin docs for inluding android library: https://docs.microsoft.com/fr-fr/xamarin/android/platform/binding-java-library/binding-an-aar

0 comments on commit 89695ef

Please sign in to comment.