From 3a14ae89c06512bc0bd98dccfbae8d750673e8cb Mon Sep 17 00:00:00 2001 From: Anthony Keenan Date: Wed, 21 Mar 2018 11:19:20 +0000 Subject: [PATCH] CORDA-1178 - Api scanner backport and update of api-current.txt (#2813) * Api scanner backport and update of api-current.txt * Updated api-current based on current state of release branch * Update to most recent version of api scanner * Fix a couple of issues with the merge and regenerate the api file with the most recent version of the scanner. * Update changelog/release notes --- .ci/api-current.txt | 190 +++++++++++------- constants.properties | 2 +- docs/source/changelog.rst | 11 + docs/source/upgrade-notes.rst | 20 +- gradle-plugins/api-scanner/README.md | 4 +- .../api-scanner/annotations/build.gradle | 7 + .../net/corda/annotation/AlsoInherited.java | 14 ++ .../net/corda/annotation/IsInherited.java | 14 ++ .../net/corda/annotation/NotInherited.java | 12 ++ gradle-plugins/api-scanner/build.gradle | 28 ++- .../java/net/corda/plugins/ApiScanner.java | 4 +- .../main/java/net/corda/plugins/ScanApi.java | 145 ++++++++++--- .../net/corda/plugins/AnnotatedClassTest.java | 52 +++++ .../net/corda/plugins/AnnotatedFieldTest.java | 52 +++++ .../corda/plugins/AnnotatedInterfaceTest.java | 52 +++++ .../corda/plugins/AnnotatedMethodTest.java | 52 +++++ .../corda/plugins/BasicAnnotationTest.java | 50 +++++ .../net/corda/plugins/BasicClassTest.java | 52 +++++ .../net/corda/plugins/BasicInterfaceTest.java | 51 +++++ .../ClassWithInternalAnnotationTest.java | 52 +++++ .../java/net/corda/plugins/CopyUtils.java | 49 +++++ .../net/corda/plugins/ExtendedClassTest.java | 51 +++++ .../corda/plugins/ExtendedInterfaceTest.java | 52 +++++ .../FieldWithInternalAnnotationTest.java | 55 +++++ .../corda/plugins/InternalAnnotationTest.java | 52 +++++ .../net/corda/plugins/InternalFieldTest.java | 51 +++++ .../net/corda/plugins/InternalMethodTest.java | 50 +++++ .../corda/plugins/InternalPackageTest.java | 53 +++++ .../corda/plugins/KotlinAnnotationsTest.java | 69 +++++++ .../plugins/KotlinInternalAnnotationTest.java | 53 +++++ .../net/corda/plugins/KotlinLambdasTest.java | 53 +++++ .../corda/plugins/KotlinVarargMethodTest.java | 48 +++++ .../MethodWithInternalAnnotationTest.java | 55 +++++ .../net/corda/plugins/VarargMethodTest.java | 48 +++++ .../resources/annotated-class/build.gradle | 31 +++ .../java/net/corda/example/AlsoInherited.java | 14 ++ .../corda/example/HasInheritedAnnotation.java | 9 + .../corda/example/InheritingAnnotations.java | 4 + .../java/net/corda/example/IsInherited.java | 14 ++ .../java/net/corda/example/NotInherited.java | 12 ++ .../resources/annotated-field/build.gradle | 30 +++ .../net/corda/example/HasAnnotatedField.java | 6 + .../annotated-interface/build.gradle | 31 +++ .../java/net/corda/example/AlsoInherited.java | 14 ++ .../corda/example/HasInheritedAnnotation.java | 9 + .../corda/example/InheritingAnnotations.java | 4 + .../java/net/corda/example/IsInherited.java | 14 ++ .../java/net/corda/example/NotInherited.java | 12 ++ .../resources/annotated-method/build.gradle | 30 +++ .../net/corda/example/HasAnnotatedMethod.java | 8 + .../resources/basic-annotation/build.gradle | 27 +++ .../net/corda/example/BasicAnnotation.java | 12 ++ .../test/resources/basic-class/build.gradle | 27 +++ .../java/net/corda/example/BasicClass.java | 13 ++ .../resources/basic-interface/build.gradle | 27 +++ .../net/corda/example/BasicInterface.java | 7 + .../class-internal-annotation/build.gradle | 30 +++ .../net/corda/example/AnnotatedClass.java | 5 + .../corda/example/InvisibleAnnotation.java | 14 ++ .../java/net/corda/example/A.java | 12 ++ .../java/net/corda/example/B.java | 12 ++ .../java/net/corda/example/C.java | 12 ++ .../java/net/corda/core/CordaInternal.java | 12 ++ .../resources/extended-class/build.gradle | 27 +++ .../java/net/corda/example/ExtendedClass.java | 10 + .../resources/extended-interface/build.gradle | 27 +++ .../net/corda/example/ExtendedInterface.java | 8 + .../field-internal-annotation/build.gradle | 30 +++ .../corda/example/field/CordaInternal.java | 12 ++ .../corda/example/field/HasVisibleField.java | 7 + .../example/field/InvisibleAnnotation.java | 14 ++ .../field/LocalInvisibleAnnotation.java | 13 ++ .../internal-annotation/build.gradle | 30 +++ .../java/net/corda/example/CordaInternal.java | 12 ++ .../resources/internal-field/build.gradle | 30 +++ .../net/corda/example/WithInternalField.java | 8 + .../resources/internal-method/build.gradle | 30 +++ .../net/corda/example/WithInternalMethod.java | 10 + .../resources/internal-package/build.gradle | 27 +++ .../java/net/corda/VisibleClass.java | 4 + .../net/corda/internal/InvisibleClass.java | 13 ++ .../resources/kotlin-annotations/build.gradle | 32 +++ .../kotlin/net/corda/example/HasJvmField.kt | 6 + .../net/corda/example/HasJvmStaticFunction.kt | 8 + .../corda/example/HasOverloadedConstructor.kt | 7 + .../kotlin-internal-annotation/build.gradle | 32 +++ .../corda/example/kotlin/AnnotatedClass.kt | 4 + .../net/corda/example/kotlin/CordaInternal.kt | 8 + .../example/kotlin/InvisibleAnnotation.kt | 9 + .../resources/kotlin-lambdas/build.gradle | 32 +++ .../net/corda/example/LambdaExpressions.kt | 14 ++ .../kotlin-vararg-method/build.gradle | 32 +++ .../net/corda/example/KotlinVarargMethod.kt | 5 + .../method-internal-annotation/build.gradle | 30 +++ .../corda/example/method/CordaInternal.java | 12 ++ .../example/method/HasVisibleMethod.java | 9 + .../example/method/InvisibleAnnotation.java | 14 ++ .../method/LocalInvisibleAnnotation.java | 13 ++ .../test/resources/vararg-method/build.gradle | 27 +++ .../java/net/corda/example/VarargMethod.java | 5 + gradle-plugins/build.gradle | 2 + gradle-plugins/settings.gradle | 1 + 102 files changed, 2556 insertions(+), 113 deletions(-) create mode 100644 gradle-plugins/api-scanner/annotations/build.gradle create mode 100644 gradle-plugins/api-scanner/annotations/src/main/java/net/corda/annotation/AlsoInherited.java create mode 100644 gradle-plugins/api-scanner/annotations/src/main/java/net/corda/annotation/IsInherited.java create mode 100644 gradle-plugins/api-scanner/annotations/src/main/java/net/corda/annotation/NotInherited.java create mode 100644 gradle-plugins/api-scanner/src/test/java/net/corda/plugins/AnnotatedClassTest.java create mode 100644 gradle-plugins/api-scanner/src/test/java/net/corda/plugins/AnnotatedFieldTest.java create mode 100644 gradle-plugins/api-scanner/src/test/java/net/corda/plugins/AnnotatedInterfaceTest.java create mode 100644 gradle-plugins/api-scanner/src/test/java/net/corda/plugins/AnnotatedMethodTest.java create mode 100644 gradle-plugins/api-scanner/src/test/java/net/corda/plugins/BasicAnnotationTest.java create mode 100644 gradle-plugins/api-scanner/src/test/java/net/corda/plugins/BasicClassTest.java create mode 100644 gradle-plugins/api-scanner/src/test/java/net/corda/plugins/BasicInterfaceTest.java create mode 100644 gradle-plugins/api-scanner/src/test/java/net/corda/plugins/ClassWithInternalAnnotationTest.java create mode 100644 gradle-plugins/api-scanner/src/test/java/net/corda/plugins/CopyUtils.java create mode 100644 gradle-plugins/api-scanner/src/test/java/net/corda/plugins/ExtendedClassTest.java create mode 100644 gradle-plugins/api-scanner/src/test/java/net/corda/plugins/ExtendedInterfaceTest.java create mode 100644 gradle-plugins/api-scanner/src/test/java/net/corda/plugins/FieldWithInternalAnnotationTest.java create mode 100644 gradle-plugins/api-scanner/src/test/java/net/corda/plugins/InternalAnnotationTest.java create mode 100644 gradle-plugins/api-scanner/src/test/java/net/corda/plugins/InternalFieldTest.java create mode 100644 gradle-plugins/api-scanner/src/test/java/net/corda/plugins/InternalMethodTest.java create mode 100644 gradle-plugins/api-scanner/src/test/java/net/corda/plugins/InternalPackageTest.java create mode 100644 gradle-plugins/api-scanner/src/test/java/net/corda/plugins/KotlinAnnotationsTest.java create mode 100644 gradle-plugins/api-scanner/src/test/java/net/corda/plugins/KotlinInternalAnnotationTest.java create mode 100644 gradle-plugins/api-scanner/src/test/java/net/corda/plugins/KotlinLambdasTest.java create mode 100644 gradle-plugins/api-scanner/src/test/java/net/corda/plugins/KotlinVarargMethodTest.java create mode 100644 gradle-plugins/api-scanner/src/test/java/net/corda/plugins/MethodWithInternalAnnotationTest.java create mode 100644 gradle-plugins/api-scanner/src/test/java/net/corda/plugins/VarargMethodTest.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/annotated-class/build.gradle create mode 100644 gradle-plugins/api-scanner/src/test/resources/annotated-class/java/net/corda/example/AlsoInherited.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/annotated-class/java/net/corda/example/HasInheritedAnnotation.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/annotated-class/java/net/corda/example/InheritingAnnotations.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/annotated-class/java/net/corda/example/IsInherited.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/annotated-class/java/net/corda/example/NotInherited.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/annotated-field/build.gradle create mode 100644 gradle-plugins/api-scanner/src/test/resources/annotated-field/java/net/corda/example/HasAnnotatedField.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/annotated-interface/build.gradle create mode 100644 gradle-plugins/api-scanner/src/test/resources/annotated-interface/java/net/corda/example/AlsoInherited.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/annotated-interface/java/net/corda/example/HasInheritedAnnotation.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/annotated-interface/java/net/corda/example/InheritingAnnotations.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/annotated-interface/java/net/corda/example/IsInherited.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/annotated-interface/java/net/corda/example/NotInherited.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/annotated-method/build.gradle create mode 100644 gradle-plugins/api-scanner/src/test/resources/annotated-method/java/net/corda/example/HasAnnotatedMethod.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/basic-annotation/build.gradle create mode 100644 gradle-plugins/api-scanner/src/test/resources/basic-annotation/java/net/corda/example/BasicAnnotation.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/basic-class/build.gradle create mode 100644 gradle-plugins/api-scanner/src/test/resources/basic-class/java/net/corda/example/BasicClass.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/basic-interface/build.gradle create mode 100644 gradle-plugins/api-scanner/src/test/resources/basic-interface/java/net/corda/example/BasicInterface.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/class-internal-annotation/build.gradle create mode 100644 gradle-plugins/api-scanner/src/test/resources/class-internal-annotation/java/net/corda/example/AnnotatedClass.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/class-internal-annotation/java/net/corda/example/InvisibleAnnotation.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/common-annotations/java/net/corda/example/A.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/common-annotations/java/net/corda/example/B.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/common-annotations/java/net/corda/example/C.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/common-internal/java/net/corda/core/CordaInternal.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/extended-class/build.gradle create mode 100644 gradle-plugins/api-scanner/src/test/resources/extended-class/java/net/corda/example/ExtendedClass.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/extended-interface/build.gradle create mode 100644 gradle-plugins/api-scanner/src/test/resources/extended-interface/java/net/corda/example/ExtendedInterface.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/field-internal-annotation/build.gradle create mode 100644 gradle-plugins/api-scanner/src/test/resources/field-internal-annotation/java/net/corda/example/field/CordaInternal.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/field-internal-annotation/java/net/corda/example/field/HasVisibleField.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/field-internal-annotation/java/net/corda/example/field/InvisibleAnnotation.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/field-internal-annotation/java/net/corda/example/field/LocalInvisibleAnnotation.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/internal-annotation/build.gradle create mode 100644 gradle-plugins/api-scanner/src/test/resources/internal-annotation/java/net/corda/example/CordaInternal.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/internal-field/build.gradle create mode 100644 gradle-plugins/api-scanner/src/test/resources/internal-field/java/net/corda/example/WithInternalField.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/internal-method/build.gradle create mode 100644 gradle-plugins/api-scanner/src/test/resources/internal-method/java/net/corda/example/WithInternalMethod.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/internal-package/build.gradle create mode 100644 gradle-plugins/api-scanner/src/test/resources/internal-package/java/net/corda/VisibleClass.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/internal-package/java/net/corda/internal/InvisibleClass.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/kotlin-annotations/build.gradle create mode 100644 gradle-plugins/api-scanner/src/test/resources/kotlin-annotations/kotlin/net/corda/example/HasJvmField.kt create mode 100644 gradle-plugins/api-scanner/src/test/resources/kotlin-annotations/kotlin/net/corda/example/HasJvmStaticFunction.kt create mode 100644 gradle-plugins/api-scanner/src/test/resources/kotlin-annotations/kotlin/net/corda/example/HasOverloadedConstructor.kt create mode 100644 gradle-plugins/api-scanner/src/test/resources/kotlin-internal-annotation/build.gradle create mode 100644 gradle-plugins/api-scanner/src/test/resources/kotlin-internal-annotation/kotlin/net/corda/example/kotlin/AnnotatedClass.kt create mode 100644 gradle-plugins/api-scanner/src/test/resources/kotlin-internal-annotation/kotlin/net/corda/example/kotlin/CordaInternal.kt create mode 100644 gradle-plugins/api-scanner/src/test/resources/kotlin-internal-annotation/kotlin/net/corda/example/kotlin/InvisibleAnnotation.kt create mode 100644 gradle-plugins/api-scanner/src/test/resources/kotlin-lambdas/build.gradle create mode 100644 gradle-plugins/api-scanner/src/test/resources/kotlin-lambdas/kotlin/net/corda/example/LambdaExpressions.kt create mode 100644 gradle-plugins/api-scanner/src/test/resources/kotlin-vararg-method/build.gradle create mode 100644 gradle-plugins/api-scanner/src/test/resources/kotlin-vararg-method/kotlin/net/corda/example/KotlinVarargMethod.kt create mode 100644 gradle-plugins/api-scanner/src/test/resources/method-internal-annotation/build.gradle create mode 100644 gradle-plugins/api-scanner/src/test/resources/method-internal-annotation/java/net/corda/example/method/CordaInternal.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/method-internal-annotation/java/net/corda/example/method/HasVisibleMethod.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/method-internal-annotation/java/net/corda/example/method/InvisibleAnnotation.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/method-internal-annotation/java/net/corda/example/method/LocalInvisibleAnnotation.java create mode 100644 gradle-plugins/api-scanner/src/test/resources/vararg-method/build.gradle create mode 100644 gradle-plugins/api-scanner/src/test/resources/vararg-method/java/net/corda/example/VarargMethod.java diff --git a/.ci/api-current.txt b/.ci/api-current.txt index a8e6fbebd6..4c18baca85 100644 --- a/.ci/api-current.txt +++ b/.ci/api-current.txt @@ -14,8 +14,6 @@ public void setMessage(String) public void setOriginalExceptionClassName(String) ## -public @interface net.corda.core.CordaInternal -## public final class net.corda.core.CordaOID extends java.lang.Object @org.jetbrains.annotations.NotNull public static final String CORDA_PLATFORM = "1.3.6.1.4.1.50530.1" public static final net.corda.core.CordaOID INSTANCE @@ -209,7 +207,7 @@ public static final class net.corda.core.context.Trace$InvocationId$Companion ex public static final class net.corda.core.context.Trace$SessionId$Companion extends java.lang.Object @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull public final net.corda.core.context.Trace$SessionId newInstance(String, java.time.Instant) ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public final class net.corda.core.contracts.AlwaysAcceptAttachmentConstraint extends java.lang.Object implements net.corda.core.contracts.AttachmentConstraint +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public final class net.corda.core.contracts.AlwaysAcceptAttachmentConstraint extends java.lang.Object implements net.corda.core.contracts.AttachmentConstraint public boolean isSatisfiedBy(net.corda.core.contracts.Attachment) public static final net.corda.core.contracts.AlwaysAcceptAttachmentConstraint INSTANCE ## @@ -284,14 +282,14 @@ public static final class net.corda.core.contracts.AmountTransfer$Companion exte @org.jetbrains.annotations.NotNull public abstract java.io.InputStream open() @org.jetbrains.annotations.NotNull public abstract jar.JarInputStream openAsJAR() ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public interface net.corda.core.contracts.AttachmentConstraint +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public interface net.corda.core.contracts.AttachmentConstraint public abstract boolean isSatisfiedBy(net.corda.core.contracts.Attachment) ## @net.corda.core.serialization.CordaSerializable public final class net.corda.core.contracts.AttachmentResolutionException extends net.corda.core.flows.FlowException public (net.corda.core.crypto.SecureHash) @org.jetbrains.annotations.NotNull public final net.corda.core.crypto.SecureHash getHash() ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public final class net.corda.core.contracts.AutomaticHashConstraint extends java.lang.Object implements net.corda.core.contracts.AttachmentConstraint +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public final class net.corda.core.contracts.AutomaticHashConstraint extends java.lang.Object implements net.corda.core.contracts.AttachmentConstraint public boolean isSatisfiedBy(net.corda.core.contracts.Attachment) public static final net.corda.core.contracts.AutomaticHashConstraint INSTANCE ## @@ -372,7 +370,7 @@ public final class net.corda.core.contracts.ContractsDSL extends java.lang.Objec @org.jetbrains.annotations.NotNull public abstract Collection getExitKeys() @org.jetbrains.annotations.NotNull public abstract net.corda.core.contracts.FungibleAsset withNewOwnerAndAmount(net.corda.core.contracts.Amount, net.corda.core.identity.AbstractParty) ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public final class net.corda.core.contracts.HashAttachmentConstraint extends java.lang.Object implements net.corda.core.contracts.AttachmentConstraint +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public final class net.corda.core.contracts.HashAttachmentConstraint extends java.lang.Object implements net.corda.core.contracts.AttachmentConstraint public (net.corda.core.crypto.SecureHash) @org.jetbrains.annotations.NotNull public final net.corda.core.crypto.SecureHash component1() @org.jetbrains.annotations.NotNull public final net.corda.core.contracts.HashAttachmentConstraint copy(net.corda.core.crypto.SecureHash) @@ -642,7 +640,7 @@ public static final class net.corda.core.contracts.UniqueIdentifier$Companion ex @net.corda.core.serialization.CordaSerializable public interface net.corda.core.contracts.UpgradedContractWithLegacyConstraint extends net.corda.core.contracts.UpgradedContract @org.jetbrains.annotations.NotNull public abstract net.corda.core.contracts.AttachmentConstraint getLegacyContractConstraint() ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public final class net.corda.core.contracts.WhitelistedByZoneAttachmentConstraint extends java.lang.Object implements net.corda.core.contracts.AttachmentConstraint +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public final class net.corda.core.contracts.WhitelistedByZoneAttachmentConstraint extends java.lang.Object implements net.corda.core.contracts.AttachmentConstraint public boolean isSatisfiedBy(net.corda.core.contracts.Attachment) public static final net.corda.core.contracts.WhitelistedByZoneAttachmentConstraint INSTANCE ## @@ -701,6 +699,7 @@ public static final class net.corda.core.crypto.CompositeKey$Builder extends jav public () @org.jetbrains.annotations.NotNull public final net.corda.core.crypto.CompositeKey$Builder addKey(java.security.PublicKey, int) @org.jetbrains.annotations.NotNull public final net.corda.core.crypto.CompositeKey$Builder addKeys(List) + @org.jetbrains.annotations.NotNull public final net.corda.core.crypto.CompositeKey$Builder addKeys(java.security.PublicKey...) @org.jetbrains.annotations.NotNull public final java.security.PublicKey build(Integer) ## public static final class net.corda.core.crypto.CompositeKey$Companion extends java.lang.Object @@ -771,8 +770,8 @@ public static final class net.corda.core.crypto.CompositeSignaturesWithKeys$Comp @org.jetbrains.annotations.NotNull public final net.corda.core.crypto.CompositeSignaturesWithKeys getEMPTY() ## public final class net.corda.core.crypto.CordaObjectIdentifier extends java.lang.Object - @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull public static final org.bouncycastle.asn1.ASN1ObjectIdentifier COMPOSITE_KEY - @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull public static final org.bouncycastle.asn1.ASN1ObjectIdentifier COMPOSITE_SIGNATURE + @org.jetbrains.annotations.NotNull public static final org.bouncycastle.asn1.ASN1ObjectIdentifier COMPOSITE_KEY + @org.jetbrains.annotations.NotNull public static final org.bouncycastle.asn1.ASN1ObjectIdentifier COMPOSITE_SIGNATURE public static final net.corda.core.crypto.CordaObjectIdentifier INSTANCE ## public final class net.corda.core.crypto.CordaSecurityProvider extends java.security.Provider @@ -818,15 +817,15 @@ public final class net.corda.core.crypto.Crypto extends java.lang.Object @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull public static final java.security.PrivateKey toSupportedPrivateKey(java.security.PrivateKey) @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull public static final java.security.PublicKey toSupportedPublicKey(java.security.PublicKey) @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull public static final java.security.PublicKey toSupportedPublicKey(org.bouncycastle.asn1.x509.SubjectPublicKeyInfo) - @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull public static final net.corda.core.crypto.SignatureScheme COMPOSITE_KEY - @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull public static final net.corda.core.crypto.SignatureScheme DEFAULT_SIGNATURE_SCHEME - @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull public static final net.corda.core.crypto.SignatureScheme ECDSA_SECP256K1_SHA256 - @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull public static final net.corda.core.crypto.SignatureScheme ECDSA_SECP256R1_SHA256 - @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull public static final net.corda.core.crypto.SignatureScheme EDDSA_ED25519_SHA512 + @org.jetbrains.annotations.NotNull public static final net.corda.core.crypto.SignatureScheme COMPOSITE_KEY + @org.jetbrains.annotations.NotNull public static final net.corda.core.crypto.SignatureScheme DEFAULT_SIGNATURE_SCHEME + @org.jetbrains.annotations.NotNull public static final net.corda.core.crypto.SignatureScheme ECDSA_SECP256K1_SHA256 + @org.jetbrains.annotations.NotNull public static final net.corda.core.crypto.SignatureScheme ECDSA_SECP256R1_SHA256 + @org.jetbrains.annotations.NotNull public static final net.corda.core.crypto.SignatureScheme EDDSA_ED25519_SHA512 public static final net.corda.core.crypto.Crypto INSTANCE - @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull public static final net.corda.core.crypto.SignatureScheme RSA_SHA256 - @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull public static final org.bouncycastle.asn1.DLSequence SHA512_256 - @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull public static final net.corda.core.crypto.SignatureScheme SPHINCS256_SHA256 + @org.jetbrains.annotations.NotNull public static final net.corda.core.crypto.SignatureScheme RSA_SHA256 + @org.jetbrains.annotations.NotNull public static final org.bouncycastle.asn1.DLSequence SHA512_256 + @org.jetbrains.annotations.NotNull public static final net.corda.core.crypto.SignatureScheme SPHINCS256_SHA256 ## public final class net.corda.core.crypto.CryptoUtils extends java.lang.Object @org.jetbrains.annotations.NotNull public static final Set byKeys(Iterable) @@ -1110,6 +1109,7 @@ public static final class net.corda.core.flows.AbstractStateReplacementFlow$Upgr ## @co.paralleluniverse.fibers.Suspendable public final class net.corda.core.flows.CollectSignatureFlow extends net.corda.core.flows.FlowLogic public (net.corda.core.transactions.SignedTransaction, net.corda.core.flows.FlowSession, List) + public (net.corda.core.transactions.SignedTransaction, net.corda.core.flows.FlowSession, java.security.PublicKey...) @co.paralleluniverse.fibers.Suspendable @org.jetbrains.annotations.NotNull public List call() @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.SignedTransaction getPartiallySignedTx() @org.jetbrains.annotations.NotNull public final net.corda.core.flows.FlowSession getSession() @@ -1253,7 +1253,7 @@ public abstract class net.corda.core.flows.FlowLogic extends java.lang.Object public final void checkFlowPermission(String, Map) @co.paralleluniverse.fibers.Suspendable @org.jetbrains.annotations.Nullable public final net.corda.core.flows.FlowStackSnapshot flowStackSnapshot() @org.jetbrains.annotations.Nullable public static final net.corda.core.flows.FlowLogic getCurrentTopLevel() - @kotlin.Deprecated @co.paralleluniverse.fibers.Suspendable @org.jetbrains.annotations.NotNull public final net.corda.core.flows.FlowInfo getFlowInfo(net.corda.core.identity.Party) + @co.paralleluniverse.fibers.Suspendable @kotlin.Deprecated @org.jetbrains.annotations.NotNull public final net.corda.core.flows.FlowInfo getFlowInfo(net.corda.core.identity.Party) @org.jetbrains.annotations.NotNull public final org.slf4j.Logger getLogger() @org.jetbrains.annotations.NotNull public final net.corda.core.identity.Party getOurIdentity() @org.jetbrains.annotations.NotNull public final net.corda.core.identity.PartyAndCertificate getOurIdentityAndCert() @@ -1262,12 +1262,12 @@ public abstract class net.corda.core.flows.FlowLogic extends java.lang.Object @org.jetbrains.annotations.NotNull public final net.corda.core.node.ServiceHub getServiceHub() @co.paralleluniverse.fibers.Suspendable @org.jetbrains.annotations.NotNull public final net.corda.core.flows.FlowSession initiateFlow(net.corda.core.identity.Party) @co.paralleluniverse.fibers.Suspendable public final void persistFlowStackSnapshot() - @kotlin.Deprecated @co.paralleluniverse.fibers.Suspendable @org.jetbrains.annotations.NotNull public net.corda.core.utilities.UntrustworthyData receive(Class, net.corda.core.identity.Party) + @co.paralleluniverse.fibers.Suspendable @kotlin.Deprecated @org.jetbrains.annotations.NotNull public net.corda.core.utilities.UntrustworthyData receive(Class, net.corda.core.identity.Party) @co.paralleluniverse.fibers.Suspendable @org.jetbrains.annotations.NotNull public List receiveAll(Class, List) @co.paralleluniverse.fibers.Suspendable @org.jetbrains.annotations.NotNull public Map receiveAllMap(Map) public final void recordAuditEvent(String, String, Map) - @kotlin.Deprecated @co.paralleluniverse.fibers.Suspendable public void send(net.corda.core.identity.Party, Object) - @kotlin.Deprecated @co.paralleluniverse.fibers.Suspendable @org.jetbrains.annotations.NotNull public net.corda.core.utilities.UntrustworthyData sendAndReceive(Class, net.corda.core.identity.Party, Object) + @co.paralleluniverse.fibers.Suspendable @kotlin.Deprecated public void send(net.corda.core.identity.Party, Object) + @co.paralleluniverse.fibers.Suspendable @kotlin.Deprecated @org.jetbrains.annotations.NotNull public net.corda.core.utilities.UntrustworthyData sendAndReceive(Class, net.corda.core.identity.Party, Object) @co.paralleluniverse.fibers.Suspendable @kotlin.jvm.JvmStatic public static final void sleep(java.time.Duration) @co.paralleluniverse.fibers.Suspendable public Object subFlow(net.corda.core.flows.FlowLogic) @org.jetbrains.annotations.Nullable public final net.corda.core.messaging.DataFeed track() @@ -1281,9 +1281,11 @@ public static final class net.corda.core.flows.FlowLogic$Companion extends java. @org.jetbrains.annotations.Nullable public final net.corda.core.flows.FlowLogic getCurrentTopLevel() @co.paralleluniverse.fibers.Suspendable @kotlin.jvm.JvmStatic public final void sleep(java.time.Duration) ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public interface net.corda.core.flows.FlowLogicRef +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public interface net.corda.core.flows.FlowLogicRef ## @net.corda.core.DoNotImplement public interface net.corda.core.flows.FlowLogicRefFactory + @org.jetbrains.annotations.NotNull public abstract net.corda.core.flows.FlowLogicRef create(Class, Object...) + @org.jetbrains.annotations.NotNull public abstract net.corda.core.flows.FlowLogicRef create(String, Object...) @org.jetbrains.annotations.NotNull public abstract net.corda.core.flows.FlowLogic toFlowLogic(net.corda.core.flows.FlowLogicRef) ## @net.corda.core.DoNotImplement public abstract class net.corda.core.flows.FlowSession extends java.lang.Object @@ -1421,7 +1423,7 @@ public static final class net.corda.core.flows.NotarisationRequest$Companion ext public int hashCode() @org.jetbrains.annotations.NotNull public String toString() public static final net.corda.core.flows.NotaryError$TimeWindowInvalid$Companion Companion - @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull public static final net.corda.core.flows.NotaryError$TimeWindowInvalid INSTANCE + @org.jetbrains.annotations.NotNull public static final net.corda.core.flows.NotaryError$TimeWindowInvalid INSTANCE ## public static final class net.corda.core.flows.NotaryError$TimeWindowInvalid$Companion extends java.lang.Object ## @@ -1445,7 +1447,7 @@ public static final class net.corda.core.flows.NotaryError$TimeWindowInvalid$Com public final class net.corda.core.flows.NotaryFlow extends java.lang.Object public () ## -@net.corda.core.flows.InitiatingFlow @net.corda.core.DoNotImplement public static class net.corda.core.flows.NotaryFlow$Client extends net.corda.core.flows.FlowLogic +@net.corda.core.DoNotImplement @net.corda.core.flows.InitiatingFlow public static class net.corda.core.flows.NotaryFlow$Client extends net.corda.core.flows.FlowLogic public (net.corda.core.transactions.SignedTransaction) public (net.corda.core.transactions.SignedTransaction, net.corda.core.utilities.ProgressTracker) @co.paralleluniverse.fibers.Suspendable @org.jetbrains.annotations.NotNull public List call() @@ -1574,15 +1576,16 @@ public final class net.corda.core.flows.TransactionParts extends java.lang.Objec public (String) public (String, Throwable) ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public abstract class net.corda.core.identity.AbstractParty extends java.lang.Object +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public abstract class net.corda.core.identity.AbstractParty extends java.lang.Object public (java.security.PublicKey) public boolean equals(Object) @org.jetbrains.annotations.NotNull public final java.security.PublicKey getOwningKey() public int hashCode() @org.jetbrains.annotations.Nullable public abstract net.corda.core.identity.CordaX500Name nameOrNull() @org.jetbrains.annotations.NotNull public abstract net.corda.core.contracts.PartyAndReference ref(net.corda.core.utilities.OpaqueBytes) + @org.jetbrains.annotations.NotNull public final net.corda.core.contracts.PartyAndReference ref(byte...) ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public final class net.corda.core.identity.AnonymousParty extends net.corda.core.identity.AbstractParty +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public final class net.corda.core.identity.AnonymousParty extends net.corda.core.identity.AbstractParty public (java.security.PublicKey) @org.jetbrains.annotations.Nullable public net.corda.core.identity.CordaX500Name nameOrNull() @org.jetbrains.annotations.NotNull public net.corda.core.contracts.PartyAndReference ref(net.corda.core.utilities.OpaqueBytes) @@ -1631,7 +1634,7 @@ public final class net.corda.core.identity.IdentityUtils extends java.lang.Objec @org.jetbrains.annotations.NotNull public static final Map groupPublicKeysByWellKnownParty(net.corda.core.node.ServiceHub, Collection) @org.jetbrains.annotations.NotNull public static final Map groupPublicKeysByWellKnownParty(net.corda.core.node.ServiceHub, Collection, boolean) ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public final class net.corda.core.identity.Party extends net.corda.core.identity.AbstractParty +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public final class net.corda.core.identity.Party extends net.corda.core.identity.AbstractParty public (java.security.cert.X509Certificate) public (net.corda.core.identity.CordaX500Name, java.security.PublicKey) @org.jetbrains.annotations.NotNull public final net.corda.core.identity.AnonymousParty anonymise() @@ -1680,6 +1683,8 @@ public final class net.corda.core.identity.IdentityUtils extends java.lang.Objec @org.jetbrains.annotations.NotNull public abstract List queryAttachments(net.corda.core.node.services.vault.AttachmentQueryCriteria, net.corda.core.node.services.vault.AttachmentSort) @org.jetbrains.annotations.NotNull public abstract List registeredFlows() public abstract void setFlowsDrainingModeEnabled(boolean) + @net.corda.core.messaging.RPCReturnsObservables @org.jetbrains.annotations.NotNull public abstract net.corda.core.messaging.FlowHandle startFlowDynamic(Class, Object...) + @net.corda.core.messaging.RPCReturnsObservables @org.jetbrains.annotations.NotNull public abstract net.corda.core.messaging.FlowProgressHandle startTrackedFlowDynamic(Class, Object...) @net.corda.core.messaging.RPCReturnsObservables @org.jetbrains.annotations.NotNull public abstract net.corda.core.messaging.DataFeed stateMachineRecordedTransactionMappingFeed() @org.jetbrains.annotations.NotNull public abstract List stateMachineRecordedTransactionMappingSnapshot() @net.corda.core.messaging.RPCReturnsObservables @org.jetbrains.annotations.NotNull public abstract net.corda.core.messaging.DataFeed stateMachinesFeed() @@ -1718,7 +1723,7 @@ public final class net.corda.core.messaging.CordaRPCOpsKt extends java.lang.Obje @org.jetbrains.annotations.NotNull public abstract net.corda.core.flows.StateMachineRunId getId() @org.jetbrains.annotations.NotNull public abstract net.corda.core.concurrent.CordaFuture getReturnValue() ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public final class net.corda.core.messaging.FlowHandleImpl extends java.lang.Object implements net.corda.core.messaging.FlowHandle +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public final class net.corda.core.messaging.FlowHandleImpl extends java.lang.Object implements net.corda.core.messaging.FlowHandle public (net.corda.core.flows.StateMachineRunId, net.corda.core.concurrent.CordaFuture) public void close() @org.jetbrains.annotations.NotNull public final net.corda.core.flows.StateMachineRunId component1() @@ -1736,7 +1741,7 @@ public final class net.corda.core.messaging.CordaRPCOpsKt extends java.lang.Obje @org.jetbrains.annotations.Nullable public abstract net.corda.core.messaging.DataFeed getStepsTreeFeed() @org.jetbrains.annotations.Nullable public abstract net.corda.core.messaging.DataFeed getStepsTreeIndexFeed() ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public final class net.corda.core.messaging.FlowProgressHandleImpl extends java.lang.Object implements net.corda.core.messaging.FlowProgressHandle +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public final class net.corda.core.messaging.FlowProgressHandleImpl extends java.lang.Object implements net.corda.core.messaging.FlowProgressHandle public (net.corda.core.flows.StateMachineRunId, net.corda.core.concurrent.CordaFuture, rx.Observable) public (net.corda.core.flows.StateMachineRunId, net.corda.core.concurrent.CordaFuture, rx.Observable, net.corda.core.messaging.DataFeed) public (net.corda.core.flows.StateMachineRunId, net.corda.core.concurrent.CordaFuture, rx.Observable, net.corda.core.messaging.DataFeed, net.corda.core.messaging.DataFeed) @@ -1911,7 +1916,9 @@ public @interface net.corda.core.messaging.RPCReturnsObservables @org.jetbrains.annotations.NotNull public abstract java.sql.Connection jdbcSession() public abstract void recordTransactions(Iterable) public abstract void recordTransactions(net.corda.core.node.StatesToRecord, Iterable) + public abstract void recordTransactions(net.corda.core.transactions.SignedTransaction, net.corda.core.transactions.SignedTransaction...) public abstract void recordTransactions(boolean, Iterable) + public abstract void recordTransactions(boolean, net.corda.core.transactions.SignedTransaction, net.corda.core.transactions.SignedTransaction...) public abstract void registerUnloadHandler(kotlin.jvm.functions.Function0) @org.jetbrains.annotations.NotNull public abstract net.corda.core.transactions.SignedTransaction signInitialTransaction(net.corda.core.transactions.TransactionBuilder) @org.jetbrains.annotations.NotNull public abstract net.corda.core.transactions.SignedTransaction signInitialTransaction(net.corda.core.transactions.TransactionBuilder, Iterable) @@ -2306,12 +2313,12 @@ public interface net.corda.core.node.services.vault.BaseQueryCriteriaParser public abstract class net.corda.core.node.services.vault.BaseSort extends java.lang.Object public () ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public final class net.corda.core.node.services.vault.BinaryComparisonOperator extends java.lang.Enum implements net.corda.core.node.services.vault.Operator +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public final class net.corda.core.node.services.vault.BinaryComparisonOperator extends java.lang.Enum implements net.corda.core.node.services.vault.Operator protected (String, int) public static net.corda.core.node.services.vault.BinaryComparisonOperator valueOf(String) public static net.corda.core.node.services.vault.BinaryComparisonOperator[] values() ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public final class net.corda.core.node.services.vault.BinaryLogicalOperator extends java.lang.Enum implements net.corda.core.node.services.vault.Operator +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public final class net.corda.core.node.services.vault.BinaryLogicalOperator extends java.lang.Enum implements net.corda.core.node.services.vault.Operator protected (String, int) public static net.corda.core.node.services.vault.BinaryLogicalOperator valueOf(String) public static net.corda.core.node.services.vault.BinaryLogicalOperator[] values() @@ -2383,7 +2390,7 @@ public abstract class net.corda.core.node.services.vault.BaseSort extends java.l @org.jetbrains.annotations.NotNull public final net.corda.core.node.services.vault.CriteriaExpression$AggregateFunctionExpression sum(kotlin.reflect.KProperty1, List, net.corda.core.node.services.vault.Sort$Direction) public static final net.corda.core.node.services.vault.Builder INSTANCE ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public final class net.corda.core.node.services.vault.CollectionOperator extends java.lang.Enum implements net.corda.core.node.services.vault.Operator +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public final class net.corda.core.node.services.vault.CollectionOperator extends java.lang.Enum implements net.corda.core.node.services.vault.Operator protected (String, int) public static net.corda.core.node.services.vault.CollectionOperator valueOf(String) public static net.corda.core.node.services.vault.CollectionOperator[] values() @@ -2520,7 +2527,7 @@ public abstract class net.corda.core.node.services.vault.BaseSort extends java.l public int hashCode() public String toString() ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public final class net.corda.core.node.services.vault.EqualityComparisonOperator extends java.lang.Enum implements net.corda.core.node.services.vault.Operator +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public final class net.corda.core.node.services.vault.EqualityComparisonOperator extends java.lang.Enum implements net.corda.core.node.services.vault.Operator protected (String, int) public static net.corda.core.node.services.vault.EqualityComparisonOperator valueOf(String) public static net.corda.core.node.services.vault.EqualityComparisonOperator[] values() @@ -2549,17 +2556,17 @@ public static interface net.corda.core.node.services.vault.GenericQueryCriteria$ @org.jetbrains.annotations.NotNull public abstract Collection parseCriteria(net.corda.core.node.services.vault.QueryCriteria$VaultCustomQueryCriteria) @org.jetbrains.annotations.NotNull public abstract Collection parseCriteria(net.corda.core.node.services.vault.QueryCriteria$VaultQueryCriteria) ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public final class net.corda.core.node.services.vault.LikenessOperator extends java.lang.Enum implements net.corda.core.node.services.vault.Operator +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public final class net.corda.core.node.services.vault.LikenessOperator extends java.lang.Enum implements net.corda.core.node.services.vault.Operator protected (String, int) public static net.corda.core.node.services.vault.LikenessOperator valueOf(String) public static net.corda.core.node.services.vault.LikenessOperator[] values() ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public final class net.corda.core.node.services.vault.NullOperator extends java.lang.Enum implements net.corda.core.node.services.vault.Operator +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public final class net.corda.core.node.services.vault.NullOperator extends java.lang.Enum implements net.corda.core.node.services.vault.Operator protected (String, int) public static net.corda.core.node.services.vault.NullOperator valueOf(String) public static net.corda.core.node.services.vault.NullOperator[] values() ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public interface net.corda.core.node.services.vault.Operator +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public interface net.corda.core.node.services.vault.Operator ## @net.corda.core.serialization.CordaSerializable public final class net.corda.core.node.services.vault.PageSpecification extends java.lang.Object public () @@ -2741,9 +2748,9 @@ public final class net.corda.core.node.services.vault.QueryCriteriaUtils extends public int hashCode() public String toString() ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public static interface net.corda.core.node.services.vault.Sort$Attribute +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public static interface net.corda.core.node.services.vault.Sort$Attribute ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public static final class net.corda.core.node.services.vault.Sort$CommonStateAttribute extends java.lang.Enum implements net.corda.core.node.services.vault.Sort$Attribute +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public static final class net.corda.core.node.services.vault.Sort$CommonStateAttribute extends java.lang.Enum implements net.corda.core.node.services.vault.Sort$Attribute protected (String, int, String, String) @org.jetbrains.annotations.Nullable public final String getAttributeChild() @org.jetbrains.annotations.NotNull public final String getAttributeParent() @@ -2755,13 +2762,13 @@ public final class net.corda.core.node.services.vault.QueryCriteriaUtils extends public static net.corda.core.node.services.vault.Sort$Direction valueOf(String) public static net.corda.core.node.services.vault.Sort$Direction[] values() ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public static final class net.corda.core.node.services.vault.Sort$FungibleStateAttribute extends java.lang.Enum implements net.corda.core.node.services.vault.Sort$Attribute +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public static final class net.corda.core.node.services.vault.Sort$FungibleStateAttribute extends java.lang.Enum implements net.corda.core.node.services.vault.Sort$Attribute protected (String, int, String) @org.jetbrains.annotations.NotNull public final String getAttributeName() public static net.corda.core.node.services.vault.Sort$FungibleStateAttribute valueOf(String) public static net.corda.core.node.services.vault.Sort$FungibleStateAttribute[] values() ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public static final class net.corda.core.node.services.vault.Sort$LinearStateAttribute extends java.lang.Enum implements net.corda.core.node.services.vault.Sort$Attribute +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public static final class net.corda.core.node.services.vault.Sort$LinearStateAttribute extends java.lang.Enum implements net.corda.core.node.services.vault.Sort$Attribute protected (String, int, String) @org.jetbrains.annotations.NotNull public final String getAttributeName() public static net.corda.core.node.services.vault.Sort$LinearStateAttribute valueOf(String) @@ -2778,7 +2785,7 @@ public final class net.corda.core.node.services.vault.QueryCriteriaUtils extends public int hashCode() public String toString() ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public static final class net.corda.core.node.services.vault.Sort$VaultStateAttribute extends java.lang.Enum implements net.corda.core.node.services.vault.Sort$Attribute +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public static final class net.corda.core.node.services.vault.Sort$VaultStateAttribute extends java.lang.Enum implements net.corda.core.node.services.vault.Sort$Attribute protected (String, int, String) @org.jetbrains.annotations.NotNull public final String getAttributeName() public static net.corda.core.node.services.vault.Sort$VaultStateAttribute valueOf(String) @@ -3018,7 +3025,7 @@ public static final class net.corda.core.serialization.SingletonSerializationTok @org.jetbrains.annotations.NotNull public final net.corda.core.crypto.SecureHash getId() @org.jetbrains.annotations.NotNull public final String getReason() ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public final class net.corda.core.transactions.ContractUpgradeFilteredTransaction extends net.corda.core.transactions.CoreTransaction +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public final class net.corda.core.transactions.ContractUpgradeFilteredTransaction extends net.corda.core.transactions.CoreTransaction public (Map, Map) @org.jetbrains.annotations.NotNull public final Map component1() @org.jetbrains.annotations.NotNull public final Map component2() @@ -3067,8 +3074,9 @@ public static final class net.corda.core.serialization.SingletonSerializationTok public String toString() public void verifyRequiredSignatures() public void verifySignaturesExcept(Collection) + public void verifySignaturesExcept(java.security.PublicKey...) ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public final class net.corda.core.transactions.ContractUpgradeWireTransaction extends net.corda.core.transactions.CoreTransaction +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public final class net.corda.core.transactions.ContractUpgradeWireTransaction extends net.corda.core.transactions.CoreTransaction public (List, net.corda.core.contracts.PrivacySalt) @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.ContractUpgradeFilteredTransaction buildFilteredTransaction() @org.jetbrains.annotations.NotNull public final List component1() @@ -3093,7 +3101,7 @@ public static final class net.corda.core.transactions.ContractUpgradeWireTransac public static net.corda.core.transactions.ContractUpgradeWireTransaction$Component valueOf(String) public static net.corda.core.transactions.ContractUpgradeWireTransaction$Component[] values() ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public abstract class net.corda.core.transactions.CoreTransaction extends net.corda.core.transactions.BaseTransaction +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public abstract class net.corda.core.transactions.CoreTransaction extends net.corda.core.transactions.BaseTransaction public () @org.jetbrains.annotations.NotNull public abstract List getInputs() ## @@ -3112,7 +3120,7 @@ public static final class net.corda.core.transactions.ContractUpgradeWireTransac public int hashCode() public String toString() ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public final class net.corda.core.transactions.FilteredTransaction extends net.corda.core.transactions.TraversableTransaction +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public final class net.corda.core.transactions.FilteredTransaction extends net.corda.core.transactions.TraversableTransaction public (net.corda.core.crypto.SecureHash, List, List) @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull public static final net.corda.core.transactions.FilteredTransaction buildFilteredTransaction(net.corda.core.transactions.WireTransaction, function.Predicate) public final void checkAllComponentsVisible(net.corda.core.contracts.ComponentGroupEnum) @@ -3137,7 +3145,7 @@ public static final class net.corda.core.transactions.FilteredTransaction$Compan protected void checkBaseInvariants() @org.jetbrains.annotations.NotNull public abstract List getInputs() ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public final class net.corda.core.transactions.LedgerTransaction extends net.corda.core.transactions.FullTransaction +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public final class net.corda.core.transactions.LedgerTransaction extends net.corda.core.transactions.FullTransaction public (List, List, List, List, net.corda.core.crypto.SecureHash, net.corda.core.identity.Party, net.corda.core.contracts.TimeWindow, net.corda.core.contracts.PrivacySalt) public (List, List, List, List, net.corda.core.crypto.SecureHash, net.corda.core.identity.Party, net.corda.core.contracts.TimeWindow, net.corda.core.contracts.PrivacySalt, net.corda.core.node.NetworkParameters) @org.jetbrains.annotations.NotNull public final List commandsOfType(Class) @@ -3220,8 +3228,9 @@ public static final class net.corda.core.transactions.LedgerTransaction$InOutGro public String toString() public void verifyRequiredSignatures() public void verifySignaturesExcept(Collection) + public void verifySignaturesExcept(java.security.PublicKey...) ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public final class net.corda.core.transactions.NotaryChangeWireTransaction extends net.corda.core.transactions.CoreTransaction +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public final class net.corda.core.transactions.NotaryChangeWireTransaction extends net.corda.core.transactions.CoreTransaction public (List) @kotlin.Deprecated public (List, net.corda.core.identity.Party, net.corda.core.identity.Party) @org.jetbrains.annotations.NotNull public final List component1() @@ -3243,7 +3252,7 @@ public static final class net.corda.core.transactions.NotaryChangeWireTransactio public static net.corda.core.transactions.NotaryChangeWireTransaction$Component valueOf(String) public static net.corda.core.transactions.NotaryChangeWireTransaction$Component[] values() ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public final class net.corda.core.transactions.SignedTransaction extends java.lang.Object implements net.corda.core.transactions.TransactionWithSignatures +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public final class net.corda.core.transactions.SignedTransaction extends java.lang.Object implements net.corda.core.transactions.TransactionWithSignatures public (net.corda.core.serialization.SerializedBytes, List) public (net.corda.core.transactions.CoreTransaction, List) @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.FilteredTransaction buildFilteredTransaction(function.Predicate) @@ -3279,6 +3288,7 @@ public static final class net.corda.core.transactions.NotaryChangeWireTransactio public final void verify(net.corda.core.node.ServiceHub, boolean) public void verifyRequiredSignatures() public void verifySignaturesExcept(Collection) + public void verifySignaturesExcept(java.security.PublicKey...) @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.SignedTransaction withAdditionalSignature(java.security.KeyPair, net.corda.core.crypto.SignatureMetadata) @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.SignedTransaction withAdditionalSignature(net.corda.core.crypto.TransactionSignature) @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.SignedTransaction withAdditionalSignatures(Iterable) @@ -3303,6 +3313,7 @@ public class net.corda.core.transactions.TransactionBuilder extends java.lang.Ob @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.TransactionBuilder addAttachment(net.corda.core.crypto.SecureHash) @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.TransactionBuilder addCommand(net.corda.core.contracts.Command) @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.TransactionBuilder addCommand(net.corda.core.contracts.CommandData, List) + @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.TransactionBuilder addCommand(net.corda.core.contracts.CommandData, java.security.PublicKey...) @org.jetbrains.annotations.NotNull public net.corda.core.transactions.TransactionBuilder addInputState(net.corda.core.contracts.StateAndRef) @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.TransactionBuilder addOutputState(net.corda.core.contracts.ContractState, String) @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.TransactionBuilder addOutputState(net.corda.core.contracts.ContractState, String, net.corda.core.contracts.AttachmentConstraint) @@ -3334,6 +3345,7 @@ public class net.corda.core.transactions.TransactionBuilder extends java.lang.Ob @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.SignedTransaction toSignedTransaction(net.corda.core.node.services.KeyManagementService, java.security.PublicKey, net.corda.core.crypto.SignatureMetadata, net.corda.core.node.ServicesForResolution) @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.WireTransaction toWireTransaction(net.corda.core.node.ServicesForResolution) public final void verify(net.corda.core.node.ServiceHub) + @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.TransactionBuilder withItems(Object...) ## @net.corda.core.DoNotImplement public interface net.corda.core.transactions.TransactionWithSignatures extends net.corda.core.contracts.NamedByHash public abstract void checkSignaturesAreValid() @@ -3343,8 +3355,9 @@ public class net.corda.core.transactions.TransactionBuilder extends java.lang.Ob @org.jetbrains.annotations.NotNull public abstract List getSigs() public abstract void verifyRequiredSignatures() public abstract void verifySignaturesExcept(Collection) + public abstract void verifySignaturesExcept(java.security.PublicKey...) ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public abstract class net.corda.core.transactions.TraversableTransaction extends net.corda.core.transactions.CoreTransaction +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public abstract class net.corda.core.transactions.TraversableTransaction extends net.corda.core.transactions.CoreTransaction public (List) @org.jetbrains.annotations.NotNull public final List getAttachments() @org.jetbrains.annotations.NotNull public final List getAvailableComponentGroups() @@ -3355,7 +3368,7 @@ public class net.corda.core.transactions.TransactionBuilder extends java.lang.Ob @org.jetbrains.annotations.NotNull public List getOutputs() @org.jetbrains.annotations.Nullable public final net.corda.core.contracts.TimeWindow getTimeWindow() ## -@net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public final class net.corda.core.transactions.WireTransaction extends net.corda.core.transactions.TraversableTransaction +@net.corda.core.DoNotImplement @net.corda.core.serialization.CordaSerializable public final class net.corda.core.transactions.WireTransaction extends net.corda.core.transactions.TraversableTransaction @kotlin.Deprecated public (List, List, List, List, net.corda.core.identity.Party, net.corda.core.contracts.TimeWindow, net.corda.core.contracts.PrivacySalt) public (List, net.corda.core.contracts.PrivacySalt) @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.FilteredTransaction buildFilteredTransaction(function.Predicate) @@ -3485,6 +3498,7 @@ public final class net.corda.core.utilities.NonEmptySet extends java.lang.Object public boolean isEmpty() @org.jetbrains.annotations.NotNull public Iterator iterator() @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull public static final net.corda.core.utilities.NonEmptySet of(Object) + @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull public static final net.corda.core.utilities.NonEmptySet of(Object, Object, Object...) @org.jetbrains.annotations.NotNull public stream.Stream parallelStream() public boolean remove(Object) public boolean removeAll(Collection) @@ -3499,6 +3513,7 @@ public final class net.corda.core.utilities.NonEmptySet extends java.lang.Object public static final class net.corda.core.utilities.NonEmptySet$Companion extends java.lang.Object @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull public final net.corda.core.utilities.NonEmptySet copyOf(Collection) @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull public final net.corda.core.utilities.NonEmptySet of(Object) + @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull public final net.corda.core.utilities.NonEmptySet of(Object, Object, Object...) ## public static final class net.corda.core.utilities.NonEmptySet$iterator$1 extends java.lang.Object implements java.util.Iterator, kotlin.jvm.internal.markers.KMappedMarker public boolean hasNext() @@ -3510,9 +3525,11 @@ public static final class net.corda.core.utilities.NonEmptySet$iterator$1 extend @org.jetbrains.annotations.NotNull public final byte[] getBytes() public int getOffset() public int getSize() + @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull public static final net.corda.core.utilities.OpaqueBytes of(byte...) public static final net.corda.core.utilities.OpaqueBytes$Companion Companion ## public static final class net.corda.core.utilities.OpaqueBytes$Companion extends java.lang.Object + @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull public final net.corda.core.utilities.OpaqueBytes of(byte...) ## @net.corda.core.serialization.CordaSerializable public final class net.corda.core.utilities.OpaqueBytesSubSequence extends net.corda.core.utilities.ByteSequence public (byte[], int, int) @@ -3521,6 +3538,7 @@ public static final class net.corda.core.utilities.OpaqueBytes$Companion extends public int getSize() ## @net.corda.core.serialization.CordaSerializable public final class net.corda.core.utilities.ProgressTracker extends java.lang.Object + public (net.corda.core.utilities.ProgressTracker$Step...) public final void endWithError(Throwable) @org.jetbrains.annotations.NotNull public final List getAllSteps() @org.jetbrains.annotations.NotNull public final List getAllStepsLabels() @@ -3951,7 +3969,7 @@ public final class net.corda.testing.driver.NotaryHandle extends java.lang.Objec @org.jetbrains.annotations.NotNull public final net.corda.core.utilities.NetworkHostAndPort nextHostAndPort() public abstract int nextPort() ## -public static final class net.corda.testing.driver.PortAllocation$Incremental extends net.corda.testing.driver.PortAllocation +@net.corda.core.DoNotImplement public static final class net.corda.testing.driver.PortAllocation$Incremental extends net.corda.testing.driver.PortAllocation public (int) @org.jetbrains.annotations.NotNull public final concurrent.atomic.AtomicInteger getPortCounter() public int nextPort() @@ -3976,7 +3994,7 @@ public final class net.corda.testing.driver.WebserverHandle extends java.lang.Ob public () public abstract int getClusterSize() ## -public static final class net.corda.testing.node.ClusterSpec$Raft extends net.corda.testing.node.ClusterSpec +@net.corda.core.DoNotImplement public static final class net.corda.testing.node.ClusterSpec$Raft extends net.corda.testing.node.ClusterSpec public (int) public final int component1() @org.jetbrains.annotations.NotNull public final net.corda.testing.node.ClusterSpec$Raft copy(int) @@ -4036,13 +4054,13 @@ public static final class net.corda.testing.node.InMemoryMessagingNetwork$MockMe @net.corda.core.DoNotImplement public abstract static class net.corda.testing.node.InMemoryMessagingNetwork$ServicePeerAllocationStrategy extends java.lang.Object public abstract Object pickNext(net.corda.testing.node.InMemoryMessagingNetwork$DistributedServiceHandle, List) ## -public static final class net.corda.testing.node.InMemoryMessagingNetwork$ServicePeerAllocationStrategy$Random extends net.corda.testing.node.InMemoryMessagingNetwork$ServicePeerAllocationStrategy +@net.corda.core.DoNotImplement public static final class net.corda.testing.node.InMemoryMessagingNetwork$ServicePeerAllocationStrategy$Random extends net.corda.testing.node.InMemoryMessagingNetwork$ServicePeerAllocationStrategy public () public (SplittableRandom) @org.jetbrains.annotations.NotNull public final SplittableRandom getRandom() public Object pickNext(net.corda.testing.node.InMemoryMessagingNetwork$DistributedServiceHandle, List) ## -public static final class net.corda.testing.node.InMemoryMessagingNetwork$ServicePeerAllocationStrategy$RoundRobin extends net.corda.testing.node.InMemoryMessagingNetwork$ServicePeerAllocationStrategy +@net.corda.core.DoNotImplement public static final class net.corda.testing.node.InMemoryMessagingNetwork$ServicePeerAllocationStrategy$RoundRobin extends net.corda.testing.node.InMemoryMessagingNetwork$ServicePeerAllocationStrategy public () public Object pickNext(net.corda.testing.node.InMemoryMessagingNetwork$DistributedServiceHandle, List) ## @@ -4140,9 +4158,17 @@ public class net.corda.testing.node.MockServices extends java.lang.Object implem public () public (List) public (List, net.corda.core.identity.CordaX500Name) + public (List, net.corda.core.identity.CordaX500Name, java.security.KeyPair, java.security.KeyPair...) public (List, net.corda.core.identity.CordaX500Name, net.corda.core.node.services.IdentityService) + public (List, net.corda.core.identity.CordaX500Name, net.corda.core.node.services.IdentityService, java.security.KeyPair, java.security.KeyPair...) + public (List, net.corda.testing.core.TestIdentity, net.corda.core.node.services.IdentityService, net.corda.core.node.NetworkParameters, java.security.KeyPair...) + public (List, net.corda.testing.core.TestIdentity, net.corda.core.node.services.IdentityService, java.security.KeyPair...) + public (List, net.corda.testing.core.TestIdentity, java.security.KeyPair...) public (net.corda.core.identity.CordaX500Name) + public (net.corda.core.identity.CordaX500Name, java.security.KeyPair, java.security.KeyPair...) public (net.corda.core.identity.CordaX500Name, net.corda.core.node.services.IdentityService) + public (net.corda.core.identity.CordaX500Name, net.corda.core.node.services.IdentityService, java.security.KeyPair, java.security.KeyPair...) + public (net.corda.testing.core.TestIdentity, net.corda.testing.core.TestIdentity...) public final void addMockCordapp(String) @org.jetbrains.annotations.NotNull public net.corda.core.transactions.SignedTransaction addSignature(net.corda.core.transactions.SignedTransaction) @org.jetbrains.annotations.NotNull public net.corda.core.transactions.SignedTransaction addSignature(net.corda.core.transactions.SignedTransaction, java.security.PublicKey) @@ -4168,9 +4194,13 @@ public class net.corda.testing.node.MockServices extends java.lang.Object implem @org.jetbrains.annotations.NotNull public net.corda.core.contracts.TransactionState loadState(net.corda.core.contracts.StateRef) @org.jetbrains.annotations.NotNull public Set loadStates(Set) @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull public static final Properties makeTestDataSourceProperties(String) + @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull public static final kotlin.Pair makeTestDatabaseAndMockServices(List, net.corda.core.node.services.IdentityService, net.corda.testing.core.TestIdentity, net.corda.core.node.NetworkParameters, java.security.KeyPair...) + @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull public static final kotlin.Pair makeTestDatabaseAndMockServices(List, net.corda.core.node.services.IdentityService, net.corda.testing.core.TestIdentity, java.security.KeyPair...) public void recordTransactions(Iterable) public void recordTransactions(net.corda.core.node.StatesToRecord, Iterable) + public void recordTransactions(net.corda.core.transactions.SignedTransaction, net.corda.core.transactions.SignedTransaction...) public void recordTransactions(boolean, Iterable) + public void recordTransactions(boolean, net.corda.core.transactions.SignedTransaction, net.corda.core.transactions.SignedTransaction...) @org.jetbrains.annotations.NotNull public Void registerUnloadHandler(kotlin.jvm.functions.Function0) @org.jetbrains.annotations.NotNull public net.corda.core.transactions.SignedTransaction signInitialTransaction(net.corda.core.transactions.TransactionBuilder) @org.jetbrains.annotations.NotNull public net.corda.core.transactions.SignedTransaction signInitialTransaction(net.corda.core.transactions.TransactionBuilder, Iterable) @@ -4180,6 +4210,8 @@ public class net.corda.testing.node.MockServices extends java.lang.Object implem ## public static final class net.corda.testing.node.MockServices$Companion extends java.lang.Object @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull public final Properties makeTestDataSourceProperties(String) + @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull public final kotlin.Pair makeTestDatabaseAndMockServices(List, net.corda.core.node.services.IdentityService, net.corda.testing.core.TestIdentity, net.corda.core.node.NetworkParameters, java.security.KeyPair...) + @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull public final kotlin.Pair makeTestDatabaseAndMockServices(List, net.corda.core.node.services.IdentityService, net.corda.testing.core.TestIdentity, java.security.KeyPair...) ## public static final class net.corda.testing.node.MockServices$Companion$makeTestDatabaseAndMockServices$mockService$1$1 extends net.corda.testing.node.MockServices @org.jetbrains.annotations.NotNull public net.corda.core.node.services.VaultService getVaultService() @@ -4188,6 +4220,7 @@ public static final class net.corda.testing.node.MockServices$Companion$makeTest ## public final class net.corda.testing.node.MockServicesKt extends java.lang.Object @org.jetbrains.annotations.NotNull public static final net.corda.core.serialization.SerializeAsToken createMockCordaService(net.corda.testing.node.MockServices, kotlin.jvm.functions.Function1) + @org.jetbrains.annotations.NotNull public static final net.corda.node.services.identity.InMemoryIdentityService makeTestIdentityService(net.corda.core.identity.PartyAndCertificate...) ## public static final class net.corda.testing.node.MockServicesKt$createMockCordaService$MockAppServiceHubImpl extends java.lang.Object implements net.corda.core.node.AppServiceHub, net.corda.core.node.ServiceHub public (net.corda.testing.node.MockServices, net.corda.testing.node.MockServices, kotlin.jvm.functions.Function1) @@ -4217,7 +4250,9 @@ public static final class net.corda.testing.node.MockServicesKt$createMockCordaS @org.jetbrains.annotations.NotNull public Set loadStates(Set) public void recordTransactions(Iterable) public void recordTransactions(net.corda.core.node.StatesToRecord, Iterable) + public void recordTransactions(net.corda.core.transactions.SignedTransaction, net.corda.core.transactions.SignedTransaction...) public void recordTransactions(boolean, Iterable) + public void recordTransactions(boolean, net.corda.core.transactions.SignedTransaction, net.corda.core.transactions.SignedTransaction...) public void registerUnloadHandler(kotlin.jvm.functions.Function0) @org.jetbrains.annotations.NotNull public net.corda.core.transactions.SignedTransaction signInitialTransaction(net.corda.core.transactions.TransactionBuilder) @org.jetbrains.annotations.NotNull public net.corda.core.transactions.SignedTransaction signInitialTransaction(net.corda.core.transactions.TransactionBuilder, Iterable) @@ -4309,11 +4344,11 @@ public final class net.corda.client.rpc.CordaRPCClientConfiguration extends java public int hashCode() public String toString() public static final net.corda.client.rpc.CordaRPCClientConfiguration$Companion Companion - @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull public static final net.corda.client.rpc.CordaRPCClientConfiguration DEFAULT + @org.jetbrains.annotations.NotNull public static final net.corda.client.rpc.CordaRPCClientConfiguration DEFAULT ## public static final class net.corda.client.rpc.CordaRPCClientConfiguration$Companion extends java.lang.Object ## -public final class net.corda.client.rpc.CordaRPCConnection extends java.lang.Object implements net.corda.client.rpc.RPCConnection +@net.corda.core.DoNotImplement public final class net.corda.client.rpc.CordaRPCConnection extends java.lang.Object implements net.corda.client.rpc.RPCConnection public (net.corda.client.rpc.RPCConnection) public void close() public void forceClose() @@ -4346,6 +4381,7 @@ public final class net.corda.testing.contracts.DummyContract extends java.lang.O @org.jetbrains.annotations.Nullable public final Object component1() @org.jetbrains.annotations.NotNull public final net.corda.testing.contracts.DummyContract copy(Object) public boolean equals(Object) + @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull public static final net.corda.core.transactions.TransactionBuilder generateInitial(int, net.corda.core.identity.Party, net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.PartyAndReference...) @org.jetbrains.annotations.Nullable public final Object getBlank() @org.jetbrains.annotations.NotNull public final String getPROGRAM_ID() public int hashCode() @@ -4365,10 +4401,11 @@ public static final class net.corda.testing.contracts.DummyContract$Commands$Mov public () ## public static final class net.corda.testing.contracts.DummyContract$Companion extends java.lang.Object + @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.TransactionBuilder generateInitial(int, net.corda.core.identity.Party, net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.PartyAndReference...) @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.TransactionBuilder move(List, net.corda.core.identity.AbstractParty) @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.TransactionBuilder move(net.corda.core.contracts.StateAndRef, net.corda.core.identity.AbstractParty) ## -public static final class net.corda.testing.contracts.DummyContract$MultiOwnerState extends java.lang.Object implements net.corda.testing.contracts.DummyContract$State +@net.corda.core.DoNotImplement public static final class net.corda.testing.contracts.DummyContract$MultiOwnerState extends java.lang.Object implements net.corda.testing.contracts.DummyContract$State public (int, List) public final int component1() @org.jetbrains.annotations.NotNull public final List component2() @@ -4380,7 +4417,7 @@ public static final class net.corda.testing.contracts.DummyContract$MultiOwnerSt public int hashCode() public String toString() ## -public static final class net.corda.testing.contracts.DummyContract$SingleOwnerState extends java.lang.Object implements net.corda.testing.contracts.DummyContract$State, net.corda.core.contracts.OwnableState +@net.corda.core.DoNotImplement public static final class net.corda.testing.contracts.DummyContract$SingleOwnerState extends java.lang.Object implements net.corda.testing.contracts.DummyContract$State, net.corda.core.contracts.OwnableState public (int, net.corda.core.identity.AbstractParty) public final int component1() @org.jetbrains.annotations.NotNull public final net.corda.core.identity.AbstractParty component2() @@ -4456,15 +4493,15 @@ public final class net.corda.testing.core.Expect extends java.lang.Object ## @net.corda.core.DoNotImplement public abstract class net.corda.testing.core.ExpectCompose extends java.lang.Object ## -public static final class net.corda.testing.core.ExpectCompose$Parallel extends net.corda.testing.core.ExpectCompose +@net.corda.core.DoNotImplement public static final class net.corda.testing.core.ExpectCompose$Parallel extends net.corda.testing.core.ExpectCompose public (List) @org.jetbrains.annotations.NotNull public final List getParallel() ## -public static final class net.corda.testing.core.ExpectCompose$Sequential extends net.corda.testing.core.ExpectCompose +@net.corda.core.DoNotImplement public static final class net.corda.testing.core.ExpectCompose$Sequential extends net.corda.testing.core.ExpectCompose public (List) @org.jetbrains.annotations.NotNull public final List getSequence() ## -public static final class net.corda.testing.core.ExpectCompose$Single extends net.corda.testing.core.ExpectCompose +@net.corda.core.DoNotImplement public static final class net.corda.testing.core.ExpectCompose$Single extends net.corda.testing.core.ExpectCompose public (net.corda.testing.core.Expect) @org.jetbrains.annotations.NotNull public final net.corda.testing.core.Expect getExpect() ## @@ -4503,8 +4540,10 @@ public final class net.corda.testing.core.ExpectKt extends java.lang.Object public static final void expectEvents(rx.Observable, boolean, kotlin.jvm.functions.Function0) public static final void genericExpectEvents(Object, boolean, kotlin.jvm.functions.Function2, kotlin.jvm.functions.Function0) @org.jetbrains.annotations.NotNull public static final net.corda.testing.core.ExpectCompose parallel(List) + @org.jetbrains.annotations.NotNull public static final net.corda.testing.core.ExpectCompose parallel(net.corda.testing.core.ExpectCompose...) @org.jetbrains.annotations.NotNull public static final net.corda.testing.core.ExpectCompose replicate(int, kotlin.jvm.functions.Function1) @org.jetbrains.annotations.NotNull public static final net.corda.testing.core.ExpectCompose sequence(List) + @org.jetbrains.annotations.NotNull public static final net.corda.testing.core.ExpectCompose sequence(net.corda.testing.core.ExpectCompose...) ## public static final class net.corda.testing.core.ExpectKt$expectEvents$1$lock$1 extends java.lang.Object ## @@ -4523,14 +4562,15 @@ public static final class net.corda.testing.core.SerializationEnvironmentRule$ap public void evaluate() ## public final class net.corda.testing.core.TestConstants extends java.lang.Object - @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.CordaX500Name ALICE_NAME - @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.CordaX500Name BOB_NAME - @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.CordaX500Name BOC_NAME - @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.CordaX500Name CHARLIE_NAME - @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.CordaX500Name DUMMY_BANK_A_NAME - @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.CordaX500Name DUMMY_BANK_B_NAME - @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.CordaX500Name DUMMY_BANK_C_NAME - @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.CordaX500Name DUMMY_NOTARY_NAME + @org.jetbrains.annotations.NotNull public static final net.corda.core.contracts.Command dummyCommand(java.security.PublicKey...) + @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.CordaX500Name ALICE_NAME + @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.CordaX500Name BOB_NAME + @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.CordaX500Name BOC_NAME + @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.CordaX500Name CHARLIE_NAME + @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.CordaX500Name DUMMY_BANK_A_NAME + @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.CordaX500Name DUMMY_BANK_B_NAME + @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.CordaX500Name DUMMY_BANK_C_NAME + @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.CordaX500Name DUMMY_NOTARY_NAME public static final int MAX_MESSAGE_SIZE = 10485760 ## public final class net.corda.testing.core.TestIdentity extends java.lang.Object @@ -4542,6 +4582,7 @@ public final class net.corda.testing.core.TestIdentity extends java.lang.Object @org.jetbrains.annotations.NotNull public final net.corda.core.identity.CordaX500Name getName() @org.jetbrains.annotations.NotNull public final net.corda.core.identity.Party getParty() @org.jetbrains.annotations.NotNull public final java.security.PublicKey getPublicKey() + @org.jetbrains.annotations.NotNull public final net.corda.core.contracts.PartyAndReference ref(byte...) public static final net.corda.testing.core.TestIdentity$Companion Companion ## public static final class net.corda.testing.core.TestIdentity$Companion extends java.lang.Object @@ -4568,10 +4609,10 @@ public final class net.corda.testing.dsl.DuplicateOutputLabel extends net.corda. ## @net.corda.core.DoNotImplement public abstract class net.corda.testing.dsl.EnforceVerifyOrFail extends java.lang.Object ## -public static final class net.corda.testing.dsl.EnforceVerifyOrFail$Token extends net.corda.testing.dsl.EnforceVerifyOrFail +@net.corda.core.DoNotImplement public static final class net.corda.testing.dsl.EnforceVerifyOrFail$Token extends net.corda.testing.dsl.EnforceVerifyOrFail public static final net.corda.testing.dsl.EnforceVerifyOrFail$Token INSTANCE ## -public final class net.corda.testing.dsl.LedgerDSL extends java.lang.Object implements net.corda.testing.dsl.LedgerDSLInterpreter +@net.corda.core.DoNotImplement public final class net.corda.testing.dsl.LedgerDSL extends java.lang.Object implements net.corda.testing.dsl.LedgerDSLInterpreter public (net.corda.testing.dsl.LedgerDSLInterpreter, net.corda.core.identity.Party) @org.jetbrains.annotations.NotNull public net.corda.core.transactions.WireTransaction _transaction(String, net.corda.core.transactions.TransactionBuilder, kotlin.jvm.functions.Function1) public void _tweak(kotlin.jvm.functions.Function1) @@ -4601,7 +4642,7 @@ public final class net.corda.testing.dsl.LedgerDSL extends java.lang.Object impl @net.corda.core.DoNotImplement public interface net.corda.testing.dsl.OutputStateLookup @org.jetbrains.annotations.NotNull public abstract net.corda.core.contracts.StateAndRef retrieveOutputStateAndRef(Class, String) ## -public final class net.corda.testing.dsl.TestLedgerDSLInterpreter extends java.lang.Object implements net.corda.testing.dsl.LedgerDSLInterpreter +@net.corda.core.DoNotImplement public final class net.corda.testing.dsl.TestLedgerDSLInterpreter extends java.lang.Object implements net.corda.testing.dsl.LedgerDSLInterpreter public (net.corda.core.node.ServiceHub) @org.jetbrains.annotations.NotNull public net.corda.core.transactions.WireTransaction _transaction(String, net.corda.core.transactions.TransactionBuilder, kotlin.jvm.functions.Function1) public void _tweak(kotlin.jvm.functions.Function1) @@ -4646,7 +4687,7 @@ public static final class net.corda.testing.dsl.TestLedgerDSLInterpreter$WireTra public int hashCode() public String toString() ## -public final class net.corda.testing.dsl.TestTransactionDSLInterpreter extends java.lang.Object implements net.corda.testing.dsl.TransactionDSLInterpreter, net.corda.testing.dsl.OutputStateLookup +@net.corda.core.DoNotImplement public final class net.corda.testing.dsl.TestTransactionDSLInterpreter extends java.lang.Object implements net.corda.testing.dsl.TransactionDSLInterpreter, net.corda.testing.dsl.OutputStateLookup public (net.corda.testing.dsl.TestLedgerDSLInterpreter, net.corda.core.transactions.TransactionBuilder) public void _attachment(String) @org.jetbrains.annotations.NotNull public net.corda.testing.dsl.EnforceVerifyOrFail _tweak(kotlin.jvm.functions.Function1) @@ -4678,12 +4719,13 @@ public static final class net.corda.testing.dsl.TestTransactionDSLInterpreter$se @org.jetbrains.annotations.NotNull public net.corda.core.contracts.TransactionState loadState(net.corda.core.contracts.StateRef) @org.jetbrains.annotations.NotNull public Set loadStates(Set) ## -public final class net.corda.testing.dsl.TransactionDSL extends java.lang.Object implements net.corda.testing.dsl.TransactionDSLInterpreter +@net.corda.core.DoNotImplement public final class net.corda.testing.dsl.TransactionDSL extends java.lang.Object implements net.corda.testing.dsl.TransactionDSLInterpreter public (net.corda.testing.dsl.TransactionDSLInterpreter, net.corda.core.identity.Party) public void _attachment(String) @org.jetbrains.annotations.NotNull public net.corda.testing.dsl.EnforceVerifyOrFail _tweak(kotlin.jvm.functions.Function1) public final void attachment(String) public void attachment(net.corda.core.crypto.SecureHash) + public final void attachments(String...) public final void command(java.security.PublicKey, net.corda.core.contracts.CommandData) public void command(List, net.corda.core.contracts.CommandData) @org.jetbrains.annotations.NotNull public net.corda.testing.dsl.EnforceVerifyOrFail fails() diff --git a/constants.properties b/constants.properties index 3364df906d..78b24ad2cd 100644 --- a/constants.properties +++ b/constants.properties @@ -1,4 +1,4 @@ -gradlePluginsVersion=3.0.9 +gradlePluginsVersion=3.1.0 kotlinVersion=1.1.60 platformVersion=3 guavaVersion=21.0 diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index ab70e5934b..e5003532ce 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -4,6 +4,17 @@ Changelog Here are brief summaries of what's changed between each snapshot release. This includes guidance on how to upgrade code from the previous milestone release. +.. _changelog_v3_1: + +Version 3.1 +----------- + +* Updated the api scanner gradle plugin to work the same way as the version in master. These changes make the api scanner more + accurate and fix a couple of bugs, and change the format of the api-current.txt file slightly. Backporting these changes + to the v3 branch will make it easier for us to ensure that apis are stable for future versions. These changes are + released in gradle plugins version 3.0.10. For more information on the api scanner see + the `documentation `_. + .. _changelog_v3: Version 3.0 diff --git a/docs/source/upgrade-notes.rst b/docs/source/upgrade-notes.rst index e06fb17f8d..0f1c2eba3e 100644 --- a/docs/source/upgrade-notes.rst +++ b/docs/source/upgrade-notes.rst @@ -28,13 +28,31 @@ versions you are currently using are still in force. We also strongly recommend cross referencing with the :doc:`changelog` to confirm changes. +v3.0 to v3.1 +------------ + +Gradle Plugin Version +^^^^^^^^^^^^^^^^^^^^^ + +Corda 3.1 uses version 3.1.0 of the gradle plugins and your ``build.gradle`` file should be updated to reflect this. + +.. sourcecode:: shell + + ext.corda_gradle_plugins_version = '3.1.0' + +You will also need to update the ``corda_release_version`` identifier in your project gradle file. + +.. sourcecode:: shell + + ext.corda_release_version = 'corda-3.1' + V2.0 to V3.0 ------------ Gradle Plugin Version ^^^^^^^^^^^^^^^^^^^^^ -Corda 3.0 uses version 3.0.8 of the gradle plugins and your ``build.gradle`` file should be updated to reflect this. +Corda 3.0 uses version 3.0.9 of the gradle plugins and your ``build.gradle`` file should be updated to reflect this. .. sourcecode:: shell diff --git a/gradle-plugins/api-scanner/README.md b/gradle-plugins/api-scanner/README.md index aba34357d4..1092856167 100644 --- a/gradle-plugins/api-scanner/README.md +++ b/gradle-plugins/api-scanner/README.md @@ -6,7 +6,7 @@ Generates a text summary of Corda's public API that we can check for API-breakin $ gradlew generateApi ``` -See [here](../../docs/source/corda-api.rst) for Corda's public API strategy. We will need to +See [here](https://github.com/corda/corda/blob/master/docs/source/corda-api.rst) for Corda's public API strategy. We will need to apply this plugin to other modules in future Corda releases as those modules' APIs stabilise. Basically, this plugin will document a module's `public` and `protected` classes/methods/fields, @@ -76,4 +76,4 @@ or in any of that project's subprojects. So it is _theoretically_ possible also from subtrees of modules simply by defining a new `GenerateApi` task at the root of that subtree. ## Plugin Installation -See [here](../README.rst) for full installation instructions. +See [here](../README.md) for full installation instructions. diff --git a/gradle-plugins/api-scanner/annotations/build.gradle b/gradle-plugins/api-scanner/annotations/build.gradle new file mode 100644 index 0000000000..9e287c1752 --- /dev/null +++ b/gradle-plugins/api-scanner/annotations/build.gradle @@ -0,0 +1,7 @@ +apply plugin: 'java' + +description 'A library of annotations for testing API Scanner.' + +jar { + archiveName 'annotations.jar' +} diff --git a/gradle-plugins/api-scanner/annotations/src/main/java/net/corda/annotation/AlsoInherited.java b/gradle-plugins/api-scanner/annotations/src/main/java/net/corda/annotation/AlsoInherited.java new file mode 100644 index 0000000000..38534b675b --- /dev/null +++ b/gradle-plugins/api-scanner/annotations/src/main/java/net/corda/annotation/AlsoInherited.java @@ -0,0 +1,14 @@ +package net.corda.annotation; + +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.*; + +@Target({TYPE, METHOD}) +@Retention(CLASS) +@Inherited +public @interface AlsoInherited { +} diff --git a/gradle-plugins/api-scanner/annotations/src/main/java/net/corda/annotation/IsInherited.java b/gradle-plugins/api-scanner/annotations/src/main/java/net/corda/annotation/IsInherited.java new file mode 100644 index 0000000000..39a7d71aa2 --- /dev/null +++ b/gradle-plugins/api-scanner/annotations/src/main/java/net/corda/annotation/IsInherited.java @@ -0,0 +1,14 @@ +package net.corda.annotation; + +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.*; + +@Target({TYPE, METHOD}) +@Retention(CLASS) +@Inherited +public @interface IsInherited { +} diff --git a/gradle-plugins/api-scanner/annotations/src/main/java/net/corda/annotation/NotInherited.java b/gradle-plugins/api-scanner/annotations/src/main/java/net/corda/annotation/NotInherited.java new file mode 100644 index 0000000000..601564dc29 --- /dev/null +++ b/gradle-plugins/api-scanner/annotations/src/main/java/net/corda/annotation/NotInherited.java @@ -0,0 +1,12 @@ +package net.corda.annotation; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.*; + +@Target({TYPE, METHOD}) +@Retention(CLASS) +public @interface NotInherited { +} diff --git a/gradle-plugins/api-scanner/build.gradle b/gradle-plugins/api-scanner/build.gradle index 13dca34301..c693e7ec8d 100644 --- a/gradle-plugins/api-scanner/build.gradle +++ b/gradle-plugins/api-scanner/build.gradle @@ -1,4 +1,5 @@ apply plugin: 'java' +apply plugin: 'java-gradle-plugin' apply plugin: 'net.corda.plugins.publish-utils' apply plugin: 'com.jfrog.artifactory' @@ -7,15 +8,36 @@ description "Generates a summary of the artifact's public API" repositories { mavenLocal() mavenCentral() + jcenter() +} + +gradlePlugin { + plugins { + apiScannerPlugin { + id = 'net.corda.plugins.api-scanner' + implementationClass = 'net.corda.plugins.ApiScanner' + } + } } dependencies { - compile gradleApi() compile "io.github.lukehutch:fast-classpath-scanner:2.7.0" - testCompile "junit:junit:4.12" + testCompile "org.assertj:assertj-core:$assertj_version" + testCompile "junit:junit:$junit_version" + + // This dependency is only to prevent IntelliJ from choking + // on the Kotlin classes in the test/resources directory. + testCompile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + testCompile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" + testCompile project(':api-scanner:annotations') +} + +processTestResources { + filesMatching('**/kotlin-*/build.gradle') { + expand(['kotlin_version': kotlin_version]) + } } publish { name project.name } - diff --git a/gradle-plugins/api-scanner/src/main/java/net/corda/plugins/ApiScanner.java b/gradle-plugins/api-scanner/src/main/java/net/corda/plugins/ApiScanner.java index 75f238891c..b5714f6e3d 100644 --- a/gradle-plugins/api-scanner/src/main/java/net/corda/plugins/ApiScanner.java +++ b/gradle-plugins/api-scanner/src/main/java/net/corda/plugins/ApiScanner.java @@ -7,6 +7,8 @@ import org.gradle.api.file.FileCollection; import org.gradle.api.tasks.TaskCollection; import org.gradle.jvm.tasks.Jar; +import javax.annotation.Nonnull; + public class ApiScanner implements Plugin { /** @@ -16,7 +18,7 @@ public class ApiScanner implements Plugin { * @param p Current project. */ @Override - public void apply(Project p) { + public void apply(@Nonnull Project p) { p.getLogger().info("Applying API scanner to {}", p.getName()); ScannerExtension extension = p.getExtensions().create("scanApi", ScannerExtension.class); diff --git a/gradle-plugins/api-scanner/src/main/java/net/corda/plugins/ScanApi.java b/gradle-plugins/api-scanner/src/main/java/net/corda/plugins/ScanApi.java index a9567035f6..1f2bc9a807 100644 --- a/gradle-plugins/api-scanner/src/main/java/net/corda/plugins/ScanApi.java +++ b/gradle-plugins/api-scanner/src/main/java/net/corda/plugins/ScanApi.java @@ -1,18 +1,12 @@ package net.corda.plugins; import io.github.lukehutch.fastclasspathscanner.FastClasspathScanner; -import io.github.lukehutch.fastclasspathscanner.scanner.ClassInfo; -import io.github.lukehutch.fastclasspathscanner.scanner.FieldInfo; -import io.github.lukehutch.fastclasspathscanner.scanner.MethodInfo; -import io.github.lukehutch.fastclasspathscanner.scanner.ScanResult; +import io.github.lukehutch.fastclasspathscanner.scanner.*; import org.gradle.api.DefaultTask; import org.gradle.api.file.ConfigurableFileCollection; import org.gradle.api.file.FileCollection; -import org.gradle.api.tasks.CompileClasspath; -import org.gradle.api.tasks.Input; -import org.gradle.api.tasks.InputFiles; -import org.gradle.api.tasks.OutputFiles; -import org.gradle.api.tasks.TaskAction; +import org.gradle.api.tasks.*; +import org.gradle.api.tasks.Console; import java.io.*; import java.lang.annotation.Annotation; @@ -33,14 +27,24 @@ import static java.util.stream.Collectors.*; public class ScanApi extends DefaultTask { private static final int CLASS_MASK = Modifier.classModifiers(); private static final int INTERFACE_MASK = Modifier.interfaceModifiers() & ~Modifier.ABSTRACT; - private static final int METHOD_MASK = Modifier.methodModifiers(); + /** + * The VARARG modifier for methods has the same value as the TRANSIENT modifier for fields. + * Unfortunately, {@link Modifier#methodModifiers() methodModifiers} doesn't include this + * flag, and so we need to add it back ourselves. + * @link https://docs.oracle.com/javase/specs/jls/se8/html/index.html + */ + private static final int METHOD_MASK = Modifier.methodModifiers() | Modifier.TRANSIENT; private static final int FIELD_MASK = Modifier.fieldModifiers(); private static final int VISIBILITY_MASK = Modifier.PUBLIC | Modifier.PROTECTED; + private static final String INTERNAL_ANNOTATION_NAME = ".CordaInternal"; + private static final String DEFAULT_INTERNAL_ANNOTATION = "net.corda.core" + INTERNAL_ANNOTATION_NAME; private static final Set ANNOTATION_BLACKLIST; static { Set blacklist = new LinkedHashSet<>(); + blacklist.add("kotlin.jvm.JvmField"); blacklist.add("kotlin.jvm.JvmOverloads"); + blacklist.add(DEFAULT_INTERNAL_ANNOTATION); ANNOTATION_BLACKLIST = unmodifiableSet(blacklist); } @@ -65,6 +69,7 @@ public class ScanApi extends DefaultTask { outputDir = new File(getProject().getBuildDir(), "api"); } + @SkipWhenEmpty @InputFiles public FileCollection getSources() { return sources; @@ -103,6 +108,7 @@ public class ScanApi extends DefaultTask { ); } + @Console public boolean isVerbose() { return verbose; } @@ -112,7 +118,7 @@ public class ScanApi extends DefaultTask { } private File toTarget(File source) { - return new File(outputDir, source.getName().replaceAll(".jar$", ".txt")); + return new File(outputDir, source.getName().replaceAll("\\.jar$", ".txt")); } @TaskAction @@ -130,10 +136,16 @@ public class ScanApi extends DefaultTask { private final URLClassLoader classpathLoader; private final Class metadataClass; private final Method classTypeMethod; + private Collection internalAnnotations; + private Collection invisibleAnnotations; + private Collection inheritedAnnotations; @SuppressWarnings("unchecked") Scanner(URLClassLoader classpathLoader) { this.classpathLoader = classpathLoader; + this.invisibleAnnotations = ANNOTATION_BLACKLIST; + this.inheritedAnnotations = emptySet(); + this.internalAnnotations = emptySet(); Class kClass; Method kMethod; @@ -160,6 +172,7 @@ public class ScanApi extends DefaultTask { void scan(File source) { File target = toTarget(source); + getLogger().info("API file: {}", target.getAbsolutePath()); try ( URLClassLoader appLoader = new URLClassLoader(new URL[]{ toURL(source) }, classpathLoader); PrintWriter writer = new PrintWriter(target, "UTF-8") @@ -171,7 +184,13 @@ public class ScanApi extends DefaultTask { } void scan(PrintWriter writer, ClassLoader appLoader) { + Set inherited = new HashSet<>(); ScanResult result = new FastClasspathScanner(getScanSpecification()) + .matchAllAnnotationClasses(annotation -> { + if (annotation.isAnnotationPresent(Inherited.class)) { + inherited.add(annotation.getName()); + } + }) .overrideClassLoaders(appLoader) .ignoreParentClassLoaders() .ignoreMethodVisibility() @@ -180,6 +199,12 @@ public class ScanApi extends DefaultTask { .enableFieldInfo() .verbose(verbose) .scan(); + inheritedAnnotations = unmodifiableSet(inherited); + loadAnnotationCaches(result); + getLogger().info("Annotations:"); + getLogger().info("- Inherited: {}", inheritedAnnotations); + getLogger().info("- Internal: {}", internalAnnotations); + getLogger().info("- Invisible: {}", invisibleAnnotations); writeApis(writer, result); } @@ -195,6 +220,21 @@ public class ScanApi extends DefaultTask { return spec; } + private void loadAnnotationCaches(ScanResult result) { + Set internal = result.getNamesOfAllAnnotationClasses().stream() + .filter(s -> s.endsWith(INTERNAL_ANNOTATION_NAME)) + .collect(toCollection(LinkedHashSet::new)); + internal.add(DEFAULT_INTERNAL_ANNOTATION); + internalAnnotations = unmodifiableSet(internal); + + Set invisible = internalAnnotations.stream() + .flatMap(a -> result.getNamesOfAnnotationsWithMetaAnnotation(a).stream()) + .collect(toCollection(LinkedHashSet::new)); + invisible.addAll(ANNOTATION_BLACKLIST); + invisible.addAll(internal); + invisibleAnnotations = unmodifiableSet(invisible); + } + private void writeApis(PrintWriter writer, ScanResult result) { Map allInfo = result.getClassNameToClassInfo(); result.getNamesOfAllClasses().forEach(className -> { @@ -216,6 +256,12 @@ public class ScanApi extends DefaultTask { return; } + if (classInfo.isAnnotation() && !isVisibleAnnotation(className)) { + // Exclude these annotations from the output, + // e.g. because they're internal to Kotlin or Corda. + return; + } + Class javaClass = result.classNameToClassRef(className); if (!isVisible(javaClass.getModifiers())) { // Excludes private and package-protected classes @@ -246,9 +292,9 @@ public class ScanApi extends DefaultTask { /* * Class declaration. */ - List annotationNames = toNames(readClassAnnotationsFor(classInfo)); - if (!annotationNames.isEmpty()) { - writer.append(asAnnotations(annotationNames)); + Names annotationNames = toNames(readClassAnnotationsFor(classInfo)); + if (!annotationNames.visible.isEmpty()) { + writer.append(asAnnotations(annotationNames.visible)); } writer.append(Modifier.toString(modifiers & CLASS_MASK)); writer.append(" class ").print(classInfo); @@ -264,9 +310,9 @@ public class ScanApi extends DefaultTask { /* * Interface declaration. */ - List annotationNames = toNames(readInterfaceAnnotationsFor(classInfo)); - if (!annotationNames.isEmpty()) { - writer.append(asAnnotations(annotationNames)); + Names annotationNames = toNames(readInterfaceAnnotationsFor(classInfo)); + if (!annotationNames.visible.isEmpty()) { + writer.append(asAnnotations(annotationNames.visible)); } writer.append(Modifier.toString(modifiers & INTERFACE_MASK)); writer.append(" interface ").print(classInfo); @@ -283,7 +329,7 @@ public class ScanApi extends DefaultTask { for (MethodInfo method : methods) { if (isVisible(method.getAccessFlags()) // Only public and protected methods && isValid(method.getAccessFlags(), METHOD_MASK) // Excludes bridge and synthetic methods - && !hasCordaInternal(method.getAnnotationNames()) // Excludes methods annotated as @CordaInternal + && !hasInternalAnnotation(method.getAnnotationNames()) // Excludes methods annotated as @CordaInternal && !isKotlinInternalScope(method)) { writer.append(" ").println(filterAnnotationsFor(method)); } @@ -293,8 +339,10 @@ public class ScanApi extends DefaultTask { private void writeFields(PrintWriter output, List fields) { sort(fields); for (FieldInfo field : fields) { - if (isVisible(field.getAccessFlags()) && isValid(field.getAccessFlags(), FIELD_MASK)) { - output.append(" ").println(field); + if (isVisible(field.getAccessFlags()) + && isValid(field.getAccessFlags(), FIELD_MASK) + && !hasInternalAnnotation(field.getAnnotationNames())) { + output.append(" ").println(filterAnnotationsFor(field)); } } } @@ -313,11 +361,12 @@ public class ScanApi extends DefaultTask { return 0; } - private List toNames(Collection classes) { - return classes.stream() + private Names toNames(Collection classes) { + Map> partitioned = classes.stream() .map(ClassInfo::toString) .filter(ScanApi::isApplicationClass) - .collect(toList()); + .collect(partitioningBy(this::isVisibleAnnotation, toCollection(ArrayList::new))); + return new Names(ordering(partitioned.get(true)), ordering(partitioned.get(false))); } private Set readClassAnnotationsFor(ClassInfo classInfo) { @@ -339,7 +388,7 @@ public class ScanApi extends DefaultTask { private List selectInheritedAnnotations(Collection classes) { return classes.stream() .flatMap(cls -> cls.getAnnotations().stream()) - .filter(ann -> ann.hasMetaAnnotation(Inherited.class.getName())) + .filter(ann -> inheritedAnnotations.contains(ann.getClassName())) .collect(toList()); } @@ -350,24 +399,44 @@ public class ScanApi extends DefaultTask { method.getAccessFlags(), method.getTypeDescriptor(), method.getAnnotationNames().stream() - .filter(ScanApi::isVisibleAnnotation) + .filter(this::isVisibleAnnotation) + .sorted() .collect(toList()) ); } + + private FieldInfo filterAnnotationsFor(FieldInfo field) { + return new FieldInfo( + field.getClassName(), + field.getFieldName(), + field.getAccessFlags(), + field.getTypeDescriptor(), + field.getConstFinalValue(), + field.getAnnotationNames().stream() + .filter(this::isVisibleAnnotation) + .sorted() + .collect(toList()) + ); + } + + private boolean isVisibleAnnotation(String annotationName) { + return !invisibleAnnotations.contains(annotationName); + } + + private boolean hasInternalAnnotation(Collection annotationNames) { + return annotationNames.stream().anyMatch(internalAnnotations::contains); + } } - private static boolean isVisibleAnnotation(String annotationName) { - return !ANNOTATION_BLACKLIST.contains(annotationName); + private static > List ordering(List list) { + sort(list); + return list; } private static boolean isKotlinInternalScope(MethodInfo method) { return method.getMethodName().indexOf('$') >= 0; } - private static boolean hasCordaInternal(Collection annotationNames) { - return annotationNames.contains("net.corda.core.CordaInternal"); - } - private static boolean isValid(int modifiers, int mask) { return (modifiers & mask) == modifiers; } @@ -400,3 +469,17 @@ public class ScanApi extends DefaultTask { return urls.toArray(new URL[urls.size()]); } } + +class Names { + List visible; + @SuppressWarnings("WeakerAccess") List hidden; + + Names(List visible, List hidden) { + this.visible = unmodifiable(visible); + this.hidden = unmodifiable(hidden); + } + + private static List unmodifiable(List list) { + return list.isEmpty() ? emptyList() : unmodifiableList(new ArrayList<>(list)); + } +} diff --git a/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/AnnotatedClassTest.java b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/AnnotatedClassTest.java new file mode 100644 index 0000000000..3998f208e4 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/AnnotatedClassTest.java @@ -0,0 +1,52 @@ +package net.corda.plugins; + +import org.gradle.testkit.runner.BuildResult; +import org.gradle.testkit.runner.BuildTask; +import org.gradle.testkit.runner.GradleRunner; +import static org.gradle.testkit.runner.TaskOutcome.*; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; + +import static net.corda.plugins.CopyUtils.*; +import static org.assertj.core.api.Assertions.*; +import static org.junit.Assert.*; + +public class AnnotatedClassTest { + @Rule + public final TemporaryFolder testProjectDir = new TemporaryFolder(); + + @Before + public void setup() throws IOException { + File buildFile = testProjectDir.newFile("build.gradle"); + copyResourceTo("annotated-class/build.gradle", buildFile); + } + + @Test + public void testAnnotatedClass() throws IOException { + BuildResult result = GradleRunner.create() + .withProjectDir(testProjectDir.getRoot()) + .withArguments(getGradleArgsForTasks("scanApi")) + .withPluginClasspath() + .build(); + String output = result.getOutput(); + System.out.println(output); + + BuildTask scanApi = result.task(":scanApi"); + assertNotNull(scanApi); + assertEquals(SUCCESS, scanApi.getOutcome()); + + Path api = pathOf(testProjectDir, "build", "api", "annotated-class.txt"); + assertThat(api).isRegularFile(); + assertThat(Files.readAllLines(api)).containsOnlyOnce( + "@net.corda.annotation.AlsoInherited @net.corda.annotation.IsInherited @net.corda.annotation.NotInherited public class net.corda.example.HasInheritedAnnotation extends java.lang.Object", + "@net.corda.annotation.AlsoInherited @net.corda.annotation.IsInherited public class net.corda.example.InheritingAnnotations extends net.corda.example.HasInheritedAnnotation" + ); + } +} diff --git a/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/AnnotatedFieldTest.java b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/AnnotatedFieldTest.java new file mode 100644 index 0000000000..be89203328 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/AnnotatedFieldTest.java @@ -0,0 +1,52 @@ +package net.corda.plugins; + +import org.gradle.testkit.runner.BuildResult; +import org.gradle.testkit.runner.BuildTask; +import org.gradle.testkit.runner.GradleRunner; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; + +import static net.corda.plugins.CopyUtils.*; +import static org.assertj.core.api.Assertions.*; +import static org.gradle.testkit.runner.TaskOutcome.*; +import static org.junit.Assert.*; + +public class AnnotatedFieldTest { + @Rule + public final TemporaryFolder testProjectDir = new TemporaryFolder(); + + @Before + public void setup() throws IOException { + File buildFile = testProjectDir.newFile("build.gradle"); + copyResourceTo("annotated-field/build.gradle", buildFile); + } + + @Test + public void testAnnotatedField() throws IOException { + BuildResult result = GradleRunner.create() + .withProjectDir(testProjectDir.getRoot()) + .withArguments(getGradleArgsForTasks("scanApi")) + .withPluginClasspath() + .build(); + String output = result.getOutput(); + System.out.println(output); + + BuildTask scanApi = result.task(":scanApi"); + assertNotNull(scanApi); + assertEquals(SUCCESS, scanApi.getOutcome()); + + Path api = pathOf(testProjectDir, "build", "api", "annotated-field.txt"); + assertThat(api).isRegularFile(); + assertThat(Files.readAllLines(api)).containsOnlyOnce( + "public class net.corda.example.HasAnnotatedField extends java.lang.Object", + " @net.corda.example.A @net.corda.example.B @net.corda.example.C public static final String ANNOTATED_FIELD = \"\"" + ); + } +} diff --git a/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/AnnotatedInterfaceTest.java b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/AnnotatedInterfaceTest.java new file mode 100644 index 0000000000..f4b7b17107 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/AnnotatedInterfaceTest.java @@ -0,0 +1,52 @@ +package net.corda.plugins; + +import org.gradle.testkit.runner.BuildResult; +import org.gradle.testkit.runner.BuildTask; +import org.gradle.testkit.runner.GradleRunner; +import static org.gradle.testkit.runner.TaskOutcome.*; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; + +import static net.corda.plugins.CopyUtils.*; +import static org.assertj.core.api.Assertions.*; +import static org.junit.Assert.*; + +public class AnnotatedInterfaceTest { + @Rule + public final TemporaryFolder testProjectDir = new TemporaryFolder(); + + @Before + public void setup() throws IOException { + File buildFile = testProjectDir.newFile("build.gradle"); + copyResourceTo("annotated-interface/build.gradle", buildFile); + } + + @Test + public void testAnnotatedInterface() throws IOException { + BuildResult result = GradleRunner.create() + .withProjectDir(testProjectDir.getRoot()) + .withArguments(getGradleArgsForTasks("scanApi")) + .withPluginClasspath() + .build(); + String output = result.getOutput(); + System.out.println(output); + + BuildTask scanApi = result.task(":scanApi"); + assertNotNull(scanApi); + assertEquals(SUCCESS, scanApi.getOutcome()); + + Path api = pathOf(testProjectDir, "build", "api", "annotated-interface.txt"); + assertThat(api).isRegularFile(); + assertThat(Files.readAllLines(api)).containsOnlyOnce( + "@net.corda.annotation.AlsoInherited @net.corda.annotation.IsInherited @net.corda.annotation.NotInherited public interface net.corda.example.HasInheritedAnnotation", + "@net.corda.annotation.AlsoInherited @net.corda.annotation.IsInherited public interface net.corda.example.InheritingAnnotations extends net.corda.example.HasInheritedAnnotation" + ); + } +} diff --git a/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/AnnotatedMethodTest.java b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/AnnotatedMethodTest.java new file mode 100644 index 0000000000..8fe20cd99b --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/AnnotatedMethodTest.java @@ -0,0 +1,52 @@ +package net.corda.plugins; + +import org.gradle.testkit.runner.BuildResult; +import org.gradle.testkit.runner.BuildTask; +import org.gradle.testkit.runner.GradleRunner; +import static org.gradle.testkit.runner.TaskOutcome.*; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; + +import static net.corda.plugins.CopyUtils.*; +import static org.assertj.core.api.Assertions.*; +import static org.junit.Assert.*; + +public class AnnotatedMethodTest { + @Rule + public final TemporaryFolder testProjectDir = new TemporaryFolder(); + + @Before + public void setup() throws IOException { + File buildFile = testProjectDir.newFile("build.gradle"); + copyResourceTo("annotated-method/build.gradle", buildFile); + } + + @Test + public void testAnnotatedMethod() throws IOException { + BuildResult result = GradleRunner.create() + .withProjectDir(testProjectDir.getRoot()) + .withArguments(getGradleArgsForTasks("scanApi")) + .withPluginClasspath() + .build(); + String output = result.getOutput(); + System.out.println(output); + + BuildTask scanApi = result.task(":scanApi"); + assertNotNull(scanApi); + assertEquals(SUCCESS, scanApi.getOutcome()); + + Path api = pathOf(testProjectDir, "build", "api", "annotated-method.txt"); + assertThat(api).isRegularFile(); + assertThat(Files.readAllLines(api)).containsOnlyOnce( + "public class net.corda.example.HasAnnotatedMethod extends java.lang.Object", + " @net.corda.example.A @net.corda.example.B @net.corda.example.C public void hasAnnotation()" + ); + } +} diff --git a/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/BasicAnnotationTest.java b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/BasicAnnotationTest.java new file mode 100644 index 0000000000..37e451fa1a --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/BasicAnnotationTest.java @@ -0,0 +1,50 @@ +package net.corda.plugins; + +import org.gradle.testkit.runner.BuildResult; +import org.gradle.testkit.runner.BuildTask; +import org.gradle.testkit.runner.GradleRunner; +import static org.gradle.testkit.runner.TaskOutcome.*; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; + +import static net.corda.plugins.CopyUtils.*; +import static org.assertj.core.api.Assertions.*; +import static org.junit.Assert.*; + +public class BasicAnnotationTest { + @Rule + public final TemporaryFolder testProjectDir = new TemporaryFolder(); + + @Before + public void setup() throws IOException { + File buildFile = testProjectDir.newFile("build.gradle"); + copyResourceTo("basic-annotation/build.gradle", buildFile); + } + + @Test + public void testBasicAnnotation() throws IOException { + BuildResult result = GradleRunner.create() + .withProjectDir(testProjectDir.getRoot()) + .withArguments(getGradleArgsForTasks("scanApi")) + .withPluginClasspath() + .build(); + String output = result.getOutput(); + System.out.println(output); + + BuildTask scanApi = result.task(":scanApi"); + assertNotNull(scanApi); + assertEquals(SUCCESS, scanApi.getOutcome()); + + Path api = pathOf(testProjectDir, "build", "api", "basic-annotation.txt"); + assertThat(api).isRegularFile(); + assertEquals( + "public @interface net.corda.example.BasicAnnotation\n" + + "##\n", CopyUtils.toString(api)); + } +} diff --git a/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/BasicClassTest.java b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/BasicClassTest.java new file mode 100644 index 0000000000..877c4ecee1 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/BasicClassTest.java @@ -0,0 +1,52 @@ +package net.corda.plugins; + +import org.gradle.testkit.runner.BuildResult; +import org.gradle.testkit.runner.BuildTask; +import org.gradle.testkit.runner.GradleRunner; +import static org.gradle.testkit.runner.TaskOutcome.*; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; + +import static net.corda.plugins.CopyUtils.*; +import static org.assertj.core.api.Assertions.*; +import static org.junit.Assert.*; + +public class BasicClassTest { + @Rule + public final TemporaryFolder testProjectDir = new TemporaryFolder(); + + @Before + public void setup() throws IOException { + File buildFile = testProjectDir.newFile("build.gradle"); + copyResourceTo("basic-class/build.gradle", buildFile); + } + + @Test + public void testBasicClass() throws IOException { + BuildResult result = GradleRunner.create() + .withProjectDir(testProjectDir.getRoot()) + .withArguments(getGradleArgsForTasks("scanApi")) + .withPluginClasspath() + .build(); + String output = result.getOutput(); + System.out.println(output); + + BuildTask scanApi = result.task(":scanApi"); + assertNotNull(scanApi); + assertEquals(SUCCESS, scanApi.getOutcome()); + + Path api = pathOf(testProjectDir, "build", "api", "basic-class.txt"); + assertThat(api).isRegularFile(); + assertEquals( + "public class net.corda.example.BasicClass extends java.lang.Object\n" + + " public (String)\n" + + " public String getName()\n" + + "##\n", CopyUtils.toString(api)); + } +} diff --git a/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/BasicInterfaceTest.java b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/BasicInterfaceTest.java new file mode 100644 index 0000000000..0518c57cfd --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/BasicInterfaceTest.java @@ -0,0 +1,51 @@ +package net.corda.plugins; + +import org.gradle.testkit.runner.BuildResult; +import org.gradle.testkit.runner.BuildTask; +import org.gradle.testkit.runner.GradleRunner; +import static org.gradle.testkit.runner.TaskOutcome.*; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; + +import static net.corda.plugins.CopyUtils.*; +import static org.assertj.core.api.Assertions.*; +import static org.junit.Assert.*; + +public class BasicInterfaceTest { + @Rule + public final TemporaryFolder testProjectDir = new TemporaryFolder(); + + @Before + public void setup() throws IOException { + File buildFile = testProjectDir.newFile("build.gradle"); + copyResourceTo("basic-interface/build.gradle", buildFile); + } + + @Test + public void testBasicInterface() throws IOException { + BuildResult result = GradleRunner.create() + .withProjectDir(testProjectDir.getRoot()) + .withArguments(getGradleArgsForTasks("scanApi")) + .withPluginClasspath() + .build(); + String output = result.getOutput(); + System.out.println(output); + + BuildTask scanApi = result.task(":scanApi"); + assertNotNull(scanApi); + assertEquals(SUCCESS, scanApi.getOutcome()); + + Path api = pathOf(testProjectDir, "build", "api", "basic-interface.txt"); + assertThat(api).isRegularFile(); + assertEquals( + "public interface net.corda.example.BasicInterface\n" + + " public abstract java.math.BigInteger getBigNumber()\n" + + "##\n", CopyUtils.toString(api)); + } +} diff --git a/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/ClassWithInternalAnnotationTest.java b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/ClassWithInternalAnnotationTest.java new file mode 100644 index 0000000000..904572fdd1 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/ClassWithInternalAnnotationTest.java @@ -0,0 +1,52 @@ +package net.corda.plugins; + +import org.gradle.testkit.runner.BuildResult; +import org.gradle.testkit.runner.BuildTask; +import org.gradle.testkit.runner.GradleRunner; +import static org.gradle.testkit.runner.TaskOutcome.*; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; + +import static net.corda.plugins.CopyUtils.*; +import static org.assertj.core.api.Assertions.*; +import static org.junit.Assert.*; + +public class ClassWithInternalAnnotationTest { + @Rule + public final TemporaryFolder testProjectDir = new TemporaryFolder(); + + @Before + public void setup() throws IOException { + File buildFile = testProjectDir.newFile("build.gradle"); + copyResourceTo("class-internal-annotation/build.gradle", buildFile); + } + + @Test + public void testClassWithInternalAnnotation() throws IOException { + BuildResult result = GradleRunner.create() + .withProjectDir(testProjectDir.getRoot()) + .withArguments(getGradleArgsForTasks("scanApi")) + .withPluginClasspath() + .build(); + String output = result.getOutput(); + System.out.println(output); + + BuildTask scanApi = result.task(":scanApi"); + assertNotNull(scanApi); + assertEquals(SUCCESS, scanApi.getOutcome()); + + assertThat(output).contains("net.corda.example.InvisibleAnnotation"); + + Path api = pathOf(testProjectDir, "build", "api", "class-internal-annotation.txt"); + assertThat(api).isRegularFile(); + assertEquals("public class net.corda.example.AnnotatedClass extends java.lang.Object\n" + + " public ()\n" + + "##\n", CopyUtils.toString(api)); + } +} diff --git a/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/CopyUtils.java b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/CopyUtils.java new file mode 100644 index 0000000000..4f7af8f1b1 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/CopyUtils.java @@ -0,0 +1,49 @@ +package net.corda.plugins; + +import org.junit.rules.TemporaryFolder; + +import java.io.*; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import static java.nio.charset.StandardCharsets.UTF_8; +import static java.nio.file.StandardCopyOption.*; + +public final class CopyUtils { + private static final String testGradleUserHome = System.getProperty("test.gradle.user.home", ""); + + private CopyUtils() { + } + + public static long copyResourceTo(String resourceName, Path target) throws IOException { + try (InputStream input = CopyUtils.class.getClassLoader().getResourceAsStream(resourceName)) { + return Files.copy(input, target, REPLACE_EXISTING); + } + } + + public static long copyResourceTo(String resourceName, File target) throws IOException { + return copyResourceTo(resourceName, target.toPath()); + } + + public static String toString(Path file) throws IOException { + return new String(Files.readAllBytes(file), UTF_8); + } + + public static Path pathOf(TemporaryFolder folder, String... elements) { + return Paths.get(folder.getRoot().getAbsolutePath(), elements); + } + + public static List getGradleArgsForTasks(String... taskNames) { + List args = new ArrayList<>(taskNames.length + 3); + Collections.addAll(args, taskNames); + args.add("--info"); + if (!testGradleUserHome.isEmpty()) { + Collections.addAll(args,"-g", testGradleUserHome); + } + return args; + } +} diff --git a/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/ExtendedClassTest.java b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/ExtendedClassTest.java new file mode 100644 index 0000000000..74c3c8813c --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/ExtendedClassTest.java @@ -0,0 +1,51 @@ +package net.corda.plugins; + +import org.gradle.testkit.runner.BuildResult; +import org.gradle.testkit.runner.BuildTask; +import org.gradle.testkit.runner.GradleRunner; +import static org.gradle.testkit.runner.TaskOutcome.*; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; + +import static net.corda.plugins.CopyUtils.*; +import static org.assertj.core.api.Assertions.*; +import static org.junit.Assert.*; + +public class ExtendedClassTest { + @Rule + public final TemporaryFolder testProjectDir = new TemporaryFolder(); + + @Before + public void setup() throws IOException { + File buildFile = testProjectDir.newFile("build.gradle"); + copyResourceTo("extended-class/build.gradle", buildFile); + } + + @Test + public void testExtendedClass() throws IOException { + BuildResult result = GradleRunner.create() + .withProjectDir(testProjectDir.getRoot()) + .withArguments(getGradleArgsForTasks("scanApi")) + .withPluginClasspath() + .build(); + String output = result.getOutput(); + System.out.println(output); + + BuildTask scanApi = result.task(":scanApi"); + assertNotNull(scanApi); + assertEquals(SUCCESS, scanApi.getOutcome()); + + Path api = pathOf(testProjectDir, "build", "api", "extended-class.txt"); + assertThat(api).isRegularFile(); + assertEquals( + "public class net.corda.example.ExtendedClass extends java.io.FilterInputStream\n" + + " public (java.io.InputStream)\n" + + "##\n", CopyUtils.toString(api)); + } +} diff --git a/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/ExtendedInterfaceTest.java b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/ExtendedInterfaceTest.java new file mode 100644 index 0000000000..fb7ad3663f --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/ExtendedInterfaceTest.java @@ -0,0 +1,52 @@ +package net.corda.plugins; + +import org.gradle.testkit.runner.BuildResult; +import org.gradle.testkit.runner.BuildTask; +import org.gradle.testkit.runner.GradleRunner; +import static org.gradle.testkit.runner.TaskOutcome.*; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; + +import static net.corda.plugins.CopyUtils.*; +import static org.assertj.core.api.Assertions.*; +import static org.junit.Assert.*; + +public class ExtendedInterfaceTest { + @Rule + public final TemporaryFolder testProjectDir = new TemporaryFolder(); + + @Before + public void setup() throws IOException { + File buildFile = testProjectDir.newFile("build.gradle"); + copyResourceTo("extended-interface/build.gradle", buildFile); + } + + @Test + public void testExtendedInterface() throws IOException { + BuildResult result = GradleRunner.create() + .withProjectDir(testProjectDir.getRoot()) + .withArguments(getGradleArgsForTasks("scanApi")) + .withPluginClasspath() + .build(); + String output = result.getOutput(); + System.out.println(output); + + BuildTask scanApi = result.task(":scanApi"); + assertNotNull(scanApi); + assertEquals(SUCCESS, scanApi.getOutcome()); + + Path api = pathOf(testProjectDir, "build", "api", "extended-interface.txt"); + assertThat(api).isRegularFile(); + assertEquals( + "public interface net.corda.example.ExtendedInterface extends java.util.concurrent.Future\n" + + " public abstract String getName()\n" + + " public abstract void setName(String)\n" + + "##\n", CopyUtils.toString(api)); + } +} diff --git a/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/FieldWithInternalAnnotationTest.java b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/FieldWithInternalAnnotationTest.java new file mode 100644 index 0000000000..0e25c6c0f6 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/FieldWithInternalAnnotationTest.java @@ -0,0 +1,55 @@ +package net.corda.plugins; + +import org.gradle.testkit.runner.BuildResult; +import org.gradle.testkit.runner.BuildTask; +import org.gradle.testkit.runner.GradleRunner; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; + +import static net.corda.plugins.CopyUtils.*; +import static org.assertj.core.api.Assertions.*; +import static org.gradle.testkit.runner.TaskOutcome.*; +import static org.junit.Assert.*; + +public class FieldWithInternalAnnotationTest { + @Rule + public final TemporaryFolder testProjectDir = new TemporaryFolder(); + + @Before + public void setup() throws IOException { + File buildFile = testProjectDir.newFile("build.gradle"); + copyResourceTo("field-internal-annotation/build.gradle", buildFile); + } + + @Test + public void testFieldWithInternalAnnotations() throws IOException { + BuildResult result = GradleRunner.create() + .withProjectDir(testProjectDir.getRoot()) + .withArguments(getGradleArgsForTasks("scanApi")) + .withPluginClasspath() + .build(); + String output = result.getOutput(); + System.out.println(output); + + BuildTask scanApi = result.task(":scanApi"); + assertNotNull(scanApi); + assertEquals(SUCCESS, scanApi.getOutcome()); + + assertThat(output) + .contains("net.corda.example.field.InvisibleAnnotation") + .contains("net.corda.example.field.LocalInvisibleAnnotation"); + + Path api = pathOf(testProjectDir, "build", "api", "field-internal-annotation.txt"); + assertThat(api).isRegularFile(); + assertEquals("public class net.corda.example.field.HasVisibleField extends java.lang.Object\n" + + " public ()\n" + + " public String hasInvisibleAnnotations\n" + + "##\n", CopyUtils.toString(api)); + } +} diff --git a/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/InternalAnnotationTest.java b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/InternalAnnotationTest.java new file mode 100644 index 0000000000..88ffb6d62b --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/InternalAnnotationTest.java @@ -0,0 +1,52 @@ +package net.corda.plugins; + +import org.gradle.testkit.runner.BuildResult; +import org.gradle.testkit.runner.BuildTask; +import org.gradle.testkit.runner.GradleRunner; +import static org.gradle.testkit.runner.TaskOutcome.*; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; + +import static net.corda.plugins.CopyUtils.*; +import static org.assertj.core.api.Assertions.*; +import static org.junit.Assert.*; + +public class InternalAnnotationTest { + @Rule + public final TemporaryFolder testProjectDir = new TemporaryFolder(); + + @Before + public void setup() throws IOException { + File buildFile = testProjectDir.newFile("build.gradle"); + copyResourceTo("internal-annotation/build.gradle", buildFile); + } + + @Test + public void testInternalAnnotations() throws IOException { + BuildResult result = GradleRunner.create() + .withProjectDir(testProjectDir.getRoot()) + .withArguments(getGradleArgsForTasks("scanApi")) + .withPluginClasspath() + .build(); + String output = result.getOutput(); + System.out.println(output); + + assertThat(output) + .contains("net.corda.core.CordaInternal") + .contains("net.corda.example.CordaInternal"); + + BuildTask scanApi = result.task(":scanApi"); + assertNotNull(scanApi); + assertEquals(SUCCESS, scanApi.getOutcome()); + + Path api = pathOf(testProjectDir, "build", "api", "internal-annotation.txt"); + assertThat(api).isRegularFile(); + assertEquals("", CopyUtils.toString(api)); + } +} diff --git a/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/InternalFieldTest.java b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/InternalFieldTest.java new file mode 100644 index 0000000000..b4787de93b --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/InternalFieldTest.java @@ -0,0 +1,51 @@ +package net.corda.plugins; + +import org.gradle.testkit.runner.BuildResult; +import org.gradle.testkit.runner.BuildTask; +import org.gradle.testkit.runner.GradleRunner; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; + +import static net.corda.plugins.CopyUtils.*; +import static org.assertj.core.api.Assertions.*; +import static org.gradle.testkit.runner.TaskOutcome.*; +import static org.junit.Assert.*; + +public class InternalFieldTest { + @Rule + public final TemporaryFolder testProjectDir = new TemporaryFolder(); + + @Before + public void setup() throws IOException { + File buildFile = testProjectDir.newFile("build.gradle"); + copyResourceTo("internal-field/build.gradle", buildFile); + } + + @Test + public void testInternalField() throws IOException { + BuildResult result = GradleRunner.create() + .withProjectDir(testProjectDir.getRoot()) + .withArguments(getGradleArgsForTasks("scanApi")) + .withPluginClasspath() + .build(); + String output = result.getOutput(); + System.out.println(output); + + BuildTask scanApi = result.task(":scanApi"); + assertNotNull(scanApi); + assertEquals(SUCCESS, scanApi.getOutcome()); + + Path api = pathOf(testProjectDir, "build", "api", "internal-field.txt"); + assertThat(api).isRegularFile(); + assertEquals( + "public class net.corda.example.WithInternalField extends java.lang.Object\n" + + " public ()\n" + + "##\n", CopyUtils.toString(api)); + } +} diff --git a/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/InternalMethodTest.java b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/InternalMethodTest.java new file mode 100644 index 0000000000..2e06dd17f3 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/InternalMethodTest.java @@ -0,0 +1,50 @@ +package net.corda.plugins; + +import org.gradle.testkit.runner.BuildResult; +import org.gradle.testkit.runner.BuildTask; +import org.gradle.testkit.runner.GradleRunner; +import static org.gradle.testkit.runner.TaskOutcome.*; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +import java.io.*; +import java.nio.file.Path; + +import static net.corda.plugins.CopyUtils.*; +import static org.assertj.core.api.Assertions.*; +import static org.junit.Assert.*; + +public class InternalMethodTest { + @Rule + public final TemporaryFolder testProjectDir = new TemporaryFolder(); + + @Before + public void setup() throws IOException { + File buildFile = testProjectDir.newFile("build.gradle"); + copyResourceTo("internal-method/build.gradle", buildFile); + } + + @Test + public void testInternalMethod() throws IOException { + BuildResult result = GradleRunner.create() + .withProjectDir(testProjectDir.getRoot()) + .withArguments(getGradleArgsForTasks("scanApi")) + .withPluginClasspath() + .build(); + String output = result.getOutput(); + System.out.println(output); + + BuildTask scanApi = result.task(":scanApi"); + assertNotNull(scanApi); + assertEquals(SUCCESS, scanApi.getOutcome()); + + Path api = pathOf(testProjectDir, "build", "api", "internal-method.txt"); + assertThat(api).isRegularFile(); + assertEquals( + "public class net.corda.example.WithInternalMethod extends java.lang.Object\n" + + " public ()\n" + + "##\n", CopyUtils.toString(api)); + } +} diff --git a/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/InternalPackageTest.java b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/InternalPackageTest.java new file mode 100644 index 0000000000..b24e690338 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/InternalPackageTest.java @@ -0,0 +1,53 @@ +package net.corda.plugins; + +import org.gradle.testkit.runner.BuildResult; +import org.gradle.testkit.runner.BuildTask; +import org.gradle.testkit.runner.GradleRunner; +import static org.gradle.testkit.runner.TaskOutcome.*; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; + +import static net.corda.plugins.CopyUtils.*; +import static org.assertj.core.api.Assertions.*; +import static org.junit.Assert.*; + +public class InternalPackageTest { + @Rule + public final TemporaryFolder testProjectDir = new TemporaryFolder(); + + @Before + public void setup() throws IOException { + File buildFile = testProjectDir.newFile("build.gradle"); + copyResourceTo("internal-package/build.gradle", buildFile); + } + + @Test + public void testInternalPackageIsIgnored() throws IOException { + BuildResult result = GradleRunner.create() + .withProjectDir(testProjectDir.getRoot()) + .withArguments(getGradleArgsForTasks("scanApi")) + .withPluginClasspath() + .build(); + String output = result.getOutput(); + System.out.println(output); + + BuildTask scanApi = result.task(":scanApi"); + assertNotNull(scanApi); + assertEquals(SUCCESS, scanApi.getOutcome()); + + assertThat(output).contains("net.corda.internal.InvisibleClass"); + + Path api = pathOf(testProjectDir, "build", "api", "internal-package.txt"); + assertThat(api).isRegularFile(); + assertEquals( + "public class net.corda.VisibleClass extends java.lang.Object\n" + + " public ()\n" + + "##\n", CopyUtils.toString(api)); + } +} diff --git a/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/KotlinAnnotationsTest.java b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/KotlinAnnotationsTest.java new file mode 100644 index 0000000000..f3c1099bd6 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/KotlinAnnotationsTest.java @@ -0,0 +1,69 @@ +package net.corda.plugins; + +import org.gradle.testkit.runner.BuildResult; +import org.gradle.testkit.runner.BuildTask; +import org.gradle.testkit.runner.GradleRunner; +import static org.gradle.testkit.runner.TaskOutcome.*; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; + +import static net.corda.plugins.CopyUtils.*; +import static org.assertj.core.api.Assertions.*; +import static org.junit.Assert.*; + +public class KotlinAnnotationsTest { + @Rule + public final TemporaryFolder testProjectDir = new TemporaryFolder(); + + @Before + public void setup() throws IOException { + File buildFile = testProjectDir.newFile("build.gradle"); + copyResourceTo("kotlin-annotations/build.gradle", buildFile); + } + + @Test + public void testKotlinAnnotations() throws IOException { + BuildResult result = GradleRunner.create() + .withProjectDir(testProjectDir.getRoot()) + .withArguments(getGradleArgsForTasks("scanApi")) + .withPluginClasspath() + .build(); + String output = result.getOutput(); + System.out.println(output); + + BuildTask scanApi = result.task(":scanApi"); + assertNotNull(scanApi); + assertEquals(SUCCESS, scanApi.getOutcome()); + + Path api = pathOf(testProjectDir, "build", "api", "kotlin-annotations.txt"); + assertThat(api).isRegularFile(); + assertEquals( + "public final class net.corda.example.HasJvmField extends java.lang.Object\n" + + " public ()\n" + + " @org.jetbrains.annotations.NotNull public final String stringValue = \"Hello World\"\n" + + "##\n" + + "public final class net.corda.example.HasJvmStaticFunction extends java.lang.Object\n" + + " public ()\n" + + " @kotlin.jvm.JvmStatic public static final void doThing(String)\n" + + " public static final net.corda.example.HasJvmStaticFunction$Companion Companion\n" + + "##\n" + + "public static final class net.corda.example.HasJvmStaticFunction$Companion extends java.lang.Object\n" + + " @kotlin.jvm.JvmStatic public final void doThing(String)\n" + + "##\n" + + "public final class net.corda.example.HasOverloadedConstructor extends java.lang.Object\n" + + " public ()\n" + + " public (String)\n" + + " public (String, String)\n" + + " public (String, String, int)\n" + + " @org.jetbrains.annotations.NotNull public final String getNotNullable()\n" + + " @org.jetbrains.annotations.Nullable public final String getNullable()\n" + + " public final int getNumber()\n" + + "##\n", CopyUtils.toString(api)); + } +} diff --git a/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/KotlinInternalAnnotationTest.java b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/KotlinInternalAnnotationTest.java new file mode 100644 index 0000000000..edb5b55501 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/KotlinInternalAnnotationTest.java @@ -0,0 +1,53 @@ +package net.corda.plugins; + +import org.gradle.testkit.runner.BuildResult; +import org.gradle.testkit.runner.BuildTask; +import org.gradle.testkit.runner.GradleRunner; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; + +import static net.corda.plugins.CopyUtils.*; +import static org.assertj.core.api.Assertions.*; +import static org.gradle.testkit.runner.TaskOutcome.SUCCESS; +import static org.junit.Assert.*; + +public class KotlinInternalAnnotationTest { + @Rule + public final TemporaryFolder testProjectDir = new TemporaryFolder(); + + @Before + public void setup() throws IOException { + File buildFile = testProjectDir.newFile("build.gradle"); + copyResourceTo("kotlin-internal-annotation/build.gradle", buildFile); + } + + @Test + public void testKotlinInternalAnnotation() throws IOException { + BuildResult result = GradleRunner.create() + .withProjectDir(testProjectDir.getRoot()) + .withArguments(getGradleArgsForTasks("scanApi")) + .withPluginClasspath() + .build(); + String output = result.getOutput(); + System.out.println(output); + + assertThat(output).contains("net.corda.example.kotlin.CordaInternal"); + + BuildTask scanApi = result.task(":scanApi"); + assertNotNull(scanApi); + assertEquals(SUCCESS, scanApi.getOutcome()); + + Path api = pathOf(testProjectDir, "build", "api", "kotlin-internal-annotation.txt"); + assertThat(api).isRegularFile(); + assertEquals( + "public final class net.corda.example.kotlin.AnnotatedClass extends java.lang.Object\n" + + " public ()\n" + + "##\n", CopyUtils.toString(api)); + } +} diff --git a/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/KotlinLambdasTest.java b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/KotlinLambdasTest.java new file mode 100644 index 0000000000..2958716968 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/KotlinLambdasTest.java @@ -0,0 +1,53 @@ +package net.corda.plugins; + +import org.gradle.testkit.runner.BuildResult; +import org.gradle.testkit.runner.BuildTask; +import org.gradle.testkit.runner.GradleRunner; +import static org.gradle.testkit.runner.TaskOutcome.*; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; + +import static net.corda.plugins.CopyUtils.*; +import static org.assertj.core.api.Assertions.*; +import static org.junit.Assert.*; + +public class KotlinLambdasTest { + @Rule + public final TemporaryFolder testProjectDir = new TemporaryFolder(); + + @Before + public void setup() throws IOException { + File buildFile = testProjectDir.newFile("build.gradle"); + copyResourceTo("kotlin-lambdas/build.gradle", buildFile); + } + + @Test + public void testKotlinLambdas() throws IOException { + BuildResult result = GradleRunner.create() + .withProjectDir(testProjectDir.getRoot()) + .withArguments(getGradleArgsForTasks("scanApi")) + .withPluginClasspath() + .build(); + String output = result.getOutput(); + System.out.println(output); + + BuildTask scanApi = result.task(":scanApi"); + assertNotNull(scanApi); + assertEquals(SUCCESS, scanApi.getOutcome()); + + assertThat(output).contains("net.corda.example.LambdaExpressions$testing$$inlined$schedule$1"); + + Path api = pathOf(testProjectDir, "build", "api", "kotlin-lambdas.txt"); + assertThat(api).isRegularFile(); + assertEquals("public final class net.corda.example.LambdaExpressions extends java.lang.Object\n" + + " public ()\n" + + " public final void testing(kotlin.Unit)\n" + + "##\n", CopyUtils.toString(api)); + } +} diff --git a/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/KotlinVarargMethodTest.java b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/KotlinVarargMethodTest.java new file mode 100644 index 0000000000..bea6c0d336 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/KotlinVarargMethodTest.java @@ -0,0 +1,48 @@ +package net.corda.plugins; + +import org.gradle.testkit.runner.*; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; + +import static net.corda.plugins.CopyUtils.*; +import static org.assertj.core.api.Assertions.*; +import static org.gradle.testkit.runner.TaskOutcome.SUCCESS; +import static org.junit.Assert.*; + +public class KotlinVarargMethodTest { + @Rule + public final TemporaryFolder testProjectDir = new TemporaryFolder(); + + @Before + public void setup() throws IOException { + File buildFile = testProjectDir.newFile("build.gradle"); + copyResourceTo("kotlin-vararg-method/build.gradle", buildFile); + } + + @Test + public void testKotlinVarargMethod() throws IOException { + BuildResult result = GradleRunner.create() + .withProjectDir(testProjectDir.getRoot()) + .withArguments(getGradleArgsForTasks("scanApi")) + .withPluginClasspath() + .build(); + String output = result.getOutput(); + System.out.println(output); + + BuildTask scanApi = result.task(":scanApi"); + assertNotNull(scanApi); + assertEquals(SUCCESS, scanApi.getOutcome()); + + Path api = pathOf(testProjectDir, "build", "api", "kotlin-vararg-method.txt"); + assertThat(api).isRegularFile(); + assertEquals("public interface net.corda.example.KotlinVarargMethod\n" + + " public abstract void action(Object...)\n" + + "##\n", CopyUtils.toString(api)); + } +} \ No newline at end of file diff --git a/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/MethodWithInternalAnnotationTest.java b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/MethodWithInternalAnnotationTest.java new file mode 100644 index 0000000000..5a56b03838 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/MethodWithInternalAnnotationTest.java @@ -0,0 +1,55 @@ +package net.corda.plugins; + +import org.gradle.testkit.runner.BuildResult; +import org.gradle.testkit.runner.BuildTask; +import org.gradle.testkit.runner.GradleRunner; +import static org.gradle.testkit.runner.TaskOutcome.*; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; + +import static net.corda.plugins.CopyUtils.*; +import static org.assertj.core.api.Assertions.*; +import static org.junit.Assert.*; + +public class MethodWithInternalAnnotationTest { + @Rule + public final TemporaryFolder testProjectDir = new TemporaryFolder(); + + @Before + public void setup() throws IOException { + File buildFile = testProjectDir.newFile("build.gradle"); + copyResourceTo("method-internal-annotation/build.gradle", buildFile); + } + + @Test + public void testMethodWithInternalAnnotations() throws IOException { + BuildResult result = GradleRunner.create() + .withProjectDir(testProjectDir.getRoot()) + .withArguments(getGradleArgsForTasks("scanApi")) + .withPluginClasspath() + .build(); + String output = result.getOutput(); + System.out.println(output); + + BuildTask scanApi = result.task(":scanApi"); + assertNotNull(scanApi); + assertEquals(SUCCESS, scanApi.getOutcome()); + + assertThat(output) + .contains("net.corda.example.method.InvisibleAnnotation") + .contains("net.corda.example.method.LocalInvisibleAnnotation"); + + Path api = pathOf(testProjectDir, "build", "api", "method-internal-annotation.txt"); + assertThat(api).isRegularFile(); + assertEquals("public class net.corda.example.method.HasVisibleMethod extends java.lang.Object\n" + + " public ()\n" + + " public void hasInvisibleAnnotations()\n" + + "##\n", CopyUtils.toString(api)); + } +} diff --git a/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/VarargMethodTest.java b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/VarargMethodTest.java new file mode 100644 index 0000000000..8b7edbfbcd --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/java/net/corda/plugins/VarargMethodTest.java @@ -0,0 +1,48 @@ +package net.corda.plugins; + +import org.gradle.testkit.runner.*; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; + +import static net.corda.plugins.CopyUtils.*; +import static org.assertj.core.api.Assertions.assertThat; +import static org.gradle.testkit.runner.TaskOutcome.SUCCESS; +import static org.junit.Assert.*; + +public class VarargMethodTest { + @Rule + public final TemporaryFolder testProjectDir = new TemporaryFolder(); + + @Before + public void setup() throws IOException { + File buildFile = testProjectDir.newFile("build.gradle"); + copyResourceTo("vararg-method/build.gradle", buildFile); + } + + @Test + public void testVarargMethod() throws IOException { + BuildResult result = GradleRunner.create() + .withProjectDir(testProjectDir.getRoot()) + .withArguments(getGradleArgsForTasks("scanApi")) + .withPluginClasspath() + .build(); + String output = result.getOutput(); + System.out.println(output); + + BuildTask scanApi = result.task(":scanApi"); + assertNotNull(scanApi); + assertEquals(SUCCESS, scanApi.getOutcome()); + + Path api = pathOf(testProjectDir, "build", "api", "vararg-method.txt"); + assertThat(api).isRegularFile(); + assertEquals("public interface net.corda.example.VarargMethod\n" + + " public abstract void action(Object...)\n" + + "##\n", CopyUtils.toString(api)); + } +} \ No newline at end of file diff --git a/gradle-plugins/api-scanner/src/test/resources/annotated-class/build.gradle b/gradle-plugins/api-scanner/src/test/resources/annotated-class/build.gradle new file mode 100644 index 0000000000..904b8a2448 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/annotated-class/build.gradle @@ -0,0 +1,31 @@ +plugins { + id 'java' + id 'net.corda.plugins.api-scanner' +} + +description 'Test annotation inheritance across classes' + +repositories { + mavenLocal() + mavenCentral() +} + +sourceSets { + main { + java { + srcDir file("../resources/test/annotated-class/java") + } + } +} + +dependencies { + compile files('../../annotations/build/libs/annotations.jar') +} + +jar { + baseName = "annotated-class" +} + +scanApi { + verbose = true +} diff --git a/gradle-plugins/api-scanner/src/test/resources/annotated-class/java/net/corda/example/AlsoInherited.java b/gradle-plugins/api-scanner/src/test/resources/annotated-class/java/net/corda/example/AlsoInherited.java new file mode 100644 index 0000000000..5045c2b9e5 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/annotated-class/java/net/corda/example/AlsoInherited.java @@ -0,0 +1,14 @@ +package net.corda.example; + +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.*; + +@Target({TYPE, METHOD}) +@Retention(CLASS) +@Inherited +public @interface AlsoInherited { +} diff --git a/gradle-plugins/api-scanner/src/test/resources/annotated-class/java/net/corda/example/HasInheritedAnnotation.java b/gradle-plugins/api-scanner/src/test/resources/annotated-class/java/net/corda/example/HasInheritedAnnotation.java new file mode 100644 index 0000000000..62c2d3ec7a --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/annotated-class/java/net/corda/example/HasInheritedAnnotation.java @@ -0,0 +1,9 @@ +package net.corda.example; + +import net.corda.annotation.*; + +@NotInherited +@IsInherited +@AlsoInherited +public class HasInheritedAnnotation { +} diff --git a/gradle-plugins/api-scanner/src/test/resources/annotated-class/java/net/corda/example/InheritingAnnotations.java b/gradle-plugins/api-scanner/src/test/resources/annotated-class/java/net/corda/example/InheritingAnnotations.java new file mode 100644 index 0000000000..aab35df615 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/annotated-class/java/net/corda/example/InheritingAnnotations.java @@ -0,0 +1,4 @@ +package net.corda.example; + +public class InheritingAnnotations extends HasInheritedAnnotation { +} \ No newline at end of file diff --git a/gradle-plugins/api-scanner/src/test/resources/annotated-class/java/net/corda/example/IsInherited.java b/gradle-plugins/api-scanner/src/test/resources/annotated-class/java/net/corda/example/IsInherited.java new file mode 100644 index 0000000000..6d1db905e6 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/annotated-class/java/net/corda/example/IsInherited.java @@ -0,0 +1,14 @@ +package net.corda.example; + +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.*; + +@Target({TYPE, METHOD}) +@Retention(CLASS) +@Inherited +public @interface IsInherited { +} diff --git a/gradle-plugins/api-scanner/src/test/resources/annotated-class/java/net/corda/example/NotInherited.java b/gradle-plugins/api-scanner/src/test/resources/annotated-class/java/net/corda/example/NotInherited.java new file mode 100644 index 0000000000..dcc6e062f5 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/annotated-class/java/net/corda/example/NotInherited.java @@ -0,0 +1,12 @@ +package net.corda.example; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.*; + +@Target({TYPE, METHOD}) +@Retention(CLASS) +public @interface NotInherited { +} diff --git a/gradle-plugins/api-scanner/src/test/resources/annotated-field/build.gradle b/gradle-plugins/api-scanner/src/test/resources/annotated-field/build.gradle new file mode 100644 index 0000000000..ce2d9d9c4b --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/annotated-field/build.gradle @@ -0,0 +1,30 @@ +plugins { + id 'java' + id 'net.corda.plugins.api-scanner' +} + +description 'Test annotation behaviour for a field' + +repositories { + mavenLocal() + mavenCentral() +} + +sourceSets { + main { + java { + srcDir files( + "../resources/test/annotated-field/java", + "../resources/test/common-annotations/java" + ) + } + } +} + +jar { + baseName = "annotated-field" +} + +scanApi { + verbose = true +} diff --git a/gradle-plugins/api-scanner/src/test/resources/annotated-field/java/net/corda/example/HasAnnotatedField.java b/gradle-plugins/api-scanner/src/test/resources/annotated-field/java/net/corda/example/HasAnnotatedField.java new file mode 100644 index 0000000000..963fec2cd1 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/annotated-field/java/net/corda/example/HasAnnotatedField.java @@ -0,0 +1,6 @@ +package net.corda.example; + +public class HasAnnotatedField { + @B @C @A + public static final String ANNOTATED_FIELD = ""; +} diff --git a/gradle-plugins/api-scanner/src/test/resources/annotated-interface/build.gradle b/gradle-plugins/api-scanner/src/test/resources/annotated-interface/build.gradle new file mode 100644 index 0000000000..c5e6c407bc --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/annotated-interface/build.gradle @@ -0,0 +1,31 @@ +plugins { + id 'java' + id 'net.corda.plugins.api-scanner' +} + +description 'Test annotation inheritance across interfaces' + +repositories { + mavenLocal() + mavenCentral() +} + +sourceSets { + main { + java { + srcDir file("../resources/test/annotated-interface/java") + } + } +} + +dependencies { + compile files('../../annotations/build/libs/annotations.jar') +} + +jar { + baseName = "annotated-interface" +} + +scanApi { + verbose = true +} diff --git a/gradle-plugins/api-scanner/src/test/resources/annotated-interface/java/net/corda/example/AlsoInherited.java b/gradle-plugins/api-scanner/src/test/resources/annotated-interface/java/net/corda/example/AlsoInherited.java new file mode 100644 index 0000000000..5045c2b9e5 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/annotated-interface/java/net/corda/example/AlsoInherited.java @@ -0,0 +1,14 @@ +package net.corda.example; + +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.*; + +@Target({TYPE, METHOD}) +@Retention(CLASS) +@Inherited +public @interface AlsoInherited { +} diff --git a/gradle-plugins/api-scanner/src/test/resources/annotated-interface/java/net/corda/example/HasInheritedAnnotation.java b/gradle-plugins/api-scanner/src/test/resources/annotated-interface/java/net/corda/example/HasInheritedAnnotation.java new file mode 100644 index 0000000000..d4a7640d65 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/annotated-interface/java/net/corda/example/HasInheritedAnnotation.java @@ -0,0 +1,9 @@ +package net.corda.example; + +import net.corda.annotation.*; + +@NotInherited +@IsInherited +@AlsoInherited +public interface HasInheritedAnnotation { +} diff --git a/gradle-plugins/api-scanner/src/test/resources/annotated-interface/java/net/corda/example/InheritingAnnotations.java b/gradle-plugins/api-scanner/src/test/resources/annotated-interface/java/net/corda/example/InheritingAnnotations.java new file mode 100644 index 0000000000..dfd6ec26a0 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/annotated-interface/java/net/corda/example/InheritingAnnotations.java @@ -0,0 +1,4 @@ +package net.corda.example; + +public interface InheritingAnnotations extends HasInheritedAnnotation { +} \ No newline at end of file diff --git a/gradle-plugins/api-scanner/src/test/resources/annotated-interface/java/net/corda/example/IsInherited.java b/gradle-plugins/api-scanner/src/test/resources/annotated-interface/java/net/corda/example/IsInherited.java new file mode 100644 index 0000000000..6d1db905e6 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/annotated-interface/java/net/corda/example/IsInherited.java @@ -0,0 +1,14 @@ +package net.corda.example; + +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.*; + +@Target({TYPE, METHOD}) +@Retention(CLASS) +@Inherited +public @interface IsInherited { +} diff --git a/gradle-plugins/api-scanner/src/test/resources/annotated-interface/java/net/corda/example/NotInherited.java b/gradle-plugins/api-scanner/src/test/resources/annotated-interface/java/net/corda/example/NotInherited.java new file mode 100644 index 0000000000..dcc6e062f5 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/annotated-interface/java/net/corda/example/NotInherited.java @@ -0,0 +1,12 @@ +package net.corda.example; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.*; + +@Target({TYPE, METHOD}) +@Retention(CLASS) +public @interface NotInherited { +} diff --git a/gradle-plugins/api-scanner/src/test/resources/annotated-method/build.gradle b/gradle-plugins/api-scanner/src/test/resources/annotated-method/build.gradle new file mode 100644 index 0000000000..84049ecc62 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/annotated-method/build.gradle @@ -0,0 +1,30 @@ +plugins { + id 'java' + id 'net.corda.plugins.api-scanner' +} + +description 'Test annotation behaviour for a method' + +repositories { + mavenLocal() + mavenCentral() +} + +sourceSets { + main { + java { + srcDir files( + "../resources/test/annotated-method/java", + "../resources/test/common-annotations/java" + ) + } + } +} + +jar { + baseName = "annotated-method" +} + +scanApi { + verbose = true +} diff --git a/gradle-plugins/api-scanner/src/test/resources/annotated-method/java/net/corda/example/HasAnnotatedMethod.java b/gradle-plugins/api-scanner/src/test/resources/annotated-method/java/net/corda/example/HasAnnotatedMethod.java new file mode 100644 index 0000000000..ebed696b87 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/annotated-method/java/net/corda/example/HasAnnotatedMethod.java @@ -0,0 +1,8 @@ +package net.corda.example; + +public class HasAnnotatedMethod { + @B @C @A + public void hasAnnotation() { + System.out.println("VISIBLE ANNOTATIONS"); + } +} diff --git a/gradle-plugins/api-scanner/src/test/resources/basic-annotation/build.gradle b/gradle-plugins/api-scanner/src/test/resources/basic-annotation/build.gradle new file mode 100644 index 0000000000..8c0611be49 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/basic-annotation/build.gradle @@ -0,0 +1,27 @@ +plugins { + id 'java' + id 'net.corda.plugins.api-scanner' +} + +description 'Test behaviour of a basic Java annotation' + +repositories { + mavenLocal() + mavenCentral() +} + +sourceSets { + main { + java { + srcDir file("../resources/test/basic-annotation/java") + } + } +} + +jar { + baseName = "basic-annotation" +} + +scanApi { + verbose = true +} diff --git a/gradle-plugins/api-scanner/src/test/resources/basic-annotation/java/net/corda/example/BasicAnnotation.java b/gradle-plugins/api-scanner/src/test/resources/basic-annotation/java/net/corda/example/BasicAnnotation.java new file mode 100644 index 0000000000..db2cc2fac6 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/basic-annotation/java/net/corda/example/BasicAnnotation.java @@ -0,0 +1,12 @@ +package net.corda.example; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.*; + +@Target({TYPE, METHOD}) +@Retention(CLASS) +public @interface BasicAnnotation { +} diff --git a/gradle-plugins/api-scanner/src/test/resources/basic-class/build.gradle b/gradle-plugins/api-scanner/src/test/resources/basic-class/build.gradle new file mode 100644 index 0000000000..daee0ff854 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/basic-class/build.gradle @@ -0,0 +1,27 @@ +plugins { + id 'java' + id 'net.corda.plugins.api-scanner' +} + +description 'Test behaviour of a basic Java class' + +repositories { + mavenLocal() + mavenCentral() +} + +sourceSets { + main { + java { + srcDir file("../resources/test/basic-class/java") + } + } +} + +jar { + baseName = "basic-class" +} + +scanApi { + verbose = true +} diff --git a/gradle-plugins/api-scanner/src/test/resources/basic-class/java/net/corda/example/BasicClass.java b/gradle-plugins/api-scanner/src/test/resources/basic-class/java/net/corda/example/BasicClass.java new file mode 100644 index 0000000000..0f4b49512a --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/basic-class/java/net/corda/example/BasicClass.java @@ -0,0 +1,13 @@ +package net.corda.example; + +public class BasicClass { + private final String name; + + public BasicClass(String name) { + this.name = name; + } + + public String getName() { + return name; + } +} diff --git a/gradle-plugins/api-scanner/src/test/resources/basic-interface/build.gradle b/gradle-plugins/api-scanner/src/test/resources/basic-interface/build.gradle new file mode 100644 index 0000000000..ba45415077 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/basic-interface/build.gradle @@ -0,0 +1,27 @@ +plugins { + id 'java' + id 'net.corda.plugins.api-scanner' +} + +description 'Test behaviour of a basic Java interface' + +repositories { + mavenLocal() + mavenCentral() +} + +sourceSets { + main { + java { + srcDir file("../resources/test/basic-interface/java") + } + } +} + +jar { + baseName = "basic-interface" +} + +scanApi { + verbose = true +} diff --git a/gradle-plugins/api-scanner/src/test/resources/basic-interface/java/net/corda/example/BasicInterface.java b/gradle-plugins/api-scanner/src/test/resources/basic-interface/java/net/corda/example/BasicInterface.java new file mode 100644 index 0000000000..e15cfeeef7 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/basic-interface/java/net/corda/example/BasicInterface.java @@ -0,0 +1,7 @@ +package net.corda.example; + +import java.math.BigInteger; + +public interface BasicInterface { + BigInteger getBigNumber(); +} diff --git a/gradle-plugins/api-scanner/src/test/resources/class-internal-annotation/build.gradle b/gradle-plugins/api-scanner/src/test/resources/class-internal-annotation/build.gradle new file mode 100644 index 0000000000..1d6fd64711 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/class-internal-annotation/build.gradle @@ -0,0 +1,30 @@ +plugins { + id 'java' + id 'net.corda.plugins.api-scanner' +} + +description 'Test behaviour of internal annotations on classes' + +repositories { + mavenLocal() + mavenCentral() +} + +sourceSets { + main { + java { + srcDir files( + "../resources/test/class-internal-annotation/java", + "../resources/test/common-internal/java" + ) + } + } +} + +jar { + baseName = "class-internal-annotation" +} + +scanApi { + verbose = true +} diff --git a/gradle-plugins/api-scanner/src/test/resources/class-internal-annotation/java/net/corda/example/AnnotatedClass.java b/gradle-plugins/api-scanner/src/test/resources/class-internal-annotation/java/net/corda/example/AnnotatedClass.java new file mode 100644 index 0000000000..f1a3ca2b0b --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/class-internal-annotation/java/net/corda/example/AnnotatedClass.java @@ -0,0 +1,5 @@ +package net.corda.example; + +@InvisibleAnnotation +public class AnnotatedClass { +} \ No newline at end of file diff --git a/gradle-plugins/api-scanner/src/test/resources/class-internal-annotation/java/net/corda/example/InvisibleAnnotation.java b/gradle-plugins/api-scanner/src/test/resources/class-internal-annotation/java/net/corda/example/InvisibleAnnotation.java new file mode 100644 index 0000000000..6096b0e42a --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/class-internal-annotation/java/net/corda/example/InvisibleAnnotation.java @@ -0,0 +1,14 @@ +package net.corda.example; + +import net.corda.core.CordaInternal; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.*; + +@Target({TYPE, METHOD}) +@Retention(CLASS) +@CordaInternal +public @interface InvisibleAnnotation { +} diff --git a/gradle-plugins/api-scanner/src/test/resources/common-annotations/java/net/corda/example/A.java b/gradle-plugins/api-scanner/src/test/resources/common-annotations/java/net/corda/example/A.java new file mode 100644 index 0000000000..63f35c8d2d --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/common-annotations/java/net/corda/example/A.java @@ -0,0 +1,12 @@ +package net.corda.example; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.*; + +@Target({TYPE, METHOD, FIELD}) +@Retention(CLASS) +public @interface A { +} diff --git a/gradle-plugins/api-scanner/src/test/resources/common-annotations/java/net/corda/example/B.java b/gradle-plugins/api-scanner/src/test/resources/common-annotations/java/net/corda/example/B.java new file mode 100644 index 0000000000..f183aec418 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/common-annotations/java/net/corda/example/B.java @@ -0,0 +1,12 @@ +package net.corda.example; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.*; + +@Target({TYPE, METHOD, FIELD}) +@Retention(CLASS) +public @interface B { +} diff --git a/gradle-plugins/api-scanner/src/test/resources/common-annotations/java/net/corda/example/C.java b/gradle-plugins/api-scanner/src/test/resources/common-annotations/java/net/corda/example/C.java new file mode 100644 index 0000000000..f3981e186d --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/common-annotations/java/net/corda/example/C.java @@ -0,0 +1,12 @@ +package net.corda.example; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.*; + +@Target({TYPE, METHOD, FIELD}) +@Retention(CLASS) +public @interface C { +} diff --git a/gradle-plugins/api-scanner/src/test/resources/common-internal/java/net/corda/core/CordaInternal.java b/gradle-plugins/api-scanner/src/test/resources/common-internal/java/net/corda/core/CordaInternal.java new file mode 100644 index 0000000000..e24a00ce4c --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/common-internal/java/net/corda/core/CordaInternal.java @@ -0,0 +1,12 @@ +package net.corda.core; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.*; + +@Target({TYPE, METHOD, FIELD}) +@Retention(CLASS) +public @interface CordaInternal { +} diff --git a/gradle-plugins/api-scanner/src/test/resources/extended-class/build.gradle b/gradle-plugins/api-scanner/src/test/resources/extended-class/build.gradle new file mode 100644 index 0000000000..c78685fb35 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/extended-class/build.gradle @@ -0,0 +1,27 @@ +plugins { + id 'java' + id 'net.corda.plugins.api-scanner' +} + +description 'Test behaviour of an extended Java class' + +repositories { + mavenLocal() + mavenCentral() +} + +sourceSets { + main { + java { + srcDir file("../resources/test/extended-class/java") + } + } +} + +jar { + baseName = "extended-class" +} + +scanApi { + verbose = true +} diff --git a/gradle-plugins/api-scanner/src/test/resources/extended-class/java/net/corda/example/ExtendedClass.java b/gradle-plugins/api-scanner/src/test/resources/extended-class/java/net/corda/example/ExtendedClass.java new file mode 100644 index 0000000000..fe4710dd0a --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/extended-class/java/net/corda/example/ExtendedClass.java @@ -0,0 +1,10 @@ +package net.corda.example; + +import java.io.InputStream; +import java.io.FilterInputStream; + +public class ExtendedClass extends FilterInputStream { + public ExtendedClass(InputStream input) { + super(input); + } +} diff --git a/gradle-plugins/api-scanner/src/test/resources/extended-interface/build.gradle b/gradle-plugins/api-scanner/src/test/resources/extended-interface/build.gradle new file mode 100644 index 0000000000..42720dd964 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/extended-interface/build.gradle @@ -0,0 +1,27 @@ +plugins { + id 'java' + id 'net.corda.plugins.api-scanner' +} + +description 'Test behaviour of an extended Java interface' + +repositories { + mavenLocal() + mavenCentral() +} + +sourceSets { + main { + java { + srcDir file("../resources/test/extended-interface/java") + } + } +} + +jar { + baseName = "extended-interface" +} + +scanApi { + verbose = true +} diff --git a/gradle-plugins/api-scanner/src/test/resources/extended-interface/java/net/corda/example/ExtendedInterface.java b/gradle-plugins/api-scanner/src/test/resources/extended-interface/java/net/corda/example/ExtendedInterface.java new file mode 100644 index 0000000000..7420ff2148 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/extended-interface/java/net/corda/example/ExtendedInterface.java @@ -0,0 +1,8 @@ +package net.corda.example; + +import java.util.concurrent.Future; + +public interface ExtendedInterface extends Future { + String getName(); + void setName(String name); +} diff --git a/gradle-plugins/api-scanner/src/test/resources/field-internal-annotation/build.gradle b/gradle-plugins/api-scanner/src/test/resources/field-internal-annotation/build.gradle new file mode 100644 index 0000000000..7b0dec36b3 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/field-internal-annotation/build.gradle @@ -0,0 +1,30 @@ +plugins { + id 'java' + id 'net.corda.plugins.api-scanner' +} + +description 'Test behaviour of internal annotations on fields' + +repositories { + mavenLocal() + mavenCentral() +} + +sourceSets { + main { + java { + srcDir files( + "../resources/test/field-internal-annotation/java", + "../resources/test/common-internal/java" + ) + } + } +} + +jar { + baseName = "field-internal-annotation" +} + +scanApi { + verbose = true +} diff --git a/gradle-plugins/api-scanner/src/test/resources/field-internal-annotation/java/net/corda/example/field/CordaInternal.java b/gradle-plugins/api-scanner/src/test/resources/field-internal-annotation/java/net/corda/example/field/CordaInternal.java new file mode 100644 index 0000000000..0e50c871cf --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/field-internal-annotation/java/net/corda/example/field/CordaInternal.java @@ -0,0 +1,12 @@ +package net.corda.example.field; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.*; + +@Target({TYPE, FIELD}) +@Retention(CLASS) +public @interface CordaInternal { +} diff --git a/gradle-plugins/api-scanner/src/test/resources/field-internal-annotation/java/net/corda/example/field/HasVisibleField.java b/gradle-plugins/api-scanner/src/test/resources/field-internal-annotation/java/net/corda/example/field/HasVisibleField.java new file mode 100644 index 0000000000..7309ecd90c --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/field-internal-annotation/java/net/corda/example/field/HasVisibleField.java @@ -0,0 +1,7 @@ +package net.corda.example.field; + +public class HasVisibleField { + @InvisibleAnnotation + @LocalInvisibleAnnotation + public String hasInvisibleAnnotations; +} diff --git a/gradle-plugins/api-scanner/src/test/resources/field-internal-annotation/java/net/corda/example/field/InvisibleAnnotation.java b/gradle-plugins/api-scanner/src/test/resources/field-internal-annotation/java/net/corda/example/field/InvisibleAnnotation.java new file mode 100644 index 0000000000..339f6bb8a8 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/field-internal-annotation/java/net/corda/example/field/InvisibleAnnotation.java @@ -0,0 +1,14 @@ +package net.corda.example.field; + +import net.corda.core.CordaInternal; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.*; + +@Target({TYPE, FIELD}) +@Retention(CLASS) +@CordaInternal +public @interface InvisibleAnnotation { +} diff --git a/gradle-plugins/api-scanner/src/test/resources/field-internal-annotation/java/net/corda/example/field/LocalInvisibleAnnotation.java b/gradle-plugins/api-scanner/src/test/resources/field-internal-annotation/java/net/corda/example/field/LocalInvisibleAnnotation.java new file mode 100644 index 0000000000..6d0e559303 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/field-internal-annotation/java/net/corda/example/field/LocalInvisibleAnnotation.java @@ -0,0 +1,13 @@ +package net.corda.example.field; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.*; + +@Target({TYPE, FIELD}) +@Retention(CLASS) +@CordaInternal +public @interface LocalInvisibleAnnotation { +} diff --git a/gradle-plugins/api-scanner/src/test/resources/internal-annotation/build.gradle b/gradle-plugins/api-scanner/src/test/resources/internal-annotation/build.gradle new file mode 100644 index 0000000000..631c6728e5 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/internal-annotation/build.gradle @@ -0,0 +1,30 @@ +plugins { + id 'java' + id 'net.corda.plugins.api-scanner' +} + +description 'Test behaviour of @CordaInternal annotations' + +repositories { + mavenLocal() + mavenCentral() +} + +sourceSets { + main { + java { + srcDir files( + "../resources/test/internal-annotation/java", + "../resources/test/common-internal/java" + ) + } + } +} + +jar { + baseName = "internal-annotation" +} + +scanApi { + verbose = true +} diff --git a/gradle-plugins/api-scanner/src/test/resources/internal-annotation/java/net/corda/example/CordaInternal.java b/gradle-plugins/api-scanner/src/test/resources/internal-annotation/java/net/corda/example/CordaInternal.java new file mode 100644 index 0000000000..33acd5fec5 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/internal-annotation/java/net/corda/example/CordaInternal.java @@ -0,0 +1,12 @@ +package net.corda.example; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.*; + +@Target({TYPE, METHOD}) +@Retention(CLASS) +public @interface CordaInternal { +} diff --git a/gradle-plugins/api-scanner/src/test/resources/internal-field/build.gradle b/gradle-plugins/api-scanner/src/test/resources/internal-field/build.gradle new file mode 100644 index 0000000000..f3c26d7bae --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/internal-field/build.gradle @@ -0,0 +1,30 @@ +plugins { + id 'java' + id 'net.corda.plugins.api-scanner' +} + +description 'Test behaviour of @CordaInternal annotation on fields' + +repositories { + mavenLocal() + mavenCentral() +} + +sourceSets { + main { + java { + srcDir files( + "../resources/test/internal-field/java", + "../resources/test/common-internal/java" + ) + } + } +} + +jar { + baseName = "internal-field" +} + +scanApi { + verbose = true +} diff --git a/gradle-plugins/api-scanner/src/test/resources/internal-field/java/net/corda/example/WithInternalField.java b/gradle-plugins/api-scanner/src/test/resources/internal-field/java/net/corda/example/WithInternalField.java new file mode 100644 index 0000000000..9acf972f52 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/internal-field/java/net/corda/example/WithInternalField.java @@ -0,0 +1,8 @@ +package net.corda.example; + +import net.corda.core.CordaInternal; + +public class WithInternalField { + @CordaInternal + public static final String INTERNAL_FIELD = ""; +} \ No newline at end of file diff --git a/gradle-plugins/api-scanner/src/test/resources/internal-method/build.gradle b/gradle-plugins/api-scanner/src/test/resources/internal-method/build.gradle new file mode 100644 index 0000000000..4bf741e4d7 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/internal-method/build.gradle @@ -0,0 +1,30 @@ +plugins { + id 'java' + id 'net.corda.plugins.api-scanner' +} + +description 'Test behaviour of @CordaInternal annotation on methods' + +repositories { + mavenLocal() + mavenCentral() +} + +sourceSets { + main { + java { + srcDir files( + "../resources/test/internal-method/java", + "../resources/test/common-internal/java" + ) + } + } +} + +jar { + baseName = "internal-method" +} + +scanApi { + verbose = true +} diff --git a/gradle-plugins/api-scanner/src/test/resources/internal-method/java/net/corda/example/WithInternalMethod.java b/gradle-plugins/api-scanner/src/test/resources/internal-method/java/net/corda/example/WithInternalMethod.java new file mode 100644 index 0000000000..34436fcbfa --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/internal-method/java/net/corda/example/WithInternalMethod.java @@ -0,0 +1,10 @@ +package net.corda.example; + +import net.corda.core.CordaInternal; + +public class WithInternalMethod { + @CordaInternal + public void internalMethod() { + System.out.println("INTERNAL METHOD"); + } +} \ No newline at end of file diff --git a/gradle-plugins/api-scanner/src/test/resources/internal-package/build.gradle b/gradle-plugins/api-scanner/src/test/resources/internal-package/build.gradle new file mode 100644 index 0000000000..22bda1fcde --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/internal-package/build.gradle @@ -0,0 +1,27 @@ +plugins { + id 'java' + id 'net.corda.plugins.api-scanner' +} + +description 'Test behaviour of an internal package' + +repositories { + mavenLocal() + mavenCentral() +} + +sourceSets { + main { + java { + srcDir file("../resources/test/internal-package/java") + } + } +} + +jar { + baseName = "internal-package" +} + +scanApi { + verbose = true +} diff --git a/gradle-plugins/api-scanner/src/test/resources/internal-package/java/net/corda/VisibleClass.java b/gradle-plugins/api-scanner/src/test/resources/internal-package/java/net/corda/VisibleClass.java new file mode 100644 index 0000000000..ad82513b85 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/internal-package/java/net/corda/VisibleClass.java @@ -0,0 +1,4 @@ +package net.corda; + +public class VisibleClass { +} diff --git a/gradle-plugins/api-scanner/src/test/resources/internal-package/java/net/corda/internal/InvisibleClass.java b/gradle-plugins/api-scanner/src/test/resources/internal-package/java/net/corda/internal/InvisibleClass.java new file mode 100644 index 0000000000..a1a51d4494 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/internal-package/java/net/corda/internal/InvisibleClass.java @@ -0,0 +1,13 @@ +package net.corda.internal; + +public class InvisibleClass { + private final String name; + + public InvisibleClass(String name) { + this.name = name; + } + + public String getName() { + return name; + } +} diff --git a/gradle-plugins/api-scanner/src/test/resources/kotlin-annotations/build.gradle b/gradle-plugins/api-scanner/src/test/resources/kotlin-annotations/build.gradle new file mode 100644 index 0000000000..a307c6e776 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/kotlin-annotations/build.gradle @@ -0,0 +1,32 @@ +plugins { + id 'net.corda.plugins.api-scanner' + id 'org.jetbrains.kotlin.jvm' version '$kotlin_version' +} + +description 'Test appearance of Kotlin-specific annotations' + +repositories { + mavenLocal() + mavenCentral() +} + +sourceSets { + main { + kotlin { + srcDir file("../resources/test/kotlin-annotations/kotlin") + } + } +} + +dependencies { + compile 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version' + compile 'org.jetbrains.kotlin:kotlin-reflect:$kotlin_version' +} + +jar { + baseName = "kotlin-annotations" +} + +scanApi { + verbose = true +} diff --git a/gradle-plugins/api-scanner/src/test/resources/kotlin-annotations/kotlin/net/corda/example/HasJvmField.kt b/gradle-plugins/api-scanner/src/test/resources/kotlin-annotations/kotlin/net/corda/example/HasJvmField.kt new file mode 100644 index 0000000000..ed42779526 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/kotlin-annotations/kotlin/net/corda/example/HasJvmField.kt @@ -0,0 +1,6 @@ +package net.corda.example + +class HasJvmField { + @JvmField + val stringValue = "Hello World" +} diff --git a/gradle-plugins/api-scanner/src/test/resources/kotlin-annotations/kotlin/net/corda/example/HasJvmStaticFunction.kt b/gradle-plugins/api-scanner/src/test/resources/kotlin-annotations/kotlin/net/corda/example/HasJvmStaticFunction.kt new file mode 100644 index 0000000000..df65d5f70d --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/kotlin-annotations/kotlin/net/corda/example/HasJvmStaticFunction.kt @@ -0,0 +1,8 @@ +package net.corda.example + +class HasJvmStaticFunction { + companion object { + @JvmStatic + fun doThing(message: String) = println(message) + } +} diff --git a/gradle-plugins/api-scanner/src/test/resources/kotlin-annotations/kotlin/net/corda/example/HasOverloadedConstructor.kt b/gradle-plugins/api-scanner/src/test/resources/kotlin-annotations/kotlin/net/corda/example/HasOverloadedConstructor.kt new file mode 100644 index 0000000000..63dfbe2a74 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/kotlin-annotations/kotlin/net/corda/example/HasOverloadedConstructor.kt @@ -0,0 +1,7 @@ +package net.corda.example + +class HasOverloadedConstructor @JvmOverloads constructor ( + val notNullable: String = "defaultName", + val nullable: String? = null, + val number: Int = 0 +) \ No newline at end of file diff --git a/gradle-plugins/api-scanner/src/test/resources/kotlin-internal-annotation/build.gradle b/gradle-plugins/api-scanner/src/test/resources/kotlin-internal-annotation/build.gradle new file mode 100644 index 0000000000..97da1749d7 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/kotlin-internal-annotation/build.gradle @@ -0,0 +1,32 @@ +plugins { + id 'net.corda.plugins.api-scanner' + id 'org.jetbrains.kotlin.jvm' version '$kotlin_version' +} + +description 'Test appearance of internal Corda annotations in Kotlin' + +repositories { + mavenLocal() + mavenCentral() +} + +sourceSets { + main { + kotlin { + srcDir file("../resources/test/kotlin-internal-annotation/kotlin") + } + } +} + +dependencies { + compile 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version' + compile 'org.jetbrains.kotlin:kotlin-reflect:$kotlin_version' +} + +jar { + baseName = "kotlin-internal-annotation" +} + +scanApi { + verbose = true +} diff --git a/gradle-plugins/api-scanner/src/test/resources/kotlin-internal-annotation/kotlin/net/corda/example/kotlin/AnnotatedClass.kt b/gradle-plugins/api-scanner/src/test/resources/kotlin-internal-annotation/kotlin/net/corda/example/kotlin/AnnotatedClass.kt new file mode 100644 index 0000000000..26431ad711 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/kotlin-internal-annotation/kotlin/net/corda/example/kotlin/AnnotatedClass.kt @@ -0,0 +1,4 @@ +package net.corda.example.kotlin + +@InvisibleAnnotation +class AnnotatedClass \ No newline at end of file diff --git a/gradle-plugins/api-scanner/src/test/resources/kotlin-internal-annotation/kotlin/net/corda/example/kotlin/CordaInternal.kt b/gradle-plugins/api-scanner/src/test/resources/kotlin-internal-annotation/kotlin/net/corda/example/kotlin/CordaInternal.kt new file mode 100644 index 0000000000..9afbcf3300 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/kotlin-internal-annotation/kotlin/net/corda/example/kotlin/CordaInternal.kt @@ -0,0 +1,8 @@ +package net.corda.example.kotlin + +import kotlin.annotation.AnnotationRetention.* +import kotlin.annotation.AnnotationTarget.* + +@Target(FILE, CLASS, FUNCTION, ANNOTATION_CLASS) +@Retention(BINARY) +annotation class CordaInternal \ No newline at end of file diff --git a/gradle-plugins/api-scanner/src/test/resources/kotlin-internal-annotation/kotlin/net/corda/example/kotlin/InvisibleAnnotation.kt b/gradle-plugins/api-scanner/src/test/resources/kotlin-internal-annotation/kotlin/net/corda/example/kotlin/InvisibleAnnotation.kt new file mode 100644 index 0000000000..a5e8b7dcec --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/kotlin-internal-annotation/kotlin/net/corda/example/kotlin/InvisibleAnnotation.kt @@ -0,0 +1,9 @@ +package net.corda.example.kotlin + +import kotlin.annotation.AnnotationRetention.* +import kotlin.annotation.AnnotationTarget.* + +@Target(FILE, CLASS, FUNCTION) +@Retention(BINARY) +@CordaInternal +annotation class InvisibleAnnotation \ No newline at end of file diff --git a/gradle-plugins/api-scanner/src/test/resources/kotlin-lambdas/build.gradle b/gradle-plugins/api-scanner/src/test/resources/kotlin-lambdas/build.gradle new file mode 100644 index 0000000000..1dcc108181 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/kotlin-lambdas/build.gradle @@ -0,0 +1,32 @@ +plugins { + id 'net.corda.plugins.api-scanner' + id 'org.jetbrains.kotlin.jvm' version '$kotlin_version' +} + +description 'Test appearance of Kotlin lambdas' + +repositories { + mavenLocal() + mavenCentral() +} + +sourceSets { + main { + kotlin { + srcDir file("../resources/test/kotlin-lambdas/kotlin") + } + } +} + +dependencies { + compile 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version' + compile 'org.jetbrains.kotlin:kotlin-reflect:$kotlin_version' +} + +jar { + baseName = "kotlin-lambdas" +} + +scanApi { + verbose = true +} diff --git a/gradle-plugins/api-scanner/src/test/resources/kotlin-lambdas/kotlin/net/corda/example/LambdaExpressions.kt b/gradle-plugins/api-scanner/src/test/resources/kotlin-lambdas/kotlin/net/corda/example/LambdaExpressions.kt new file mode 100644 index 0000000000..d337a1fa30 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/kotlin-lambdas/kotlin/net/corda/example/LambdaExpressions.kt @@ -0,0 +1,14 @@ +package net.corda.example + +import java.util.* +import kotlin.concurrent.schedule + +class LambdaExpressions { + private val timer: Timer = Timer() + + fun testing(block: Unit) { + timer.schedule(Random().nextLong()) { + block + } + } +} \ No newline at end of file diff --git a/gradle-plugins/api-scanner/src/test/resources/kotlin-vararg-method/build.gradle b/gradle-plugins/api-scanner/src/test/resources/kotlin-vararg-method/build.gradle new file mode 100644 index 0000000000..eda3bee2c3 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/kotlin-vararg-method/build.gradle @@ -0,0 +1,32 @@ +plugins { + id 'net.corda.plugins.api-scanner' + id 'org.jetbrains.kotlin.jvm' version '$kotlin_version' +} + +description 'Test appearance of Kotlin vararg functions' + +repositories { + mavenLocal() + mavenCentral() +} + +sourceSets { + main { + kotlin { + srcDir file("../resources/test/kotlin-vararg-method/kotlin") + } + } +} + +dependencies { + compile 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version' + compile 'org.jetbrains.kotlin:kotlin-reflect:$kotlin_version' +} + +jar { + baseName = "kotlin-vararg-method" +} + +scanApi { + verbose = true +} diff --git a/gradle-plugins/api-scanner/src/test/resources/kotlin-vararg-method/kotlin/net/corda/example/KotlinVarargMethod.kt b/gradle-plugins/api-scanner/src/test/resources/kotlin-vararg-method/kotlin/net/corda/example/KotlinVarargMethod.kt new file mode 100644 index 0000000000..3b1606fc04 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/kotlin-vararg-method/kotlin/net/corda/example/KotlinVarargMethod.kt @@ -0,0 +1,5 @@ +package net.corda.example + +interface KotlinVarargMethod { + fun action(vararg arg: Any?) +} diff --git a/gradle-plugins/api-scanner/src/test/resources/method-internal-annotation/build.gradle b/gradle-plugins/api-scanner/src/test/resources/method-internal-annotation/build.gradle new file mode 100644 index 0000000000..f00408b55e --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/method-internal-annotation/build.gradle @@ -0,0 +1,30 @@ +plugins { + id 'java' + id 'net.corda.plugins.api-scanner' +} + +description 'Test behaviour of internal annotations on methods' + +repositories { + mavenLocal() + mavenCentral() +} + +sourceSets { + main { + java { + srcDir files( + "../resources/test/method-internal-annotation/java", + "../resources/test/common-internal/java" + ) + } + } +} + +jar { + baseName = "method-internal-annotation" +} + +scanApi { + verbose = true +} diff --git a/gradle-plugins/api-scanner/src/test/resources/method-internal-annotation/java/net/corda/example/method/CordaInternal.java b/gradle-plugins/api-scanner/src/test/resources/method-internal-annotation/java/net/corda/example/method/CordaInternal.java new file mode 100644 index 0000000000..0b03067b08 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/method-internal-annotation/java/net/corda/example/method/CordaInternal.java @@ -0,0 +1,12 @@ +package net.corda.example.method; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.*; + +@Target({TYPE, METHOD}) +@Retention(CLASS) +public @interface CordaInternal { +} diff --git a/gradle-plugins/api-scanner/src/test/resources/method-internal-annotation/java/net/corda/example/method/HasVisibleMethod.java b/gradle-plugins/api-scanner/src/test/resources/method-internal-annotation/java/net/corda/example/method/HasVisibleMethod.java new file mode 100644 index 0000000000..cf1ad37ab5 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/method-internal-annotation/java/net/corda/example/method/HasVisibleMethod.java @@ -0,0 +1,9 @@ +package net.corda.example.method; + +public class HasVisibleMethod { + @InvisibleAnnotation + @LocalInvisibleAnnotation + public void hasInvisibleAnnotations() { + System.out.println("VISIBLE METHOD, INVISIBLE ANNOTATIONS"); + } +} diff --git a/gradle-plugins/api-scanner/src/test/resources/method-internal-annotation/java/net/corda/example/method/InvisibleAnnotation.java b/gradle-plugins/api-scanner/src/test/resources/method-internal-annotation/java/net/corda/example/method/InvisibleAnnotation.java new file mode 100644 index 0000000000..0ed9612006 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/method-internal-annotation/java/net/corda/example/method/InvisibleAnnotation.java @@ -0,0 +1,14 @@ +package net.corda.example.method; + +import net.corda.core.CordaInternal; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.*; + +@Target({TYPE, METHOD}) +@Retention(CLASS) +@CordaInternal +public @interface InvisibleAnnotation { +} diff --git a/gradle-plugins/api-scanner/src/test/resources/method-internal-annotation/java/net/corda/example/method/LocalInvisibleAnnotation.java b/gradle-plugins/api-scanner/src/test/resources/method-internal-annotation/java/net/corda/example/method/LocalInvisibleAnnotation.java new file mode 100644 index 0000000000..785480f4c9 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/method-internal-annotation/java/net/corda/example/method/LocalInvisibleAnnotation.java @@ -0,0 +1,13 @@ +package net.corda.example.method; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.*; + +@Target({TYPE, METHOD}) +@Retention(CLASS) +@CordaInternal +public @interface LocalInvisibleAnnotation { +} diff --git a/gradle-plugins/api-scanner/src/test/resources/vararg-method/build.gradle b/gradle-plugins/api-scanner/src/test/resources/vararg-method/build.gradle new file mode 100644 index 0000000000..9e80a1039f --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/vararg-method/build.gradle @@ -0,0 +1,27 @@ +plugins { + id 'net.corda.plugins.api-scanner' + id 'java' +} + +description 'Test appearance of Java vararg functions' + +repositories { + mavenLocal() + mavenCentral() +} + +sourceSets { + main { + java { + srcDir file("../resources/test/vararg-method/java") + } + } +} + +jar { + baseName = "vararg-method" +} + +scanApi { + verbose = true +} diff --git a/gradle-plugins/api-scanner/src/test/resources/vararg-method/java/net/corda/example/VarargMethod.java b/gradle-plugins/api-scanner/src/test/resources/vararg-method/java/net/corda/example/VarargMethod.java new file mode 100644 index 0000000000..f5f942f0d0 --- /dev/null +++ b/gradle-plugins/api-scanner/src/test/resources/vararg-method/java/net/corda/example/VarargMethod.java @@ -0,0 +1,5 @@ +package net.corda.example; + +public interface VarargMethod { + void action(Object... arg); +} diff --git a/gradle-plugins/build.gradle b/gradle-plugins/build.gradle index 32763f85f6..b7e35f2646 100644 --- a/gradle-plugins/build.gradle +++ b/gradle-plugins/build.gradle @@ -15,6 +15,8 @@ buildscript { kotlin_version = constants.getProperty("kotlinVersion") artifactory_plugin_version = constants.getProperty('artifactoryPluginVersion') snake_yaml_version = constants.getProperty('snakeYamlVersion') + assertj_version = '3.8.0' + junit_version = '4.12' } repositories { diff --git a/gradle-plugins/settings.gradle b/gradle-plugins/settings.gradle index 995cd8c899..5184883a5e 100644 --- a/gradle-plugins/settings.gradle +++ b/gradle-plugins/settings.gradle @@ -4,4 +4,5 @@ include 'quasar-utils' include 'cordformation' include 'cordform-common' include 'api-scanner' +include 'api-scanner:annotations' include 'cordapp' \ No newline at end of file