flavioarfaria / catalog Goto Github PK
View Code? Open in Web Editor NEWGenerate type-safe, user-friendly extensions to resolve Android resources.
License: Apache License 2.0
Generate type-safe, user-friendly extensions to resolve Android resources.
License: Apache License 2.0
Hi, I've been trying to set up the plugin to be used with Jetpack Compose, and I have the following string:
<string name="welcome">Welcome back!</string>
The issue is that it gets generated twice, one for Context
context, and the other for the Fragment
context:
context(Context)
@Composable
@ReadOnlyComposable
public inline fun Strings.welcome(): CharSequence = stringResource(R.string.welcome)
context(Fragment)
@Composable
@ReadOnlyComposable
public inline fun Strings.welcome(): CharSequence = stringResource(R.string.welcome)
Then, when I try to call
com.flaviofaria.catalog.runtime.compose.Strings.welcome()
This is thrown:
None of the following functions can be called with the arguments supplied.
Strings.welcome() defined in com....
Strings.welcome() defined in com....
Catalog's Gradle plugin currently includes dependencies on both the Android and Kotlin Gradle plugins which forces an additional set of these rather large and unnecessary transitive dependencies being included in the dependency graphs of end users. Since Catalog generates Kotlin code for use in Android apps, it is very safe to assume that both these dependencies will already exist on the plugin classpath of users.
Lowering these from implementation
to compileOnly
will be a sufficient resolution for this.
GenerateResourceExtensionsTask
makes a call to Task.project
here which is incompatible with configuration caching.
When adding KtDoc contents to an string's content, for example:
...
<!--
Welcomes the user to the app
@author Arnau Mora
@since 20221206
-->
<string name="welcome">Welcome, user!</string>
...
Since the content is indented, this is the comment that gets generated:
/**
* Welcomes the user to the app
* @author Arnau Mora
* @since 20221206
*/
context(Context)
@Composable
@ReadOnlyComposable
public inline fun Strings.welcome(): CharSequence = stringResource(R.string.welcome)
Maybe trimming all the lines that start with spaces and @
could be a fix. Or simply trimming each line would fix it.
This happens after I add a dependency on this project.
For reference my Gradle Plugin Version is 7.3.1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.