-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f1d7c1b
commit 0b0923a
Showing
4 changed files
with
162 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -209,73 +209,86 @@ public abstract class Proxy_MvpView implements MvpView { | |
this.inner = instance; | ||
} | ||
|
||
public abstract boolean predicate(final String methodName, final Object... args); | ||
public abstract boolean predicate(@Methods @NonNull final String methodName, | ||
final Object... args); | ||
|
||
public final Observable<Boolean> dummyCall() { | ||
if (!predicate( "dummyCall" )) { | ||
if (!predicate( Methods.DUMMYCALL )) { | ||
// @com.olku.annotations.AutoProxy.Yield("null") | ||
return (Observable<Boolean>)null; | ||
} | ||
return this.inner.dummyCall(); | ||
} | ||
|
||
public final Observable<Boolean> dummyCall(final List<String> generic) { | ||
if (!predicate( "dummyCall", generic )) { | ||
if (!predicate( Methods.DUMMYCALL, generic )) { | ||
// @com.olku.annotations.AutoProxy.Yield(adapter=com.olku.generators.RetRxGenerator.class, value="empty") | ||
return Observable.empty(); | ||
} | ||
return this.inner.dummyCall(generic); | ||
} | ||
|
||
public final Observable<Boolean> dummyCall(final String message, final List<String> args) { | ||
if (!predicate( "dummyCall", message, args )) { | ||
// @com.olku.annotations.AutoProxy.Yield("throws") | ||
throw new UnsupportedOperationException("cannot resolve return type."); | ||
if (!predicate( Methods.DUMMYCALL, message, args )) { | ||
// @com.olku.annotations.AutoProxy.Yield | ||
throw new UnsupportedOperationException("cannot resolve return value."); | ||
} | ||
return this.inner.dummyCall(message, args); | ||
} | ||
|
||
public final Observable<Boolean> dummyCall(final String message, final Object... args) { | ||
if (!predicate( "dummyCall", message, args )) { | ||
if (!predicate( Methods.DUMMYCALL, message, args )) { | ||
// @com.olku.annotations.AutoProxy.Yield(adapter=com.olku.generators.RetRxGenerator.class, value="error") | ||
return Observable.error(new UnsupportedOperationException("unsupported method call")); | ||
} | ||
return this.inner.dummyCall(message, args); | ||
} | ||
|
||
public final double numericCall() { | ||
if (!predicate( "numericCall" )) { | ||
if (!predicate( Methods.NUMERICCALL )) { | ||
// @com.olku.annotations.AutoProxy.Yield("0") | ||
return 0; | ||
} | ||
return this.inner.numericCall(); | ||
} | ||
|
||
public final boolean booleanCall() { | ||
if (!predicate( "booleanCall" )) { | ||
if (!predicate( Methods.BOOLEANCALL )) { | ||
// @com.olku.annotations.AutoProxy.Yield("false") | ||
return false; | ||
} | ||
return this.inner.booleanCall(); | ||
} | ||
|
||
public final boolean dispatchDeepLink(@NonNull final Uri deepLink) { | ||
if (!predicate( "dispatchDeepLink", deepLink )) { | ||
if (!predicate( Methods.DISPATCHDEEPLINK, deepLink )) { | ||
// @com.olku.annotations.AutoProxy.Yield("direct") | ||
// direct call, ignore predicate result | ||
} | ||
return this.inner.dispatchDeepLink(deepLink); | ||
} | ||
|
||
public final Observable<Boolean> startHearthAnimation() { | ||
if (!predicate( "startHearthAnimation" )) { | ||
if (!predicate( Methods.STARTHEARTHANIMATION )) { | ||
// @com.olku.annotations.AutoProxy.Yield(adapter=com.olku.generators.JustRxGenerator.class, value="true") | ||
return Observable.just(true); | ||
} | ||
return this.inner.startHearthAnimation(); | ||
} | ||
} | ||
|
||
@StringDef({Methods.BOOLEANCALL, Methods.DISPATCHDEEPLINK, Methods.DUMMYCALL, Methods.NUMERICCALL, Methods.STARTHEARTHANIMATION}) | ||
public @interface Methods { | ||
String BOOLEANCALL = "booleanCall"; | ||
|
||
String DISPATCHDEEPLINK = "dispatchDeepLink"; | ||
|
||
String DUMMYCALL = "dummyCall"; | ||
|
||
String NUMERICCALL = "numericCall"; | ||
|
||
String STARTHEARTHANIMATION = "startHearthAnimation"; | ||
} | ||
} | ||
``` | ||
|
||
## Step #5: Usage in project | ||
|
@@ -291,7 +304,7 @@ public abstract class Proxy_MvpView implements MvpView { | |
// destroyed or any other inproper state). | ||
return new Proxy_MvpView(this.view) { | ||
@Override | ||
public boolean predicate(final String methodName, final Object... args) { | ||
public boolean predicate(@Methods @NonNull final String methodName, final Object... args) { | ||
return ((BaseFragment) inner).isUpdatable(); | ||
} | ||
}; | ||
|
@@ -327,7 +340,50 @@ Debugging: | |
|
||
[more details ...](https://stackoverflow.com/questions/8587096/how-do-you-debug-java-annotation-processors-using-intellij) | ||
|
||
## Roadmap | ||
## How to Change/Generate GPG signing key? | ||
|
||
```bash | ||
brew install gpg | ||
gpg --gen-key | ||
|
||
# pub rsa2048 2020-04-21 [SC] [expires: 2022-04-21] | ||
# 6B38C8BB4161F9AF99133B4B8DF78BA02F1868F9 | ||
# uid Oleksandr Kucherenko <[email protected]> | ||
# sub rsa2048 2020-04-21 [E] [expires: 2022-04-21] | ||
gpg -a --export 6B38C8BB4161F9AF99133B4B8DF78BA02F1868F9 >gpg.public.key | ||
gpg -a --export-secret-key 6B38C8BB4161F9AF99133B4B8DF78BA02F1868F9 >gpg.private.key | ||
|
||
``` | ||
|
||
- open https://bintray.com/profile/edit | ||
- Select `GPG Signing` | ||
- First set the public key and press Update | ||
- Than press Private Key `Click to Change` and upload private key | ||
- Store Passpharse in `credentials.gradle` | ||
|
||
```diff | ||
- ext.gpg_password = '<secret>' | ||
+ ext.gpg_password = 'my_new_and_secure_passphrase' | ||
|
||
``` | ||
|
||
|
||
## How to publish? | ||
|
||
Edit file `credentials.gradle` in the root of the project: | ||
|
||
```diff | ||
- ext.bintray_dryrun = true | ||
+ ext.bintray_dryrun = false | ||
``` | ||
|
||
Disable DRY_RUN mode, that will allow binaries upload to the bintray side. Than Run: | ||
|
||
```bash | ||
./gradlew bintrayUpload | ||
``` | ||
|
||
# Roadmap | ||
|
||
- [x] Incremental Annotation Processing | ||
- [x] Create constants class for method names | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
-----BEGIN PGP PRIVATE KEY BLOCK----- | ||
|
||
lQPGBF6fBagBCADIIkoxvmHBbGb0ntNdaWOTNdp+Di7n+wO+3c+wCPh7FN6Sw+Lm | ||
WxZD4PWYMnN3/MLKYYfgVuIslVwy53LUaMEv/jKWPWxahGT1aOFc6uXygd1R7QL8 | ||
5hd4DyAdx+CDXYRMSETq7AvVDiY5ftfXqDDeiohgsnHOcTLB4nPWFu9sdCR15Zvg | ||
8VdzveRtm7ia7Bgcwn4BfTko9qnqrtxZwKOXhGEWCsbd8BL2rcsYV8/LEEK91/2W | ||
MRvvylECKVkzMoBSWXxmUDC+KzOr8Hg0DGIGN1E6oILj9kCh0RhS+b8APDF469uk | ||
uttjvvlgi1DRp8kSBrtmZ7zoEMFtyf+gufwZABEBAAH+BwMCn7+d/543tV7tbwEC | ||
iNM5GoS4wQhmV9PVbiaKJgr+53yncCWktNXH1u2gfvtuVnCzISnlEaBp4YJRhnVO | ||
kYdwbMzcm0HXGfRohZCrpF+OMNyZ3m6CuSGNqe88GEqwQqa4CQnhG//UcREMp847 | ||
KkBCAGqFi4+kSrE6EWU8ICDsHJ+mII1+JQ7F7sAnoCflyQUApof2imHB3Od2LNM+ | ||
tkVtgpR0thI2+Tq6LRexlGAsK2tuEhnDXXZxgCezDOBuCUulPPr9wWnSNjScI6zA | ||
/mLWsH2AFgg7u0xWh9+iFonJ1kGk5Vi+fQChqv7d3+0y7qD5mL4a65ya9O8YGKGk | ||
69gHzVE08YGrldl2xGtfpqkexqTgj6KxJOFpCpqt+zdU2c+7LHKlxdvyE/r8ZgXu | ||
e4f2roXqFPN1LsNMj34ULVyeUYoIqYxoocQMywdu46spRbiNXPrJBSV/S5IajXE1 | ||
hjR+nTh3bfur6CVTPxhb66L8KJLLO1NJjwL6IrJSKAVr72e/nNn9c64LxnEKeesc | ||
EKJZ7PF+teU96fo2pJULhUM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 | ||
6gK9nH2Uo0g3zuuki8pZK5wQBKkTlMc3NHOHt28YxY5ZZ/i0LA+HLggtgAMY3KCV | ||
nz6YK478mnhrv05HHz3YvGdweta0ZUEDzPy+G4uZQL/TuzEqKh2g7BnxjAnhkj9s | ||
lsJ8z5tPZYw1sq5UGXdax6A+jG/pSo04PMOsiQE8BBgBCAAmFiEEazjIu0Fh+a+Z | ||
EztLjfeLoC8YaPkFAl6fBagCGwwFCQPCZwAACgkQjfeLoC8YaPmZcQf+OcdqNROE | ||
hWl2gTAKrUx9Us6z6eu5e7nnJxnpS9oQ/Se/alikEoZ4o0vuED3DI9PDOQP2YjnG | ||
lUxy93zOwwvsA6FzTtZJaum2PiYHV9Em8JzzBPp4UK9crasgYb2N9sAP6zsqOOzX | ||
xDExBQgoDpeVTniNQPBjPtSSDzziq0opndYEcXngYZPjVN3UWWxUNdtDB+6kUGJJ | ||
RV8EQp5pLTE3z+zT3CK/ZxRY+QiU0Jv94x9mdITBvmhssske2mNn5reJ2ZbRfoGI | ||
80wo8cRVAtac2zjCcPdBmgK9Jd0/bRztJpNK6FF2WNALd+kd3AZisccdd5xHSGLN | ||
I5pbfRA9E8prRg== | ||
=8je3 | ||
-----END PGP PRIVATE KEY BLOCK----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
-----BEGIN PGP PUBLIC KEY BLOCK----- | ||
|
||
mQENBF6fBagBCADIIkoxvmHBbGb0ntNdaWOTNdp+Di7n+wO+3c+wCPh7FN6Sw+Lm | ||
WxZD4PWYMnN3/MLKYYfgVuIslVwy53LUaMEv/jKWPWxahGT1aOFc6uXygd1R7QL8 | ||
5hd4DyAdx+CDXYRMSETq7AvVDiY5ftfXqDDeiohgsnHOcTLB4nPWFu9sdCR15Zvg | ||
8VdzveRtm7ia7Bgcwn4BfTko9qnqr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dSxblepXDzHtLcg18AEQEAAYkBPAQYAQgAJhYhBGs4yLtBYfmvmRM7 | ||
S433i6AvGGj5BQJenwWoAhsMBQkDwmcAAAoJEI33i6AvGGj5mXEH/jnHajUThIVp | ||
doEwCq1MfVLOs+nruXu55ycZ6UvaEP0nv2pYpBKGeKNL7hA9wyPTwzkD9mI5xpVM | ||
cvd8zsML7AOhc07WSWrptj4mB1fRJvCc8wT6eFCvXK2rIGG9jfbAD+s7Kjjs18Qx | ||
MQUIKA6XlU54jUDwYz7Ukg884qtKKZ3WBHF54GGT41Td1FlsVDXbQwfupFBiSUVf | ||
BEKeaS0xN8/s09wiv2cUWPkIlNCb/eMfZnSEwb5obLLJHtpjZ+a3idmW0X6BiPNM | ||
KPHEVQLWnNs4wnD3QZoCvSXdP20c7SaTSuhRdljQC3fpHdwGYrHHHXecR0hizSOa | ||
W30QPRPKa0Y= | ||
=/xZQ | ||
-----END PGP PUBLIC KEY BLOCK----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters