Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
chenakam committed Feb 20, 2023
1 parent a6397ca commit 652a991
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,26 @@ Now, this plugin is well developed and ready for official use.
https://docs.gradle.org/current/userguide/scala_plugin.html#sec:configure_zinc_compiler
For details about how to set `zincVersion`, see the example code below.

* Known issues:
Since the Android's built-in _`JDK/JRE`_ does NOT have implements the class `java.lang.ClassValue`, but some classes require it, such as `scala.reflect.ClassTag`. So

This comment has been minimized.

Copy link
@sideeffffect

sideeffffect Feb 21, 2023

@chenakam Why would you need the workaround? A fallback for java.lang.ClassValue has already been implemented and is available since 2.13.7.
scala/scala#9752

i have made a copy [_**here**_](https://github.com/bdo-cash/assoid/blob/v.gradle/src/main/scala/java/lang/ClassValue.java).
Or as an alternative, you can set _`cacheDisabled = true`_ in [**`ClassTag`**](https://github.com/scala/scala/blob/2.12.x/src/library/scala/reflect/ClassTag.scala#L140)
to avoid method calls to **`ClassValue`**. To achieve this, you can
use [_**`classTagDisableCache`**_](https://github.com/bdo-cash/assoid/blob/v.gradle/src/main/scala/scala/compat/classTagDisableCache.scala) (it works well even
after `Proguard/R8`) at the very beginning of your app startup (
e.g. [_**`AbsApp`**_](https://github.com/bdo-cash/assoid/blob/v.gradle/src/main/scala/hobby/wei/c/core/AbsApp.scala#L51)). But you still need to define a simple class
so that it can be found at runtime:
```java
package java.lang;
//import hobby.wei.c.anno.proguard.Keep$;
//@Keep$
public abstract class ClassValue<T> {
protected abstract T computeValue(Class<?> type);
public T get(Class<?> type) { return null; }
public void remove(Class<?> type) {}
}
```

## Usage

1. Clone this repository to your project's `buildSrc` directory (**optional**):
Expand Down

0 comments on commit 652a991

Please sign in to comment.