diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml new file mode 100644 index 0000000..d896c95 --- /dev/null +++ b/.github/workflows/common.yml @@ -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 diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml new file mode 100644 index 0000000..8724813 --- /dev/null +++ b/.github/workflows/pullrequest.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..0b10195 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4cdfb71 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +# Artifacts +bin +obj + +# Visual studio +.vs +*.user + +# Resharper +_ReSharper.Caches + +# NCrunch +*.ncrunchsolution +_NCrunch* \ No newline at end of file diff --git a/AndroidX.Work.Testing.sln b/AndroidX.Work.Testing.sln new file mode 100644 index 0000000..5a61843 --- /dev/null +++ b/AndroidX.Work.Testing.sln @@ -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 diff --git a/AndroidX.Work.Testing/AndroidX.Work.Testing.csproj b/AndroidX.Work.Testing/AndroidX.Work.Testing.csproj new file mode 100644 index 0000000..1743c27 --- /dev/null +++ b/AndroidX.Work.Testing/AndroidX.Work.Testing.csproj @@ -0,0 +1,61 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {900872E6-329C-4FAF-A35C-B11F452051E1} + {10368E6C-D01B-4462-8E8B-01FC667A7035};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {77efb91c-a7e9-4b0e-a7c5-31eeec3c6d46} + Library + Properties + AndroidX.Work.Testing + AndroidX.Work.Testing + 512 + True + false + v9.0 + class-parse + XAJavaInterop1 + PackageReference + MIT + + + true + portable + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + bin\Debug\AndroidX.Work.Testing.xml + + + portable + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AndroidX.Work.Testing/Jars/work-testing-2.9.0.aar b/AndroidX.Work.Testing/Jars/work-testing-2.9.0.aar new file mode 100644 index 0000000..005fa46 Binary files /dev/null and b/AndroidX.Work.Testing/Jars/work-testing-2.9.0.aar differ diff --git a/AndroidX.Work.Testing/Properties/AssemblyInfo.cs b/AndroidX.Work.Testing/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..87ef74e --- /dev/null +++ b/AndroidX.Work.Testing/Properties/AssemblyInfo.cs @@ -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")] diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..70f89da --- /dev/null +++ b/NOTICE @@ -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. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..200646d --- /dev/null +++ b/README.md @@ -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 \ No newline at end of file