{"id":18378203,"url":"https://github.com/fabulous-dev/fsharp.android.resource","last_synced_at":"2025-04-06T22:32:15.443Z","repository":{"id":39993820,"uuid":"454750272","full_name":"fabulous-dev/FSharp.Android.Resource","owner":"fabulous-dev","description":"MSBuild task to expose resources to F# .NET Fx / .NET Android projects","archived":false,"fork":false,"pushed_at":"2023-10-23T13:13:19.000Z","size":95,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-26T20:20:17.656Z","etag":null,"topics":["android","dotnet","fsharp","maui","resources","xamarin","xamarin-forms"],"latest_commit_sha":null,"homepage":"","language":"F#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fabulous-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-02T11:36:28.000Z","updated_at":"2023-05-20T18:14:52.000Z","dependencies_parsed_at":"2024-11-06T00:33:36.034Z","dependency_job_id":"560e3745-5816-41df-93c0-ecb591d0766f","html_url":"https://github.com/fabulous-dev/FSharp.Android.Resource","commit_stats":null,"previous_names":["fabulousfx/fsharp.android.resource"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabulous-dev%2FFSharp.Android.Resource","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabulous-dev%2FFSharp.Android.Resource/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabulous-dev%2FFSharp.Android.Resource/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabulous-dev%2FFSharp.Android.Resource/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabulous-dev","download_url":"https://codeload.github.com/fabulous-dev/FSharp.Android.Resource/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247563901,"owners_count":20958971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","dotnet","fsharp","maui","resources","xamarin","xamarin-forms"],"created_at":"2024-11-06T00:32:05.558Z","updated_at":"2025-04-06T22:32:15.417Z","avatar_url":"https://github.com/fabulous-dev.png","language":"F#","funding_links":[],"categories":[],"sub_categories":[],"readme":"FSharp.Android.Resource\n--\n\n\u003e [!IMPORTANT]\n\u003e This library is no longer needed for .NET 8 and higher.  \n\u003e Please remove it from your projects when you migrate.\n\nMSBuild task to expose resources to F# Xamarin.Android / .NET Android projects up until .NET 7.\n\n### Why is it no longer needed for .NET 8 and higher?\n\nStarting .NET 8, F# Android projects work out of the box without the need for this library.\n\nMicrosoft improved access to assets in your Android apps. They generate an assembly named `_Microsoft.Android.Resource.Designer` which contains all your Android assets, instead of silently injecting C# code into your F# projects.\n\n### How to use\n\n1. Replace the old type provider with the new package for your Android project\n\n```diff\n- \u003cPackageReference Include=\"Xamarin.Android.FSharp.ResourceProvider\" /\u003e\n+ \u003cPackageReference Include=\"FSharp.Android.Resource\" /\u003e\n```\n\n2. Remove the following properties from your Android project fsproj file. \n   They are managed by FSharp.Android.Resource\n   \n\n```diff\n\u003cPropertyGroup\u003e\n-   \u003cAndroidResgenFile\u003eResources/Resource.designer.cs\u003c/AndroidResgenFile\u003e\n-   \u003cAndroidUseIntermediateDesignerFile\u003efalse\u003c/AndroidUseIntermediateDesignerFile\u003e\n\u003c/PropertyGroup\u003e\n```\n\n3. Run the build one time; **it will fail but it's ok**. This generates the resource assembly.\n4. Reload your project to be able to see the new resource assembly\n5. Add `do Resource.UpdateIdValues()` to your MainActivity (or whichever activity is the first one to display)\n\n```fsharp\ntype MainActivity() =\n    inherit Activity()\n    \n    // This is required for the app to pick up the right resources\n    do Resource.UpdateIdValues()\n    \n    member _.OnCreate(bundle) =\n      base.OnCreate(bundle)\n      \n      // Now you can use Resource like usual\n      this.SetContentView(Resource.Layout.Main)\n```\n\n6. Build one more time. This time it should complete successfully.\n7. Everything should be working, enjoy!\n\n### How to use in a Continuous Integration environment\n\nGiven the first build will always fail, you can use the following steps to workaround it:\n\n1. Execute a build using the target `CompileResourceDesignerForFSharp`\n2. Execute a normal build\n\n```sh\nmsbuild -t:CompileResourceDesignerForFSharp\nmsbuild -t:Build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabulous-dev%2Ffsharp.android.resource","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabulous-dev%2Ffsharp.android.resource","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabulous-dev%2Ffsharp.android.resource/lists"}